| <script src=media-file.js></script> |
| <script src=video-test.js></script> |
| video = document.getElementById('video'); |
| run('controller = video.controller'); |
| controller.addEventListener('canplaythrough', canplaythrough, true); |
| var src = findMediaFile('video', 'content/test'); |
| function canplaythrough() { |
| consoleWrite("EVENT(canplaythrough)"); |
| controller.removeEventListener('canplaythrough', canplaythrough, true); |
| controller.addEventListener('ended', ended, true); |
| // 0.05 is greater than one frame of this 25fps video. |
| run('controller.currentTime = controller.duration - 0.05'); |
| run('controller.play()'); |
| consoleWrite("EVENT(ended)"); |
| testExpected("controller.currentTime", 0, ">"); |
| testExpected("controller.currentTime <= controller.duration", true); |
| <video id="video" mediaGroup="group" controls></video> |