Open laobento opened 4 years ago
Anyone else meet this problem?
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.
Not sure if it's related, but looks like a clue: https://philna.sh/blog/2018/10/23/service-workers-beware-safaris-range-request/
@jalik Let me have a look, thank you!
@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!
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.
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.