React Native OTVPlayer

Namespace: OTVPlayer

OTVPlayer

React Native Player Plugin

Namespaces

props

Methods

staticOTVPlayer.maxResolution()

Set the maximum resolution allowed for DASH streams. You can remove the cap by setting the width and height to Infinity.

Calling this method when the user wants to cap the resolution for streams. After calling this method, OTVPlayer.props.onDownloadResChanged event is triggered from the player to specify the selected resolution

See:

staticOTVPlayer.pause()

Pause the playback of the media data.

Before calling this method props.source must be set.

After calling this method OTVPlayer.props.onPaused event is triggered

staticOTVPlayer.play()

Start or resume playback of media data.

Can be called to resume playing a stopped or paused content. Before calling this method, props.source must be set and for encrypted content props.source.token must be set.

From a stop to play scenario props.source.token can be set after play if it was reset to empty string after stop call.

After calling this method, OTVPlayer.props.onPlay event is triggered.

Callback OTVPlayer.props.onProgress is called when media data is playing in progress.

Callback OTVPlayer.props.onWaiting is called when the playback gets stalled.

staticOTVPlayer.seek(position, tolerance)

Set the current playback position of the media data.

Before calling this method, props.source must be set.

Callback OTVPlayer.props.onSeek is called when the seeking completes.

Name Type Description
position Number

The position in seconds.

tolerance Number

The tolerance in milliseconds of the seeking accuracy. Only Applicable for iOS/tvOS. Default value is 100.

See:

staticOTVPlayer.selectAudioTrack(value)

Select one audio track to render.

Calling this method only when you receive the available tracks from callback OTVPlayer.props.onTracksChanged. After calling this method, OTVPlayer.props.onTracksChanged is triggered and the selectedAudioTrack from the event is updated

Name Type Description
value OTVPlayer.props.mediaTrack

Index to the audio track selected to render.

See:

staticOTVPlayer.selectTextTrack(value)

Select one text track to render.

Calling this method only when you receive the available tracks from callback OTVPlayer.props.onTracksChanged. After calling this method, OTVPlayer.props.onTracksChanged is triggered and the selectedTextTrack from the event is updated

Name Type Description
value OTVPlayer.props.mediaTrack

Index to the text track selected to render.

See:

staticOTVPlayer.stop()

Stop the playback of the media data.

Before calling this method props.source must be set.

After calling this method OTVPlayer.props.onStopped event is triggered