Changeset 183613 in webkit
- Timestamp:
- Apr 29, 2015, 8:40:16 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r183612 r183613 1 2015-04-29 Eric Carlson <eric.carlson@apple.com> 2 3 Not all videos should automatically play to playback target 4 https://bugs.webkit.org/show_bug.cgi?id=144430 5 <rdar://problem/20718523> 6 7 Reviewed by Darin Adler. 8 9 * Modules/mediasession/WebMediaSessionManager.cpp: 10 (WebCore::WebMediaSessionManager::clientStateDidChange): Consider ExternalDeviceAutoPlayCandidate. 11 Minor cleanup. 12 13 * html/HTMLMediaElement.cpp: 14 (WebCore::HTMLMediaElement::mediaState): Set ExternalDeviceAutoPlayCandidate when a <video> 15 has a file with an audio track that does not loop. 16 17 * page/MediaProducer.h: Add ExternalDeviceAutoPlayCandidate. 18 1 19 2015-04-29 Joseph Pecoraro <pecoraro@apple.com> 2 20 -
trunk/Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp
r183587 r183613 145 145 configurePlaybackTargetMonitoring(); 146 146 147 if (!flagsAreSet(newFlags, MediaProducer::IsPlayingVideo)) 147 if (!flagsAreSet(newFlags, MediaProducer::IsPlayingVideo) || !flagsAreSet(newFlags, MediaProducer::ExternalDeviceAutoPlayCandidate)) 148 return; 149 150 if (!m_playbackTarget || !m_playbackTarget->hasActiveRoute()) 148 151 return; 149 152 … … 157 160 } 158 161 159 if (m_playbackTarget && m_playbackTarget->hasActiveRoute()) { 160 161 for (auto& state : m_clientState) { 162 if (state->contextId == contextId && state->client == &client) 163 continue; 164 state->client->setShouldPlayToPlaybackTarget(state->contextId, false); 165 } 166 167 changedClientState->client->setShouldPlayToPlaybackTarget(changedClientState->contextId, true); 168 } 162 for (auto& state : m_clientState) { 163 if (state->contextId == contextId && state->client == &client) 164 continue; 165 state->client->setShouldPlayToPlaybackTarget(state->contextId, false); 166 } 167 168 changedClientState->client->setShouldPlayToPlaybackTarget(changedClientState->contextId, true); 169 169 170 170 if (index && m_clientState.size() > 1) -
trunk/Source/WebCore/html/HTMLMediaElement.cpp
r183587 r183613 6190 6190 6191 6191 bool hasActiveVideo = isVideo() && hasVideo(); 6192 bool hasAudio = this->hasAudio(); 6192 6193 #if ENABLE(WIRELESS_PLAYBACK_TARGET) 6193 6194 if (isPlayingToWirelessPlaybackTarget()) … … 6198 6199 state |= RequiresPlaybackTargetMonitoring; 6199 6200 } 6201 6202 if (hasActiveVideo && hasAudio && !loop()) 6203 state |= ExternalDeviceAutoPlayCandidate; 6204 6200 6205 #endif 6201 6206 … … 6203 6208 return state; 6204 6209 6205 if (hasAudio ()&& !muted())6210 if (hasAudio && !muted()) 6206 6211 state |= IsPlayingAudio; 6207 6212 -
trunk/Source/WebCore/page/MediaProducer.h
r183096 r183613 37 37 IsPlayingToExternalDevice = 1 << 2, 38 38 RequiresPlaybackTargetMonitoring = 1 << 3, 39 ExternalDeviceAutoPlayCandidate = 1 << 4, 39 40 }; 40 41 typedef unsigned MediaStateFlags;
Note:
See TracChangeset
for help on using the changeset viewer.