mediaCapabilites
by dustinkerstein
HTML
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Origin Trial Token, feature = Media Capabilities, origin = https://beaufortfrancois.github.io, expires = 2018-04-12 -->
<meta http-equiv="origin-trial" data-feature="Media Capabilities" data-expires="2018-04-12" content="AqmvO7/qCy1nTh2NmOwn3/gmVCIMt3dPPlSZ7810DQmC5eyQsQxfpgDZ9TETCHFR5x5uXSqNuHPO7d29dHwPkwEAAABleyJvcmlnaW4iOiJodHRwczovL2JlYXVmb3J0ZnJhbmNvaXMuZ2l0aHViLmlvOjQ0MyIsImZlYXR1cmUiOiJNZWRpYUNhcGFiaWxpdGllcyIsImV4cGlyeSI6MTUyMzQ5MTIwMH0=">
<title>🎮 mediaCapabilities.decodingInfo()</title>
<style>
body { margin: 0 auto; max-width: 1200px; }
select { height: 200px; margin-right: 2px; }
@media (max-width: 1200px) {
body { margin: 0 12px; }
}
@media (max-width: 768px) {
select { height: auto; margin-right: 2px; }
}
</style>
</head>
<body>
<h1>🎮 mediaCapabilities.decodingInfo()</h1>
<h3>Showing only supported but not smooth and/or power efficient</h3>
</body>
<script>
var $ = document.querySelector.bind(document);
if (!('mediaCapabilities' in navigator)) {
let warningElement = document.createElement('div');
warningElement.style.color = 'red';
warningElement.innerHTML = 'Warning! The Media Capabilities API is not available.';
$('body').appendChild(warningElement);
}
const MEDIA_CONFIGURATION_TYPES = ['media-source', 'file'];
const VIDEO_CONFIGURATION_CONTENT_TYPES = [
{ mime: 'video/mp4; codecs="hev1.1.6.L93.B0"', title: 'HEVC progressive, non-packed stream, Main Profile, Main Tier, Level 3.1'},
{ mime: 'video/mp4; codecs=av1', title: 'AV1 in MP4 container' },
{ mime: 'video/mp4; codecs=avc1.42001E', title: 'H.264 Baseline Profile' },
{ mime: 'video/mp4; codecs=avc1.4D001E', title: 'H.264 Main Profile' },
{ mime: 'video/mp4; codecs=avc1.58001E', title: 'H.264 Extended Profile' },
{ mime: 'video/mp4; codecs=avc1.64001E', title: 'H.264 High Profile' },
...