Changeset 225265 in webkit
- Timestamp:
- Nov 29, 2017 5:31:36 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r225260 r225265 1 2017-11-29 Antoine Quint <graouts@apple.com> 2 3 Pressing the space bar while watching a fullscreen video doesn't play or pause 4 https://bugs.webkit.org/show_bug.cgi?id=180033 5 <rdar://problem/33610443> 6 7 Reviewed by Eric Carlson. 8 9 Adding a new macOS-only test that checks that pressing the space bar while playing fullscreen 10 pauses the media and resumes it when pressing the space bar again. 11 12 * media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback-expected.txt: Added. 13 * media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html: Added. 14 * media/video-test.js: 15 (runWithKeyDown): Update the key to not be space since this would cause media to be paused when entering fullscreen. 16 * platform/ios-simulator/TestExpectations: 17 1 18 2017-11-28 Zan Dobersek <zdobersek@igalia.com> 2 19 -
trunk/LayoutTests/media/video-test.js
r223626 r225265 415 415 if (window.testRunner) { 416 416 if (eventSender.keyDown) 417 eventSender.keyDown(" 417 eventSender.keyDown("a", []); 418 418 else 419 419 eventSender.mouseDown(); -
trunk/LayoutTests/platform/ios-simulator/TestExpectations
r225222 r225265 129 129 media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause.html [ Skip ] 130 130 media/modern-media-controls/media-controller/media-controller-click-on-video-background-to-dismiss-tracks-panel-should-not-toggle-playback.html [ Skip ] 131 media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html [ Skip ] 131 132 media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html [ Skip ] 132 133 media/modern-media-controls/media-documents/media-document-video-mac-sizing.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r225264 r225265 1 2017-11-29 Antoine Quint <graouts@apple.com> 2 3 Pressing the space bar while watching a fullscreen video doesn't play or pause 4 https://bugs.webkit.org/show_bug.cgi?id=180033 5 <rdar://problem/33610443> 6 7 Reviewed by Eric Carlson. 8 9 We register a "keydown" event to track when the space bar is pressed, and if the media is playing 10 in fullscreen, we toggle playback. This does not interfere with full keyboard access since activating 11 one of the media controls using the keyboard will not let the events we register for be dispatched 12 this far along the event dispatch phase. 13 14 Test: media/modern-media-controls/media-controller/media-controller-space-bar-toggle-playback.html 15 16 * Modules/modern-media-controls/media/media-controller.js: 17 (MediaController): 18 (MediaController.prototype.togglePlayback): Add a catch() statement since calling play() could sometime 19 lead to some extraneous unhandled promise console logging that pollutes test output. 20 (MediaController.prototype.handleEvent): 21 1 22 2017-11-28 Brent Fulgham <bfulgham@apple.com> 2 23 -
trunk/Source/WebCore/Modules/modern-media-controls/media/media-controller.js
r225222 r225265 58 58 59 59 media.addEventListener(this.fullscreenChangeEventType, this); 60 61 window.addEventListener("keydown", this); 60 62 } 61 63 … … 101 103 { 102 104 if (this.media.paused) 103 this.media.play() ;105 this.media.play().catch(e => {}); 104 106 else 105 107 this.media.pause(); … … 159 161 if (event.type === "webkitpresentationmodechanged") 160 162 this._returnMediaLayerToInlineIfNeeded(); 163 } else if (event.type === "keydown" && this.isFullscreen && event.key === " ") { 164 this.togglePlayback(); 165 event.preventDefault(); 161 166 } 162 167 }
Note: See TracChangeset
for help on using the changeset viewer.