0.0.3 • Published 3 years ago

flight-controls-capacitor v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

music-controls-capacitor

Music Control Notification Implementation in Android for Capacitor

Install

npm install music-controls-capacitor
npx cap sync

API

create(...)

create(options: CapacitorMusicControlsInfo) => any

Create the media controls

ParamType
optionsCapacitorMusicControlsInfo

Returns: any


destroy()

destroy() => any

Destroy the media controller

Returns: any


updateIsPlaying(...)

updateIsPlaying(isPlaying: boolean) => void

Toggle play/pause:

ParamType
isPlayingboolean

updateElapsed(...)

updateElapsed(args: { elapsed: string; isPlaying: boolean; }) => void

Update elapsed time, optionally toggle play/pause:

ParamType
args{ elapsed: string; isPlaying: boolean; }

updateDismissible(...)

updateDismissible(dismissible: boolean) => void

Toggle dismissible:

ParamType
dismissibleboolean

update(...)

update(args: { track: string; artist: string; cover: string; isPlaying: boolean; dismissible: boolean; }) => void

Toggle play/pause && dismissible:

ParamType
args{ track: string; artist: string; cover: string; isPlaying: boolean; dismissible: boolean; }

addListener(...)

addListener(eventName: 'controlsNotification', listenerFunc: ControlsNotificationListener) => Promise<PluginListenerHandle> & PluginListenerHandle

Listen for updates from the notification

ParamType
eventName"controlsNotification"
listenerFunc(info: CapacitorMusicControlsInfo) => void

Returns: any


Interfaces

CapacitorMusicControlsInfo

PropType
trackstring
artiststring
coverstring
isPlayingboolean
dismissibleboolean
hasPrevboolean
hasNextboolean
hasSkipForwardboolean
hasSkipBackwardboolean
skipForwardIntervalnumber
skipBackwardIntervalnumber
hasScrubbingboolean
hasCloseboolean
albumstring
durationnumber
elapsednumber
tickerstring
playIconstring
pauseIconstring
prevIconstring
nextIconstring
closeIconstring
notificationIconstring

PluginListenerHandle

PropType
remove() => any
0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago