49 lines
1.5 KiB
HTML
49 lines
1.5 KiB
HTML
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<script src=media-file.js></script>
|
|
<script src=video-test.js></script>
|
|
<script>
|
|
function start()
|
|
{
|
|
findMediaElement();
|
|
|
|
var countPlaying = 0;
|
|
waitForEvent('playing', function() {
|
|
if (++countPlaying > 2) {
|
|
logResult(false, 'FAIL: playing fired more then twice.');
|
|
endTest();
|
|
return;
|
|
}
|
|
var seekTarget = 3;
|
|
if (countPlaying == 2) {
|
|
testExpected('video.currentTime.toFixed(2)', seekTarget, '==');
|
|
endTest();
|
|
return;
|
|
}
|
|
|
|
waitForEventOnce('ended', function() {
|
|
video.currentTime = seekTarget;
|
|
waitForEventOnce('seeked', function() { video.play(); })
|
|
});
|
|
|
|
video.currentTime = video.duration - 0.2;
|
|
});
|
|
|
|
video.src = findMediaFile('video', 'content/test');
|
|
video.play();
|
|
|
|
setTimeout(function() {
|
|
logResult(false, 'FAIL: timeout');
|
|
endTest();
|
|
}, 1500);
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body onload="start()">
|
|
<p>Test that we can seek after reached the end of the video.</p>
|
|
<video controls></video>
|
|
</body>
|
|
</html>
|