Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media served from HTTP/1.0 server breaks audio element #57

Open
banksJeremy opened this issue Jun 12, 2012 · 1 comment
Open

Media served from HTTP/1.0 server breaks audio element #57

banksJeremy opened this issue Jun 12, 2012 · 1 comment

Comments

@banksJeremy
Copy link
Collaborator

Headers not causing the error

HTTP/1.1 206 Partial Content
X-Powered-By: Express
Date: Tue, 12 Jun 2012 19:31:22 GMT
Cache-Control: public, max-age=0
Last-Modified: Tue, 29 May 2012 18:37:52 GMT
ETag: "1636628-1338316672000"
Content-Type: audio/ogg
Accept-Ranges: bytes
Content-Range: bytes 0-1636627/1636628
Content-Length: 1636628
Set-Cookie: connect.sid=AwDDNAmAymrNPigoH3kRDxnj.olJWNdnzjJ2ZcT2oepIPhNC4yBuxOCgaWPAbr3DylU8; path=/; expires=Tue, 12 Jun 2012 23:31:22 GMT; httpOnly
Connection: keep-alive

Headers causing the error

HTTP/1.0 200 OK
Server: SimpleHTTP/0.6 Python/2.7.1
Date: Tue, 12 Jun 2012 19:30:37 GMT
Content-type: audio/ogg
Content-Length: 1636628
Last-Modified: Tue, 29 May 2012 18:37:52 GMT

It seems like this is the result of using an HTTP/1.0 server, which lacks support for Content-Range. For example, this has happened when using Python's SimpleHTTPServer/http.server. I'm not sure if it always happens.

In Chrome this causes assignment to the .currentTime property to be ignored. In Firefox it causes .duration to be NaN.

I'd expect it to work regardless once it has downloaded the entire media file, but apparently not.

We may want to detect this and handle it in some way. It currently causes confusing silently failures. Maybe we should throw an exception if we're unable to change .currentTime after the content has loaded.

banksJeremy pushed a commit to jeremyBanks/slide-drive that referenced this issue Jun 12, 2012
banksJeremy pushed a commit to jeremyBanks/slide-drive that referenced this issue Jun 12, 2012
@banksJeremy
Copy link
Collaborator Author

I noticed Firefox returning a duration of NaN without the headers and some Googling backs this up, but now I can't seem to replicate the issue again. Nevertheless, I'm going to add a check for that, too.

banksJeremy pushed a commit to jeremyBanks/slide-drive that referenced this issue Jun 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant