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

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

Issue 477033002: Allow to close the video player with ctrl-w. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« 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 29 matching lines...) Expand all
40 player.advance_(1); 40 player.advance_(1);
41 break; 41 break;
42 case 'Left': 42 case 'Left':
43 case 'MediaPreviousTrack': 43 case 'MediaPreviousTrack':
44 player.advance_(0); 44 player.advance_(0);
45 break; 45 break;
46 case 'MediaStop': 46 case 'MediaStop':
47 // TODO: Define "Stop" behavior. 47 // TODO: Define "Stop" behavior.
48 break; 48 break;
49 } 49 }
50 e.preventDefault();
51 }.wrap(this)); 50 }.wrap(this));
52 51
53 // TODO(mtomasz): Simplify. crbug.com/254318. 52 // TODO(mtomasz): Simplify. crbug.com/254318.
54 var clickInProgress = false; 53 var clickInProgress = false;
55 videoContainer.addEventListener('click', function(e) { 54 videoContainer.addEventListener('click', function(e) {
56 if (clickInProgress) 55 if (clickInProgress)
57 return; 56 return;
58 57
59 clickInProgress = true; 58 clickInProgress = true;
60 var togglePlayState = function() { 59 var togglePlayState = function() {
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
606 var initPromise = Promise.all( 605 var initPromise = Promise.all(
607 [new Promise(initVideos.wrap(null)), 606 [new Promise(initVideos.wrap(null)),
608 new Promise(initStrings.wrap(null)), 607 new Promise(initStrings.wrap(null)),
609 new Promise(util.addPageLoadHandler.wrap(null))]); 608 new Promise(util.addPageLoadHandler.wrap(null))]);
610 609
611 initPromise.then(function(results) { 610 initPromise.then(function(results) {
612 var videos = results[0]; 611 var videos = results[0];
613 player.prepare(videos); 612 player.prepare(videos);
614 return new Promise(player.playFirstVideo.wrap(player)); 613 return new Promise(player.playFirstVideo.wrap(player));
615 }.wrap(null)); 614 }.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