OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src=media-file.js></script> | |
5 <script src=video-test.js></script> | |
6 | |
7 <script> | |
8 var controller; | |
9 var video2; | |
10 | |
11 function start() | |
12 { | |
13 var videos = document.getElementsByTagName('video'); | |
14 video = videos[0]; | |
15 video2 = videos[1]; | |
16 run('controller = video.controller'); | |
17 controller.addEventListener('canplaythrough', canplaythrough, true); | |
18 var src = findMediaFile('video', 'content/test'); | |
19 video.src = src; | |
20 video2.src = src; | |
21 } | |
22 | |
23 function canplaythrough() | |
24 { | |
25 consoleWrite("EVENT(canplaythrough)"); | |
26 controller.removeEventListener('canplaythrough', canplaythrough, tru
e); | |
27 controller.addEventListener('playing', playing, true); | |
28 run('controller.play()'); | |
29 } | |
30 | |
31 function playing() | |
32 { | |
33 consoleWrite("EVENT(playing)"); | |
34 controller.removeEventListener('playing', playing, true); | |
35 controller.addEventListener('pause', pause, true); | |
36 run('controller.pause()'); | |
37 } | |
38 | |
39 function pause() { | |
40 consoleWrite("EVENT(pause)"); | |
41 controller.removeEventListener('pause', pause, true); | |
42 controller.addEventListener('playing', playingAgain, true); | |
43 run('controller.play()'); | |
44 } | |
45 | |
46 function playingAgain() | |
47 { | |
48 consoleWrite("EVENT(playing)"); | |
49 testExpected('controller.playbackState', 'playing'); | |
50 controller.removeEventListener('playing', playingAgain, true); | |
51 endTest(); | |
52 } | |
53 | |
54 </script> | |
55 </head> | |
56 <body onload="start()"> | |
57 <video mediaGroup="group" controls></video> | |
58 <video mediaGroup="group" controls></video> | |
59 </body> | |
60 </html> | |
OLD | NEW |