OTV Player React Native

Namespace: props

OTVPlayer. props

Public properties

Properties:
Name Type Description
source Object

Source for the content to be played.

Properties
Name Type Description
src String

Source URI of the content.

type String

Mime type of the content.

token String

The SSP stream token in base64. It is required for SSP encrypted stream, not required for clear stream.

tokenType String

The SSPHeader type, defualts as nv-authorizations

adtagurl String

The IMA ads tag url. Optional.

textTracks Array.<Object>

The side loaded text track for the content. Optional.

textTracks[].url Number

The url of text track source.

textTracks[].mimeType String

The mime type of the text track.

textTracks[].language String

The language of the text track.

drm String

The drm configuration for the encrypted media data Optional.

Properties
Name Type Description
type String

The drm scheme for the media data. (Fairplay, Widevine, Playready, or TVKey) Optional.

certificateURL String

The DRM Certificate URL

licenseURL String

The DRM License URL

ssmServerURL String

The Secure Session Management(SSM) Server URL

ssmSyncMode String

The flag indicates whether the SSM is in sync mode.

autoplay Boolean

Whether to autoplay the video. Default value is false.

volume Number

The volume for playback (0-1).

muted Boolean

Whether the player is muted or not. Default value is false.

progressUpdateInterval Number

The update period for the progress event in milliseconds.

onLoadStart function

Get called when the video starts loading.

Application needs to set handler to receive and handle information from the event.

See OTVPlayer.props.onLoadStart

onLoad function

Get called when the video has finished loading.

Application needs to set handler to receive and handle information from the event.

See OTVPlayer.props.onLoad

onTracksChanged function

Called when a change has occurred to the player's tracks (i.e. addition, removal or select/deselect a track).

Application needs to set handler to receive and handle information from the event.

See OTVPlayer.props.onTracksChanged

onTextTrackSelected function

Called when a change to the text track that has been selected (i.e. user select/deselect a track).

Application needs to set handler to receive and handle information from the event.

See OTVPlayer.props.onTextTrackSelected

onAudioTrackSelected function

Called when a change to the audio track that has been selected (i.e. user select/deselect a track).

Application needs to set handler to receive and handle information from the event.

See OTVPlayer.props.onAudioTrackSelected

onProgress function

Called when the video playback progresses.

Application needs to set handler to receive and handle information from the event.

See OTVPlayer.props.onProgress

onSeek function

Called when the player has completed a seek operation.

Application needs to set handler to receive and handle information from the event.

See OTVPlayer.props.onSeek

onEnd function

Called when the player has completed playback of the video to its end.

Application needs to set handler to receive and handle information from the event.

See OTVPlayer.props.onEnd

onPaused function

Called when the player has paused playback of the video.

Application needs to set handler to receive and handle the event.

See OTVPlayer.props.onPaused

onPlay function

Called when the player starts or resumes playback of the video.

Application needs to set handler to receive and handle the event.

See OTVPlayer.props.onPlay

onError function

Called when OTVPlayerView has encouted an error it will return an errorType, error and error message.

Application needs to set handler to receive and handle information from the event.

See OTVPlayer.props.onError

onWaiting function

Called when playback has stalled.

Application needs to set handler to receive and handle the event.

See OTVPlayer.props.onWaiting

onStopped function

Called when the player stop playback of the video, after stop api call. This event currently works on Web platform only.

Application needs to set handler to receive and handle the event.

See OTVPlayer.props.onStopped

Type Definitions

OTVPlayer.props.onAudioTrackSelected(event)

Callback set by application to handle event onAudioTrackSelected.

Name Type Description
event Object

The event object.

Name Type Description
index Number

The native index of the audio track.

OTVPlayer.props.onEnd(event)

Callback set by application to handle event onEnd.

Name Type Description
event Object

The event object. This will be empty.

OTVPlayer.props.onError(event)

Callback set by application to handle event onError.

Name Type Description
event Object

