blob: f98243c1388ea6f9d0359a0a705b072d80d818ee [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>video-track-configuration</title>
<script src="../video-test.js"></script>
<script>
window.addEventListener('load', async event => {
findMediaElement();
run('video.src = "../content/test.mp4"');
const timeout = 100;
await waitFor(video, 'canplay');
await testExpectedEventually('video.videoTracks.length', 1, '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration', null, '!=', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.codec', 'avc1.4D400D', '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.width', 320, '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.height', 240, '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.bitrate', 240000, '>=', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.framerate', 30, '>=', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.colorSpace', null, '!=', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.colorSpace.matrix', 'bt470bg', '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.colorSpace.primaries', 'smpte170m', '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.colorSpace.transfer', 'bt709', '==', timeout);
run('video.src = "../content/test-hevc.mp4"');
await waitFor(video, 'canplay');
await testExpectedEventually('video.videoTracks.length', 1, '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration', null, '!=', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.codec', 'hvc1.1.6.L93.B0', '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.width', 320, '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.height', 240, '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.bitrate', 150000, '>=', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.framerate', 30, '>=', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.colorSpace', null, '!=', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.colorSpace.matrix', 'bt709', '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.colorSpace.primaries', 'bt709', '==', timeout);
await testExpectedEventually('video.videoTracks[0].configuration.colorSpace.transfer', 'bt709', '==', timeout);
endTest();
});
</script>
</head>
<body>
<video controls></video>
</body>
</html>