Search code examples
google-chromeaudiomp3html5-audiojplayer

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


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?


Solution

  • 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.