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.
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
Specification | Status | Comment |
---|---|---|
Media Capabilities The definition of 'MediaCapabilities' in that specification. |
Draft | Initial definition |
Browser compatibility
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.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
MediaCapabilities | Chrome Full support 66 | Edge Full support ≤79 | Firefox Full support 63 | IE ? | Opera Full support 55 | Safari ? | WebView Android Full support 66 | Chrome Android Full support 66 | Firefox Android Full support 63 | Opera Android Full support 48 | Safari iOS ? | Samsung Internet Android Full support 9.0 |
decodingInfo | Chrome Full support 66 | Edge Full support ≤79 | Firefox Full support 63 | IE ? | Opera Full support 55 | Safari ? | WebView Android Full support 66 | Chrome Android Full support 66 | Firefox Android Full support 63 | Opera Android Full support 48 | Safari iOS ? | Samsung Internet Android Full support 9.0 |
encodingInfo | Chrome
Full support
67
| Edge
Full support
≤79
| Firefox Full support 63 | IE ? | Opera ? | Safari ? | WebView Android No support No | Chrome Android
Full support
67
| Firefox Android Full support 63 | Opera Android ? | Safari iOS ? | Samsung Internet Android No support No |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Experimental. Expect behavior to change in the future.
- Experimental. Expect behavior to change in the future.
- User must explicitly enable this feature.
- User must explicitly enable this feature.
See also
- HTMLMediaElement's method canPlayType()
- MediaSource's method isTypeSupported()
Navigator
interface