canPlayType
canPlayType is a method of the HTMLMediaElement interface that allows a script to query whether the user agent can play a given media type. It is available on media elements such as HTMLVideoElement and HTMLAudioElement. The method accepts a single string parameter that identifies a MIME type and, optionally, a list of codecs. For example: video.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"').
The return value is a string and can be "probably", "maybe", or an empty string "". "Probably" indicates
Usage of canPlayType is common for progressive enhancement, allowing a page to select a source that is
Example usage: create a video element and query canPlayType for different formats to decide which source to
Related concepts include the HTMLMediaElement interface and the HTMLVideoElement and HTMLAudioElement types, which expose canPlayType as