4 ms·
+1 to changing maybe to a shrug :) MediaCapabilities is the new way to ask the "can I play this" question: https://developer.mozilla.org/en-US/docs/Web/API/Med
by DaleCurtis 5y ago
+1 to changing maybe to a shrug :)
MediaCapabilities is the new way to ask the "can I play this" question:
https://developer.mozilla.org/en-US/docs/Web/API/Media_Capabilities_API https://developer.mozilla.org/en-US/docs/Web/API/Media_Capab...
It returns a boolean for whether a codec is supported or not.
- Bilal_io 5y agoMediaCapabilites.IsTypeSupported was very unhelpful when used to check if mimetype is supported for encoding instead of decoding. But perhaps that's not what it was created for.
- DaleCurtis 5y agoYes, it was originally for decoding information only. https://developer.mozilla.org/en-US/docs/Web/API/MediaCapabilities/encodingInfo https://developer.mozilla.org/en-US/docs/Web/API/MediaCapabi... is on the way. I believe the latest Safari preview has it implemented and Chromium should have it shortly as well.