Skip to main content

Player

Represents the native player and provides methods for its control.

Getter methods do not rely on the React Native bridge; they return cached values instead. Cached values are updated via the event pipeline. Setter methods use the React Native bridge to modify the native player.

Extends​

Implements​

  • default

Methods​

addEventListener()​

addEventListener(eventType, callback): void

Parameters​

ParameterType
eventTypeEventType
callbackEventCallback

Inherited from​

EventEmitter.addEventListener


destroy()​

destroy(): Promise<void>

enterPictureInPictureMode()​

enterPictureInPictureMode(): Promise<void>

exitPictureInPictureMode()​

exitPictureInPictureMode(): Promise<void>

getDuration()​

getDuration(): number

Returns the duration of the current stream in milliseconds.


getFatalError()​

getFatalError(): null | PrestoPlayError

Returns the last fatal error that occurred.


getPosition()​

getPosition(): number

Returns the current playback position in milliseconds.


getState()​

getState(): PlayerState

Returns the current player state.


getTrackManager()​

getTrackManager(): TrackManager

Returns the track manager.


getVolume()​

getVolume(): number

isLive()​

isLive(): boolean

Returns whether the player is playing a live stream.


isMuted()​

isMuted(): boolean

isPictureInPictureMode()​

isPictureInPictureMode(): boolean

isPlayWhenReady()​

isPlayWhenReady(): boolean

open()​

open(playerConfiguration): Promise<void>

Parameters​

ParameterType
playerConfigurationPlayerConfiguration

pause()​

pause(): Promise<void>

play()​

play(): Promise<void>

removeEventListener()​

removeEventListener(eventType, callback): void

Parameters​

ParameterType
eventTypeEventType
callbackEventCallback

Inherited from​

EventEmitter.removeEventListener


replay()​

replay(): Promise<void>

setMuted()​

setMuted(newMuted): Promise<void>

Parameters​

ParameterType
newMutedboolean

setPosition()​

setPosition(newPosition): Promise<void>

Seeks to a new position.

Parameters​

ParameterTypeDescription
newPositionnumberNew position in milliseconds.

setVolume()​

setVolume(newVolume): Promise<void>

Parameters​

ParameterType
newVolumenumber

stop()​

stop(): Promise<void>

supportsPictureInPicture()​

supportsPictureInPicture(): Promise<undefined | boolean>