void WebMediaSessionManager::configurePlaybackTargetMonitoring() { bool monitoringRequired = false; for (auto& state : m_clientState) { if (state->flags & MediaProducer::RequiresPlaybackTargetMonitoring) { monitoringRequired = true; break; } } if (monitoringRequired) targetPicker().startingMonitoringPlaybackTargets(); else targetPicker().stopMonitoringPlaybackTargets(); }
void WebMediaSessionManager::watchdogTimerFired() { LOG(Media, "WebMediaSessionManager::watchdogTimerFired"); if (!m_playbackTarget) return; targetPicker().stopMonitoringPlaybackTargets(); }
void WebMediaSessionManager::showPlaybackTargetPicker(WebMediaSessionManagerClient& client, uint64_t contextId, const IntRect& rect, bool isVideo) { size_t index = find(&client, contextId); ASSERT(index != notFound); if (index == notFound) return; for (auto& state : m_clientState) state->requestedPicker = (state->contextId == contextId && state->client == &client); targetPicker().showPlaybackTargetPicker(FloatRect(rect), isVideo); }
void WebMediaSessionManager::showPlaybackTargetPicker(WebMediaSessionManagerClient& client, uint64_t contextId, const IntRect& rect, bool) { size_t index = find(&client, contextId); ASSERT(index != notFound); if (index == notFound) return; for (auto& state : m_clientState) state->requestedPicker = (state->contextId == contextId && state->client == &client); bool hasActiveRoute = flagsAreSet(m_clientState[index]->flags, MediaProducer::IsPlayingToExternalDevice); targetPicker().showPlaybackTargetPicker(FloatRect(rect), hasActiveRoute); }
void WebMediaSessionManager::showPlaybackTargetPicker(WebMediaSessionManagerClient& client, uint64_t contextId, const IntRect& rect, bool) { size_t index = find(&client, contextId); ASSERT(index != notFound); if (index == notFound) return; auto& clientRequestingPicker = m_clientState[index]; for (auto& state : m_clientState) { state->requestedPicker = state == clientRequestingPicker; state->previouslyRequestedPicker = state == clientRequestingPicker; } bool hasActiveRoute = flagsAreSet(m_clientState[index]->flags, MediaProducer::IsPlayingToExternalDevice); LOG(Media, "WebMediaSessionManager::showPlaybackTargetPicker(%p + %llu) - hasActiveRoute = %i", &client, contextId, (int)hasActiveRoute); targetPicker().showPlaybackTargetPicker(FloatRect(rect), hasActiveRoute); }