3

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?

2 Answers 2

2

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
1

First of all, your syntax is incorrect. It should be:

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

It appears that Safari is reading your code as intended, while Firefox/Chrome is reading it as written; i.e. with and without the preload attribute.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .