4 <script src=media-file.js></script>
5 <script src=video-test.js></script>
7 var ratechangeCount = 0;
9 var progressEventCount = 0;
10 var pauseEventCount = 0;
12 function eventHandler()
14 // Don't log progress event since the number and order are platform
16 if (event.type != "progress")
17 consoleWrite("EVENT(" + event.type + ")");
20 case "canplaythrough":
21 testExpected('progressEventCount', 1, '>=');
22 consoleWrite("<br>*** starting playback");
26 if (++playingCount == 1) {
27 consoleWrite("<br>*** changing playback rate");
28 run("video.playbackRate = 2");
32 if (++ratechangeCount == 1) {
33 consoleWrite("<br>*** setting volume");
34 run("video.volume = 0.5");
38 consoleWrite("<br>*** pausing playback");
42 if(++pauseEventCount == 1) {
43 consoleWrite("<br>*** seeking");
44 run("video.currentTime = 5.6");
48 consoleWrite("<br>*** beginning playback");
52 var mediaFile = findMediaFile("video", "content/garbage");
53 consoleWrite("<br>*** played to end, setting 'src' to an invalid movie");
54 run("progressEventCount = 0");
55 video.src = mediaFile;
61 testExpected('progressEventCount', 0);
71 setSrcByTagName("video", findMediaFile("video", "content/test"));
78 <body onload="start()">
81 onabort="eventHandler()"
82 oncanplay="eventHandler()"
83 oncanplaythrough="eventHandler()"
84 ondurationchange="eventHandler()"
85 onemptied="eventHandler()"
86 onended="eventHandler()"
87 onerror="eventHandler()"
88 onloadeddata="eventHandler()"
89 onloadedmetadata="eventHandler()"
90 onloadstart="eventHandler()"
91 onpause="eventHandler()"
92 onplay="eventHandler()"
93 onplaying="eventHandler()"
94 onprogress="eventHandler()"
95 onratechange="eventHandler()"
96 onseeked="eventHandler()"
97 onseeking="eventHandler()"
98 onstalled="eventHandler()"
99 onsuspend="eventHandler()"
100 onvolumechange="eventHandler()"
101 onwaiting="eventHandler()"