capacitor-plugin-applemusic
v0.0.61
Published
capacitor plugin apple music
Downloads
133
Readme
capacitor-plugin-applemusic
It is in the development stage. Please do not use it.
Install
npm install capacitor-plugin-applemusic
npx cap sync
API
echo(...)
configure(...)
isAuthorized()
hasMusicSubscription()
authorize()
unauthorize()
setSong(...)
getLibraryAlbum(...)
getLibraryAlbums(...)
play()
stop()
pause()
currentPlaybackDuration()
currentPlaybackTime()
seekToTime(...)
setVolume(...)
addListener(...)
addListener(...)
- Interfaces
echo(...)
echo(options: { value: string; }) => Promise<{ value: string; }>
| Param | Type |
| ------------- | ------------------------------- |
| options
| { value: string; } |
Returns: Promise<{ value: string; }>
configure(...)
configure(options: { config: MusicKit.Config; }) => Promise<{ result: boolean; }>
| Param | Type |
| ------------- | -------------------------------- |
| options
| { config: Config; } |
Returns: Promise<{ result: boolean; }>
isAuthorized()
isAuthorized() => Promise<{ result: boolean; }>
Returns: Promise<{ result: boolean; }>
hasMusicSubscription()
hasMusicSubscription() => Promise<{ result: boolean; }>
Returns: Promise<{ result: boolean; }>
authorize()
authorize() => Promise<{ result: boolean; }>
Returns: Promise<{ result: boolean; }>
unauthorize()
unauthorize() => Promise<{ result: boolean; }>
Returns: Promise<{ result: boolean; }>
setSong(...)
setSong(options: { songId: string; librarySongId?: string; previewUrl?: string; songTitle?: string; albumTitle?: string; forcePreview?: boolean; }) => Promise<{ result: boolean; librarySongId?: string; albumTitle?: string; }>
| Param | Type |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| options
| { songId: string; librarySongId?: string; previewUrl?: string; songTitle?: string; albumTitle?: string; forcePreview?: boolean; } |
Returns: Promise<{ result: boolean; librarySongId?: string; albumTitle?: string; }>
getLibraryAlbum(...)
getLibraryAlbum(options: { id?: string; title?: string; }) => Promise<{ result: boolean; album?: { title: string; id: string; tracks: { title: string; id: string; discNumber: string; trackNumber: string; }[]; }; }>
| Param | Type |
| ------------- | --------------------------------------------- |
| options
| { id?: string; title?: string; } |
Returns: Promise<{ result: boolean; album?: { title: string; id: string; tracks: { title: string; id: string; discNumber: string; trackNumber: string; }[]; }; }>
getLibraryAlbums(...)
getLibraryAlbums(options: { limit: number; offset: number; }) => Promise<{ result: boolean; albums: { title: string; id: string; artworkUrl?: string; }[]; hasNext: boolean; }>
| Param | Type |
| ------------- | ----------------------------------------------- |
| options
| { limit: number; offset: number; } |
Returns: Promise<{ result: boolean; albums: { title: string; id: string; artworkUrl?: string; }[]; hasNext: boolean; }>
play()
play() => Promise<{ result: boolean; }>
Returns: Promise<{ result: boolean; }>
stop()
stop() => Promise<{ result: boolean; }>
Returns: Promise<{ result: boolean; }>
pause()
pause() => Promise<{ result: boolean; }>
Returns: Promise<{ result: boolean; }>
currentPlaybackDuration()
currentPlaybackDuration() => Promise<{ result: number; }>
Returns: Promise<{ result: number; }>
currentPlaybackTime()
currentPlaybackTime() => Promise<{ result: number; }>
Returns: Promise<{ result: number; }>
seekToTime(...)
seekToTime(options: { playbackTime: number; }) => Promise<{ result: boolean; }>
| Param | Type |
| ------------- | -------------------------------------- |
| options
| { playbackTime: number; } |
Returns: Promise<{ result: boolean; }>
setVolume(...)
setVolume(options: { volume: number; }) => Promise<{ result: boolean; }>
| Param | Type |
| ------------- | -------------------------------- |
| options
| { volume: number; } |
Returns: Promise<{ result: boolean; }>
addListener(...)
addListener(eventName: 'playbackStateDidChange', listenerFunc: PlaybackStateDidChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| eventName
| "playbackStateDidChange" |
| listenerFunc
| (state: { result: "none" | "loading" | "playing" | "paused" | "stopped" | "ended" | "seeking" | "waiting" | "stalled" | "completed"; }) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
addListener(...)
addListener(eventName: 'authorizationStatusDidChange', listenerFunc: AuthorizationStatusDidChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle
| Param | Type |
| ------------------ | ----------------------------------------------------------------- |
| eventName
| "authorizationStatusDidChange" |
| listenerFunc
| (state: { result: AuthorizationStatus; }) => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove
| () => Promise<void> |