How MediaManager and MediaSession work together
masterThe library uses a hierarchical structure to manage media sessions:
MediaManager: The top-level controller. It manages the globalWindowsSessionManagerand provides events for any session opening, closing, or changing state across the entire OS.MediaManager.MediaSession: Represents an individual media session (e.g., a specific Spotify instance or Chrome tab). It contains aControlSessionwhich provides direct access to that specific session's properties and playback state.
Use MediaManager.GetFocusedSession() to retrieve the session currently controlling audio.