Changeset 209156 in webkit
- Timestamp:
- Nov 30, 2016 2:45:38 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r209155 r209156 1 2016-11-30 Antoine Quint <graouts@apple.com> 2 3 [Modern Media Controls] Controls are not visible when returning from picture-in-picture playback 4 https://bugs.webkit.org/show_bug.cgi?id=165183 5 6 Reviewed by Dean Jackson. 7 8 We need to call MediaControlsHost::setPreparedToReturnVideoLayerToInline() when we return from 9 picture-in-picture playback such that the video layer is correctly stacked under the media controls. 10 We call that function in a rAF call to ensure it's performed in sync with the next scheduled layout 11 or the media controls would not appear in sync with the video layer. 12 13 We also fix an error from a previous commit in ControlsVisibilitySupport. 14 15 * Modules/modern-media-controls/media/controls-visibility-support.js: 16 (ControlsVisibilitySupport.prototype.syncControl): 17 (ControlsVisibilitySupport): 18 * Modules/modern-media-controls/media/media-controller.js: 19 (MediaController): 20 (MediaController.prototype.handleEvent): 21 (MediaController.prototype._returnMediaLayerToInlineIfNeeded): 22 1 23 2016-11-30 Jiewen Tan <jiewen_tan@apple.com> 2 24 -
trunk/Source/WebCore/Modules/modern-media-controls/media/controls-visibility-support.js
r209108 r209156 50 50 { 51 51 let shouldShowControls = this.mediaController.media.controls; 52 if ( media instanceof HTMLVideoElement)52 if (this.mediaController.media instanceof HTMLVideoElement) 53 53 shouldShowControls = shouldShowControls && this.mediaController.media.readyState > HTMLMediaElement.HAVE_NOTHING; 54 54 -
trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js
r209108 r209156 33 33 this.host = host; 34 34 35 if (host) 36 media.addEventListener("webkitpresentationmodechanged", this); 37 35 38 this._updateControlsIfNeeded(); 36 39 … … 62 65 handleEvent(event) 63 66 { 64 if (event.type === "resize" && event.currentTarget === this.media) 67 if (event.currentTarget !== this.media) 68 return; 69 70 switch (event.type) { 71 case "resize": 65 72 this._updateControlsSize(); 66 else if (event.type === "webkitfullscreenchange" && event.currentTarget === this.media) 73 break; 74 case "webkitfullscreenchange": 67 75 this._updateControlsIfNeeded(); 76 break; 77 case "webkitpresentationmodechanged": 78 this._returnMediaLayerToInlineIfNeeded(); 79 break; 80 } 68 81 } 69 82 … … 104 117 } 105 118 119 _returnMediaLayerToInlineIfNeeded() 120 { 121 window.requestAnimationFrame(() => this.host.setPreparedToReturnVideoLayerToInline(this.media.webkitPresentationMode !== PiPMode)); 122 } 123 106 124 _controlsClass() 107 125 {
Note: See TracChangeset
for help on using the changeset viewer.