The event object.

Name Type Description
code number

Refer ERROR_TABLE for error codes.

nativeError Object

Platform specific error object

OTVPlayer.props.onLoad(event)

Callback set by application to handle event onLoad.

Name Type Description
event Object

The event object.

Name Type Description
duration Number

The duration of the content in seconds.

canPlayReverse Boolean

A Boolean value that indicates whether the item can be played in reverse.

Only for iOS, and the value is true for Android.

canPlayFastForward Boolean

A Boolean value that indicates whether the item can be fast forwared.

Only for iOS, and the value is true for Android.

canPlaySlowForward Boolean

A Boolean value that indicates whether the item can be played slower than normal.

Only for iOS, and the value is true for Android.

canPlaySlowReverse Boolean

A Boolean value that indicates whether the item can be played slowly backward.

Only for iOS, and the value is true for Android.

canStepBackward Boolean

A Boolean value that indicates whether the item supports stepping backward.

Only for iOS, and the value is true for Android.

canStepForward Boolean

A Boolean value that indicates whether the item supports stepping forward.

Only for iOS, and the value is true for Android.

naturalSize Object

Indicates the natural dimensions of the media data referenced by the track.

Name Type Description
width Number

The width of the media data.

height Number

The height of the media data.

orientation String

"landscape" or "portrait" to indicate the orientation.

OTVPlayer.props.onLoadStart(event)

Callback set by application to handle the event onLoadStart.

Name Type Description
event Object

The event object.

Name Type Description
src String

The Source URI of the media data.

type String

The Source type. Not implemented.

OTVPlayer.props.onPaused(event)

Callback set by application to handle event onPaused.

Name Type Description
event Object

The event object. This will be empty.

See:

OTVPlayer.props.onPlay(event)

Callback set by application to handle event onPlay.

Name Type Description
event Object

The event object. This will be empty.

See:

OTVPlayer.props.onPlaying(event)

Callback set by application to handle event onPlaying.

Name Type Description
event Object

The event object. This will be empty.

OTVPlayer.props.onProgress(event)

Callback set by application to handle event onProgress.

Name Type Description
event Object

The event object.

Name Type Description
currentPosition Number

The current position of the playback in seconds.

playableDuration Number

The duration of the media data.

seekableDuration Number

The seekable duration of the media data.

  • For VOD content, the value is equal to event.playableDuration.
  • For LIVE content, the value is equel to the seekable windows size in seconds.

OTVPlayer.props.onSeek(event)

Callback set by application to handle event onSeek.

Name Type Description
event Object

The event object.

Name Type Description
currentPosition Number

The current position of the playback in seconds.

seekPosition Number

The seek position value set from this.props.seek.position.

See:

OTVPlayer.props.onStopped(event)

Callback set by application to handle event onStopped.

Name Type Description
event Object

The event object. This will be empty.

See:

OTVPlayer.props.onTextTrackSelected(event)

Callback set by application to handle event onTextTrackSelected.

Name Type Description
event Object

The event object.

Name Type Description
index Number

The native index of the text track.

OTVPlayer.props.onTracksChanged(event)

Callback set by application to handle event onTracksChanged.

Name Type Description
event Object

The event object.

Name Type Description
audioTracks Array.<Object>

Array of available audio tracks.

textTracks Array.<Object>

Array of available text traks.

textTracks[].index Number

The native index of the text track.

textTracks[].title String

The title of the track.

textTracks[].language String

The language of the track.

textTracks[].enabled Boolean

Flag to indicate if this is the active track

Properties:
Name Type Description
event.audioTracks[].index Number

The native index of the audio track.

event.audioTracks[].title String

The title of the track.

event.audioTracks[].language String

The language of the track.

event.audioTracks[].enabled Boolean

Flag to indicate if this is the active track

OTVPlayer.props.onWaiting(event)

Callback set by application to handle event onWaiting.

Name Type Description
event Object

The event object. This will be empty.