Media Capabilities VP9
by dustinkerstein
JavaScript
const mediaConfig = {
type: 'file', // or 'file'
video: {
contentType: 'video/webm; codecs="vp09.00.10.08"',
width: 3840,
height: 2160,
bitrate: 1000000, // number of bits used to encode a second of video
framerate: '60' // number of frames used in one second
}
};
navigator.mediaCapabilities.decodingInfo(mediaConfig).then(result => {
document.body.innerHTML = result.supported && result.smooth && result.powerEfficient
console.log('This configuration is' +
(result.supported ? '' : ' NOT') + ' supported,' +
(result.smooth ? '' : ' NOT') + ' smooth and' +
(result.powerEfficient ? '' : ' NOT') + ' power efficient.');
});