-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
CORS error with Range header on Safari 14 #207
Comments
It should retry the request without the range header when encountering the CORS error in Safari. There's some conditional logic that checks for this case, but the error details must be different in Safari 14. Would you be able to put a breakpoint on this condition, reproduce the error in your test environment, and let me know what the value of icecast-metadata-js/src/icecast-metadata-player/src/PlayerFactory.js Lines 143 to 152 in 694b9f1
I should note, this is a bug in Safari. The |
Thanks for getting that info. I've released icecast-metadata-player/1.17.8 that should fix this. Also, thanks for all the testing and for reporting these issues as they come up. This really helps make this library better for everyone. |
Any chance it's related to the way string equality checks work in JavaScript? I took a look at https://stackoverflow.com/questions/3586775/what-is-the-correct-way-to-check-for-string-equality-in-javascript and it appears that |
The icecast-metadata-js/src/icecast-metadata-player/src/PlayerFactory.js Lines 147 to 158 in 90db5f3
I'm happy to continue pair programming through this github issue, but it might be faster for you to clone this repo and try things out yourself. Everything you need to do to build and run locally can be found here. |
Looks like I have a typo in the error message check, so that will need to be fixed... However, we might be overthinking this. Could you try out this branch? https://github.com/eshaz/icecast-metadata-js/tree/fix-safari-14 If this change doesn't work, I'll put the promise code back into this branch and fix the typo. |
I don't have a development environment on the Safari 14 machine, but I might be able to figure out some way to host the assets somewhere the machine can access them. |
Hmm, looks like the debugger's watches were a red herring: As you can see the condition ends up being true despite Good call on your part. It's running smoothly now, and I'm glad that the working solution is simpler than the previous iteration. Thanks Ethan! |
Excellent, glad it worked! I've released this fix as icecast-metadata-player/1.17.9 |
While solving some compatibility issues with legacy Safari versions in my own codebase, I bumped into one involving the
Range
header in the library. I tested on Safari 14 (macOS Big Sur). Here's a minimal reproduction case:This triggers the following errors:
I'm aware that the
Range
header is there for a reason. However, when I play the stream in a separate tab the stream plays fine despite the browser not sending it:Do you see a solution that avoids breaking other scenarios?
The text was updated successfully, but these errors were encountered: