How can I make Chrome use the range http header for seeking in audio?

只谈情不闲聊 提交于 2019-12-01 04:44:23

问题


It looks like Chrome downloads from the beginning of a file when scrubbing past the buffered/loaded duration, even though the 'seekable' amount claims to be 100%.

I put up a demo page hardcoded to a 59 min audio file stored on s3, but otherwise identical to the jPlayer demo:

http://beta.prx.org/jplayer_demos/demo-01-supplied-mp3-bm.htm

I'm testing on a Mac (10.6.8):

On Safari (5.1.4), if you scrub past the loaded/buffered duration, it initiates another request using the range header, and gets the audio from that point almost instantly.

On Chrome (17.0.963.79), when you scrub beyond the buffered/loaded duration, it sits and spins until it can load the audio from the beginning to the duration scrubbed.

Any idea how to make Chrome behave itself and use the range header when you scrub past the loaded part of the audio file?


回答1:


I was driving nuts with this. I'm implementing a web player with jPlayer too and they talk on the dev guide about the "Accepts-range" HTTP header and how it mess with Chrome, but thanks to you I realised it's a HTML5 audio tag problem... so much time wasted. FIX: add the parameter "solution: 'flash, html'" on the jPlayer constructor to change to flash by default.



来源:https://stackoverflow.com/questions/9711184/how-can-i-make-chrome-use-the-range-http-header-for-seeking-in-audio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!