Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(643)

Side by Side Diff: media/test/data/player.html

Issue 2655333006: media: Work around an Android bug in the video size browsertests (Closed)
Patch Set: fix comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/media/media_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <html>
2 <body onload="RunTest();"> 2 <body onload="RunTest();">
3 <div id="player_container"></div> 3 <div id="player_container"></div>
4 </body> 4 </body>
5 5
6 <script type="text/javascript"> 6 <script type="text/javascript">
7 // <audio> or <video> player element. 7 // <audio> or <video> player element.
8 var player; 8 var player;
9 9
10 // Listen for |event| from |element|, set document.title = |event| upon event. 10 // Listen for |event| from |element|, set document.title = |event| upon event.
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 if (tag != 'audio' && tag != 'video') { 78 if (tag != 'audio' && tag != 'video') {
79 return Failed(); 79 return Failed();
80 } 80 }
81 81
82 // Create player and insert into DOM. 82 // Create player and insert into DOM.
83 player = document.createElement(tag); 83 player = document.createElement(tag);
84 player.controls = true; 84 player.controls = true;
85 document.getElementById('player_container').appendChild(player); 85 document.getElementById('player_container').appendChild(player);
86 86
87 player.addEventListener('loadedmetadata', function(e) { 87 // We use loadeddata instead of loadedmetadata to ensure the decoder has
88 // completed initialization, even though we don't need to decode anything to
89 // get the size metadata. This is an unfortunate workaround for an Android
90 // framework bug (http://crbug.com/682387) where we have to avoid killing
91 // the GPU process while the decoder is initializing.
92 player.addEventListener('loadeddata', function(e) {
88 document.title = '' + player.videoWidth + ' ' + player.videoHeight; 93 document.title = '' + player.videoWidth + ' ' + player.videoHeight;
89 }); 94 });
90 95
91 // Transition to the seek test after X seconds of playback or when the ended 96 // Transition to the seek test after X seconds of playback or when the ended
92 // event occurs, whichever happens first. 97 // event occurs, whichever happens first.
93 player.addEventListener('ended', SeekTestStep, false); 98 player.addEventListener('ended', SeekTestStep, false);
94 player.addEventListener('timeupdate', SeekTestTimeoutSetup, false); 99 player.addEventListener('timeupdate', SeekTestTimeoutSetup, false);
95 100
96 // Ensure we percolate up any error events. 101 // Ensure we percolate up any error events.
97 InstallTitleEventHandler(player, 'error'); 102 InstallTitleEventHandler(player, 'error');
98 103
99 // Starts the player. 104 // Starts the player.
100 player.loop = loop; 105 player.loop = loop;
101 player.src = media_url; 106 player.src = media_url;
102 player.play(); 107 player.play();
103 } 108 }
104 </script> 109 </script>
105 </html> 110 </html>
OLDNEW
« no previous file with comments | « content/browser/media/media_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698