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

Side by Side Diff: chrome/browser/resources/file_manager/js/media/video_player.js

Issue 12575004: Escape key should exit the fullscreen mode when playing a video. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 * Display error message. 6 * Display error message.
7 * @param {string} message Message id. 7 * @param {string} message Message id.
8 */ 8 */
9 function showErrorMessage(message) { 9 function showErrorMessage(message) {
10 var errorBanner = document.querySelector('#error'); 10 var errorBanner = document.querySelector('#error');
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 onPlaybackError, 51 onPlaybackError,
52 function() { chrome.fileBrowserPrivate.toggleFullscreen() }, 52 function() { chrome.fileBrowserPrivate.toggleFullscreen() },
53 videoContainer); 53 videoContainer);
54 54
55 this.playerContainer_ = playerContainer; 55 this.playerContainer_ = playerContainer;
56 56
57 this.updateStyle(); 57 this.updateStyle();
58 window.addEventListener('resize', this.updateStyle.bind(this)); 58 window.addEventListener('resize', this.updateStyle.bind(this));
59 59
60 document.addEventListener('keydown', function(e) { 60 document.addEventListener('keydown', function(e) {
61 if (e.keyIdentifier == 'U+0020') { 61 if (e.keyIdentifier == 'U+0020') { // Space
62 this.togglePlayStateWithFeedback(); 62 this.togglePlayStateWithFeedback();
63 e.preventDefault(); 63 e.preventDefault();
64 } 64 }
65 if (e.keyIdentifier == 'U+001B') { // Escape
66 chrome.fileBrowserPrivate.isFullscreen(function(enabled) {
67 if (enabled)
68 chrome.fileBrowserPrivate.toggleFullscreen();
69 });
70 e.preventDefault();
71 }
65 }.bind(this)); 72 }.bind(this));
66 73
67 util.disableBrowserShortcutKeys(document); 74 util.disableBrowserShortcutKeys(document);
68 75
69 videoContainer.addEventListener('click', 76 videoContainer.addEventListener('click',
70 this.togglePlayStateWithFeedback.bind(this)); 77 this.togglePlayStateWithFeedback.bind(this));
71 78
72 this.inactivityWatcher_ = new MouseInactivityWatcher(playerContainer); 79 this.inactivityWatcher_ = new MouseInactivityWatcher(playerContainer);
73 this.__defineGetter__('inactivityWatcher', function() { 80 this.__defineGetter__('inactivityWatcher', function() {
74 return this.inactivityWatcher_; 81 return this.inactivityWatcher_;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 webkitResolveLocalFileSystemURL(src, 262 webkitResolveLocalFileSystemURL(src,
256 function(entry) { 263 function(entry) {
257 var video = document.querySelector('video'); 264 var video = document.querySelector('video');
258 if (video.src != src) return; 265 if (video.src != src) return;
259 selectedItemFilesystemPath = entry.fullPath; 266 selectedItemFilesystemPath = entry.fullPath;
260 }); 267 });
261 }); 268 });
262 } 269 }
263 270
264 util.addPageLoadHandler(loadVideoPlayer); 271 util.addPageLoadHandler(loadVideoPlayer);
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