4 <script src=media-file.js
></script>
5 <script src=video-test.js
></script>
8 var mediaElement
= new Audio();
12 mediaElement
.src
= findMediaFile('audio', 'content/silence');
13 waitForEvent("loadedmetadata", mediaLoadedMetadata
);
16 function mediaLoadedMetadata()
18 waitForEventOnce("playing", mediaPlaying
);
19 waitForEvent("pause", mediaPause
);
20 waitForEvent("ended", mediaEnded
);
21 run("mediaElement.play()");
24 function mediaPlaying()
26 mediaElement
.currentTime
= mediaElement
.duration
- 0.2;
31 testExpected("mediaElement.paused", true);
36 testExpected("mediaElement.ended", true);
44 waitForEventOnce("playing", mediaPlaying
);
45 run("mediaElement.play()");
50 <body onload=
"start()">
51 <p>This tests ensure that media element emits the 'playing' event every time it starts playing after eos. It also ensure that 'pause' and 'ended' events are sent when media playback ends.
</p>