Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html5 audio not playing in 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.

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!

like image 805
user2636480 Avatar asked Sep 19 '13 23:09

user2636480


1 Answers

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

MP3 with 128 works fine!!!

like image 185
hectormr85 Avatar answered Sep 28 '22 06:09

hectormr85