$ fingerprint@info:~ echo $CAN-PLAY-TYPE
HTMLMediaElement.canPlayType determines, whether the specified media type can be played back and MediaSource.isTypeSupported checks if a SourceBuffer object can be created for the specified MIME type. For more details see, e.g., MDN web docs ([1], [2])
There are many different media MIME types
including media subtypes and codecs available and whether a browser supports a given MIME type, subtype or codec depends on the browser implementation, installed plugins and the host system.
The test of a MIME type with the method HTMLMediaElement.canPlayType can have three possible return values:
There is no guarantee for the return values to be correct (e.g., H.264 support in Firefox OS 1.0),
but the same values are consistently returned (within the same environment).
The test of a MIME type with the method MediaSource.isTypeSupported returns true, if the browser is capable of playing the specified MIME type, and otherwise false.
Given a comprehensive MIME types test, it is possible to distinguish browsers and browser versions. In this demo, the canPlayType/isTypeSupported fingerprint is the hashed result of 797 MIME type support tests.
$ fingerprint@info:~ run can-play-type-demo
This test shows results
using the HTMLMediaElement.canPlayType
and MediaSource.isTypeSupported
methods for various versions of ISOBMFF MIME types, in particular for codecs as registered on the MP4 Registration Authority.
The MIME types collection comprises General MIME Types, General track codecs, Audio codecs and Video codecs, in particular all AVC profiles, other video codecs/container such as AV1, VP9, HEVC, WebM, Ogg and test cases (how browser handles the input). If your codec is not listed, you can also test your own codec.