Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Prevent Chrome fetching the last 128 bytes of an MP3 file

Tags:

I am having a problem with this for a while now, so I thought I'd ask for your help.

For a proof of concept project, I created a HTML 5 only last.fm player using jPlayer . It works fine with Firefox, but does not play using the html solution when using Chrome(Chromium).

First, Chrome tries to fetch the mp3 file via the stream url. After it has pre-buffered a bit, it always tries to read the last 128 bytes by making another HTTP request. The problem now is that the last.fm streaming servers only seem allow one connection per file at a time, which causes both http connections to fail. It seems Chrome/Chromium is ignoring the preload="none" property of the audio tag. As far as I could find out the tag is only a recommendation to the browser.

Normal mp3 files work like a charm. Also, when entering the redirected streaming url in the browser, it starts playing. It seems last.fm is using the original urls as kind of one-time access token/access control filter, whereas the resolved stream url is valid for a while.

For the full HTTP headers (cookies censored), see http://pastebin.com/rBAdL4X8. (Copied from Chromium element inspector).

Is there any way to circumvent this problem from within the browser?

like image 477
user3001 Avatar asked Apr 06 '12 18:04

user3001


1 Answers

There doesn't seem to be a current workaround but from comment 11 on the bug report pointed to by neoascetic, it may be addressed in next release of Chrome - M20.

like image 95
Danny D'Amours Avatar answered Oct 16 '22 04:10

Danny D'Amours