OTV Player React Native

Namespace: OTVPlayer

OTVPlayer

React Native Player Plugin

Example

<OTVPlayer ref={otvplayer => this.otvplayer.ref = otvplayer}
			style={styles.player.video}
			source={
				src: "https://BigBuckBunny.mpd,
				type: "application/dash+xml"
				token: "base64 token",
				tokenType: "nv-authorizations"
				adTagURL: "https://this.is.a.url.to.an.IMA.ad",
				textTracks: [{
					url: "https://BigBuckBunny.subtitles.srt",
					mimeType: "application/x-subrip",
					language: "eng"
				}],
				drm: {
					type: "Widevine",
					certificateURL: "certificate server URL",
					licenseURL: "license server URL",
					ssmServerURL: "SSM server URL",
					ssmSyncMode: 0
				}
			}
			autoplay={true}
			progressUpdateInterval={1000}
			muted={false}
			volume={1.0}
			onLoadStart={ console.log("OnLoadStart event called"); }
			onLoad={ console.log("OnLoad event called"); }
			onProgress={ console.log("onProgress event called"); }
			onPaused={ console.log("onPaused event called"); }
			onPlay={ console.log("onPlay event called"); }
			onEnd={ console.log("onEnd event called"); }
			onTracksChanged={ console.log("onTracksChanged event called"); }
			onAudioTrackSelected={ console.log("onAudioTrackSelected event called"); }
			onTextTrackSelected={ console.log("onTextTrackSelected event called"); }
			onError={ console.log("onError event called"); }
			onWaiting={ console.log("onWaiting event called"); }
			onPlaying={ console.log("onPlaying event called"); }
			onStopped={ console.log("onStopped event called"); }
			/>

/**

Namespaces

props

Methods

staticOTVPlayer.pause()

Pause the playback of the media data.

Before calling this method this.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, this.props.source must be set.

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, this.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 triggerded 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 triggerded 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. This api currently works on Web platform only

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

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