-
Notifications
You must be signed in to change notification settings - Fork 79
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 MIME type handling #559
base: main
Are you sure you want to change the base?
Conversation
</p> | ||
</li> | ||
<li> | ||
<p> | ||
Let <var>container</var> be the container type specified by <var>content | ||
type</var>. | ||
If <var>mimeType</var> is <code>failure</code> or is unrecognized, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does "unrecognized" mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not the author of that phrase, but I think the distinction between "invalid"/"failure" and "unrecognized" is that you could have a valid MIME type that is not recognized as supported for media playback by the UA, e.g. "image/png".
If this is indeed the intent, I think the term "unrecognized" is not the best we could come up with.
How about If <var>mimeType</var> is <code>failure</code> or is not a supported type for media playback
? Is that clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Joey's suggestion is better, but ideally we actually list the MIME types. See also https://mimesniff.spec.whatwg.org/#supported-by-the-user-agent and references.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I not convinced that an explicit list of supported media types is practical, given the variability in what is supported across the entire ecosystem of media streaming devices.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a related PR for Media Capabilities, see "Check MIME Type Support" in https://github.com/w3c/media-capabilities/pull/222/files. We may be able to reuse this, or maybe even just reference it. But in that PR we reference https://mimesniff.spec.whatwg.org/#supported-by-the-user-agent rather than list MIME types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "supported by the user agent" plus limiting it to media in some way is reasonable. It will at least give us a central place to work on improving this longer term.
@annevk @joeyparrish How does this look? There may be more we could do to be more precise, e.g., "unrecognized", or how to identify the container type from the MIME type, but for now I've tried to reference mimesniff but without introducing other changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good % the choice of the word "unrecognized". It's fine with me if we keep this PR focused on mimesniff
and follow-up to clarify "unrecognized" in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on tackling this!
Let <var>container</var> be the container type specified by <var>content | ||
type</var>. | ||
If <var>mimeType</var> is <code>failure</code> or is unrecognized, | ||
continue to the next iteration. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point you might want to adopt https://infra.spec.whatwg.org/#iteration-continue and other Infra conventions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, let's do this in a separate PR.
I agree, thanks. |
See #511. This PR removes the Valid Media MIME Type definition and references mimesniff for "parse a MIME type".
Further work is needed to address #512.
Preview | Diff