Add new access object callback
[framework/web/webkit-efl.git] / LayoutTests / media / media-controller-playback.html
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             var videos = document.getElementsByTagName('video');
13             video = videos[0];
14             video2 = videos[1];
15             run('controller = video.controller');
16             controller.addEventListener('canplaythrough', canplaythrough, true);
17             var src = findMediaFile('video', 'content/test');
18             video.src = src;
19             video2.src = src;
20         }
21         
22         function canplaythrough() {
23             consoleWrite("EVENT(canplaythrough)");
24             controller.removeEventListener('canplaythrough', canplaythrough, true);
25             controller.addEventListener('playing', playing, true);
26             run('controller.play()');
27         }
28         
29         function playing() { 
30             consoleWrite("EVENT(playing)");
31             controller.removeEventListener('playing', playing, true);
32             testExpected('controller.paused', false);
33             controller.addEventListener('ended', ended, true);
34             run('controller.currentTime = 5');
35             testExpected('video.currentTime', 5);
36             testExpected('video2.currentTime', 5);
37         }
38
39         function ended() { 
40             consoleWrite("EVENT(ended)");
41             controller.removeEventListener('ended', ended, true);
42             endTest();
43         }
44         </script>
45     </head>
46     <body onload="start()">
47         <video mediaGroup="group" controls></video>
48         <video mediaGroup="group" controls></video>
49     </body>
50 </html>