The Navigator.mediaCapabilities
read-only property returns a MediaCapabilities
object that can expose information about the decoding and encoding capabilities for a given format and output capabilities as defined by the Media Capabilities API.
The Navigator.mediaCapabilities
read-only property returns a MediaCapabilities
object that can expose information about the decoding and encoding capabilities for a given format and output capabilities as defined by the Media Capabilities API.
A MediaCapabilities
object.
js
navigator.mediaCapabilities .decodingInfo({ type: "file", audio: { contentType: "audio/mp3", channels: 2, bitrate: 132700, samplerate: 5200, }, }) .then((result) => { console.log( `This configuration is ${result.supported ? "" : "not "}supported,`, ); console.log(`${result.smooth ? "" : "not "}smooth, and`); console.log(`${result.powerEfficient ? "" : "not "}power efficient.`); });
Specification |
---|
Media Capabilities # dom-navigator-mediacapabilities |
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 | 55 | 13 | 66 | 66 | 63 | 48 | 13 | 9.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaCapabilities