Title: [182262] trunk/Source/WebCore
- Revision
- 182262
- Author
- [email protected]
- Date
- 2015-04-01 16:43:50 -0700 (Wed, 01 Apr 2015)
Log Message
Media controls should not always auto-hide
https://bugs.webkit.org/show_bug.cgi?id=143322
Reviewed by Dean Jackson.
* Modules/mediacontrols/mediaControlsApple.js:
(Controller): Intialize new properties.
(Controller.prototype.hideControls): Do nothing if controlsAlwaysVisible() returns true;
(Controller.prototype.controlsAlwaysVisible): New.
(Controller.prototype.controlsAreHidden): Consult controlsAlwaysVisible().
(Controller.prototype.currentPlaybackTargetIsWireless): Use new properties.
(Controller.prototype.updateWirelessTargetAvailable): Cache video.webkitCurrentPlaybackTargetIsWireless
and video.webkitWirelessVideoPlaybackDisabled because we know when they change and
use them frequently.
* Modules/mediacontrols/mediaControlsiOS.js:
(ControllerIOS.prototype.controlsAlwaysVisible): New.
* platform/graphics/MediaPlaybackTarget.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (182261 => 182262)
--- trunk/Source/WebCore/ChangeLog 2015-04-01 23:43:17 UTC (rev 182261)
+++ trunk/Source/WebCore/ChangeLog 2015-04-01 23:43:50 UTC (rev 182262)
@@ -1,3 +1,23 @@
+2015-04-01 Eric Carlson <[email protected]>
+
+ Media controls should not always auto-hide
+ https://bugs.webkit.org/show_bug.cgi?id=143322
+
+ Reviewed by Dean Jackson.
+
+ * Modules/mediacontrols/mediaControlsApple.js:
+ (Controller): Intialize new properties.
+ (Controller.prototype.hideControls): Do nothing if controlsAlwaysVisible() returns true;
+ (Controller.prototype.controlsAlwaysVisible): New.
+ (Controller.prototype.controlsAreHidden): Consult controlsAlwaysVisible().
+ (Controller.prototype.currentPlaybackTargetIsWireless): Use new properties.
+ (Controller.prototype.updateWirelessTargetAvailable): Cache video.webkitCurrentPlaybackTargetIsWireless
+ and video.webkitWirelessVideoPlaybackDisabled because we know when they change and
+ use them frequently.
+ * Modules/mediacontrols/mediaControlsiOS.js:
+ (ControllerIOS.prototype.controlsAlwaysVisible): New.
+ * platform/graphics/MediaPlaybackTarget.h:
+
2015-04-01 Alexey Proskuryakov <[email protected]>
REGRESSION (r182121): SVG animation macros cause warnings in MSVC
Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js (182261 => 182262)
--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js 2015-04-01 23:43:17 UTC (rev 182261)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js 2015-04-01 23:43:50 UTC (rev 182262)
@@ -15,6 +15,8 @@
this.hasVisualMedia = false;
this.hasWirelessPlaybackTargets = false;
this.isListeningForPlaybackTargetAvailabilityEvent = false;
+ this.currentTargetIsWireless = false;
+ this.wirelessPlaybackDisabled = false;
this.addVideoListeners();
this.createBase();
@@ -1285,15 +1287,23 @@
hideControls: function()
{
+ if (this.controlsAlwaysVisible())
+ return;
+
this.updateShouldListenForPlaybackTargetAvailabilityEvent();
this.controls.panel.classList.remove(this.ClassNames.show);
if (this.controls.panelBackground)
this.controls.panelBackground.classList.remove(this.ClassNames.show);
},
+ controlsAlwaysVisible: function()
+ {
+ return this.isAudio() || this.currentPlaybackTargetIsWireless();
+ },
+
controlsAreHidden: function()
{
- return !this.isAudio() && !this.controls.panel.classList.contains(this.ClassNames.show);
+ return !this.controlsAlwaysVisible() && !this.controls.panel.classList.contains(this.ClassNames.show);
},
removeControls: function()
@@ -1698,7 +1708,7 @@
if (Controller.gSimulateWirelessPlaybackTarget)
return true;
- if (!this.video.webkitCurrentPlaybackTargetIsWireless || this.video.webkitWirelessVideoPlaybackDisabled)
+ if (!this.currentTargetIsWireless || this.wirelessPlaybackDisabled)
return false;
return true;
@@ -1746,8 +1756,11 @@
},
updateWirelessTargetAvailable: function() {
+ this.currentTargetIsWireless = this.video.webkitCurrentPlaybackTargetIsWireless;
+ this.wirelessPlaybackDisabled = this.video.webkitWirelessVideoPlaybackDisabled;
+
var wirelessPlaybackTargetsAvailable = Controller.gSimulateWirelessPlaybackTarget || this.hasWirelessPlaybackTargets;
- if (this.video.webkitWirelessVideoPlaybackDisabled)
+ if (this.wirelessPlaybackDisabled)
wirelessPlaybackTargetsAvailable = false;
if (wirelessPlaybackTargetsAvailable)
Modified: trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js (182261 => 182262)
--- trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js 2015-04-01 23:43:17 UTC (rev 182261)
+++ trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js 2015-04-01 23:43:50 UTC (rev 182262)
@@ -651,6 +651,15 @@
this.controls.fullscreenButton.classList.remove(this.ClassNames.hidden);
},
+ controlsAlwaysVisible: function()
+ {
+ if (this.presentationMode() === 'optimized')
+ return true;
+
+ return Controller.prototype.controlsAlwaysVisible.call(this);
+ },
+
+
};
Object.create(Controller.prototype).extend(ControllerIOS.prototype);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes