diff options
Diffstat (limited to 'media/test/data/rapid_video_change_test.html')
-rw-r--r-- | media/test/data/rapid_video_change_test.html | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/media/test/data/rapid_video_change_test.html b/media/test/data/rapid_video_change_test.html new file mode 100644 index 0000000..81a853b --- /dev/null +++ b/media/test/data/rapid_video_change_test.html @@ -0,0 +1,47 @@ +<!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> |