Interface: PlayerSdkApi
Methods
destroy
▸ destroy(): Promise
<void
>
Destroys the player and frees up the resources it uses.
Returns
Promise
<void
>
Promise that switches to the fulfilled
state once the player is deleted.
getState
▸ getState(): PlayerSdkState
Returns the state of PlayerSdk.
Returns
off
▸ off<EventName
>(eventName
, handler
): void
Unsubscribes from a player event.
Type parameters
Name | Type |
---|---|
EventName |
extends PlayerSdkEvents |
Parameters
Name | Type | Description |
---|---|---|
eventName |
EventName |
Event name |
handler |
PlayerSdkEventHandlers [EventName ] |
Event handler |
Returns
void
on
▸ on<EventName
>(eventName
, handler
): void
Subscribes to a player event.
Type parameters
Name | Type |
---|---|
EventName |
extends PlayerSdkEvents |
Parameters
Name | Type | Description |
---|---|---|
eventName |
EventName |
Event name |
handler |
PlayerSdkEventHandlers [EventName ] |
Event handler |
Returns
void
once
▸ once<EventName
>(eventName
, handler
): void
Subscribes to a single-time triggering of a player event.
Type parameters
Name | Type |
---|---|
EventName |
extends PlayerSdkEvents |
Parameters
Name | Type | Description |
---|---|---|
eventName |
EventName |
Event name |
handler |
PlayerSdkEventHandlers [EventName ] |
Event handler |
Returns
void
pause
▸ pause(): void
Returns
void
play
▸ play(): Promise
<void
>
Returns
Promise
<void
>
Promise that switches to the fulfilled
state once the video playback starts.
seek
▸ seek(time
): void
Rewinds or fast forward a video to a specific position.
Parameters
Name | Type | Description |
---|---|---|
time |
Seconds |
Time in seconds |
Returns
void
setMuted
▸ setMuted(muted
): void
Mutes/unmutes a video.
Parameters
Name | Type | Description |
---|---|---|
muted |
boolean |
True to mute, false to unmute |
Returns
void
setSource
▸ setSource(sourceConfig
): Promise
<void
>
Parameters
Name | Type | Description |
---|---|---|
sourceConfig |
PlayerSdkSourceConfig |
Video source to switch to and its parameters |
Returns
Promise
<void
>
Promise that switches to the fulfilled
state once the main player resources are freed up.
setVolume
▸ setVolume(volume
): void
Sets the sound volume of a video.
Parameters
Name | Type | Description |
---|---|---|
volume |
Volume |
Video volume from 0 (muted) to 1 (maximum volume) |
Returns
void