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

Side by Side Diff: ui/file_manager/video_player/js/video_player.js

Issue 528733002: Video Player: Restyle Files.app Cast Selection Menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Localize the string Created 6 years, 3 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 | « ui/file_manager/video_player/css/cast_menu.css ('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 // 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
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
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));
OLDNEW
« no previous file with comments | « ui/file_manager/video_player/css/cast_menu.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698