Skip to content

Instantly share code, notes, and snippets.

@dagingaa
Last active October 24, 2018 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagingaa/bd616aa0b846938ae0613d14d1ed1705 to your computer and use it in GitHub Desktop.
Save dagingaa/bd616aa0b846938ae0613d14d1ed1705 to your computer and use it in GitHub Desktop.
if ('mediaCapabilities' in navigator && 'encodingInfo' in navigator.mediaCapabilities) {
const videoFileConfiguration = {
type : 'record',
video : {
contentType: "video/webm;codecs=vp8",
width: 1920,
height: 1080,
bitrate: 2500000,
framerate: 30,
}
};
navigator.mediaCapabilities.encodingInfo(videoFileConfiguration).then(result => {
console.log('This configuration is ' +
(result.supported ? '' : 'not ') + 'supported, ' +
(result.smooth ? '' : 'not ') + 'smooth, and ' +
(result.powerEfficient ? '' : 'not ') + 'power efficient.')
})
.catch((e) => {
console.log("encodingInfo error: " + e)
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment