HTMLMediaElement: canPlayType() メソッド
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
HTMLMediaElement
の canPlayType()
メソッドは、現在のブラウザーが指定された MIME タイプのメディアを再生できるかどうかを報告します。
構文
js
canPlayType(type)
引数
返値
例
js
let obj = document.createElement("video");
console.log(obj.canPlayType("video/mp4")); // "maybe"
仕様書
Specification |
---|
HTML # dom-navigator-canplaytype-dev |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
canPlayType() |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- See implementation notes.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
関連情報
HTMLMediaElement
:HTMLMediaElement.canPlayType()
メソッドを定義しているインターフェイスMediaCapabilities
- ウェブコンテンツのメディア対応に関する問題への対応
- メディア種別と形式のガイド
- よくあるメディア種別のコーデック