Easy Tutorial
❮ Prop Ins Datetime Prop Style Borderimage ❯

Video canPlayType() Method

Video Object

Example

Check if your browser can play different types of videos:


Definition and Usage

The canPlayType() method checks if the browser can play the specified audio/video type.

The canPlayType() method can return one of the following values:


Browser Support

All major browsers support the canPlayType() method.

Note: Internet Explorer 8 and earlier versions do not support this method.


Syntax

Parameter Values

Value Description
type Describes the audio/video type to be tested. <br> Commonly can be: video/ogg<br> video/mp4<br> video/webm Usually includes codecs: video/ogg; codecs="theora, vorbis"<br> video/mp4; codecs="avc1.4D401E, mp4a.40.2"<br> video/webm; codecs="vp8.0, vorbis" Note:<br> If codecs are included, the method is more likely to return "probably".

Technical Details

| Return Value: | Indicates the level of support. Possible values: "probably" - Most likely supported<br>"maybe" - Possibly supported<br>"" - (empty string) Not supported | | --- | --- |

❮ Prop Ins Datetime Prop Style Borderimage ❯