shaka-packager/media/test/data/rapid_video_change_test.html

48 lines
1.3 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>HTML 5 Change H.264 Video Test</title>
<script>
var changeVideoInterval;
var changeVideoCounter = 0;
function changeVideo() {
try {
if (changeVideoCounter == 40) {
alert('40 video changes done. Test over');
window.clearInterval(changeVideoInterval);
return;
}
var video = document.getElementById('video');
video.pause();
video.src = 'bear-1280x720.mp4?counter=' +
changeVideoCounter.toString();
++changeVideoCounter;
video.play();
video.currentTime = 1;
}
catch (e) {
}
}
function onLoad() {
var video = document.getElementById('video');
video.play();
video.currentTime = 1;
changeVideoInterval = setInterval(changeVideo, 200);
}
</script>
</head>
<body onload='onLoad();'> <b> This test tests the case where in H.264 H/W
decoded videos are added and removed a number of times from the page,
while they are playing. <br> This should not cause the browser to hang.
<div id='videoDiv'>
<video id='video' width=320 height=240 src='bear-1280x720.mp4'
controls='controls'>
</video>
</div>
</body>
</html>