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

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

Issue 1415213003: VideoPlayer: Show fullscreen-exit button when the player window is fullscreened. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « ui/file_manager/video_player/images/media/media_fullscreen_exit.png ('k') | 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 a9c39133cabb887a2b3271bdc0b8e43144f6094b..eaa6f31cb3e336c0b298c0e1c6841a88d93b807b 100644
--- a/ui/file_manager/video_player/js/video_player.js
+++ b/ui/file_manager/video_player/js/video_player.js
@@ -26,6 +26,11 @@ function FullWindowVideoControls(
this.updateStyle();
window.addEventListener('resize', this.updateStyle.wrap(this));
+ var currentWindow = chrome.app.window.current();
+ currentWindow.onFullscreened.addListener(
+ this.onFullScreenChanged_.bind(this, true));
+ currentWindow.onRestored.addListener(
+ this.onFullScreenChanged_.bind(this, false));
document.addEventListener('keydown', function(e) {
switch (util.getKeyModifiers(e) + e.keyIdentifier) {
// Handle debug shortcut keys.
@@ -163,6 +168,19 @@ FullWindowVideoControls.prototype.toggleFullScreen_ = function() {
};
/**
+ * Updates video control when the window is fullscreened or restored.
+ * @param {boolean} fullscreen True if the window gets fullscreened.
+ * @private
+ */
+FullWindowVideoControls.prototype.onFullScreenChanged_ = function(fullscreen) {
+ if (fullscreen) {
+ this.playerContainer_.setAttribute('fullscreen', '');
+ } else {
+ this.playerContainer_.removeAttribute('fullscreen');
+ }
+};
+
+/**
* Media completion handler.
*/
FullWindowVideoControls.prototype.onMediaComplete = function() {
« no previous file with comments | « ui/file_manager/video_player/images/media/media_fullscreen_exit.png ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698