@capgo/ivs-player
TypeScript icon, indicating that this package has built-in type declarations

6.0.1 • Public • Published

@capgo/ivs-player

Capgo - Instant updates for capacitor

Ivs player for Capacitor app Android and IOS.

Install

npm install @capgo/ivs-player
npx cap sync

API

create(...)

create(options: { url: string; pip?: boolean; title?: string; subtitle?: string; cover?: string; autoPlay?: boolean; toBack?: boolean; x?: number; y?: number; width?: number; height?: number; }) => Promise<void>
Param Type
options { url: string; pip?: boolean; title?: string; subtitle?: string; cover?: string; autoPlay?: boolean; toBack?: boolean; x?: number; y?: number; width?: number; height?: number; }

start()

start() => Promise<void>

cast()

cast() => Promise<void>

getCastStatus()

getCastStatus() => Promise<{ isActive: boolean; }>

Returns: Promise<{ isActive: boolean; }>


pause()

pause() => Promise<void>

delete()

delete() => Promise<void>

getUrl()

getUrl() => Promise<{ url: string; }>

Returns: Promise<{ url: string; }>


getState()

getState() => Promise<{ state: CapacitorIvsPlayerState; }>

Returns: Promise<{ state: CapacitorIvsPlayerState; }>


setPlayerPosition(...)

setPlayerPosition(options?: { toBack: boolean; } | undefined) => Promise<void>
Param Type
options { toBack: boolean; }

getPlayerPosition()

getPlayerPosition() => Promise<{ toBack: boolean; }>

Returns: Promise<{ toBack: boolean; }>


setAutoQuality(...)

setAutoQuality(options?: { autoQuality?: boolean | undefined; } | undefined) => Promise<void>
Param Type
options { autoQuality?: boolean; }

getAutoQuality()

getAutoQuality() => Promise<{ autoQuality: boolean; }>

Returns: Promise<{ autoQuality: boolean; }>


setPip(...)

setPip(options?: { pip?: boolean | undefined; } | undefined) => Promise<void>
Param Type
options { pip?: boolean; }

getPip()

getPip() => Promise<{ pip: boolean; }>

Returns: Promise<{ pip: boolean; }>


setFrame(...)

setFrame(options?: { x?: number | undefined; y?: number | undefined; width?: number | undefined; height?: number | undefined; } | undefined) => Promise<void>

Set the frame of the player view, all number have to be positive and integers

Param Type Description
options { x?: number; y?: number; width?: number; height?: number; } : number, y: number, width: number, height: number}

Since: 1.0.0


getFrame()

getFrame() => Promise<CapacitorFrame>

Returns: Promise<CapacitorFrame>


setBackgroundState(...)

setBackgroundState(options: { backgroundState: CapacitorIvsPlayerBackgroundState; }) => Promise<void>
Param Type
options { backgroundState: CapacitorIvsPlayerBackgroundState; }

getBackgroundState()

getBackgroundState() => Promise<{ backgroundState: CapacitorIvsPlayerBackgroundState; }>

Returns: Promise<{ backgroundState: CapacitorIvsPlayerBackgroundState; }>


setMute(...)

setMute(options?: { muted?: boolean | undefined; } | undefined) => Promise<void>
Param Type
options { muted?: boolean; }

getMute()

getMute() => Promise<{ mute: boolean; }>

Returns: Promise<{ mute: boolean; }>


setQuality(...)

setQuality(options?: { quality: string; } | undefined) => Promise<void>
Param Type
options { quality: string; }

getQuality()

getQuality() => Promise<{ quality: string; }>

Returns: Promise<{ quality: string; }>


getQualities()

getQualities() => Promise<{ qualities: string[]; }>

Returns: Promise<{ qualities: string[]; }>


getPluginVersion()

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

Get the native Capacitor plugin version

Returns: Promise<{ version: string; }>


addListener('startPip', ...)

