@capgo/capacitor-media-session
Overview
Section titled “Overview”@capgo/capacitor-media-session wires your Capacitor player into the OS now playing surface: lock screen, notification controls, headsets, and CarPlay style remotes. Set title and artwork, publish playback state, and react to play, pause, seek, and skip actions from native UI.
Use it for podcasts, music, audiobooks, and long form video where users expect hardware button control.
Platform support
Section titled “Platform support”| Platform | Implementation |
|---|---|
| iOS | Web implementation adapter (navigator.mediaSession; rejects when unavailable) |
| Android | Media session service |
| Web | Media Session API |
Core Capabilities
Section titled “Core Capabilities”setMetadata- Sets metadata of the currently playing media.setPlaybackState- Updates the playback state of the media session.setActionHandler- Registers a handler for a media session action.setPositionState- Updates position state for the active media session.
Public API
Section titled “Public API”| Method | Description |
|---|---|
setMetadata | Sets metadata of the currently playing media. |
setPlaybackState | Updates the playback state of the media session. |
setActionHandler | Registers a handler for a media session action. |
setPositionState | Updates position state for the active media session. |
getPluginVersion | Get the native Capacitor plugin version. |
Source Of Truth
Section titled “Source Of Truth”This reference is synced from src/definitions.ts in capacitor-media-session.
Keep going from @capgo/capacitor-media-session
Section titled “Keep going from @capgo/capacitor-media-session”If you are using @capgo/capacitor-media-session to plan dashboard and API operations, connect it with Using @capgo/capacitor-media-session for the native capability in Using @capgo/capacitor-media-session, API Overview for the implementation detail in API Overview, Introduction for the implementation detail in Introduction, API Keys for the implementation detail in API Keys, and Devices for the implementation detail in Devices.