html5音频无法在Chrome中播放 [英] html5 audio not playing in chrome

查看:587
本文介绍了html5音频无法在Chrome中播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的网站,带有一个html5视频和html5音频,可以通过两个简单的按钮来打开和关闭该按钮.音频在Safari中都能正常播放,但在Chrome中无法正常播放.

I have a very simple website with an html5 video and a html5 audio that is triggered on and off with two simple buttons. the audio all works gloriously fine in Safari, but will not work in Chrome.

我的网站是www.rossfraser.co(不是.com)

my website is www.rossfraser.co (that is not .com)

我的音频代码是这样的:

my code for the audio is this:

<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>

任何帮助将不胜感激.谢谢!

Any help would be GREATLY appreciated. Thanks!

推荐答案

我认为我有解决方案. 192kbps的MP3无法正常工作.

I think I have the solution. MP3 with 192kbps doesn't work.

带有128的MP3可以正常工作!!

MP3 with 128 works fine!!!

这篇关于html5音频无法在Chrome中播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