🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@capgo/capacitor-media-session

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@capgo/capacitor-media-session

Capacitor plugin to expose media session controls of the device

Source
npmnpm
Version
8.0.20
Version published
Weekly downloads
13K
11.8%
Maintainers
1
Weekly downloads
 
Created
Source

@capgo/capacitor-media-session

Capgo - Instant updates for capacitor

Expose media session controls for Capacitor apps

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/media-session/

Compatibility

Plugin versionCapacitor compatibilityMaintained
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.

Install

npm install @capgo/capacitor-media-session
npx cap sync

API

setMetadata(...)

setMetadata(options: MetadataOptions) => Promise<void>

Sets metadata of the currently playing media.

ParamType
optionsMetadataOptions

setPlaybackState(...)

setPlaybackState(options: PlaybackStateOptions) => Promise<void>

Updates the playback state of the media session.

ParamType
optionsPlaybackStateOptions

setActionHandler(...)

setActionHandler(options: ActionHandlerOptions, handler: ActionHandler | null) => Promise<void>

Registers a handler for a media session action.

ParamType
optionsActionHandlerOptions
handlerActionHandler | null

setPositionState(...)

setPositionState(options: PositionStateOptions) => Promise<void>

Updates position state for the active media session.

ParamType
optionsPositionStateOptions

getPluginVersion()

getPluginVersion() => Promise<{ version: string; }>

Get the native Capacitor plugin version

Returns: Promise<{ version: string; }>

Interfaces

MetadataOptions

PropType
albumstring
artiststring
artworkMediaImage[]
titlestring

MediaImage

PropType
srcstring
sizesstring
typestring

PlaybackStateOptions

PropType
playbackStateMediaSessionPlaybackState

ActionHandlerOptions

PropType
actionMediaSessionAction

ActionDetails

PropType
actionMediaSessionAction
seekTimenumber | null

PositionStateOptions

PropType
durationnumber
playbackRatenumber
positionnumber

Type Aliases

MediaSessionPlaybackState

'none' | 'paused' | 'playing'

MediaSessionAction

'play' | 'pause' | 'seekbackward' | 'seekforward' | 'previoustrack' | 'nexttrack' | 'seekto' | 'stop'

ActionHandler

(details: ActionDetails): void

Keywords

capacitor

FAQs

Package last updated on 13 Apr 2026

Did you know?

Socket

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.

Install

Related posts