Public properties
Properties:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
source |
Object | Source for the content to be played. Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
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. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
maxBitrate |
Number | User sets the maximum bitrate to be capped. To reset the capping we need to pass NULL or Infinity as maxBitrate. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
progressUpdateInterval |
Number | The update period for the progress event in milliseconds. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
statisticsConfig |
Object | The statistics Configuration. An Object with statisticsTypes and statisticsUpdateInterval as its properties. Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
onLoadStart |
function | Get called when the video starts loading. Application needs to set handler to receive and handle information from the event. SeeOTVPlayer.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. SeeOTVPlayer.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. SeeOTVPlayer.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. SeeOTVPlayer.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. SeeOTVPlayer.props.onAudioTrackSelected |
|||||||||||||||||||||||||||||||||||||||||||||||||||
onProgress |
function | Called when the video playback progresses. Application needs to set handler to receive and handle information from the event. SeeOTVPlayer.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. SeeOTVPlayer.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. SeeOTVPlayer.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. SeeOTVPlayer.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. SeeOTVPlayer.props.onPlay . |
|||||||||||||||||||||||||||||||||||||||||||||||||||
onError |
function | Called when OTVPlayerView has encountered an error it will return an errorType, error and error message. Application needs to set handler to receive and handle information from the event. SeeOTVPlayer.props.onError |
|||||||||||||||||||||||||||||||||||||||||||||||||||
onWaiting |
function | Called when playback has stalled. Application needs to set handler to receive and handle the event. SeeOTVPlayer.props.onWaiting |
|||||||||||||||||||||||||||||||||||||||||||||||||||
onStopped |
function | Called when the player stop playback of the video, after stop api call. Application needs to set handler to receive and handle the event. SeeOTVPlayer.props.onStopped |
|||||||||||||||||||||||||||||||||||||||||||||||||||
onStatisticsUpdate |
function | Gets called periodically to display the stats. Application needs to set handler to receive and handle information from the event. SeeOTVPlayer.props.onStatisticsUpdate |
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.onBitratesAvailable(event)
Callback set by application to handle event onBitratesAvailable.
-
If provided by the App, will be triggered by the RN Plugin once bitrates information is available for a currently played content.
Name Type Description event
Object The event object.
Name Type Description bitrates
Array.<Number> Array of bitrates (in bits per second) for the currently selected content.
-
OTVPlayer.props.onDownloadResChanged(event)
Callback given by application to the player for getting the event onDownloadResChanged.
-
Name Type Description event
Object The event object.
Name Type Description width
number the width, in pixels, to cap the content.
height
number the height, in pixels, to cap the content.
-
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 forwarded.
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.
-
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 currentTime
Number The current time from the content of the playback in seconds.
- For VOD content, the value is the current playback time between 0 and total duration (
event.seekableDuration
). - For LIVE content, the value is the program date time of the current playback.
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 equal to the seekable windows size in seconds.
- For VOD content, the value is the current playback time between 0 and total duration (
-
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 props.seek.position.
- See:
-
OTVPlayer.props.onSelectedBitrateChanged(event)
Callback set by application to handle event onSelectedBitrateChanged.
-
If provided by the App, will be triggered by the RN Plugin on every change of bitrate at which the current content is running.
This is the actual rate at which content is running (depending on currently available bandwidth on the Client).Name Type Description event
Object The event object.
Name Type Description bitrate
Number bitrate in bits per second.
-
OTVPlayer.props.onStatisticsUpdate(event)
Callback set by application to handle the event onStatisticsUpdate and display required statistics.
-
Name Type Description event
Object The event object.
Name Type Description framesPerSecondNominal
String The number of frames per second nominal.
framesPerSecond
String The number of frames per second.
frameDrops
String The number of frame drops.
frameDropsPerSecond
String The number of frame drops per second.
availableBitrates
String The available bitrates while playback.
selectedBitrate
String The selected bitrate from the available bitrate.
bytesDownloaded
String The number of bytes downloaded.
downloadBitrate
String The download bitrate.
downloadBitrateAverage
String The average download bitrate.
streamBitrate
String The stream bitrate.
resolution
String The resolution of the content.
-
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.
audioTracks[].title
String The title of the track.
audioTracks[].language
String The language of the track.
audioTracks[].encodeType
Number Refer to
AUDIO_ENCODING_TYPE
.textTracks
Array.<Object> Array of available text tracks.
textTracks[].title
String The title of the track.
textTracks[].language
String The language of the track.
textTracks[].encodeType
Number Refer to
TEXT_ENCODING_TYPE
.textTracks[].characteristics
Array.<String> Characteristics of the 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.