Update fullscreen button visibility on fullscreen change.
authorroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Apr 2015 18:35:46 +0000 (18:35 +0000)
committerroger_fong@apple.com <roger_fong@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Apr 2015 18:35:46 +0000 (18:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=143861.
<rdar://problem/20143218>

Reviewed by Eric Carlson.

* Modules/mediacontrols/mediaControlsApple.js:
(Controller): There is no need for hasVisualMedia to be a class variable.
(Controller.prototype.handleReadyStateChange):
(Controller.prototype.handleFullscreenChange):
(Controller.prototype.updateFullscreenButtons):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182958 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

index 0e0f400..b3b361d 100644 (file)
@@ -1,3 +1,17 @@
+2015-04-16  Roger Fong  <roger_fong@apple.com>
+
+        Update fullscreen button visibility on fullscreen change.
+        https://bugs.webkit.org/show_bug.cgi?id=143861.
+        <rdar://problem/20143218>
+
+        Reviewed by Eric Carlson.
+
+        * Modules/mediacontrols/mediaControlsApple.js:
+        (Controller): There is no need for hasVisualMedia to be a class variable.
+        (Controller.prototype.handleReadyStateChange):
+        (Controller.prototype.handleFullscreenChange):
+        (Controller.prototype.updateFullscreenButtons):
+
 2015-04-17  Daniel Bates  <dabates@apple.com>
 
         REGRESSION: SVG does not support link dragging
index 2509530..7adade0 100644 (file)
@@ -12,7 +12,6 @@ function Controller(root, video, host)
     this.listeners = {};
     this.isLive = false;
     this.statusHidden = true;
-    this.hasVisualMedia = false;
     this.hasWirelessPlaybackTargets = false;
     this.isListeningForPlaybackTargetAvailabilityEvent = false;
     this.currentTargetIsWireless = false;
@@ -646,7 +645,6 @@ Controller.prototype = {
 
     handleReadyStateChange: function(event)
     {
-        this.hasVisualMedia = this.video.videoTracks && this.video.videoTracks.length > 0;
         this.updateReadyState();
         this.updateDuration();
         this.updateCaptionButton();
@@ -739,6 +737,7 @@ Controller.prototype = {
     {
         this.updateBase();
         this.updateControls();
+        this.updateFullscreenButtons();
         this.updateWirelessPlaybackStatus();
 
         if (this.isFullScreen()) {
@@ -975,7 +974,8 @@ Controller.prototype = {
 
     updateFullscreenButtons: function()
     {
-        var shouldBeHidden = !this.video.webkitSupportsFullscreen || !this.hasVisualMedia;
+        var hasVisualMedia = this.video.videoTracks && this.video.videoTracks.length > 0;
+        var shouldBeHidden = !this.video.webkitSupportsFullscreen || !hasVisualMedia;
         this.controls.fullscreenButton.classList.toggle(this.ClassNames.hidden, shouldBeHidden);
         this.controls.optimizedFullscreenButton.classList.toggle(this.ClassNames.hidden, shouldBeHidden);
     },