Skip to content

nypublicradio/capacitor-remote-streamer

 
 

Repository files navigation

mp3-hls-streaming

Stream remote HLS and MP3 streams on iOS and Android.

Install

npm install mp3-hls-streaming
npx cap sync

API

play(...)

play(options: { url: string; enableCommandCenter?: boolean; enableCommandCenterSeek?: boolean; }) => Promise<void>
Param Type
options { url: string; enableCommandCenter?: boolean; enableCommandCenterSeek?: boolean; }

pause()

pause() => Promise<void>

resume()

resume() => Promise<void>

seekTo(...)

seekTo(options: { position: number; }) => Promise<void>
Param Type
options { position: number; }

stop()

stop() => Promise<void>

setVolume(...)

setVolume(options: { volume: number; }) => Promise<void>
Param Type
options { volume: number; }

setPlaybackRate(...)

setPlaybackRate(options: { rate: number; }) => Promise<void>
Param Type
options { rate: number; }

setNowPlayingInfo(...)

setNowPlayingInfo(options: { title: string; artist: string; album: string; duration: string; imageUrl: string; isLiveStream: boolean; }) => Promise<void>
Param Type
options { title: string; artist: string; album: string; duration: string; imageUrl: string; isLiveStream: boolean; }

addListener('error' | 'play' | 'pause' | 'stop' | 'timeUpdate' | 'buffering', ...)

addListener(eventName: 'play' | 'pause' | 'stop' | 'timeUpdate' | 'buffering' | 'error', listenerFunc: (data: RemoteStreamerEventData) => void) => Promise<PluginListenerHandle>
Param Type
eventName 'error' | 'play' | 'pause' | 'stop' | 'timeUpdate' | 'buffering'
listenerFunc (data: RemoteStreamerEventData) => void

Returns: Promise<PluginListenerHandle>


removeAllListeners()

removeAllListeners() => Promise<void>

Interfaces

PluginListenerHandle

Prop Type
remove () => Promise<void>

PlayEvent

Prop Type
type 'play'

PauseEvent

Prop Type
type 'pause'

StopEvent

Prop Type
type 'stop'

TimeUpdateEvent

Prop Type
type 'timeUpdate'
currentTime number

BufferingEvent

Prop Type
type 'buffering'
isBuffering boolean

ErrorEvent

Prop Type
type 'error'
message string

Type Aliases

RemoteStreamerEventData

PlayEvent | PauseEvent | StopEvent | TimeUpdateEvent | BufferingEvent | ErrorEvent

About

Stream HLS and MP3 remote streams using capacitor

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 53.4%
  • Swift 28.8%
  • TypeScript 8.1%
  • JavaScript 6.9%
  • HTML 1.8%
  • Ruby 0.9%
  • CSS 0.1%