MediaDecodingConfiguration

The MediaDecodingConfiguration dictionary of the Media Capabilities API is used to define the type of media being tested when calling MediaCapabilities.decodingInfo() to query whether a specific media configuration is supported, smooth, and/or power efficient.

Properties

A MediaDecodingConfiguration dictionary takes two properties:

  • type — the type of media being tested. This takes one of two values:
    • file: Represents a configuration that is meant to be used for a plain file playback.
    • media-source: Represents a configuration that is meant to be used for playback of a MediaSource.
  • A media configuration — a VideoConfiguration or AudioConfiguration dictionary.

Examples

//Create media configuration to be tested
const mediaConfig = {
    type : 'file', // or 'media-source'
    video : {
        contentType : "video/webm;codecs=vp8", // valid content type
        width : 800,     // width of the video
        height : 600,    // height of the video
        bitrate : 10000, // number of bits used to encode 1s of video
        framerate : 30   // number of frames making up that 1s.
     }
};

// check support and performance
navigator.mediaCapabilities.decodingInfo(mediaConfig).then(result => {
    console.log('This configuration is ' +  (result.supported ? '' : 'not ') + 'supported.')
});

Specifications

No specification found

No specification data found for api.MediaDecodingConfiguration.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser compatibility

No compatibility data found for api.MediaDecodingConfiguration.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaDecodingConfiguration