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

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

Issue 569663002: Detach video when the another video is loaded (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « no previous file | 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 videoPlayerElement.removeAttribute('last-video'); 300 videoPlayerElement.removeAttribute('last-video');
301 301
302 if (this.currentPos_ === 0) 302 if (this.currentPos_ === 0)
303 videoPlayerElement.setAttribute('first-video', true); 303 videoPlayerElement.setAttribute('first-video', true);
304 else 304 else
305 videoPlayerElement.removeAttribute('first-video'); 305 videoPlayerElement.removeAttribute('first-video');
306 306
307 // Re-enables ui and hides error message if already displayed. 307 // Re-enables ui and hides error message if already displayed.
308 document.querySelector('#video-player').removeAttribute('disabled'); 308 document.querySelector('#video-player').removeAttribute('disabled');
309 document.querySelector('#error').removeAttribute('visible'); 309 document.querySelector('#error').removeAttribute('visible');
310 this.controls.detachMedia();
310 this.controls.inactivityWatcher.disabled = true; 311 this.controls.inactivityWatcher.disabled = true;
311 this.controls.decodeErrorOccured = false; 312 this.controls.decodeErrorOccured = false;
312 this.controls.casting = !!this.currentCast_; 313 this.controls.casting = !!this.currentCast_;
313 314
314 videoPlayerElement.setAttribute('loading', true); 315 videoPlayerElement.setAttribute('loading', true);
315 316
316 var media = new MediaManager(video.entry); 317 var media = new MediaManager(video.entry);
317 318
318 Promise.all([media.getThumbnail(), media.getToken()]).then( 319 Promise.all([media.getThumbnail(), media.getToken()]).then(
319 function(results) { 320 function(results) {
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 var initPromise = Promise.all( 669 var initPromise = Promise.all(
669 [new Promise(initVideos.wrap(null)), 670 [new Promise(initVideos.wrap(null)),
670 new Promise(initStrings.wrap(null)), 671 new Promise(initStrings.wrap(null)),
671 new Promise(util.addPageLoadHandler.wrap(null))]); 672 new Promise(util.addPageLoadHandler.wrap(null))]);
672 673
673 initPromise.then(function(results) { 674 initPromise.then(function(results) {
674 var videos = results[0]; 675 var videos = results[0];
675 player.prepare(videos); 676 player.prepare(videos);
676 return new Promise(player.playFirstVideo.wrap(player)); 677 return new Promise(player.playFirstVideo.wrap(player));
677 }.wrap(null)); 678 }.wrap(null));
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698