Diff
Modified: trunk/Source/WebCore/ChangeLog (235751 => 235752)
--- trunk/Source/WebCore/ChangeLog 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/ChangeLog 2018-09-06 19:59:33 UTC (rev 235752)
@@ -1,3 +1,49 @@
+2018-09-06 Jer Noble <[email protected]>
+
+ Don't pause playback when locking screen if video is being displayed on second screen.
+ https://bugs.webkit.org/show_bug.cgi?id=189321
+
+ Reviewed by Eric Carlson.
+
+ Expand the existing behavior when AirPlaying to an external device to playing to a local
+ external screen. Don't pause when the screen locks, and don't stop buffering in that mode either.
+
+ Add a KVO-observer to the WebAVPlayerController's playingOnSecondScreen property, and pass
+ that observed value on to the media element.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
+ (WebCore::HTMLMediaElement::setPlayingOnSecondScreen):
+ (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
+ (WebCore::HTMLMediaElement::processingUserGestureForMedia const):
+ (WebCore::HTMLMediaElement::mediaState const):
+ (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
+ (WebCore::HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction const):
+ (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
+ (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget const): Deleted.
+ (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget const): Deleted.
+ * html/HTMLMediaElement.h:
+ (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
+ (WebCore::HTMLMediaElement::isPlayingToExternalTarget const):
+ * html/MediaElementSession.cpp:
+ (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget const): Deleted.
+ * html/MediaElementSession.h:
+ * platform/audio/PlatformMediaSession.h:
+ (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
+ (WebCore::PlatformMediaSessionClient::isPlayingOnSecondScreen const):
+ (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget const): Deleted.
+ (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget const): Deleted.
+ * platform/cocoa/PlaybackSessionModel.h:
+ * platform/cocoa/PlaybackSessionModelMediaElement.h:
+ * platform/cocoa/PlaybackSessionModelMediaElement.mm:
+ (WebCore::PlaybackSessionModelMediaElement::setPlayingOnSecondScreen):
+ * platform/ios/WebAVPlayerController.mm:
+ (-[WebAVPlayerController init]):
+ (-[WebAVPlayerController dealloc]):
+ (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
+ * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+ (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
+
2018-09-06 Frederic Wang <[email protected]>
Group options of scrollRectToVisible into a struct
Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (235751 => 235752)
--- trunk/Source/WebCore/html/HTMLMediaElement.cpp 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp 2018-09-06 19:59:33 UTC (rev 235752)
@@ -5744,11 +5744,6 @@
m_mediaSession->showPlaybackTargetPicker();
}
-bool HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless() const
-{
- return m_isPlayingToWirelessTarget;
-}
-
void HTMLMediaElement::wirelessRoutesAvailableDidChange()
{
enqueuePlaybackTargetAvailabilityChangedEvent();
@@ -5836,20 +5831,6 @@
m_player->setWirelessPlaybackTarget(WTFMove(device));
}
-bool HTMLMediaElement::canPlayToWirelessPlaybackTarget() const
-{
- bool canPlay = m_player && m_player->canPlayToWirelessPlaybackTarget();
-
- INFO_LOG(LOGIDENTIFIER, "returning ", canPlay);
-
- return canPlay;
-}
-
-bool HTMLMediaElement::isPlayingToWirelessPlaybackTarget() const
-{
- return m_isPlayingToWirelessTarget;
-}
-
void HTMLMediaElement::setShouldPlayToPlaybackTarget(bool shouldPlay)
{
ALWAYS_LOG(LOGIDENTIFIER, shouldPlay);
@@ -5857,15 +5838,21 @@
if (m_player)
m_player->setShouldPlayToPlaybackTarget(shouldPlay);
}
-#else // ENABLE(WIRELESS_PLAYBACK_TARGET)
-bool HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless() const
+#endif // ENABLE(WIRELESS_PLAYBACK_TARGET)
+
+void HTMLMediaElement::setPlayingOnSecondScreen(bool value)
{
- return false;
+ if (value == m_playingOnSecondScreen)
+ return;
+
+ m_playingOnSecondScreen = value;
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+ updateMediaState(UpdateState::Asynchronously);
+#endif
}
-#endif // ENABLE(WIRELESS_PLAYBACK_TARGET)
-
double HTMLMediaElement::minFastReverseRate() const
{
return m_player ? m_player->minFastReverseRate() : 0;
@@ -7572,12 +7559,10 @@
bool HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType type) const
{
if (type == PlatformMediaSession::EnteringBackground) {
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
- if (m_isPlayingToWirelessTarget) {
- INFO_LOG(LOGIDENTIFIER, "returning true because m_isPlayingToWirelessTarget is true");
+ if (isPlayingToExternalTarget()) {
+ INFO_LOG(LOGIDENTIFIER, "returning true because isPlayingToExternalTarget() is true");
return true;
}
-#endif
if (m_videoFullscreenMode & VideoFullscreenModePictureInPicture)
return true;
#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
@@ -7585,12 +7570,10 @@
return true;
#endif
} else if (type == PlatformMediaSession::SuspendedUnderLock) {
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
- if (m_isPlayingToWirelessTarget) {
- INFO_LOG(LOGIDENTIFIER, "returning true because m_isPlayingToWirelessTarget is true");
+ if (isPlayingToExternalTarget()) {
+ INFO_LOG(LOGIDENTIFIER, "returning true because isPlayingToExternalTarget() is true");
return true;
}
-#endif
}
return false;
}
@@ -7599,8 +7582,8 @@
{
return document().processingUserGestureForMedia();
}
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
void HTMLMediaElement::updateMediaState(UpdateState updateState)
{
if (updateState == UpdateState::Asynchronously) {
@@ -7628,10 +7611,10 @@
bool hasActiveVideo = isVideo() && hasVideo();
bool hasAudio = this->hasAudio();
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
- if (m_isPlayingToWirelessTarget)
+ if (isPlayingToExternalTarget())
state |= IsPlayingToExternalDevice;
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
if (m_hasPlaybackTargetAvailabilityListeners) {
state |= HasPlaybackTargetAvailabilityListener;
if (!m_mediaSession->wirelessVideoPlaybackDisabled())
@@ -7754,7 +7737,7 @@
if (!MemoryPressureHandler::singleton().isUnderMemoryPressure() && m_mediaSession->dataBufferingPermitted())
return;
- if (m_isPlayingToWirelessTarget) {
+ if (isPlayingToExternalTarget()) {
INFO_LOG(LOGIDENTIFIER, "early return because playing to wireless target");
return;
}
@@ -7933,10 +7916,8 @@
bool HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction() const
{
-#if ENABLE(WIRELESS_PLAYBACK_TARGET)
- if (isPlayingToWirelessPlaybackTarget())
+ if (isPlayingToExternalTarget())
return true;
-#endif
return m_videoFullscreenMode == VideoFullscreenModePictureInPicture;
}
Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (235751 => 235752)
--- trunk/Source/WebCore/html/HTMLMediaElement.h 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h 2018-09-06 19:59:33 UTC (rev 235752)
@@ -404,13 +404,17 @@
bool removeEventListener(const AtomicString& eventType, EventListener&, const ListenerOptions&) override;
void wirelessRoutesAvailableDidChange() override;
- bool canPlayToWirelessPlaybackTarget() const override;
- bool isPlayingToWirelessPlaybackTarget() const override;
void setWirelessPlaybackTarget(Ref<MediaPlaybackTarget>&&) override;
void setShouldPlayToPlaybackTarget(bool) override;
#endif
- bool webkitCurrentPlaybackTargetIsWireless() const;
+ bool isPlayingToWirelessPlaybackTarget() const override { return m_isPlayingToWirelessTarget; };
+ bool webkitCurrentPlaybackTargetIsWireless() const { return m_isPlayingToWirelessTarget; }
+ void setPlayingOnSecondScreen(bool value);
+ bool isPlayingOnSecondScreen() const override { return m_playingOnSecondScreen; }
+
+ bool isPlayingToExternalTarget() const { return isPlayingToWirelessPlaybackTarget() || isPlayingOnSecondScreen(); }
+
// EventTarget function.
// Both Node (via HTMLElement) and ActiveDOMObject define this method, which
// causes an ambiguity error at compile time. This class's constructor
@@ -1170,8 +1174,10 @@
MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying };
bool m_hasPlaybackTargetAvailabilityListeners { false };
bool m_failedToPlayToWirelessTarget { false };
+#endif
+
bool m_isPlayingToWirelessTarget { false };
-#endif
+ bool m_playingOnSecondScreen { false };
};
String convertEnumerationToString(HTMLMediaElement::PlaybackWithoutUserGesture);
Modified: trunk/Source/WebCore/html/MediaElementSession.cpp (235751 => 235752)
--- trunk/Source/WebCore/html/MediaElementSession.cpp 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/html/MediaElementSession.cpp 2018-09-06 19:59:33 UTC (rev 235752)
@@ -651,16 +651,6 @@
m_targetAvailabilityChangedTimer.startOneShot(0_s);
}
-bool MediaElementSession::canPlayToWirelessPlaybackTarget() const
-{
-#if !PLATFORM(IOS)
- if (!m_playbackTarget || !m_playbackTarget->hasActiveRoute())
- return false;
-#endif
-
- return client().canPlayToWirelessPlaybackTarget();
-}
-
bool MediaElementSession::isPlayingToWirelessPlaybackTarget() const
{
#if !PLATFORM(IOS)
Modified: trunk/Source/WebCore/html/MediaElementSession.h (235751 => 235752)
--- trunk/Source/WebCore/html/MediaElementSession.h 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/html/MediaElementSession.h 2018-09-06 19:59:33 UTC (rev 235752)
@@ -87,7 +87,6 @@
void setHasPlaybackTargetAvailabilityListeners(bool);
- bool canPlayToWirelessPlaybackTarget() const override;
bool isPlayingToWirelessPlaybackTarget() const override;
void mediaStateDidChange(MediaProducer::MediaStateFlags);
Modified: trunk/Source/WebCore/platform/audio/PlatformMediaSession.h (235751 => 235752)
--- trunk/Source/WebCore/platform/audio/PlatformMediaSession.h 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/platform/audio/PlatformMediaSession.h 2018-09-06 19:59:33 UTC (rev 235752)
@@ -152,7 +152,6 @@
bool shouldOverrideBackgroundLoadingRestriction() const;
- virtual bool canPlayToWirelessPlaybackTarget() const { return false; }
virtual bool isPlayingToWirelessPlaybackTarget() const { return m_isPlayingToWirelessPlaybackTarget; }
void isPlayingToWirelessPlaybackTargetChanged(bool);
@@ -240,10 +239,11 @@
virtual void wirelessRoutesAvailableDidChange() { }
virtual void setWirelessPlaybackTarget(Ref<MediaPlaybackTarget>&&) { }
- virtual bool canPlayToWirelessPlaybackTarget() const { return false; }
virtual bool isPlayingToWirelessPlaybackTarget() const { return false; }
virtual void setShouldPlayToPlaybackTarget(bool) { }
+ virtual bool isPlayingOnSecondScreen() const { return false; }
+
virtual Document* hostingDocument() const = 0;
virtual String sourceApplicationIdentifier() const = 0;
Modified: trunk/Source/WebCore/platform/cocoa/PlaybackSessionModel.h (235751 => 235752)
--- trunk/Source/WebCore/platform/cocoa/PlaybackSessionModel.h 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/platform/cocoa/PlaybackSessionModel.h 2018-09-06 19:59:33 UTC (rev 235752)
@@ -59,6 +59,7 @@
virtual void toggleMuted() = 0;
virtual void setMuted(bool) = 0;
virtual void setVolume(double) = 0;
+ virtual void setPlayingOnSecondScreen(bool) = 0;
enum ExternalPlaybackTargetType { TargetTypeNone, TargetTypeAirPlay, TargetTypeTVOut };
Modified: trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h (235751 => 235752)
--- trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h 2018-09-06 19:59:33 UTC (rev 235752)
@@ -73,6 +73,7 @@
WEBCORE_EXPORT void toggleMuted() final;
WEBCORE_EXPORT void setMuted(bool) final;
WEBCORE_EXPORT void setVolume(double) final;
+ WEBCORE_EXPORT void setPlayingOnSecondScreen(bool) final;
double duration() const final;
double currentTime() const final;
Modified: trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm (235751 => 235752)
--- trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm 2018-09-06 19:59:33 UTC (rev 235752)
@@ -325,6 +325,12 @@
m_mediaElement->setVolume(volume);
}
+void PlaybackSessionModelMediaElement::setPlayingOnSecondScreen(bool value)
+{
+ if (m_mediaElement)
+ m_mediaElement->setPlayingOnSecondScreen(value);
+}
+
void PlaybackSessionModelMediaElement::updateMediaSelectionOptions()
{
if (!m_mediaElement)
Modified: trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm (235751 => 235752)
--- trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/platform/ios/WebAVPlayerController.mm 2018-09-06 19:59:33 UTC (rev 235752)
@@ -48,6 +48,7 @@
static void * WebAVPlayerControllerSeekableTimeRangesObserverContext = &WebAVPlayerControllerSeekableTimeRangesObserverContext;
static void * WebAVPlayerControllerHasLiveStreamingContentObserverContext = &WebAVPlayerControllerHasLiveStreamingContentObserverContext;
+static void * WebAVPlayerControllerIsPlayingOnSecondScreenObserverContext = &WebAVPlayerControllerIsPlayingOnSecondScreenObserverContext;
static double WebAVPlayerControllerLiveStreamSeekableTimeRangeDurationHysteresisDelta = 3.0; // Minimum delta of time required to change the duration of the seekable time range.
static double WebAVPlayerControllerLiveStreamMinimumTargetDuration = 1.0; // Minimum segment duration to be considered valid.
@@ -71,8 +72,8 @@
[self addObserver:self forKeyPath:@"seekableTimeRanges" options:(NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew | NSKeyValueObservingOptionInitial) context:WebAVPlayerControllerSeekableTimeRangesObserverContext];
[self addObserver:self forKeyPath:@"hasLiveStreamingContent" options:NSKeyValueObservingOptionInitial context:WebAVPlayerControllerHasLiveStreamingContentObserverContext];
+ [self addObserver:self forKeyPath:@"playingOnSecondScreen" options:NSKeyValueObservingOptionNew context:WebAVPlayerControllerIsPlayingOnSecondScreenObserverContext];
-
return self;
}
@@ -80,6 +81,7 @@
{
[self removeObserver:self forKeyPath:@"seekableTimeRanges" context:WebAVPlayerControllerSeekableTimeRangesObserverContext];
[self removeObserver:self forKeyPath:@"hasLiveStreamingContent" context:WebAVPlayerControllerHasLiveStreamingContentObserverContext];
+ [self removeObserver:self forKeyPath:@"playingOnSecondScreen" context:WebAVPlayerControllerIsPlayingOnSecondScreenObserverContext];
[_playerControllerProxy release];
[_loadedTimeRanges release];
@@ -553,6 +555,10 @@
}
} else if (WebAVPlayerControllerHasLiveStreamingContentObserverContext == context)
[self updateMinMaxTiming];
+ else if (WebAVPlayerControllerIsPlayingOnSecondScreenObserverContext == context) {
+ if (auto* delegate = self.delegate)
+ delegate->setPlayingOnSecondScreen(_playingOnSecondScreen);
+ }
}
- (void)updateMinMaxTiming
Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (235751 => 235752)
--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm 2018-09-06 19:59:33 UTC (rev 235752)
@@ -174,6 +174,7 @@
void toggleMuted() override;
void setMuted(bool) final;
void setVolume(double) final;
+ void setPlayingOnSecondScreen(bool) final;
// PlaybackSessionModelClient
void durationChanged(double) override;
@@ -742,6 +743,15 @@
});
}
+void VideoFullscreenControllerContext::setPlayingOnSecondScreen(bool value)
+{
+ ASSERT(isUIThread());
+ WebThreadRun([protectedThis = makeRefPtr(this), this, value] {
+ if (m_playbackModel)
+ m_playbackModel->setPlayingOnSecondScreen(value);
+ });
+}
+
void VideoFullscreenControllerContext::beginScrubbing()
{
ASSERT(isUIThread());
Modified: trunk/Source/WebKit/ChangeLog (235751 => 235752)
--- trunk/Source/WebKit/ChangeLog 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebKit/ChangeLog 2018-09-06 19:59:33 UTC (rev 235752)
@@ -1,3 +1,21 @@
+2018-09-06 Jer Noble <[email protected]>
+
+ Don't pause playback when locking screen if video is being displayed on second screen.
+ https://bugs.webkit.org/show_bug.cgi?id=189321
+
+ Reviewed by Eric Carlson.
+
+ Pass the "isPlayingOnSecondScreen" value across the process boundary.
+
+ * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
+ * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
+ (WebKit::PlaybackSessionModelContext::setPlayingOnSecondScreen):
+ (WebKit::PlaybackSessionManagerProxy::setPlayingOnSecondScreen):
+ * WebProcess/cocoa/PlaybackSessionManager.h:
+ * WebProcess/cocoa/PlaybackSessionManager.messages.in:
+ * WebProcess/cocoa/PlaybackSessionManager.mm:
+ (WebKit::PlaybackSessionManager::setPlayingOnSecondScreen):
+
2018-09-06 Wenson Hsieh <[email protected]>
[macOS] Cannot change font size at selection until font panel is shown
Modified: trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h (235751 => 235752)
--- trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h 2018-09-06 19:59:33 UTC (rev 235752)
@@ -113,6 +113,7 @@
void toggleMuted() final;
void setMuted(bool) final;
void setVolume(double) final;
+ void setPlayingOnSecondScreen(bool) final;
double playbackStartedTime() const final { return m_playbackStartedTime; }
double duration() const final { return m_duration; }
@@ -231,6 +232,7 @@
void toggleMuted(uint64_t contextId);
void setMuted(uint64_t contextId, bool);
void setVolume(uint64_t contextId, double);
+ void setPlayingOnSecondScreen(uint64_t contextId, bool);
WebPageProxy* m_page;
HashMap<uint64_t, ModelInterfaceTuple> m_contextMap;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm (235751 => 235752)
--- trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm 2018-09-06 19:59:33 UTC (rev 235752)
@@ -151,6 +151,12 @@
m_manager->setVolume(m_contextId, volume);
}
+void PlaybackSessionModelContext::setPlayingOnSecondScreen(bool value)
+{
+ if (m_manager)
+ m_manager->setPlayingOnSecondScreen(m_contextId, value);
+}
+
void PlaybackSessionModelContext::playbackStartedTimeChanged(double playbackStartedTime)
{
m_playbackStartedTime = playbackStartedTime;
@@ -571,6 +577,12 @@
m_page->send(Messages::PlaybackSessionManager::SetVolume(contextId, volume), m_page->pageID());
}
+void PlaybackSessionManagerProxy::setPlayingOnSecondScreen(uint64_t contextId, bool value)
+{
+ if (m_page)
+ m_page->send(Messages::PlaybackSessionManager::SetPlayingOnSecondScreen(contextId, value), m_page->pageID());
+}
+
void PlaybackSessionManagerProxy::requestControlledElementID()
{
if (m_controlsManagerContextId)
Modified: trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h (235751 => 235752)
--- trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h 2018-09-06 19:59:33 UTC (rev 235752)
@@ -162,6 +162,7 @@
void toggleMuted(uint64_t contextId);
void setMuted(uint64_t contextId, bool muted);
void setVolume(uint64_t contextId, double volume);
+ void setPlayingOnSecondScreen(uint64_t contextId, bool value);
WebPage* m_page;
HashMap<WebCore::HTMLMediaElement*, uint64_t> m_mediaElements;
Modified: trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.messages.in (235751 => 235752)
--- trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.messages.in 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.messages.in 2018-09-06 19:59:33 UTC (rev 235752)
@@ -40,5 +40,6 @@
ToggleMuted(uint64_t contextId)
SetMuted(uint64_t contextId, bool muted)
SetVolume(uint64_t contextId, double volume)
+ SetPlayingOnSecondScreen(uint64_t contextId, bool value)
}
#endif
Modified: trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm (235751 => 235752)
--- trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm 2018-09-06 19:58:57 UTC (rev 235751)
+++ trunk/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm 2018-09-06 19:59:33 UTC (rev 235752)
@@ -507,6 +507,12 @@
ensureModel(contextId).setVolume(volume);
}
+void PlaybackSessionManager::setPlayingOnSecondScreen(uint64_t contextId, bool value)
+{
+ UserGestureIndicator indicator(ProcessingUserGesture);
+ ensureModel(contextId).setPlayingOnSecondScreen(value);
+}
+
} // namespace WebKit
#endif // PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))