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 /** | 5 /** |
6 * @param {!HTMLElement} playerContainer Main container. | 6 * @param {!HTMLElement} playerContainer Main container. |
7 * @param {!HTMLElement} videoContainer Container for the video element. | 7 * @param {!HTMLElement} videoContainer Container for the video element. |
8 * @param {!HTMLElement} controlsContainer Container for video controls. | 8 * @param {!HTMLElement} controlsContainer Container for video controls. |
9 * @constructor | 9 * @constructor |
10 * @struct | 10 * @struct |
11 * @extends {VideoControls} | 11 * @extends {VideoControls} |
12 */ | 12 */ |
13 function FullWindowVideoControls( | 13 function FullWindowVideoControls( |
14 playerContainer, videoContainer, controlsContainer) { | 14 playerContainer, videoContainer, controlsContainer) { |
15 VideoControls.call(this, | 15 VideoControls.call(this, |
16 controlsContainer, | 16 controlsContainer, |
17 this.onPlaybackError_.wrap(this), | 17 this.onPlaybackError_.wrap(this), |
18 loadTimeData.getString.wrap(loadTimeData), | 18 loadTimeData.getString.wrap(loadTimeData), |
19 this.toggleFullScreen_.wrap(this), | 19 this.toggleFullScreen_.wrap(this), |
20 videoContainer); | 20 videoContainer); |
21 | 21 |
22 this.playerContainer_ = playerContainer; | 22 this.playerContainer_ = playerContainer; |
23 this.decodeErrorOccured = false; | 23 this.decodeErrorOccured = false; |
24 | 24 |
25 this.casting = false; | 25 this.casting = false; |
26 | 26 |
27 this.updateStyle(); | 27 this.updateStyle(); |
28 window.addEventListener('resize', this.updateStyle.wrap(this)); | 28 window.addEventListener('resize', this.updateStyle.wrap(this)); |
29 document.addEventListener('keydown', function(e) { | 29 document.addEventListener('keydown', function(e) { |
30 switch (e.keyIdentifier) { | 30 switch (util.getKeyModifiers(e) + e.keyIdentifier) { |
| 31 // Handle debug shortcut keys. |
| 32 case 'Ctrl-Shift-U+0049': // Ctrl+Shift+I |
| 33 chrome.fileManagerPrivate.openInspector('normal'); |
| 34 break; |
| 35 case 'Ctrl-Shift-U+004A': // Ctrl+Shift+J |
| 36 chrome.fileManagerPrivate.openInspector('console'); |
| 37 break; |
| 38 case 'Ctrl-Shift-U+0043': // Ctrl+Shift+C |
| 39 chrome.fileManagerPrivate.openInspector('element'); |
| 40 break; |
| 41 case 'Ctrl-Shift-U+0042': // Ctrl+Shift+B |
| 42 chrome.fileManagerPrivate.openInspector('background'); |
| 43 break; |
| 44 |
31 case 'U+0020': // Space | 45 case 'U+0020': // Space |
32 case 'MediaPlayPause': | 46 case 'MediaPlayPause': |
33 this.togglePlayStateWithFeedback(); | 47 this.togglePlayStateWithFeedback(); |
34 break; | 48 break; |
35 case 'U+001B': // Escape | 49 case 'U+001B': // Escape |
36 util.toggleFullScreen( | 50 util.toggleFullScreen( |
37 chrome.app.window.current(), | 51 chrome.app.window.current(), |
38 false); // Leave the full screen mode. | 52 false); // Leave the full screen mode. |
39 break; | 53 break; |
40 case 'Right': | 54 case 'Right': |
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 return new Promise(function(fulfill, reject) { | 698 return new Promise(function(fulfill, reject) { |
685 util.URLsToEntries(window.appState.items, function(entries) { | 699 util.URLsToEntries(window.appState.items, function(entries) { |
686 metrics.recordOpenVideoPlayerAction(); | 700 metrics.recordOpenVideoPlayerAction(); |
687 metrics.recordNumberOfOpenedFiles(entries.length); | 701 metrics.recordNumberOfOpenedFiles(entries.length); |
688 | 702 |
689 player.prepare(entries); | 703 player.prepare(entries); |
690 player.playFirstVideo(player, fulfill); | 704 player.playFirstVideo(player, fulfill); |
691 }.wrap()); | 705 }.wrap()); |
692 }.wrap()); | 706 }.wrap()); |
693 }.wrap()); | 707 }.wrap()); |
OLD | NEW |