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

Unified Diff: ui/file_manager/video_player/js/video_player.js

Issue 383313002: Video Player: Add support for Media Keys (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nit 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/video_player/js/video_player.js
diff --git a/ui/file_manager/video_player/js/video_player.js b/ui/file_manager/video_player/js/video_player.js
index 20c101c75827a920589e2756d21156bde281c62f..5271dc7c01890484bb5f147a0169d9be9b1929a5 100644
--- a/ui/file_manager/video_player/js/video_player.js
+++ b/ui/file_manager/video_player/js/video_player.js
@@ -25,16 +25,29 @@ function FullWindowVideoControls(
this.updateStyle();
window.addEventListener('resize', this.updateStyle.wrap(this));
document.addEventListener('keydown', function(e) {
- if (e.keyIdentifier == 'U+0020') { // Space
- this.togglePlayStateWithFeedback();
- e.preventDefault();
- }
- if (e.keyIdentifier == 'U+001B') { // Escape
- util.toggleFullScreen(
- chrome.app.window.current(),
- false); // Leave the full screen mode.
- e.preventDefault();
+ switch (e.keyIdentifier) {
+ case 'U+0020': // Space
+ case 'MediaPlayPause':
+ this.togglePlayStateWithFeedback();
+ break;
+ case 'U+001B': // Escape
+ util.toggleFullScreen(
+ chrome.app.window.current(),
+ false); // Leave the full screen mode.
+ break;
+ case 'Right':
+ case 'MediaNextTrack':
+ player.advance_(1);
+ break;
+ case 'Left':
+ case 'MediaPreviousTrack':
+ player.advance_(0);
+ break;
+ case 'MediaStop':
+ // TODO: Define "Stop" behavior.
+ break;
}
+ e.preventDefault();
}.wrap(this));
// TODO(mtomasz): Simplify. crbug.com/254318.
« 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