diff options
Diffstat (limited to 'dom/media/test/test_hevc_playback.html')
-rw-r--r-- | dom/media/test/test_hevc_playback.html | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/dom/media/test/test_hevc_playback.html b/dom/media/test/test_hevc_playback.html new file mode 100644 index 0000000000..6327008102 --- /dev/null +++ b/dom/media/test/test_hevc_playback.html @@ -0,0 +1,45 @@ +<!DOCTYPE HTML> +<html> +<head> +<title>Test HEVC video playback</title> +<script src="/tests/SimpleTest/SimpleTest.js"></script> +<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> +<script type="application/javascript"> + +/** + * This test is used to check whether non-MSE HEVC video can be played on the + * platform. HEVC can only be played if we have platform decoder supports + * hardware decoding. Currently we can only do that on Windows. + */ +add_task(async function testHEVCPlayback() { + let video = document.createElement('video'); + info(`try to play HEVC video`); + video.src = "hevc_white_frame.mp4"; + video.controls = true; + document.body.appendChild(video); + ok(await video.play().then(_=>true, _=>false), "video started playing"); + ok(await new Promise(r => video.onended = r).then(_=>true, _=>false), + "video played to end"); + +}); + + +// This test video contains an inband SPS that is different from the SPS in the +// extradata, so we would recreate a new decoder. +add_task(async function testHEVCInbandConfigChange() { + let video = document.createElement('video'); + info(`try to play HEVC video`); + video.src = "hevc_white_red_frames.mp4"; + video.playbackRate = 2.0; // speed up the test. + video.controls = true; + document.body.appendChild(video); + ok(await video.play().then(_=>true, _=>false), "video started playing"); + ok(await new Promise(r => video.onended = r).then(_=>true, _=>false), + "video played to end"); +}); + +</script> +</head> +<body> +</body> +</html> |