Html5 audio play doesn’t work on firefox/chrome

audiobrowserhtml5

I would like to play big mp3 file (30MB) with tag in my web site, but it doesn't seem like working on Firefox 8.0 and Chrome 16.0.912. It works well with Safari tho. Under Firefox and Chrome, small mp3 file works but not big one. Here's simple codes I used:

<audio autobuffer controls>
<src="mp3 file" preload="auto">
</audio>

Is it the problem of browsers?

Best Answer

Safari is just doing the best job of the three (Safari, Chrome, and Firefox) which currently support this element in handling the errors presented to it via the syntax you've used.

It should look like this:

<audio controls preload="auto">
    <source src="song.mp3" type="audio/mpeg" />
    This text displays if the audio tag isn't supported.
</audio>

The autobuffer attribute doesn't exist in HTML and should be removed.

Sources:

  1. W3Schools
  2. W3C HTML5 Spec Section 4.8.7: The audio element
Related Question