The MediaCapabilities
interface of the Media Capabilities API provides information about the decoding abilities of the device, system and browser. The API can be used to query the browser about the decoding abilities of the device based on codecs, profile, resolution, and bitrates. The information can be used to serve optimal media streams to the user and determine if playback should be smooth and power efficient.
The information is accessed through the mediaCapabilities
property of the Navigator
interface.
Instance methods
-
MediaCapabilities.encodingInfo()
-
When passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether encoding such media would be smooth and power efficient.
-
MediaCapabilities.decodingInfo()
-
When passed a valid media configuration, it returns a promise with information as to whether the media type is supported, and whether decoding such media would be smooth and power efficient.
Specifications
Browser compatibility
|
Desktop |
Mobile |
|
Chrome |
Edge |
Firefox |
Internet Explorer |
Opera |
Safari |
WebView Android |
Chrome Android |
Firefox for Android |
Opera Android |
Safari on IOS |
Samsung Internet |
MediaCapabilities |
66 |
79 |
63 |
No |
53 |
13 |
66 |
66 |
63 |
48 |
13 |
9.0 |
decodingInfo |
66["codecs string can contain any subset of optional parameters (should be all or none).", "Errors if codecs string contains unexpected characters (should evaluate string up to character)."]
|
79["codecs string can contain any subset of optional parameters (should be all or none).", "Errors if codecs string contains unexpected characters (should evaluate string up to character)."]
|
63["The webrtc value of the type option is named transmission .", "Before Firefox 101, decodingInfo() ignored codecs parameter options for av01 codecs (treating them as av1 )."]
|
No |
53["codecs string can contain any subset of optional parameters (should be all or none).", "Errors if codecs string contains unexpected characters (should evaluate string up to character)."]
|
13 |
66["codecs string can contain any subset of optional parameters (should be all or none).", "Errors if codecs string contains unexpected characters (should evaluate string up to character)."]
|
66["codecs string can contain any subset of optional parameters (should be all or none).", "Errors if codecs string contains unexpected characters (should evaluate string up to character)."]
|
63["The webrtc value of the type option is named transmission .", "Before Firefox 101, decodingInfo() ignored codecs parameter options for av01 codecs (treating them as av1 )."]
|
48["codecs string can contain any subset of optional parameters (should be all or none).", "Errors if codecs string contains unexpected characters (should evaluate string up to character)."]
|
13 |
9.0["codecs string can contain any subset of optional parameters (should be all or none).", "Errors if codecs string contains unexpected characters (should evaluate string up to character)."]
|
encodingInfo |
101 |
101 |
63The webrtc value of the type option is named transmission .
|
No |
87 |
15.4 |
101 |
101 |
63The webrtc value of the type option is named transmission .
|
70 |
15.4 |
19.0 |
See also