mp3-hls-streaming
v0.1.21
Published
Stream remote HLS and MP3 streams on iOS and Android. Capacitor 6.
Downloads
14
Readme
mp3-hls-streaming
Stream remote HLS and MP3 streams on iOS and Android.
Install
npm install mp3-hls-streaming
npx cap sync
API
play(...)
pause()
resume()
seekTo(...)
stop()
setPlaybackRate(...)
addListener('error' | 'play' | 'pause' | 'stop' | 'timeUpdate' | 'buffering', ...)
removeAllListeners()
- Interfaces
- Type Aliases
play(...)
play(options: { url: string; }) => Promise<void>
| Param | Type |
| ------------- | ----------------------------- |
| options
| { url: string; } |
pause()
pause() => Promise<void>
resume()
resume() => Promise<void>
seekTo(...)
seekTo(options: { position: number; }) => Promise<void>
| Param | Type |
| ------------- | ---------------------------------- |
| options
| { position: number; } |
stop()
stop() => Promise<void>
setPlaybackRate(...)
setPlaybackRate(options: { rate: number; }) => Promise<void>
| Param | Type |
| ------------- | ------------------------------ |
| options
| { rate: number; } |
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