WorkerNavigator: mediaCapabilities property
The read-only mediaCapabilities
property of the WorkerNavigator
interface references 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).
Value
A MediaCapabilities
object.
Examples
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.`);
});
Specifications
Specification |
---|
Media Capabilities # dom-workernavigator-mediacapabilities |
Browser compatibility
BCD tables only load in the browser