addListener(eventName: "startPip", listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for start pip

Param Type
eventName 'startPip'
listenerFunc () => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('stopPip', ...)

addListener(eventName: "stopPip", listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for stop pip

Param Type
eventName 'stopPip'
listenerFunc () => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('expandPip', ...)

addListener(eventName: "expandPip", listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for expend pip

Param Type
eventName 'expandPip'
listenerFunc () => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('closePip', ...)

addListener(eventName: "closePip", listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for close pip

Param Type
eventName 'closePip'
listenerFunc () => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onState', ...)

addListener(eventName: "onState", listenerFunc: (data: { state: CapacitorIvsPlayerState; }) => void) => Promise<PluginListenerHandle>

Listen for state changes

Param Type
eventName 'onState'
listenerFunc (data: { state: CapacitorIvsPlayerState; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onCues', ...)

addListener(eventName: "onCues", listenerFunc: (data: { cues: string; }) => void) => Promise<PluginListenerHandle>

Listen for cue changes

Param Type
eventName 'onCues'
listenerFunc (data: { cues: string; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onDuration', ...)

addListener(eventName: "onDuration", listenerFunc: (data: { duration: number; }) => void) => Promise<PluginListenerHandle>

Listen for duration changes

Param Type
eventName 'onDuration'
listenerFunc (data: { duration: number; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onError', ...)

addListener(eventName: "onError", listenerFunc: (data: { error: string; }) => void) => Promise<PluginListenerHandle>

Listen for errors

Param Type
eventName 'onError'
listenerFunc (data: { error: string; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onRebuffering', ...)

addListener(eventName: "onRebuffering", listenerFunc: () => void) => Promise<PluginListenerHandle>

Listen for rebuffering

Param Type
eventName 'onRebuffering'
listenerFunc () => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onSeekCompleted', ...)

addListener(eventName: "onSeekCompleted", listenerFunc: (data: { position: number; }) => void) => Promise<PluginListenerHandle>

Listen for position changes

Param Type
eventName 'onSeekCompleted'
listenerFunc (data: { position: number; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onVideoSize', ...)

addListener(eventName: "onVideoSize", listenerFunc: (data: { width: number; height: number; }) => void) => Promise<PluginListenerHandle>

Listen for video size changes

Param Type
eventName 'onVideoSize'
listenerFunc (data: { width: number; height: number; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onQuality', ...)

addListener(eventName: "onQuality", listenerFunc: (data: { quality: string; }) => void) => Promise<PluginListenerHandle>

Listen for quality changes

Param Type
eventName 'onQuality'
listenerFunc (data: { quality: string; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


addListener('onCastStatus', ...)

addListener(eventName: "onCastStatus", listenerFunc: (data: { isActive: boolean; }) => void) => Promise<PluginListenerHandle>

Listen for cast status changes

Param Type
eventName 'onCastStatus'
listenerFunc (data: { isActive: boolean; }) => void

Returns: Promise<PluginListenerHandle>

Since: 1.0.0


removeAllListeners()

removeAllListeners() => Promise<void>

Remove all listeners for this plugin.

Since: 1.0.0


Interfaces

CapacitorFrame

Prop Type
x number
y number
width number
height number

PluginListenerHandle

Prop Type
remove () => Promise<void>

Type Aliases

CapacitorIvsPlayerState

"IDLE" | "BUFFERING" | "READY" | "PLAYING" | "ENDED" | "UNKNOWN"

CapacitorIvsPlayerBackgroundState

"PAUSED" | "PLAYING"

Credits

This plugin was created originally for Kick.com by Capgo

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
6.0.15latest

Version History

VersionDownloads (Last 7 Days)Published
6.0.15
6.0.01
0.13.510
0.13.500
0.13.490
0.13.480
0.13.470
0.13.460
0.13.450
0.13.430
0.13.420
0.13.410
0.13.400
0.13.390
0.13.380
0.13.361
0.13.341
0.13.331
0.13.321
0.13.311
0.13.301
0.13.291
0.13.281
0.13.271
0.13.241
0.13.231
0.13.221
0.13.161
0.13.151
0.13.101
0.13.91
0.13.81
0.13.71
0.13.51
0.13.41
0.13.31
0.13.21
0.13.11
0.13.01
0.12.21
0.12.11
0.12.01
0.11.21
0.11.11
0.11.02
0.10.261
0.10.251
0.10.241
0.10.231
0.10.221
0.10.211
0.10.201
0.10.191
0.10.182
0.10.161
0.10.151
0.10.141
0.10.131
0.10.121
0.10.101
0.10.91
0.10.81
0.10.71
0.10.61
0.10.51
0.10.41
0.10.31
0.10.21
0.10.11
0.10.01
0.9.31
0.9.21
0.9.11
0.9.01
0.8.81
0.8.71
0.8.61
0.8.51
0.8.41
0.8.31
0.8.21
0.8.11
0.8.01
0.7.01
0.6.21
0.6.11
0.6.01
0.5.21
0.5.11
0.5.01
0.4.01
0.3.11
0.3.01
0.2.21
0.2.11
0.2.01
0.1.01
0.0.121
0.0.111
0.0.101
0.0.91
0.0.81
0.0.71
0.0.61
0.0.51
0.0.41
0.0.31
0.0.21
0.0.11

Package Sidebar

Install

npm i @capgo/ivs-player

Weekly Downloads

102

Version

6.0.1

License

MIT

Unpacked Size

162 kB

Total Files

34

Last publish

Collaborators

  • riderx