VOOZH about

URL: https://www.geeksforgeeks.org/html/html-dom-video-canplaytype-method/

⇱ HTML DOM Video canPlayType( ) Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML DOM Video canPlayType( ) Method

Last Updated : 23 Jun, 2023

The Video canPlayType() method is used for checking if the browser can play the specified video type or not. The Video canPlayType method returns a string that represents the level of support. 

Syntax:

videoObject.canPlayType(type)

Parameter Values:

  • type: It specifies the video type (and optional codecs) to test support for.

Return: The Video canPlayType() method generally returns one of the following values:

  • "probably": It means that this video type is most likely supported for browser.
  • "maybe" : It means that the browser might support this video type.
  • "" (empty string) : It means that the browser does not support this video type.

The below program illustrates the Video canPlayType() method : 

Example: Checking if a browser can play different types of video or not. 

Output:

👁 Image
 

Supported Browsers: The browser supported by HTML DOM Video canPlayType( ) Method are listed below:

  • Google Chrome 3 and above
  • Edge 12 and above
  • Internet Explorer 9 and above
  • Firefox 3.5 and above
  • Opera 12.1 and above
  • Apple Safari 4 and above
Comment
Article Tags: