Changeset 226796 in webkit
- Timestamp:
- Jan 11, 2018 12:29:25 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r226795 r226796 1 2018-01-11 Antoine Quint <graouts@apple.com> 2 3 Only listen to webkitplaybacktargetavailabilitychanged when media controls are visible to the user 4 https://bugs.webkit.org/show_bug.cgi?id=181547 5 <rdar://problem/35947650> 6 7 Reviewed by Eric Carlson. 8 9 Add a test that checks that enabling AirPlay routes when the controls are not visible to the user 10 does not incur any change, and that making the controls visible again shows the controls in the 11 expected state. 12 13 * media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-with-hidden-controls-expected.txt: Added. 14 * media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-with-hidden-controls.html: Added. 15 1 16 2018-01-11 Antoine Quint <graouts@apple.com> 2 17 -
trunk/Source/WebCore/ChangeLog
r226795 r226796 1 2018-01-11 Antoine Quint <graouts@apple.com> 2 3 Only listen to webkitplaybacktargetavailabilitychanged when media controls are visible to the user 4 https://bugs.webkit.org/show_bug.cgi?id=181547 5 <rdar://problem/35947650> 6 7 Reviewed by Eric Carlson. 8 9 Because listening to "webkitplaybacktargetavailabilitychanged" events incurs some higher power usage on iOS, 10 we only listen to such events when controls are visible to the user. In other words, the MediaControls need to 11 have both "visible" set to "true" and "faded" set to "false". To support this, we add a delegate method on 12 MediaControls such that it can tell the MediaController that the "visible" property changed. With this message, 13 MediaController can inform its MediaControllerSupport objects that user visibility of the controls changed, which 14 lets AirplaySupport disable itself when controls are no longer visible. 15 16 Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-with-hidden-controls.html 17 18 * Modules/modern-media-controls/controls/media-controls.js: 19 (MediaControls.prototype.set visible): 20 * Modules/modern-media-controls/media/airplay-support.js: 21 (AirplaySupport.prototype.controlsUserVisibilityDidChange): 22 * Modules/modern-media-controls/media/media-controller-support.js: 23 (MediaControllerSupport.prototype.controlsUserVisibilityDidChange): 24 * Modules/modern-media-controls/media/media-controller.js: 25 (MediaController.prototype.mediaControlsVisibilityDidChange): 26 (MediaController.prototype.mediaControlsFadedStateDidChange): 27 (MediaController.prototype._controlsUserVisibilityDidChange): 28 1 29 2018-01-11 Antoine Quint <graouts@apple.com> 2 30 -
trunk/Source/WebCore/Modules/modern-media-controls/controls/media-controls.js
r219552 r226796 87 87 if (flag) 88 88 this.layout(); 89 90 if (this.delegate && typeof this.delegate.mediaControlsVisibilityDidChange === "function") 91 this.delegate.mediaControlsVisibilityDidChange(); 89 92 } 90 93 -
trunk/Source/WebCore/Modules/modern-media-controls/media/airplay-support.js
r218891 r226796 44 44 } 45 45 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 46 55 handleEvent(event) 47 56 { -
trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller-support.js
r225279 r226796 91 91 } 92 92 93 controlsUserVisibilityDidChange() 94 { 95 // Implement by subclasses. 96 } 97 93 98 handleEvent(event) 94 99 { -
trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js
r226795 r226796 125 125 } 126 126 127 mediaControlsVisibilityDidChange() 128 { 129 this._controlsUserVisibilityDidChange(); 130 } 131 127 132 mediaControlsFadedStateDidChange() 128 133 { 134 this._controlsUserVisibilityDidChange(); 129 135 this._updateTextTracksClassList(); 130 136 } … … 287 293 } 288 294 295 _controlsUserVisibilityDidChange() 296 { 297 if (!this.controls || !this._supportingObjects) 298 return; 299 300 this._supportingObjects.forEach(supportingObject => supportingObject.controlsUserVisibilityDidChange()); 301 } 302 289 303 _updateiOSFullscreenProperties() 290 304 {
Note: See TracChangeset
for help on using the changeset viewer.