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

audio element not work on safari, Accept-ranges not include in response #142

Open
laobento opened this issue Aug 5, 2019 · 6 comments
Open

Comments

@laobento
Copy link

laobento commented Aug 5, 2019

I am using HTML5 Audio element in my work and it works on ie, Firefox, chrome, but not on safari. I guess maybe the server's response does not include Accept-ranges field.

@laobento
Copy link
Author

laobento commented Aug 6, 2019

Anyone else meet this problem?

@jalik
Copy link
Owner

jalik commented Aug 6, 2019

Hello @laobento.
As I see you seems to be competent enough to dig into the problem.
What you're looking for may be in the code below:
https://github.com/jalik/meteor-jalik-ufs/blob/master/ufs-server.js#L284-L328

Support for this kind of HTTP request was asked and added by another contributor, I helped him but I am afraid I don't have time anymore, I would accept any working PR though.

@jalik
Copy link
Owner

jalik commented Aug 6, 2019

Not sure if it's related, but looks like a clue:
https://philna.sh/blog/2018/10/23/service-workers-beware-safaris-range-request/

@laobento
Copy link
Author

laobento commented Aug 6, 2019

@jalik Let me have a look, thank you!

@laobento
Copy link
Author

laobento commented Aug 8, 2019

@jalik I capture the packet and found that the content not ok in the response with content-range. The first response should send a content of length 2, but it only has 1 byte of data. I guess the code 'store.getReadStream(fileId, file, options);' has something wrong, and finally I tried to modify the code in ufs-gridfs.s, the code is :
this.getReadStream = function (fileId, file, options) {
options = _.extend({}, options);
return mongoStore.openDownloadStream(fileId, {
start: options.start,
end: options.end+1 //I modified this line,
});
};

it works!

@laobento
Copy link
Author

laobento commented Aug 8, 2019

I am not sure is it the right way, because I am a newer to WEB, JS, METEOR..., I was a C/C++ programmer before.

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