My code is basically this
<audio controls preload="none" src="linktofile.mp3" />
It works great in Safari 5 and Chrome 8 except that Chrome completely ignores the preload attribute and starts loading (not playing) the file after page load. Which consumes a huge amount of bandwidth if the page is full of audio tags.
Is there a way to make Chrome behave like Safari 5 (ie. the right way) and only load a file when开发者_StackOverflow中文版 the user clicks on the play button ?
This is Chrome bug #16482 , and still not fixed, nope.
Update: As of April 6, 2011 it is fixed :-)
You could have a placeholder element and replace it with the Audio element by Javascript when it's clicked...
Did you try setting the autobuffer
attribute to false?
精彩评论