我有一个非常简单的网站,其中包含一个 html5 视频和一个 html5 音频,它们通过两个简单的按钮触发打开和关闭。音频在 Safari 中运行良好,但在 Chrome 中无法运行。
我的网站是 www.rossfraser.co(不是 .com)
我的音频代码是这样的:
<div align="center">
<audio>
<source src="audio/site-jingle.mp3" type="audio/mpeg">
</audio>
</div>
<audio id="player" src="audio/site-jingle.mp3" type="audio/mpeg" loop></audio>
<div style="text-align:center">
<button onclick="document.getElementById('player').play()">JINGLE</button>
<button onclick="document.getElementById('player').pause()">NO JINGLE</button>
</div>
如有任何帮助,我们将不胜感激。谢谢!
最佳答案
我想我有解决办法。 192kbps 的 MP3 不工作。
128 的 MP3 工作正常!!!
关于html5 音频无法在 chrome 中播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18906360/