4 <script src=media-file.js
></script>
5 <script src=video-test.js
></script>
12 var videos
= document
.getElementsByTagName('video');
15 run('controller = video.controller');
16 controller
.addEventListener('canplaythrough', canplaythrough
, true);
17 var src
= findMediaFile('video', 'content/test');
22 function canplaythrough() {
23 consoleWrite("EVENT(canplaythrough)");
24 controller
.removeEventListener('canplaythrough', canplaythrough
, true);
26 testException("controller.currentTime = -Infinity", '"TypeError: Failed to set the \'currentTime\' property on \'MediaController\': The provided double value is non-finite."');
27 testException("controller.currentTime = Infinity", '"TypeError: Failed to set the \'currentTime\' property on \'MediaController\': The provided double value is non-finite."');
28 testException("controller.currentTime = NaN", '"TypeError: Failed to set the \'currentTime\' property on \'MediaController\': The provided double value is non-finite."');
30 controller
.addEventListener('playing', playing
, true);
31 run('controller.play()');
35 consoleWrite("EVENT(playing)");
36 controller
.removeEventListener('playing', playing
, true);
37 testExpected('controller.paused', false);
38 controller
.addEventListener('ended', ended
, true);
39 run('controller.currentTime = 5');
40 testExpected('controller.currentTime', 5);
41 testExpected('video.currentTime', 5);
42 testExpected('video2.currentTime', 5);
46 consoleWrite("EVENT(ended)");
47 controller
.removeEventListener('ended', ended
, true);
52 <body onload=
"start()">
53 <video mediaGroup=
"group" controls
></video>
54 <video mediaGroup=
"group" controls
></video>