Changeset 182262 in webkit


Ignore:
Timestamp:
Apr 1, 2015, 4:43:50 PM (10 years ago)
Author:
eric.carlson@apple.com
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:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified trunk/Source/WebCore/ChangeLog

    r182256 r182262  
     12015-04-01  Eric Carlson  <eric.carlson@apple.com>
     2
     3        Media controls should not always auto-hide
     4        https://bugs.webkit.org/show_bug.cgi?id=143322
     5
     6        Reviewed by Dean Jackson.
     7
     8        * Modules/mediacontrols/mediaControlsApple.js:
     9        (Controller): Intialize new properties.
     10        (Controller.prototype.hideControls): Do nothing if controlsAlwaysVisible() returns true;
     11        (Controller.prototype.controlsAlwaysVisible): New.
     12        (Controller.prototype.controlsAreHidden): Consult controlsAlwaysVisible().
     13        (Controller.prototype.currentPlaybackTargetIsWireless): Use new properties.
     14        (Controller.prototype.updateWirelessTargetAvailable): Cache video.webkitCurrentPlaybackTargetIsWireless
     15            and video.webkitWirelessVideoPlaybackDisabled because we know when they change and
     16            use them frequently.
     17        * Modules/mediacontrols/mediaControlsiOS.js:
     18        (ControllerIOS.prototype.controlsAlwaysVisible): New.
     19        * platform/graphics/MediaPlaybackTarget.h:
     20
    1212015-04-01  Alexey Proskuryakov  <ap@apple.com>
    222
  • TabularUnified trunk/Source/WebCore/Modules/mediacontrols/mediaControlsApple.js

    r182240 r182262  
    1616    this.hasWirelessPlaybackTargets = false;
    1717    this.isListeningForPlaybackTargetAvailabilityEvent = false;
     18    this.currentTargetIsWireless = false;
     19    this.wirelessPlaybackDisabled = false;
    1820
    1921    this.addVideoListeners();
     
    12861288    hideControls: function()
    12871289    {
     1290        if (this.controlsAlwaysVisible())
     1291            return;
     1292
    12881293        this.updateShouldListenForPlaybackTargetAvailabilityEvent();
    12891294        this.controls.panel.classList.remove(this.ClassNames.show);
     
    12921297    },
    12931298
     1299    controlsAlwaysVisible: function()
     1300    {
     1301        return this.isAudio() || this.currentPlaybackTargetIsWireless();
     1302    },
     1303
    12941304    controlsAreHidden: function()
    12951305    {
    1296         return !this.isAudio() && !this.controls.panel.classList.contains(this.ClassNames.show);
     1306        return !this.controlsAlwaysVisible() && !this.controls.panel.classList.contains(this.ClassNames.show);
    12971307    },
    12981308
     
    16991709            return true;
    17001710
    1701         if (!this.video.webkitCurrentPlaybackTargetIsWireless || this.video.webkitWirelessVideoPlaybackDisabled)
     1711        if (!this.currentTargetIsWireless || this.wirelessPlaybackDisabled)
    17021712            return false;
    17031713
     
    17471757
    17481758    updateWirelessTargetAvailable: function() {
     1759        this.currentTargetIsWireless = this.video.webkitCurrentPlaybackTargetIsWireless;
     1760        this.wirelessPlaybackDisabled = this.video.webkitWirelessVideoPlaybackDisabled;
     1761
    17491762        var wirelessPlaybackTargetsAvailable = Controller.gSimulateWirelessPlaybackTarget || this.hasWirelessPlaybackTargets;
    1750         if (this.video.webkitWirelessVideoPlaybackDisabled)
     1763        if (this.wirelessPlaybackDisabled)
    17511764            wirelessPlaybackTargetsAvailable = false;
    17521765
  • TabularUnified trunk/Source/WebCore/Modules/mediacontrols/mediaControlsiOS.js

    r181899 r182262  
    652652    },
    653653
     654    controlsAlwaysVisible: function()
     655    {
     656        if (this.presentationMode() === 'optimized')
     657            return true;
     658
     659        return Controller.prototype.controlsAlwaysVisible.call(this);
     660    },
     661
     662
    654663};
    655664
Note: See TracChangeset for help on using the changeset viewer.