I'm trying to use jPlayer in a python/django application where I'm serving out audio content (MP3/M4A) from a repository that I can only access via APIs, so to support seeking within jPlayer I need to implement the HTTP Range support in my django code. I've taken a stab at this, and I think I have the logic basically correct, but as far as I can tell, jPlayer does not like something about the headers that I'm returning - when I turned on error reporting, I started getting this message in the console:
Media URL could not be loaded.
Check media URL is valid.
I've read some of the other posts about range requests and the thread about php support, but so far that hasn't been enough for me to figure out what I'm doing wrong. If it takes a while for my request to return, is there a timeout issue that could be at play here?
For a request with a Range request of "bytes=0-" I'm returning the following headers (tested against django runserver via curl -v):
< HTTP/1.0 206 PARTIAL CONTENT
< Date: Mon, 07 Apr 2014 19:04:57 GMT
< Server: WSGIServer/0.1 Python/2.7.6
< Content-Length: 114126372
< Content-Transfer-Encoding: binary
< Accept-Ranges: bytes
< Vary: Cookie
< Content-MD5: d31deda97a29f412b048b6169d8741fc
< Content-Range: bytes 0-114126372/114126372
< ETag: d31deda97a29f412b048b6169d8741fc
< Content-Type: audio/mpeg
For a request with range bytes=1500- I'm returning:
< HTTP/1.0 206 PARTIAL CONTENT
< Date: Mon, 07 Apr 2014 19:07:02 GMT
< Server: WSGIServer/0.1 Python/2.7.6
< Content-Length: 114124872
< Content-Transfer-Encoding: binary
< Accept-Ranges: bytes
< Vary: Cookie
< Content-Range: bytes 1500-114126372/114126372
< ETag: "d31deda97a29f412b048b6169d8741fc"
< Content-Type: audio/mpeg
Does anyone see anything wrong or missing here, or do you have any suggestions of other things I can try? Is there any utility that I can use to validate my results, or is one browser easier than the others to test with first (I have noticed that the requests and behavior does differ from one browser to another).
These tests above are using Django with the development runserver, which I understand could be an issue, but I'm getting pretty much the same behavior for the same code running under apache.
Thanks in advance for any advice or help to get this working.