
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
@capgo/capacitor-media-session
Advanced tools
Capacitor plugin to expose media session controls of the device
The most complete doc is available here: https://capgo.app/docs/plugins/media-session/
| Plugin version | Capacitor compatibility | Maintained |
|---|---|---|
| v8.*.* | v8.*.* | ✅ |
| v7.*.* | v7.*.* | On demand |
| v6.*.* | v6.*.* | ❌ |
| v5.*.* | v5.*.* | ❌ |
Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins
Then use the following prompt:
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-media-session` plugin in my project.
If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
npm install @capgo/capacitor-media-session
npx cap sync
setMetadata(...)setPlaybackState(...)setActionHandler(...)setPositionState(...)getPluginVersion()setMetadata(options: MetadataOptions) => Promise<void>
Sets metadata of the currently playing media.
| Param | Type |
|---|---|
options | MetadataOptions |
setPlaybackState(options: PlaybackStateOptions) => Promise<void>
Updates the playback state of the media session.
| Param | Type |
|---|---|
options | PlaybackStateOptions |
setActionHandler(options: ActionHandlerOptions, handler: ActionHandler | null) => Promise<void>
Registers a handler for a media session action.
| Param | Type |
|---|---|
options | ActionHandlerOptions |
handler | ActionHandler | null |
setPositionState(options: PositionStateOptions) => Promise<void>
Updates position state for the active media session.
| Param | Type |
|---|---|
options | PositionStateOptions |
getPluginVersion() => Promise<{ version: string; }>
Get the native Capacitor plugin version
Returns: Promise<{ version: string; }>
| Prop | Type |
|---|---|
album | string |
artist | string |
artwork | MediaImage[] |
title | string |
| Prop | Type |
|---|---|
src | string |
sizes | string |
type | string |
| Prop | Type |
|---|---|
playbackState | MediaSessionPlaybackState |
| Prop | Type |
|---|---|
action | MediaSessionAction |
| Prop | Type |
|---|---|
action | MediaSessionAction |
seekTime | number | null |
| Prop | Type |
|---|---|
duration | number |
playbackRate | number |
position | number |
'none' | 'paused' | 'playing'
'play' | 'pause' | 'seekbackward' | 'seekforward' | 'previoustrack' | 'nexttrack' | 'seekto' | 'stop'
(details: ActionDetails): void
FAQs
Capacitor plugin to expose media session controls of the device
We found that @capgo/capacitor-media-session demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.