#include "content/browser/media/session/media_session_controllers_manager.h"
#include <map>
#include "content/browser/media/session/media_session_controller.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "media/base/media_switches.h"
#include "services/media_session/public/cpp/features.h"
namespace content {
namespace {
bool IsMediaSessionEnabled() { … }
}
MediaSessionControllersManager::MediaSessionControllersManager(
WebContentsImpl* web_contents)
: … { … }
MediaSessionControllersManager::~MediaSessionControllersManager() = default;
void MediaSessionControllersManager::RenderFrameDeleted(
RenderFrameHost* render_frame_host) { … }
void MediaSessionControllersManager::OnMetadata(
const MediaPlayerId& id,
bool has_audio,
bool has_video,
media::MediaContentType media_content_type) { … }
bool MediaSessionControllersManager::RequestPlay(const MediaPlayerId& id) { … }
void MediaSessionControllersManager::OnPause(const MediaPlayerId& id,
bool reached_end_of_stream) { … }
void MediaSessionControllersManager::OnEnd(const MediaPlayerId& id) { … }
void MediaSessionControllersManager::OnMediaPositionStateChanged(
const MediaPlayerId& id,
const media_session::MediaPosition& position) { … }
void MediaSessionControllersManager::PictureInPictureStateChanged(
bool is_picture_in_picture) { … }
void MediaSessionControllersManager::WebContentsMutedStateChanged(bool muted) { … }
void MediaSessionControllersManager::OnMediaMutedStatusChanged(
const MediaPlayerId& id,
bool mute) { … }
void MediaSessionControllersManager::OnPictureInPictureAvailabilityChanged(
const MediaPlayerId& id,
bool available) { … }
void MediaSessionControllersManager::OnAudioOutputSinkChanged(
const MediaPlayerId& id,
const std::string& raw_device_id) { … }
void MediaSessionControllersManager::OnAudioOutputSinkChangingDisabled(
const MediaPlayerId& id) { … }
void MediaSessionControllersManager::OnRemotePlaybackMetadataChange(
const MediaPlayerId& id,
media_session::mojom::RemotePlaybackMetadataPtr remote_playback_metadata) { … }
void MediaSessionControllersManager::OnVideoVisibilityChanged(
const MediaPlayerId& id,
bool meets_visibility_threshold) { … }
MediaSessionController* MediaSessionControllersManager::FindOrCreateController(
const MediaPlayerId& id) { … }
}