开发者

HTML5 Audio: preload attribute ignored in Chrome

开发者 https://www.devze.com 2023-02-02 12:49 出处:网络
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 st

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消