4 <script src=media-file.js
></script>
5 <script src=video-test.js
></script>
13 consoleWrite("seeking " + e
.target
.currentTime
.toFixed(2));
20 consoleWrite("seeked " + e
.target
.currentTime
.toFixed(2));
23 var now
= e
.target
.currentTime
.toFixed(2);
24 var expected
= expectedSeek
.toFixed(2);
25 if (now
!= expected
) {
26 failTest("Expected " + expectedSeek
+ " got " + now
);
32 function doNextSeek(video
)
34 consoleWrite("doNextSeek() " + seekCount
);
36 var newSeekPoint
= -1;
49 if (newSeekPoint
>= 0) {
50 consoleWrite('doNextSeek() seeking to ' + newSeekPoint
.toFixed(2));
51 expectedSeek
= newSeekPoint
;
52 video
.currentTime
= newSeekPoint
;
57 function loadedmetadata(e
)
59 consoleWrite("loadedmetadata()");
63 function onWindowLoad(e
)
65 video
= document
.getElementById('video');
67 video
.src
= findMediaFile("video", "content/test");
68 video
.addEventListener('seeking', seeking
);
69 video
.addEventListener('seeked', seeked
);
70 video
.addEventListener('loadedmetadata', loadedmetadata
);
74 window
.addEventListener('load', onWindowLoad
, false);
78 <video controls
id=
"video"></video>
79 <p>Test currentTime values when setting from seeking event.
</p>