Changeset 201435 in webkit
- Timestamp:
- May 26, 2016, 3:05:26 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r201432 r201435 1 2016-05-25 Ada Chan <adachan@apple.com> 2 3 Add WebKitAdditions extension point in HTMLMediaElement. 4 https://bugs.webkit.org/show_bug.cgi?id=158097 5 6 Reviewed by Eric Carlson. 7 8 * html/HTMLMediaElement.cpp: 9 (WebCore::HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction): 10 We need to load data in the background if playing to wireless playback target. 11 (WebCore::HTMLMediaElement::fullscreenModeChanged): 12 Moved from header file. 13 * html/HTMLMediaElement.h: 14 15 * platform/audio/PlatformMediaSession.cpp: 16 (WebCore::PlatformMediaSession::clientWillPausePlayback): 17 The code to start m_clientDataBufferingTimer is also in visibilityChanged(). 18 Moved that code to PlatformMediaSession::scheduleClientDataBufferingCheck() and call 19 that method here. 20 (WebCore::PlatformMediaSession::visibilityChanged): 21 Call PlatformMediaSession::scheduleClientDataBufferingCheck(). 22 (WebCore::PlatformMediaSession::scheduleClientDataBufferingCheck): 23 Start m_clientDataBufferingTimer if it's not already active. 24 (WebCore::PlatformMediaSession::shouldOverrideBackgroundLoadingRestriction): 25 Call the client. 26 27 * platform/audio/PlatformMediaSession.h: 28 (WebCore::PlatformMediaSessionClient::shouldOverrideBackgroundLoadingRestriction): 29 30 * platform/audio/PlatformMediaSessionManager.cpp: 31 (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia): 32 Call the new PlatformMediaSession::shouldOverrideBackgroundLoadingRestriction(). 33 1 34 2016-05-26 Jer Noble <jer.noble@apple.com> 2 35 -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r201305 r201435 153 153 #endif 154 154 155 #if USE(APPLE_INTERNAL_SDK) 156 #include <WebKitAdditions/HTMLMediaElementAdditions.cpp> 157 #endif 158 155 159 namespace WebCore { 156 160 … … 7025 7029 } 7026 7030 7027 } 7028 7029 #endif 7031 #if !USE(APPLE_INTERNAL_SDK) 7032 bool HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction() const 7033 { 7034 #if ENABLE(WIRELESS_PLAYBACK_TARGET) 7035 if (isPlayingToWirelessPlaybackTarget()) 7036 return true; 7037 #endif 7038 7039 return false; 7040 } 7041 7042 void HTMLMediaElement::fullscreenModeChanged(VideoFullscreenMode mode) 7043 { 7044 m_videoFullscreenMode = mode; 7045 } 7046 #endif 7047 7048 } 7049 7050 #endif -
trunk/Source/WebCore/html/HTMLMediaElement.h
r201305 r201435 371 371 using MediaPlayerEnums::VideoFullscreenMode; 372 372 VideoFullscreenMode fullscreenMode() const { return m_videoFullscreenMode; } 373 virtual void fullscreenModeChanged(VideoFullscreenMode mode) { m_videoFullscreenMode = mode; }373 virtual void fullscreenModeChanged(VideoFullscreenMode); 374 374 375 375 void enterFullscreen(VideoFullscreenMode); … … 758 758 void didReceiveRemoteControlCommand(PlatformMediaSession::RemoteControlCommandType) override; 759 759 bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const override; 760 bool shouldOverrideBackgroundLoadingRestriction() const override; 760 761 761 762 void pageMutedStateDidChange() override; -
trunk/Source/WebCore/platform/audio/PlatformMediaSession.cpp
r200446 r201435 187 187 setState(Paused); 188 188 PlatformMediaSessionManager::sharedManager().sessionWillEndPlayback(*this); 189 if (!m_clientDataBufferingTimer.isActive()) 190 m_clientDataBufferingTimer.startOneShot(kClientDataBufferingTimerThrottleDelay); 189 scheduleClientDataBufferingCheck(); 191 190 return true; 192 191 } … … 249 248 void PlatformMediaSession::visibilityChanged() 250 249 { 250 scheduleClientDataBufferingCheck(); 251 } 252 253 void PlatformMediaSession::scheduleClientDataBufferingCheck() 254 { 251 255 if (!m_clientDataBufferingTimer.isActive()) 252 256 m_clientDataBufferingTimer.startOneShot(kClientDataBufferingTimerThrottleDelay); … … 282 286 { 283 287 return m_client.elementIsHidden(); 288 } 289 290 bool PlatformMediaSession::shouldOverrideBackgroundLoadingRestriction() const 291 { 292 return m_client.shouldOverrideBackgroundLoadingRestriction(); 284 293 } 285 294 -
trunk/Source/WebCore/platform/audio/PlatformMediaSession.h
r199351 r201435 138 138 bool isHidden() const; 139 139 140 bool shouldOverrideBackgroundLoadingRestriction() const; 141 140 142 virtual bool canPlayToWirelessPlaybackTarget() const { return false; } 141 143 virtual bool isPlayingToWirelessPlaybackTarget() const { return m_isPlayingToWirelessPlaybackTarget; } … … 156 158 bool canProduceAudio() const { return m_canProduceAudio; } 157 159 void setCanProduceAudio(bool); 160 161 void scheduleClientDataBufferingCheck(); 158 162 159 163 protected: … … 204 208 205 209 virtual bool shouldOverrideBackgroundPlaybackRestriction(PlatformMediaSession::InterruptionType) const = 0; 210 virtual bool shouldOverrideBackgroundLoadingRestriction() const { return false; } 206 211 207 212 virtual void wirelessRoutesAvailableDidChange() { } -
trunk/Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp
r199351 r201435 281 281 bool PlatformMediaSessionManager::sessionCanLoadMedia(const PlatformMediaSession& session) const 282 282 { 283 return session.state() == PlatformMediaSession::Playing || !session.isHidden() || session. isPlayingToWirelessPlaybackTarget();283 return session.state() == PlatformMediaSession::Playing || !session.isHidden() || session.shouldOverrideBackgroundLoadingRestriction(); 284 284 } 285 285
Note:
See TracChangeset
for help on using the changeset viewer.