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":
23 video
.oncanplaythrough
= null;
24 testExpected('progressEventCount', 1, '>=');
25 consoleWrite("<br>*** starting playback");
29 video
.oncanplay
= null;
32 if (++playingCount
== 1) {
33 consoleWrite("<br>*** changing playback rate");
34 run("video.playbackRate = 2");
38 if (++ratechangeCount
== 1) {
39 consoleWrite("<br>*** setting volume");
40 run("video.volume = 0.5");
44 consoleWrite("<br>*** pausing playback");
48 if(++pauseEventCount
== 1) {
49 consoleWrite("<br>*** seeking");
50 run("video.currentTime = 5.6");
54 consoleWrite("<br>*** beginning playback");
58 var mediaFile
= findMediaFile("video", "content/garbage");
59 consoleWrite("<br>*** played to end, setting 'src' to an invalid movie");
60 run("progressEventCount = 0");
61 video
.src
= mediaFile
;
67 testExpected('progressEventCount', 0);
77 setSrcByTagName("video", findMediaFile("video", "content/test"));
84 <body onload=
"start()">
87 onabort=
"eventHandler()"
88 oncanplay=
"eventHandler()"
89 oncanplaythrough=
"eventHandler()"
90 ondurationchange=
"eventHandler()"
91 onemptied=
"eventHandler()"
92 onended=
"eventHandler()"
93 onerror=
"eventHandler()"
94 onloadeddata=
"eventHandler()"
95 onloadedmetadata=
"eventHandler()"
96 onloadstart=
"eventHandler()"
97 onpause=
"eventHandler()"
98 onplay=
"eventHandler()"
99 onplaying=
"eventHandler()"
100 onprogress=
"eventHandler()"
101 onratechange=
"eventHandler()"
102 onseeked=
"eventHandler()"
103 onseeking=
"eventHandler()"
104 onstalled=
"eventHandler()"
105 onvolumechange=
"eventHandler()"
106 onwaiting=
"eventHandler()"