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

Not seekable audio files in Chrome - "Range"/"Partial Content" support should be added? #92

Closed
seabrus opened this issue Sep 27, 2016 · 4 comments

Comments

@seabrus
Copy link

seabrus commented Sep 27, 2016

Hi,

Working with audio files stored with the help of UFS and ufs-gridfs, I've found that in Chrome they are not seekable when playing them in the HTML5 audio player (tag <audio ...>). However, in Firefox there is no such a problem.

1️⃣ Googling the web, I found that it may be related to the ability of the server to correctly process Range header in the browser request - see here:

Make sure the server accepts Range requests, you can check to see if Accept-Ranges is in the header

and especially here - see subsection "Byte-Range Requests":

Your server must enable Range requests. This is easy to check for by seeing if your server's response includes the Accept-Ranges in its header. Most HTML5 browsers enable seeking to new file positions during a download, so the server must allow the new Range to be requested.
Failure to accept byte Range requests will cause problems on some HTML5 browsers...
Chrome tends to be the browser that has most problems if the Range request is not enabled on the server, but all browsers will have some issue even if it is only that you have to wait for all the media to load before jumping close to the end.

2️⃣ Valuable recommendations

are also given in Can't seek html5 video or audio in chrome and HTML5 video will not loop (GridFS):

Our server doesn't understand partial content right now. As a result chrome is sending requests for content that doesn't get answered which in turn makes our video's and audio unseekable (and unloopable).

and

As it turns out, looping (or any sort of seeking, for that matter) in

(see more details at the links above)

3️⃣ Checking my Chrome console

I found that it contains Range request too:

header2

✅ Suggestion

I'm not sure but if UFS influences the server headers and server response when uploading a file from the GridFS, it could be nice to take into account the abovementioned recommendations and process the Range requests from Chrome (and possibly from other browsers).

Sorry if this suggestion has no relation to your package.

P.S.

I also understood that just the reason discussed above may be responsible for sudden stopping playing HTML5 <audio> in Chrome (in some cases with the error message Failed to load resource: net::ERR_CONTENT_LENGTH_MISMATCH).

@seabrus seabrus changed the title Not seekable audio files in Chrome - "Accept-Ranges" in headers should be added? Not seekable audio files in Chrome - "Range" support should be added? Sep 28, 2016
@seabrus seabrus changed the title Not seekable audio files in Chrome - "Range" support should be added? Not seekable audio files in Chrome - "Range"/"Partial Content" support should be added? Sep 28, 2016
@jalik
Copy link
Owner

jalik commented Sep 29, 2016

Hi @seabrus, I need more time to dig into that issue, but I think that adding the header won't be enough, I would maybe have to handle this case and return the byte range on server side.
Please be patient. Thanks.

@seabrus
Copy link
Author

seabrus commented Sep 29, 2016

Hi @jalik, thanks for your efforts and support!

@jalik jalik closed this as completed in b8cd7f3 Oct 2, 2016
@jalik
Copy link
Owner

jalik commented Oct 2, 2016

@seabrus the 0.7.0_2 should fix your problem.

@seabrus
Copy link
Author

seabrus commented Oct 4, 2016

@jalik thank a lot! It is a pleasure to work with you

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

2 participants