Recognise a presentation media container from its leading bytes. This is a header check, not a full decode: a host that renders the bytes still relies on the browser's image or video decoder and must not display a blob that fails to decode.
Complete blob bytes
The recognised format, or undefined for anything else
undefined
sniffPresentationMediaFormat(bytes) === 'image/png'; Copy
sniffPresentationMediaFormat(bytes) === 'image/png';
Recognise a presentation media container from its leading bytes. This is a header check, not a full decode: a host that renders the bytes still relies on the browser's image or video decoder and must not display a blob that fails to decode.