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.
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.
const mediaConfig = {
type : 'file',
video : {
contentType : "video/webm;codecs=vp8",
width : 800,
height : 600,
bitrate : 10000,
framerate : 30
}
};
navigator.mediaCapabilities.decodingInfo(mediaConfig).then(result => {
console.log('This configuration is ' + (result.supported ? '' : 'not ') + 'supported.')
});