Changeset 204989 in webkit
- Timestamp:
- Aug 25, 2016, 3:01:07 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r204987 r204989 1 2016-08-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Dragging against the end of the inline media scrubber causes the media scrubber to hide 4 https://bugs.webkit.org/show_bug.cgi?id=161207 5 6 Reviewed by Eric Carlson. 7 8 Previously, we would re-enable behavior restrictions when firing an ended event. However, if the ended event is 9 caused by the user seeking to the end of the video, the media controls would be taken away from under the user. 10 To prevent this, we don't add the relevant behavior restrictions upon media ended if media was seeking before 11 firing the event. 12 13 Tweaked an existing WebKit API test to cover this change. 14 15 * html/HTMLMediaElement.cpp: 16 (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): 17 (WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary): 18 * html/HTMLMediaElement.h: 19 * html/MediaElementSession.cpp: 20 (WebCore::MediaElementSession::canControlControlsManager): 21 1 22 2016-08-25 Andreas Kling <akling@apple.com> 2 23 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r204702 r204989 4366 4366 4367 4367 invalidateCachedTime(); 4368 bool wasSeeking = seeking(); 4368 4369 4369 4370 // 4.8.10.9 step 14 & 15. Needed if no ReadyState change is associated with the seek. … … 4403 4404 m_sentEndEvent = true; 4404 4405 scheduleEvent(eventNames().endedEvent); 4405 m_mediaSession->addBehaviorRestriction(MediaElementSession::RequireUserGestureToControlControlsManager | MediaElementSession::RequirePlaybackToControlControlsManager); 4406 if (!wasSeeking) 4407 addBehaviorRestrictionsOnEndIfNecessary(); 4406 4408 } 4407 4409 // If the media element has a current media controller, then report the controller state … … 4424 4426 m_sentEndEvent = true; 4425 4427 scheduleEvent(eventNames().endedEvent); 4426 m_mediaSession->addBehaviorRestriction(MediaElementSession::RequireUserGestureToControlControlsManager | MediaElementSession::RequirePlaybackToControlControlsManager); 4428 if (!wasSeeking) 4429 addBehaviorRestrictionsOnEndIfNecessary(); 4427 4430 m_paused = true; 4428 4431 setPlaying(false); … … 4435 4438 updatePlayState(UpdateState::Asynchronously); 4436 4439 endProcessingMediaPlayerCallback(); 4440 } 4441 4442 void HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary() 4443 { 4444 if (isFullscreen()) 4445 return; 4446 4447 m_mediaSession->addBehaviorRestriction(MediaElementSession::RequirePlaybackToControlControlsManager | MediaElementSession::RequireUserGestureToControlControlsManager); 4437 4448 } 4438 4449 -
trunk/Source/WebCore/html/HTMLMediaElement.h
r204717 r204989 795 795 void setControllerJSProperty(const char*, JSC::JSValue); 796 796 797 void addBehaviorRestrictionsOnEndIfNecessary(); 798 797 799 Timer m_pendingActionTimer; 798 800 Timer m_progressEventTimer; -
trunk/Source/WebCore/html/MediaElementSession.cpp
r204394 r204989 225 225 } 226 226 227 if (m_element.ended()) {228 LOG(Media, "MediaElementSession::canControlControlsManager - returning FALSE: Ended");229 return false;230 }231 232 227 if (m_element.document().activeDOMObjectsAreSuspended()) { 233 228 LOG(Media, "MediaElementSession::canControlControlsManager - returning FALSE: activeDOMObjectsAreSuspended()"); -
trunk/Tools/ChangeLog
r204971 r204989 1 2016-08-25 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Dragging against the end of the inline media scrubber causes the media scrubber to hide 4 https://bugs.webkit.org/show_bug.cgi?id=161207 5 6 Reviewed by Eric Carlson. 7 8 Tweaks an existing WebKit API test covering this behavior change. After some discussion, rather than hide media 9 controls in this case, we should actually continue showing them. This is because seeking due to user gestures 10 similar to "scrubbing" are indistinguishable from gestures that immediately seek to the end. 11 12 * TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm: 13 (TestWebKitAPI::TEST): 14 1 15 2016-08-25 Daniel Bates <dabates@apple.com> 2 16 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm
r203928 r204989 300 300 } 301 301 302 TEST(VideoControlsManager, VideoControlsManagerLargeAutoplayingVideo HidesControlsAfterSeekingToEnd)302 TEST(VideoControlsManager, VideoControlsManagerLargeAutoplayingVideoAfterSeekingToEnd) 303 303 { 304 304 RetainPtr<WKWebViewConfiguration> configuration = adoptNS([[WKWebViewConfiguration alloc] init]); … … 316 316 [[configuration userContentController] addScriptMessageHandler:onloadHandler.get() name:@"onloadHandler"]; 317 317 318 // Since the video has ended, the expectation is NO. 319 [handler setExpectedToHaveControlsManager:NO]; 318 // We expect there to be media controls, since this is a user gestured seek to the end. 319 // This is akin to seeking to the end by scrubbing in the controls. 320 [handler setExpectedToHaveControlsManager:YES]; 320 321 NSURLRequest *request = [NSURLRequest requestWithURL:[[NSBundle mainBundle] URLForResource:@"large-video-hides-controls-after-seek-to-end" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]]; 321 322 [webView loadRequest:request];
Note:
See TracChangeset
for help on using the changeset viewer.