YouTip LogoYouTip

Met Video Canplaytype

# Video canPlayType() Method [![Image 8: Video Object Reference](#) Video Object](#) ## Example Check if your browser can play different types of video: var x = document.createElement("VIDEO"); isSupp = x.canPlayType(vidType+';codecs="'+codType+'"'); [Try it Yourself Β»](#) * * * ## Definition and Usage The canPlayType() method checks whether the browser can play the specified audio/video type. The canPlayType() method can return one of the following values: * "probably" - The browser most likely supports this audio/video type * "maybe" - The browser may support this audio/video type * "" - (empty string) The browser does not support this audio/video type * * * ## Browser Support ![Image 9: Internet Explorer](#)![Image 10: Firefox](#)![Image 11: Opera](#)![Image 12: Google Chrome](#)![Image 13: Safari](#) The canPlayType() method is supported by all major browsers. **Note:** Internet Explorer 8 and earlier versions do not support this method. * * * ## Syntax _videoObject_.canPlayType(_type_)) ## Parameter Values | Value | Description | | --- | --- | | _type_ | Describes the audio/video type to check. Can typically be: * video/ogg * video/mp4 * video/webm Typically, with codecs: * video/ogg; codecs="theora, vorbis" * video/mp4; codecs="avc1.4D401E, mp4a.40.2" * video/webm; codecs="vp8.0, vorbis" **Note:** If codecs are included, the method can only return "probably". | ## Technical Details | Return Value: | Indicates the level of support. Possible values: * "probably" - Most likely supported * "maybe" - Possibly supported * "" - (empty string) Not supported | | --- | * * Video Object](#)
← Met Video LoadMet Video Addtexttrack β†’