在网页嵌入音频的最佳方式
问题说明
我知道,我知道。这听起来很可怕,但这是客户想要的,他们非常关注这个想法。我现在想找出实现它的最佳方法。 Flash是理想的,但客户希望避免使用它。
I know, I know. It sounds horrific, but it's what the client wants, and they're very set on the idea. It's now come to me to figure out the best way make it happen. Flash would be ideal but the client wants to avoid using it.
这是一个数字音频文件,因此我可以将其转换为任何可能使事情变得更容易的格式(例如MP3)或者OGG)但它至少需要支持IE 8 ,FF 3.5 ,Safari和Chrome。它需要自动播放,有隐藏的控件(我知道,我知道),希望它会循环。
It's a digital audio file, so I can convert it to any format that might make things easier (e.g. MP3 or OGG) but it needs to support IE 8 , FF 3.5 , Safari and Chrome at the very least. It needs to autoplay, have hidden controls (I know, I know) and hopefully it will loop.
我会倾向于 HTML5音频,但我不确定IE8是否会支持它(虽然我想IE8我可以使用条件注释?)。
I would lean towards HTML5 audio, but I'm not sure if IE8 will support it (although I suppose for IE8 I could use Conditional Comments?).
关于最佳方式的任何想法?
Any ideas on the best way?
PS - 我知道,我知道。
PS - I know, I know.
正确答案
这是我最终解决的问题。它适用于IE7,IE8,IE9,FF3.5,FF4,Safari和Chrome。
Here's the solution I ended up with. It works with IE7, IE8, IE9, FF3.5, FF4, Safari and Chrome.
<audio autoplay="autoplay">
<source src="https://www.it1352.com/static/audio/clip.ogg" type="audio/ogg" />
<source src="https://www.it1352.com/static/audio/clip.mp3" type="audio/mpeg" />
</audio>
<!--[if (!IE)|(gte IE 9)]>
<a href="https://www.it1352.com/1023358.html" onclick="document.getElementById('background_audio').muted = true; return false">mute sound</a>
<![endif]-->
<!--[if lt IE 9]>
<bgsound src="https://www.it1352.com/static/audio/clip.mp3" autostart="true" loop="1">
<a href="https://www.it1352.com/1023358.html" onclick="document.all['background_snd'].src='https://www.it1352.com/1023358.html'; return false">mute sound</a>
<![endif]-->
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhchabee
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20