-
Notifications
You must be signed in to change notification settings - Fork 32
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
Use mimesniff's "parse a MIME type" to parse the contentType member #69
Comments
(In general it would be good to build more on the MIME Sniffing infrastructure here.) |
@foolip @annevk questions as I'm taking a look at this. I see the mimesniff spec defines both #valid-mime-type and the algorithm #parsing-a-mime-type. Why doesn't #valid-mime-type reference #parsing-a-mime-type? Then we could take a reference on #valid-mime-type and transitively reference the parsing algo. As I write the steps to define a valid mime type from MC perspective its counter intuitive to reference #parsing-a-mime-type rather than #valid-mime-type. Especially since #valid-mime-type seems to be more strict. |
One is for web developers and the other for user agents. User agents have historically been somewhat forgiving, so we cannot really make them stricter, but it makes sense for web developers to be recommended to use a subset if you will for maximum interoperability (and in case we ever need to make some breaking change outside of that subset for extensions or some such). |
Thanks, makes sense. I think I missed the note: |
Related: w3c/encrypted-media#511 |
Ok, we have some interop issues here: Given: await navigator.mediaCapabilities.decodingInfo({ type: "file", audio: {contentType: "audio/mp3;" }}) Chrome rejects. Firefox and WebKit don't. The spec (although not using MIME Sniff) says that it should reject. |
I think you probably want to make that work. And it would probably make sense to run a bunch of the MIME type parser tests through that API (they're in |
https://wicg.github.io/media-capabilities/#dom-videoconfiguration-contenttype says "If configuration’s contentType is not a valid video MIME type, return false and abort these steps."
Since this was written, @annevk defined https://mimesniff.spec.whatwg.org/#parse-a-mime-type which, if followed, should lead to more interoperable MIME type parsing.
The structure would be something like invoking "parse a MIME type", and then handling the failure case.
The text was updated successfully, but these errors were encountered: