blob: c716f5d98552b7711871d96f270be352cc504d7a [file] [log] [blame]
<!-- This is a test html file for video test. -->
<html>
<body>
<video id='testvideo' controls autoplay muted name='media'>
<source src=''>
</video>
</body>
<script type="text/javascript">
var seeked = 0;
var max_seeks = 100;
var testvideo = document.getElementById('testvideo');
function loadSourceAndRunSeekTest(video) {
testvideo.src = video;
testvideo.play();
// Random seek forward and backward until reaching max seeks.
seeked = 0;
testvideo.addEventListener("seeked", function() {
seeked++; if (seeked < max_seeks) randomSeek(); });
// Start the first seek only after the video is ready.
testvideo.addEventListener("loadeddata", function() { randomSeek(); });
}
function randomSeek() {
testvideo.currentTime = Math.random() * testvideo.duration;
}
function getSeekTestStatus() {
if (seeked == max_seeks)
return 'pass'
return testvideo.currentTime + '/' + testvideo.duration + '/' + seeked;
}
</script>
</html>