React Native Player Plugin
Namespaces
Methods
-
staticOTVPlayer.pause()
Pause the playback of the media data.
-
Before calling this method props.source must be set.
After calling this methodOTVPlayer.props.onPausedevent 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 at the same time or be set in 5 seconds after set source.
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.onPlayevent is triggered. CallbackOTVPlayer.props.onProgressis called when media data is playing in progress. CallbackOTVPlayer.props.onWaitingis 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.
CallbackOTVPlayer.props.onSeekis called when the seeking completes.Name Type Description positionNumber The position in seconds.
toleranceNumber The tolerance in milliseconds of the seeking accuracy. Only Applicable for iOS/tvOS. Default value is 100.
-
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.onTracksChangedis triggered and the selectedAudioTrack from the event is updatedName Type Description valueOTVPlayer.props.mediaTrack Index to the audio track selected to render.
-
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.onTracksChangedis triggered and the selectedTextTrack from the event is updatedName Type Description valueOTVPlayer.props.mediaTrack Index to the text track selected to render.
-
staticOTVPlayer.stop()
Stop the playback of the media data.
-
Before calling this method props.source must be set.
After calling this methodOTVPlayer.props.onStoppedevent is triggered