Media controls on apple.com don't disappear when movie finishes playing
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jul 2016 17:49:17 +0000 (17:49 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 25 Jul 2016 17:49:17 +0000 (17:49 +0000)
commit4aa1f5f1c2287a7cd38dd4af46c9a7942de84d47
tree85caba04db4bff0daddc1710187bebc7acaa49db
parentb21bcb159678acda2bc46919376b82a2999e1a79
Media controls on apple.com don't disappear when movie finishes playing
https://bugs.webkit.org/show_bug.cgi?id=160068
<rdar://problem/26668526>

Reviewed by Darin Adler.

Source/WebCore:

When a video ends, it should cause media controls to hide. While current logic
mostly accounts for this, it does not account for programmatic seeks causing
the video to lose its 'ended' status before querying for whether or not to
show media controls.

Three new API tests: large-video-seek-after-ending.html
large-video-hides-controls-after-seek-to-end.html
large-video-seek-to-beginning-and-play-after-ending.html

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
(WebCore::HTMLMediaElement::setPlaying):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canControlControlsManager):
* html/MediaElementSession.h:

Tools:

Adds new API tests. Please see WebCore ChangeLog for more details.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:
(-[MediaPlaybackMessageHandler initWithWKWebView:finalMessageString:]):
(-[MediaPlaybackMessageHandler userContentController:didReceiveScriptMessage:]):
(TestWebKitAPI::TEST):
(-[DidPlayMessageHandler initWithWKWebView:]): Deleted.
(-[DidPlayMessageHandler userContentController:didReceiveScriptMessage:]): Deleted.
* TestWebKitAPI/Tests/WebKit2Cocoa/large-video-hides-controls-after-seek-to-end.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/large-video-seek-after-ending.html: Added.
* TestWebKitAPI/Tests/WebKit2Cocoa/large-video-seek-to-beginning-and-play-after-ending.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@203690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/html/MediaElementSession.h
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/large-video-hides-controls-after-seek-to-end.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/large-video-seek-after-ending.html [new file with mode: 0644]
Tools/TestWebKitAPI/Tests/WebKit2Cocoa/large-video-seek-to-beginning-and-play-after-ending.html [new file with mode: 0644]