Changeset 229472 in webkit
- Timestamp:
- Mar 9, 2018, 10:59:33 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r229471 r229472 1 2018-03-09 Jer Noble <jer.noble@apple.com> 2 3 Add isPictureInPictureActive messaging across WebKit process boundary 4 https://bugs.webkit.org/show_bug.cgi?id=183499 5 6 Reviewed by Eric Carlson. 7 8 * platform/cocoa/PlaybackSessionModel.h: 9 (WebCore::PlaybackSessionModelClient::pictureInPictureActiveChanged): 10 * platform/cocoa/PlaybackSessionModelMediaElement.h: 11 * platform/cocoa/PlaybackSessionModelMediaElement.mm: 12 (WebCore::PlaybackSessionModelMediaElement::updateForEventName): 13 (WebCore::PlaybackSessionModelMediaElement::isPictureInPictureActive const): 14 * platform/ios/WebVideoFullscreenControllerAVKit.mm: 15 (VideoFullscreenControllerContext::isPictureInPictureActive const): 16 1 17 2018-03-09 Basuke Suzuki <Basuke.Suzuki@sony.com> 2 18 -
trunk/Source/WebCore/platform/cocoa/PlaybackSessionModel.h
r224085 r229472 82 82 virtual bool wirelessVideoPlaybackDisabled() const = 0; 83 83 virtual bool isMuted() const = 0; 84 virtual bool isPictureInPictureActive() const = 0; 84 85 }; 85 86 … … 101 102 virtual void wirelessVideoPlaybackDisabledChanged(bool) { } 102 103 virtual void mutedChanged(bool) { } 104 virtual void pictureInPictureActiveChanged(bool) { } 103 105 }; 104 106 -
trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.h
r224085 r229472 93 93 bool wirelessVideoPlaybackDisabled() const final; 94 94 bool isMuted() const final; 95 bool isPictureInPictureActive() const final; 95 96 96 97 protected: -
trunk/Source/WebCore/platform/cocoa/PlaybackSessionModelMediaElement.mm
r224085 r229472 166 166 } 167 167 168 if (all 169 || eventName == eventNames().webkitpresentationmodechangedEvent) { 170 bool isPictureInPictureActive = this->isPictureInPictureActive(); 171 172 for (auto client : m_clients) 173 client->pictureInPictureActiveChanged(isPictureInPictureActive); 174 } 175 176 168 177 // We don't call updateMediaSelectionIndices() in the all case, since 169 178 // updateMediaSelectionOptions() will also update the selection indices. … … 530 539 } 531 540 541 bool PlaybackSessionModelMediaElement::isPictureInPictureActive() const 542 { 543 if (!m_mediaElement) 544 return false; 545 546 return (m_mediaElement->fullscreenMode() & HTMLMediaElementEnums::VideoFullscreenModePictureInPicture) == HTMLMediaElementEnums::VideoFullscreenModePictureInPicture; 547 } 548 532 549 } 533 550 -
trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
r226217 r229472 198 198 FloatSize videoDimensions() const override; 199 199 bool isMuted() const override; 200 bool isPictureInPictureActive() const override; 200 201 201 202 HashSet<PlaybackSessionModelClient*> m_playbackClients; … … 589 590 } 590 591 592 bool VideoFullscreenControllerContext::isPictureInPictureActive() const 593 { 594 ASSERT(isUIThread()); 595 return m_playbackModel ? m_playbackModel->isPictureInPictureActive() : false; 596 } 597 591 598 FloatSize VideoFullscreenControllerContext::videoDimensions() const 592 599 { -
trunk/Source/WebKit/ChangeLog
r229467 r229472 1 2018-03-09 Jer Noble <jer.noble@apple.com> 2 3 Add isPictureInPictureActive messaging across WebKit process boundary 4 https://bugs.webkit.org/show_bug.cgi?id=183499 5 6 Reviewed by Eric Carlson. 7 8 * UIProcess/Cocoa/PlaybackSessionManagerProxy.h: 9 * UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in: 10 * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm: 11 (WebKit::PlaybackSessionModelContext::pictureInPictureActiveChanged): 12 (WebKit::PlaybackSessionManagerProxy::pictureInPictureActiveChanged): 13 1 14 2018-03-09 Stephan Szabo <stephan.szabo@sony.com> 2 15 -
trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.h
r224085 r229472 85 85 void wirelessVideoPlaybackDisabledChanged(bool); 86 86 void mutedChanged(bool); 87 void pictureInPictureActiveChanged(bool); 87 88 88 89 private: … … 132 133 bool wirelessVideoPlaybackDisabled() const final { return m_wirelessVideoPlaybackDisabled; } 133 134 bool isMuted() const final { return m_muted; } 135 bool isPictureInPictureActive() const final { return m_pictureInPictureActive; } 134 136 135 137 PlaybackSessionManagerProxy* m_manager; … … 157 159 bool m_wirelessVideoPlaybackDisabled { false }; 158 160 bool m_muted { false }; 161 bool m_pictureInPictureActive { false }; 159 162 }; 160 163 … … 203 206 void handleControlledElementIDResponse(uint64_t, String) const; 204 207 void mutedChanged(uint64_t contextId, bool muted); 208 void pictureInPictureActiveChanged(uint64_t contextId, bool pictureInPictureActive); 205 209 206 210 // Messages to PlaybackSessionManager -
trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.messages.in
r219996 r229472 38 38 RateChanged(uint64_t contextId, bool isPlaying, double rate) 39 39 MutedChanged(uint64_t contextId, bool muted); 40 PictureInPictureActiveChanged(uint64_t contextId, bool pictureInPictureActive) 40 41 SetUpPlaybackControlsManagerWithID(uint64_t contextId) 41 42 ClearPlaybackControlsManager() -
trunk/Source/WebKit/UIProcess/Cocoa/PlaybackSessionManagerProxy.mm
r224085 r229472 259 259 } 260 260 261 void PlaybackSessionModelContext::pictureInPictureActiveChanged(bool active) 262 { 263 m_pictureInPictureActive = active; 264 for (auto* client : m_clients) 265 client->pictureInPictureActiveChanged(active); 266 } 267 261 268 #pragma mark - PlaybackSessionManagerProxy 262 269 … … 455 462 } 456 463 464 void PlaybackSessionManagerProxy::pictureInPictureActiveChanged(uint64_t contextId, bool active) 465 { 466 ensureModel(contextId).pictureInPictureActiveChanged(active); 467 } 457 468 458 469 void PlaybackSessionManagerProxy::handleControlledElementIDResponse(uint64_t contextId, String identifier) const
Note:
See TracChangeset
for help on using the changeset viewer.