A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/canPlayType below:

HTMLMediaElement: canPlayType() method - Web APIs

HTMLMediaElement: canPlayType() method

Baseline Widely available

The HTMLMediaElement method canPlayType() reports how likely it is that the current browser will be able to play media of a given MIME type.

Syntax Parameters
type

A string specifying the MIME type of the media and (optionally) a codecs parameter containing a comma-separated list of the supported codecs.

Return value

A string indicating how likely it is that the media can be played. The string will be one of the following values:

"" (empty string)

The media cannot be played on the current device.

probably

The media is probably playable on this device.

maybe

There is not enough information to determine whether the media can play (until playback is actually attempted).

Examples
let obj = document.createElement("video");
console.log(obj.canPlayType("video/mp4")); // "maybe"
Specifications Browser compatibility See also

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4