Description
After long periods of time during which having a mime-types were mandatory to render audio or video, the HTML spec now says that sniffing should be implemented (with very specific steps from MIMESNIFF), and is in fact required for example for decodeAudioData
in the Web Audio API, since there is no mime type information on a byte buffer (unlike with a URL or a Blob
).
Here, we're in a novel situation. There is a bit more chances to have a mime type, because authors have probably (but not necessarily) just demuxed a byte stream, and they must have a good idea of what's in it, but in the end it's really just a series of bytes, for the video or audio case.
For images, less so. Authors are used to sniffing and never really touching the byte stream, so this is a bit of a problem.
Additionally, requiring a mime type means that in terms of layering, web codecs cannot be used to implement AudioContext.decodeAudioData
or the <img>
tag without having an author-provided implementation of MIMESNIFF.