Netflix seeking quirk should also apply to Now Playing, and should always use the
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Jun 2017 21:46:29 +0000 (21:46 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 6 Jun 2017 21:46:29 +0000 (21:46 +0000)
commit42644a43a10e0d45be1ae267d870a5ca128b523c
treed1312011dc9be519157ef3dc3b9a18fe65a63cd8
parent0503e7a46fc080d14ece4193a4dda0ee2f8826f0
Netflix seeking quirk should also apply to Now Playing, and should always use the
livestream UI
https://bugs.webkit.org/show_bug.cgi?id=173030
-and corresponding-
rdar://problem/32228660

Reviewed by Darin Adler.

Source/WebCore:

This patch rolls out much of https://trac.webkit.org/changeset/217791/webkit in
favor of an approach that can be used to apply the quirk to Now Playing in
addition to Touch Bar. This patch also changes the UI in both Touch Bar and Now
Playing to match live stream UI, which means there is no playhead. This hopefully
makes it less confusing that taps on the timeline will have no effect.

supportsSeeking() should return false for Netflix. That function needs to be
public now.
* html/HTMLMediaElement.cpp:
(WebCore::needsSeekingSupportQuirk):
(WebCore::HTMLMediaElement::supportsSeeking):
* html/HTMLMediaElement.h:

Here is where we get the desired result in Now Playing. Make sure the
currentSession supportsSeeking() before relying on the time and duration info for
the sake of Now Playing.
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):

We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
* platform/cocoa/WebPlaybackSessionModel.h:
(WebCore::WebPlaybackSessionModelClient::mutedChanged):
(WebCore::WebPlaybackSessionModelClient::allowsTouchBarScrubbingChanged): Deleted.
* platform/cocoa/WebPlaybackSessionModelMediaElement.h:
* platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
(WebCore::WebPlaybackSessionModelMediaElement::updateForEventName):

And here is where we get the desired result for Touch Bar. Make sure the the media
element supportsSeeking() before relying on the duration.
(WebCore::WebPlaybackSessionModelMediaElement::duration):

We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
(WebCore::WebPlaybackSessionModelMediaElement::allowsTouchBarScrubbing): Deleted.
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
* platform/mac/WebPlaybackControlsManager.h:

Currently the Touch Bar live stream UI lets you seek, which results in broken
behavior on real live streams and on Netflix. Prevent that by preventing scrubbing
for NaN and infinite durations.
* platform/mac/WebPlaybackControlsManager.mm:
(-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):

We can roll out allowsTouchBarScrubbing() and rely on supportsSeeking().
* platform/mac/WebPlaybackSessionInterfaceMac.h:
* platform/mac/WebPlaybackSessionInterfaceMac.mm:
(WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
(WebCore::WebPlaybackSessionInterfaceMac::allowsTouchBarScrubbingChanged): Deleted.

Source/WebKit2:

See WebCore ChangeLog for more details. We can roll out allowsTouchBarScrubbing()
and rely on supportsSeeking().

* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in:
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm:
(WebKit::WebPlaybackSessionModelContext::setAllowsTouchBarScrubbing): Deleted.
(WebKit::WebPlaybackSessionManagerProxy::setAllowsTouchBarScrubbing): Deleted.
* WebProcess/cocoa/WebPlaybackSessionManager.h:
* WebProcess/cocoa/WebPlaybackSessionManager.mm:
(WebKit::WebPlaybackSessionInterfaceContext::allowsTouchBarScrubbingChanged): Deleted.
(WebKit::WebPlaybackSessionManager::allowsTouchBarScrubbingChanged): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm
Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h
Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h
Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm
Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
Source/WebCore/platform/mac/WebPlaybackControlsManager.h
Source/WebCore/platform/mac/WebPlaybackControlsManager.mm
Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h
Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h
Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in
Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm
Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.h
Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.mm