OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 'use strict'; | 5 'use strict'; |
6 | 6 |
7 /** | 7 /** |
8 * @param {Element} playerContainer Main container. | 8 * @param {Element} playerContainer Main container. |
9 * @param {Element} videoContainer Container for the video element. | 9 * @param {Element} videoContainer Container for the video element. |
10 * @param {Element} controlsContainer Container for video controls. | 10 * @param {Element} controlsContainer Container for video controls. |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 arrowRight.addEventListener('click', this.advance_.wrap(this, 1)); | 245 arrowRight.addEventListener('click', this.advance_.wrap(this, 1)); |
246 var arrowLeft = document.querySelector('.arrow-box .arrow.left'); | 246 var arrowLeft = document.querySelector('.arrow-box .arrow.left'); |
247 arrowLeft.addEventListener('click', this.advance_.wrap(this, 0)); | 247 arrowLeft.addEventListener('click', this.advance_.wrap(this, 0)); |
248 | 248 |
249 var videoPlayerElement = document.querySelector('#video-player'); | 249 var videoPlayerElement = document.querySelector('#video-player'); |
250 if (videos.length > 1) | 250 if (videos.length > 1) |
251 videoPlayerElement.setAttribute('multiple', true); | 251 videoPlayerElement.setAttribute('multiple', true); |
252 else | 252 else |
253 videoPlayerElement.removeAttribute('multiple'); | 253 videoPlayerElement.removeAttribute('multiple'); |
254 | 254 |
| 255 document.querySelector('#cast-menu').setAttribute( |
| 256 'playon-text', |
| 257 loadTimeData.getString('VIDEO_PLAYER_PLAY_ON')); |
| 258 |
255 document.addEventListener('keydown', reloadVideo); | 259 document.addEventListener('keydown', reloadVideo); |
256 document.addEventListener('click', reloadVideo); | 260 document.addEventListener('click', reloadVideo); |
257 }; | 261 }; |
258 | 262 |
259 /** | 263 /** |
260 * Unloads the player. | 264 * Unloads the player. |
261 */ | 265 */ |
262 function unload() { | 266 function unload() { |
263 if (!player.controls || !player.controls.getMedia()) | 267 if (!player.controls || !player.controls.getMedia()) |
264 return; | 268 return; |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 var initPromise = Promise.all( | 647 var initPromise = Promise.all( |
644 [new Promise(initVideos.wrap(null)), | 648 [new Promise(initVideos.wrap(null)), |
645 new Promise(initStrings.wrap(null)), | 649 new Promise(initStrings.wrap(null)), |
646 new Promise(util.addPageLoadHandler.wrap(null))]); | 650 new Promise(util.addPageLoadHandler.wrap(null))]); |
647 | 651 |
648 initPromise.then(function(results) { | 652 initPromise.then(function(results) { |
649 var videos = results[0]; | 653 var videos = results[0]; |
650 player.prepare(videos); | 654 player.prepare(videos); |
651 return new Promise(player.playFirstVideo.wrap(player)); | 655 return new Promise(player.playFirstVideo.wrap(player)); |
652 }.wrap(null)); | 656 }.wrap(null)); |
OLD | NEW |