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

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

Issue 385113007: Video Player: Automatically load next video (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 /** 98 /**
99 * Toggles the full screen mode. 99 * Toggles the full screen mode.
100 * @private 100 * @private
101 */ 101 */
102 FullWindowVideoControls.prototype.toggleFullScreen_ = function() { 102 FullWindowVideoControls.prototype.toggleFullScreen_ = function() {
103 var appWindow = chrome.app.window.current(); 103 var appWindow = chrome.app.window.current();
104 util.toggleFullScreen(appWindow, !util.isFullScreen(appWindow)); 104 util.toggleFullScreen(appWindow, !util.isFullScreen(appWindow));
105 }; 105 };
106 106
107 /** 107 /**
108 * Media completion handler.
109 */
110 FullWindowVideoControls.prototype.onMediaComplete = function() {
111 VideoControls.prototype.onMediaComplete.apply(this, arguments);
112 if (!this.getMedia().loop)
113 player.advance_(1);
114 };
115
116 /**
108 * @constructor 117 * @constructor
109 */ 118 */
110 function VideoPlayer() { 119 function VideoPlayer() {
111 this.controls_ = null; 120 this.controls_ = null;
112 this.videoElement_ = null; 121 this.videoElement_ = null;
113 this.videos_ = null; 122 this.videos_ = null;
114 this.currentPos_ = 0; 123 this.currentPos_ = 0;
115 124
116 Object.seal(this); 125 Object.seal(this);
117 } 126 }
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 var initPromise = Promise.all( 425 var initPromise = Promise.all(
417 [new Promise(initVideos.wrap(null)), 426 [new Promise(initVideos.wrap(null)),
418 new Promise(initStrings.wrap(null)), 427 new Promise(initStrings.wrap(null)),
419 new Promise(util.addPageLoadHandler.wrap(null))]); 428 new Promise(util.addPageLoadHandler.wrap(null))]);
420 429
421 initPromise.then(function(results) { 430 initPromise.then(function(results) {
422 var videos = results[0]; 431 var videos = results[0];
423 player.prepare(videos); 432 player.prepare(videos);
424 return new Promise(player.playFirstVideo.wrap(player)); 433 return new Promise(player.playFirstVideo.wrap(player));
425 }.wrap(null)); 434 }.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