-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fix: don't use a blob URL for unknown MIME types #3471
Conversation
@719media could you test this branch against the problematic server? You can use this deployment to test: https://blob-type.wavesurfer-js.pages.dev |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
I have confirmed that the https://blob-type.wavesurfer-js.pages.dev/ page works for loading "bad mime-type" file examples as discussed in the linked issue. Vs current master where it continues to not work (no waveform/nothing plays) |
Awesome, thank you! 🙏 |
@katspaugh Is it possible to add a config for |
You mean to optionally skip this check? |
Yes. we can choose whether to use this check. |
I would suggest an alternative to that: specify a MIME type in the options. E.g.
It would then use this MIME type when fetching a blob:
|
This seems to work for me, and this design is consistent with the record plugin( |
Short description
Resolves #3380
As per this comment, if an audio file is fetched from a server that doesn't send the correct MIME type, the downloaded blob might fail to play in an audio element.
Implementation details
I've added a check when setting an audio src to a blob URL: if the MIME type is not supported, it will fallback to the original audio URL.