WebKit Bugzilla
Attachment 349033 Details for
Bug 189321
: Don't pause playback when locking screen if video is being displayed on second screen.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-189321-20180906093115.patch (text/plain), 23.76 KB, created by
Jer Noble
on 2018-09-06 09:31:16 PDT
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
Jer Noble
Created:
2018-09-06 09:31:16 PDT
Size:
23.76 KB
patch
obsolete
>Subversion Revision: 235558 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index ece3f0f644f2ef57a79951d0a239cab012ac96f8..6297f4daf92dd1dacfcf9423ddca9d0176ac0b7a 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,49 @@ >+2018-09-05 Jer Noble <jer.noble@apple.com> >+ >+ 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-08-31 Jer Noble <jer.noble@apple.com> > > Add MediaCapabilities as an Experimental Feature >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 14a2942c176445213ab5e803413802679a874ef6..282d2ead7238aa971fc9c14f1127f3110c736db7 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2018-09-05 Jer Noble <jer.noble@apple.com> >+ >+ 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-08-31 Jer Noble <jer.noble@apple.com> > > Add MediaCapabilities as an Experimental Feature >diff --git a/Source/WebCore/html/HTMLMediaElement.cpp b/Source/WebCore/html/HTMLMediaElement.cpp >index 3019e096b693d58eaa54e6af66ceab91ce5be5db..27d4aaba4204cdf3e16c34a57fbedfa44d7fd8ef 100644 >--- a/Source/WebCore/html/HTMLMediaElement.cpp >+++ b/Source/WebCore/html/HTMLMediaElement.cpp >@@ -5744,11 +5744,6 @@ void HTMLMediaElement::webkitShowPlaybackTargetPicker() > m_mediaSession->showPlaybackTargetPicker(); > } > >-bool HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless() const >-{ >- return m_isPlayingToWirelessTarget; >-} >- > void HTMLMediaElement::wirelessRoutesAvailableDidChange() > { > enqueuePlaybackTargetAvailabilityChangedEvent(); >@@ -5836,20 +5831,6 @@ void HTMLMediaElement::setWirelessPlaybackTarget(Ref<MediaPlaybackTarget>&& devi > 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,14 +5838,20 @@ void HTMLMediaElement::setShouldPlayToPlaybackTarget(bool shouldPlay) > 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; > >-#endif // ENABLE(WIRELESS_PLAYBACK_TARGET) >+ m_playingOnSecondScreen = value; >+ >+#if ENABLE(WIRELESS_PLAYBACK_TARGET) >+ updateMediaState(UpdateState::Asynchronously); >+#endif >+} > > double HTMLMediaElement::minFastReverseRate() const > { >@@ -7572,12 +7559,10 @@ bool HTMLMediaElement::supportsSeeking() const > 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 @@ bool HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction(PlatformMedia > 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 @@ bool HTMLMediaElement::processingUserGestureForMedia() const > { > return document().processingUserGestureForMedia(); > } >- > #if ENABLE(WIRELESS_PLAYBACK_TARGET) >+ > void HTMLMediaElement::updateMediaState(UpdateState updateState) > { > if (updateState == UpdateState::Asynchronously) { >@@ -7628,10 +7611,10 @@ MediaProducer::MediaStateFlags HTMLMediaElement::mediaState() const > > 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 @@ void HTMLMediaElement::purgeBufferedDataIfPossible() > 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 @@ void HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired() > > bool HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction() const > { >-#if ENABLE(WIRELESS_PLAYBACK_TARGET) >- if (isPlayingToWirelessPlaybackTarget()) >+ if (isPlayingToExternalTarget()) > return true; >-#endif > > return m_videoFullscreenMode == VideoFullscreenModePictureInPicture; > } >diff --git a/Source/WebCore/html/HTMLMediaElement.h b/Source/WebCore/html/HTMLMediaElement.h >index a78ecfd3196b9fdeabc510277fca764ee3dd6a72..572c189537e9b4c37a3a8a5e82b8672f2186aa8a 100644 >--- a/Source/WebCore/html/HTMLMediaElement.h >+++ b/Source/WebCore/html/HTMLMediaElement.h >@@ -404,12 +404,16 @@ public: > 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 >@@ -1170,8 +1174,10 @@ private: > MediaProducer::MediaStateFlags m_mediaState { MediaProducer::IsNotPlaying }; > bool m_hasPlaybackTargetAvailabilityListeners { false }; > bool m_failedToPlayToWirelessTarget { false }; >- bool m_isPlayingToWirelessTarget { false }; > #endif >+ >+ bool m_isPlayingToWirelessTarget { false }; >+ bool m_playingOnSecondScreen { false }; > }; > > String convertEnumerationToString(HTMLMediaElement::PlaybackWithoutUserGesture); >diff --git a/Source/WebCore/html/MediaElementSession.cpp b/Source/WebCore/html/MediaElementSession.cpp >index 82f3c7662ba5e89aed82ca7db8bf85b34ac539ba..dc7d5c18db45dc9b02774f6a785e1bcb1af15050 100644 >--- a/Source/WebCore/html/MediaElementSession.cpp >+++ b/Source/WebCore/html/MediaElementSession.cpp >@@ -651,16 +651,6 @@ void MediaElementSession::externalOutputDeviceAvailableDidChange(bool hasTargets > 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) >diff --git a/Source/WebCore/html/MediaElementSession.h b/Source/WebCore/html/MediaElementSession.h >index ffed5b328f96e085e87bbb5d0a5cbe736c3af6f3..6d6ecf7c81a3f6d9bf01709c089cd5b564a0b8c2 100644 >--- a/Source/WebCore/html/MediaElementSession.h >+++ b/Source/WebCore/html/MediaElementSession.h >@@ -87,7 +87,6 @@ public: > > void setHasPlaybackTargetAvailabilityListeners(bool); > >- bool canPlayToWirelessPlaybackTarget() const override; > bool isPlayingToWirelessPlaybackTarget() const override; > > void mediaStateDidChange(MediaProducer::MediaStateFlags); >diff --git a/Source/WebCore/platform/audio/PlatformMediaSession.h b/Source/WebCore/platform/audio/PlatformMediaSession.h >index 11f7aac1a3eabbec64aaf1a42b0f355998ae8437..a3ecf010f0bebaa66e9eb056b5324c1e55f0f7a4 100644 >--- a/Source/WebCore/platform/audio/PlatformMediaSession.h >+++ b/Source/WebCore/platform/audio/PlatformMediaSession.h >@@ -152,7 +152,6 @@ public: > > bool shouldOverrideBackgroundLoadingRestriction() const; > >- virtual bool canPlayToWirelessPlaybackTarget() const { return false; } > virtual bool isPlayingToWirelessPlaybackTarget() const { return m_isPlayingToWirelessPlaybackTarget; } > void isPlayingToWirelessPlaybackTargetChanged(bool); > >@@ -240,10 +239,11 @@ public: > > 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; > >diff --git a/Source/WebCore/platform/cocoa/PlaybackSessionModel.h b/Source/WebCore/platform/cocoa/PlaybackSessionModel.h >index 08d82a4519a2ef6ec66a8344367f5f6a7d9f3319..3286fe4dc741084bdf02d1a2405ea8c60f20430e 100644 >--- a/Source/WebCore/platform/cocoa/PlaybackSessionModel.h >+++ b/Source/WebCore/platform/cocoa/PlaybackSessionModel.h >@@ -64,6 +64,7 @@ public: > virtual void toggleMuted() = 0; > virtual void setMuted(bool) = 0; > virtual void setVolume(double) = 0; >+ virtual void setPlayingOnSecondScreen(bool) = 0; > > enum ExternalPlaybackTargetType { TargetTypeNone, TargetTypeAirPlay, TargetTypeTVOut }; > >diff --git a/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h b/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h >index 860de152a2240cd17eebb56f154e522d5b2a02d0..11e81b047bdc5691a6e939ab6a13413378d6fb18 100644 >--- a/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h >+++ b/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h >@@ -73,6 +73,7 @@ public: > 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; >diff --git a/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm b/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm >index 810683ca5a5cc320633f0a1d6b63fce4fdcf386e..92a55c2802eb6d068faf5f35112b92426fa6ee93 100644 >--- a/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm >+++ b/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm >@@ -323,6 +323,12 @@ void PlaybackSessionModelMediaElement::setVolume(double volume) > m_mediaElement->setVolume(volume); > } > >+void PlaybackSessionModelMediaElement::setPlayingOnSecondScreen(bool value) >+{ >+ if (m_mediaElement) >+ m_mediaElement->setPlayingOnSecondScreen(value); >+} >+ > void PlaybackSessionModelMediaElement::updateMediaSelectionOptions() > { > if (!m_mediaElement) >diff --git a/Source/WebCore/platform/ios/WebAVPlayerController.mm b/Source/WebCore/platform/ios/WebAVPlayerController.mm >index 66e20319a1cf39038cf15d8ba4f21e0897d2308d..6f24ab21a0ea5a0eccf9319b36c4d11914ccb9a8 100644 >--- a/Source/WebCore/platform/ios/WebAVPlayerController.mm >+++ b/Source/WebCore/platform/ios/WebAVPlayerController.mm >@@ -48,6 +48,7 @@ using namespace WebCore; > > 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,7 +72,7 @@ - (instancetype)init > > [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 @@ - (void)dealloc > { > [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]; >@@ -570,6 +572,10 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N > } > } else if (WebAVPlayerControllerHasLiveStreamingContentObserverContext == context) > [self updateMinMaxTiming]; >+ else if (WebAVPlayerControllerIsPlayingOnSecondScreenObserverContext == context) { >+ if (auto* delegate = self.delegate) >+ delegate->setPlayingOnSecondScreen(_playingOnSecondScreen); >+ } > } > > - (void)updateMinMaxTiming >diff --git a/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm b/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm >index 12dfa8e6de8c49692e10064e1c3243ef1016af35..44ea37aaf1d7373afbaaf0ad7c51a40b512b6022 100644 >--- a/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm >+++ b/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm >@@ -179,6 +179,7 @@ private: > void toggleMuted() override; > void setMuted(bool) final; > void setVolume(double) final; >+ void setPlayingOnSecondScreen(bool) final; > > // PlaybackSessionModelClient > void durationChanged(double) override; >@@ -751,6 +752,15 @@ void VideoFullscreenControllerContext::setVolume(double volume) > }); > } > >+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()); >diff --git a/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h b/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h >index 831e431320211a89c65074ff6f67228085430307..47ce0ead37f937bcb38c2d56fb786600c8da8e00 100644 >--- a/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h >+++ b/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h >@@ -121,6 +121,7 @@ private: > 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; } >@@ -242,6 +243,7 @@ private: > 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; >diff --git a/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm b/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm >index ed1731a1d5bc2d3126ce3ebc3b0978c24af93727..672ac8dd649d8e36193c9757b95e87edabc38b20 100644 >--- a/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm >+++ b/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm >@@ -149,6 +149,12 @@ void PlaybackSessionModelContext::setVolume(double volume) > 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; >@@ -591,6 +597,12 @@ void PlaybackSessionManagerProxy::setVolume(uint64_t contextId, double volume) > 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_page && m_controlsManagerContextId) >diff --git a/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h b/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h >index c8c6254ecb8d71853fcff87730b09a5ebb517b1c..c9f00fb29a70c20f0e2a329ab843d66860f91cba 100644 >--- a/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h >+++ b/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.h >@@ -168,6 +168,7 @@ protected: > 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); > > WeakPtrFactory<WebCore::PlaybackSessionModel> m_weakPtrFactory; > WebPage* m_page; >diff --git a/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.messages.in b/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.messages.in >index 4d2a786e1390564823a18993f5fcf57291cf65d6..453008d34cbb4180739b3f719fa0480998c2dcc4 100644 >--- a/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.messages.in >+++ b/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.messages.in >@@ -40,5 +40,6 @@ messages -> PlaybackSessionManager { > ToggleMuted(uint64_t contextId) > SetMuted(uint64_t contextId, bool muted) > SetVolume(uint64_t contextId, double volume) >+ SetPlayingOnSecondScreen(uint64_t contextId, bool value) > } > #endif >diff --git a/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm b/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm >index 73f27f7bccf95bb1c533613e97e96eb8de63c181..c0c722559cf83852363475aa176a1715ca88cc37 100644 >--- a/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm >+++ b/Source/WebKit/WebProcess/cocoa/PlaybackSessionManager.mm >@@ -525,6 +525,12 @@ void PlaybackSessionManager::setVolume(uint64_t contextId, double volume) > 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))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189321
:
348972
| 349033