OLD | NEW |
1 <!-- | 1 <!-- |
2 This HTML file contains a div for a player which is used for event testing | 2 This HTML file contains a div for a player which is used for event testing |
3 (chrome/test/functional/media_event_*.py). | 3 (chrome/test/functional/media_event_*.py). |
4 The query string should contain the following information: | 4 The query string should contain the following information: |
5 tag (required): HTML video/audio tag. | 5 tag (required): HTML video/audio tag. |
6 video file (required): video file name. | 6 video file (required): video file name. |
7 t (optional): if specified, disables the media cache. | 7 t (optional): if specified, disables the media cache. |
8 actions (optional): add a list of triples (time, action, action_argument) | 8 actions (optional): add a list of triples (time, action, action_argument) |
9 delimited by '|'. For example, '3000|seek|5000' means 'at second 3, seek | 9 delimited by '|'. For example, '3000|seek|5000' means 'at second 3, seek |
10 to second 5'. Possible actions are 'play', 'pause', 'seek', or | 10 to second 5'. Possible actions are 'play', 'pause', 'seek', or |
11 'ratechange'. Time and action_arugment is in milliseconds. 'play' and | 11 'ratechange'. Time and action_arugment is in milliseconds. 'play' and |
12 'pause' should have dummy action_argument, which is ignored. | 12 'pause' should have dummy action_argument, which is ignored. |
13 | 13 |
14 Example: "media_event.html?tag=video&media=foo.webm&t=t&actions=3000|seek|5000" | 14 Example: "media_event.html?tag=video&media=foo.webm&t=t&actions=3000|seek|5000" |
15 --> | 15 --> |
16 <html> | 16 <html> |
17 <body> | 17 <body> |
18 <div id='player_container'></div> | 18 <div id='player_container'></div> |
19 <script type='text/javascript' src='player.js'></script> | 19 <script type='text/javascript' src='player.js'></script> |
20 <script> | 20 <script> |
21 var events = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', | 21 var events = ['abort', 'canplay', 'canplaythrough', 'durationchange', 'emptied', |
22 'ended', 'error', 'load', 'loadeddata', 'loadedmetadata', | 22 'ended', 'error', 'load', 'loadeddata', 'loadedmetadata', |
23 'loadstart', 'pause', 'play', 'playing', 'progress', | 23 'loadstart', 'pause', 'play', 'playing', 'progress', |
24 'ratechange', 'seeked', 'seeking', 'stalled', 'suspend', | 24 'ratechange', 'seeked', 'seeking', 'stalled', 'suspend', |
25 'timeupdate', 'volumechange', 'waiting'] | 25 'timeupdate', 'volumechange', 'waiting', |
| 26 'cuechange', 'enter', 'exit', 'change']; |
26 | 27 |
27 var startTime = 0 | 28 var startTime = 0 |
28 | 29 |
29 var table = document.createElement('table'); | 30 var table = document.createElement('table'); |
30 table.id = 'event'; | 31 table.id = 'event'; |
31 document.body.appendChild(table); | 32 document.body.appendChild(table); |
32 | 33 |
33 function recordEventTime(evt) { | 34 function recordEventTime(evt) { |
34 // Record the time when an event happens. | 35 // Record the time when an event happens. |
35 var time = new Date().getTime() - startTime | 36 var time = new Date().getTime() - startTime |
(...skipping 16 matching lines...) Expand all Loading... |
52 } | 53 } |
53 | 54 |
54 if (ok) { | 55 if (ok) { |
55 startTime = new Date().getTime(); | 56 startTime = new Date().getTime(); |
56 player.play(); | 57 player.play(); |
57 } | 58 } |
58 </script> | 59 </script> |
59 </body> | 60 </body> |
60 </html> | 61 </html> |
61 | 62 |
OLD | NEW |