Changeset 226872 in webkit


Ignore:
Timestamp:
Jan 11, 2018 10:31:07 PM (6 years ago)
Author:
jmarcell@apple.com
Message:

Cherry-pick r226796. rdar://problem/36450730

Location:
branches/safari-605-branch
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-605-branch/LayoutTests/ChangeLog

    r226871 r226872  
     12018-01-11  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r226796. rdar://problem/36450730
     4
     5    2018-01-11  Antoine Quint  <graouts@apple.com>
     6
     7            Only listen to webkitplaybacktargetavailabilitychanged when media controls are visible to the user
     8            https://bugs.webkit.org/show_bug.cgi?id=181547
     9            <rdar://problem/35947650>
     10
     11            Reviewed by Eric Carlson.
     12
     13            Add a test that checks that enabling AirPlay routes when the controls are not visible to the user
     14            does not incur any change, and that making the controls visible again shows the controls in the
     15            expected state.
     16
     17            * media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-with-hidden-controls-expected.txt: Added.
     18            * media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-with-hidden-controls.html: Added.
     19
    1202018-01-11  Jason Marcell  <jmarcell@apple.com>
    221
  • branches/safari-605-branch/Source/WebCore/ChangeLog

    r226871 r226872  
     12018-01-11  Jason Marcell  <jmarcell@apple.com>
     2
     3        Cherry-pick r226796. rdar://problem/36450730
     4
     5    2018-01-11  Antoine Quint  <graouts@apple.com>
     6
     7            Only listen to webkitplaybacktargetavailabilitychanged when media controls are visible to the user
     8            https://bugs.webkit.org/show_bug.cgi?id=181547
     9            <rdar://problem/35947650>
     10
     11            Reviewed by Eric Carlson.
     12
     13            Because listening to "webkitplaybacktargetavailabilitychanged" events incurs some higher power usage on iOS,
     14            we only listen to such events when controls are visible to the user. In other words, the MediaControls need to
     15            have both "visible" set to "true" and "faded" set to "false". To support this, we add a delegate method on
     16            MediaControls such that it can tell the MediaController that the "visible" property changed. With this message,
     17            MediaController can inform its MediaControllerSupport objects that user visibility of the controls changed, which
     18            lets AirplaySupport disable itself when controls are no longer visible.
     19
     20            Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-with-hidden-controls.html
     21
     22            * Modules/modern-media-controls/controls/media-controls.js:
     23            (MediaControls.prototype.set visible):
     24            * Modules/modern-media-controls/media/airplay-support.js:
     25            (AirplaySupport.prototype.controlsUserVisibilityDidChange):
     26            * Modules/modern-media-controls/media/media-controller-support.js:
     27            (MediaControllerSupport.prototype.controlsUserVisibilityDidChange):
     28            * Modules/modern-media-controls/media/media-controller.js:
     29            (MediaController.prototype.mediaControlsVisibilityDidChange):
     30            (MediaController.prototype.mediaControlsFadedStateDidChange):
     31            (MediaController.prototype._controlsUserVisibilityDidChange):
     32
    1332018-01-11  Jason Marcell  <jmarcell@apple.com>
    234
  • branches/safari-605-branch/Source/WebCore/Modules/modern-media-controls/controls/media-controls.js

    r219552 r226872  
    8787        if (flag)
    8888            this.layout();
     89
     90        if (this.delegate && typeof this.delegate.mediaControlsVisibilityDidChange === "function")
     91            this.delegate.mediaControlsVisibilityDidChange();
    8992    }
    9093
  • branches/safari-605-branch/Source/WebCore/Modules/modern-media-controls/media/airplay-support.js

    r218891 r226872  
    4444    }
    4545
     46    controlsUserVisibilityDidChange()
     47    {
     48        const controls = this.mediaController.controls;
     49        if (controls.visible && !controls.faded)
     50            this.enable();
     51        else
     52            this.disable();
     53    }
     54
    4655    handleEvent(event)
    4756    {
  • branches/safari-605-branch/Source/WebCore/Modules/modern-media-controls/media/media-controller-support.js

    r225279 r226872  
    9191    }
    9292
     93    controlsUserVisibilityDidChange()
     94    {
     95        // Implement by subclasses.
     96    }
     97
    9398    handleEvent(event)
    9499    {
  • branches/safari-605-branch/Source/WebCore/Modules/modern-media-controls/media/media-controller.js

    r226871 r226872  
    125125    }
    126126
     127    mediaControlsVisibilityDidChange()
     128    {
     129        this._controlsUserVisibilityDidChange();
     130    }
     131
    127132    mediaControlsFadedStateDidChange()
    128133    {
     134        this._controlsUserVisibilityDidChange();
    129135        this._updateTextTracksClassList();
    130136    }
     
    287293    }
    288294
     295    _controlsUserVisibilityDidChange()
     296    {
     297        if (!this.controls || !this._supportingObjects)
     298            return;
     299
     300        this._supportingObjects.forEach(supportingObject => supportingObject.controlsUserVisibilityDidChange());
     301    }
     302
    289303    _updateiOSFullscreenProperties()
    290304    {
Note: See TracChangeset for help on using the changeset viewer.