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. if autoPlay in player fails then error callback |
|||||||||||||||||||||||||||||||||||||||||||||||||||
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. If nothing is passed, it is treated as undefined |
|||||||||||||||||||||||||||||||||||||||||||||||||||
maxResolution |
Object | User sets the maximum resolution to be capped. Resolution is an object with width and height. To reset the capping we need to pass NULL or Infinity as maxResolution. If nothing is passed, it is treated as undefined Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
progressUpdateInterval |
Number | The update period for the progress event in seconds with up to 3 decimal places for milliseconds. The default value will be 0.25 seconds. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
statisticsConfig |
Object | The statistics Configuration. An Object with statisticsTypes and statisticsUpdateInterval as its properties. Properties
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
thumbnail |
Object | The thumbnail configuration. An Object with thumbnail display, thumbnail position and thumbnail style 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 |
|||||||||||||||||||||||||||||||||||||||||||||||||||
onDownloadResChanged |
function | Event triggered when resolution is changed Application triggers the event from the player to specify the selected resolution SeeOTVPlayer.props.onDownloadResChanged |
|||||||||||||||||||||||||||||||||||||||||||||||||||
onThumbnailAvailable |
function | Called when the Thumbnails for the content being played become availible to be shown. Application needs to set handler to receive and handle the event. SeeOTVPlayer.props.onThumbnailAvailable |
Type Definitions
-
OTVPlayer.props.onAudioTrackSelected(event)
Callback set by application to handle event onAudioTrackSelected.
-
Name Type Description eventObject The event object.
Name Type Description indexNumber 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 eventObject The event object.
Name Type Description bitratesArray.<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 eventObject The event object.
Name Type Description widthnumber the width, in pixels, to cap the content.
heightnumber the height, in pixels, to cap the content.
-
OTVPlayer.props.onEnd(event)
Callback set by application to handle event onEnd.
-
Name Type Description eventObject The event object. This will be empty.
-
OTVPlayer.props.onError(event)
Callback set by application to handle event onError.
-
Name Type Description eventObject The event object.
Name Type Description codenumber Refer
ERROR_TABLEfor error codes.nativeErrorObject Platform specific error object
-
OTVPlayer.props.onLicenseRequest(keySystem, source, requestPayload, licenseRequestType)
Callback set by application to handle the event onLicenseRequest if application chooses to handle license requests by itself.
-
If App sets this callback prop, it will be called whenever Player wants App to provide any of the following:
- license data.
- Certificate data.
- Renewed license data.
Once the Promise is fulfilled, the data provided should be an ArrayBuffer.
If the Promise is rejected, the playback shall fail and an onError shall be triggered.
If a channel/content change is requested before fulfilling or rejecting a promise, the Player will discard the last Promise.
NOTE: Apps should make sure not to accept/reject Promises which were made for the previous content (if a new content request was made).
NOTE: Currently supported for browser-based SDK only.Name Type Description keySystemString The key System string value:
- Widevine: "com.widevine.alpha"
- Playready: "com.microsoft.playready"
- TVKey: "com.tvkey.drm" (For HbbTV supporting TVKey only)
- Fairplay: "com.apple.fps" (for Safari and iOS/tvOS devices)
sourceObject The source this request is related to:
Name Type Description srcString The resource URL. Should be what App provided as a prop: source→src.
tokenString The token string. Should be what App provided as a prop: source→token. Undefined if not provided as a prop.
typeString Mime type of the src request. Should be what App provided as a prop: source→type. Undefined if not provided as a prop.
requestPayloadArrayBuffer Payload data to be used for making license request
licenseRequestTypeString Request type:
- "license-request": a new license
- "license-renewal": a renewal of license
- "certificate-request": a certificate request (applicable for Widevine and FairPlay only).
-
OTVPlayer.props.onLoad(event)
Callback set by application to handle event onLoad.
-
Name Type Description eventObject The event object.
Name Type Description durationNumber The duration of the content in seconds.
canPlayReverseBoolean A Boolean value that indicates whether the item can be played in reverse.
Only for iOS, and the value is true for Android.canPlayFastForwardBoolean A Boolean value that indicates whether the item can be fast forwarded.
Only for iOS, and the value is true for Android.canPlaySlowForwardBoolean A Boolean value that indicates whether the item can be played slower than normal.
Only for iOS, and the value is true for Android.canPlaySlowReverseBoolean A Boolean value that indicates whether the item can be played slowly backward.
Only for iOS, and the value is true for Android.canStepBackwardBoolean A Boolean value that indicates whether the item supports stepping backward.
Only for iOS, and the value is true for Android.canStepForwardBoolean A Boolean value that indicates whether the item supports stepping forward.
Only for iOS, and the value is true for Android.naturalSizeObject Indicates the natural dimensions of the media data referenced by the track.
Name Type Description widthNumber The width of the media data.
heightNumber The height of the media data.
orientationString "landscape" or "portrait" to indicate the orientation.
-
OTVPlayer.props.onLoadStart(event)
Callback set by application to handle the event onLoadStart.
-
Name Type Description eventObject The event object.
Name Type Description srcString The Source URI of the media data.
typeString The Source type.
-
OTVPlayer.props.onPaused(event)
Callback set by application to handle event onPaused.
-
Name Type Description eventObject The event object. This will be empty.
- See:
-
OTVPlayer.props.onPlay(event)
Callback set by application to handle event onPlay.
-
Name Type Description eventObject The event object. This will be empty.
- See:
-
OTVPlayer.props.onPlaying(event)
Callback set by application to handle event onPlaying.
-
Name Type Description eventObject The event object. This will be empty.
-
OTVPlayer.props.onProgress(event)
Callback set by application to handle event onProgress.
-
Name Type Description eventObject The event object.
Name Type Description currentTimeNumber 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.
currentPositionNumber The current position of the playback in seconds.
playableDurationNumber The duration of the media data.
seekableDurationNumber 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 eventObject The event object.
Name Type Description currentPositionNumber The current position of the playback in seconds.
seekPositionNumber 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 eventObject The event object.
Name Type Description bitrateNumber 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 eventObject The event object.
Name Type Description availableBitratesArray The available bitrates while playback. Applicable for iOS/tvOS, Android and Web(DASH).
selectedBitrateNumber The selected bitrate from the available bitrate. Applicable for iOS/tvOS, Android and Web(DASH).
bitrateSwitchesNumber Number of bitrate switches happening from start to the end of the playback. Applicable for iOS/tvOS, Android.
bitrateDowngradeNumber Number of times the bitrate has switched to a lower bitrate. Applicable for iOS/tvOS, Android.
averageVideoBitrateNumber This value indicates the average video bitrate. Applicable for iOS/tvOS.
averageAudioBitrateNumber This value indicates the average audio bitrate. Applicable for iOS/tvOS.
bytesDownloadedNumber The number of bytes downloaded. Applicable for iOS/tvOS, Android.
downloadBitrateNumber The download bitrate. Applicable for iOS/tvOS, Android and Web(DASH).
downloadBitrateAverageNumber The average download bitrate. Applicable for iOS/tvOS, Android and Web(DASH).
numberOfMediaRequestsNumber The number of media read requests from the server to this client. The number of media requests Applicable for iOS/tvOS.
transferDurationNumber The accumulated duration, in seconds, of active network transfer of bytes. Applicable for iOS/tvOS.
downloadsOverdueNumber The total number of times that downloading the segments took too long. Applicable for iOS/tvOS.
finalIPAddressString IPAddress of the playing content. Applicable for iOS/tvOS, Android.
finalURLString finalURL of the content. Applicable for iOS/tvOS, Android.
urlString url of the content. Applicable for iOS/tvOS, Android and Web(HLS).
numberOfServerAddressChangesNumber A count of changes to the server address over the last uninterrupted period of playback. Applicable for iOS/tvOS.
bufferedDurationNumber The time taken to buffer. Applicable for iOS/tvOS, Android.
availableResolutionsArrayBuffer This gives the available resolutions as array of Objects. Each object contains width and height. Applicable for iOS/tvOS.
selectedResolutionObject This is the selected resolution width and resolution height. Applicable for iOS/tvOS, Android, Web(DASH) and Web(HLS).
Name Type Description widthNumber Resolution width in pixels.
heightNumber Resolution height in pixels.
streamBitrateNumber The stream bitrate. Applicable for Android and Web(DASH).
startUpTimeNumber The accumulated duration, in seconds, until the player item is ready to play. Applicable for iOS/tvOS.
numberOfStallsNumber The total number of playback stalls encountered. Applicable for iOS/tvOS.
playbackTypeString The playback type - VOD/LIVE. Applicable for iOS/tvOS.
playbackStartDateString The date and time at which playback began for this event. Applicable for iOS/tvOS.
playbackStartOffsetNumber The offset, in seconds, in the playlist where the last uninterrupted period of playback began. Applicable for iOS/tvOS.
frameDropsNumber The number of frame drops. Applicable for iOS/tvOS, Android and Web(DASH).
frameDropsPerSecondNumber The number of frame drops per second. Applicable for iOS/tvOS, Android and Web(DASH).
framesPerSecondNominalNumber {@label iOS} The number of frames per second nominal. Applicable for iOS/tvOS, Android and Web(DASH).
framesPerSecondNumber The number of frames per second. Applicable for iOS/tvOS, Android and Web(DASH).
-
OTVPlayer.props.onStopped(event)
Callback set by application to handle event onStopped.
-
Name Type Description eventObject The event object. This will be empty.
- See:
-
OTVPlayer.props.onTextTrackSelected(event)
Callback set by application to handle event onTextTrackSelected.
-
Name Type Description eventObject The event object.
Name Type Description indexNumber The native index of the text track.
-
OTVPlayer.props.onThumbnailAvailable(event)
Callback set by application to notify when thumbnails are available.
-
Name Type Description eventObject The event object. This will be empty.
-
OTVPlayer.props.onTracksChanged(event)
Callback set by application to handle event onTracksChanged.
-
Name Type Description eventObject The event object.
Name Type Description audioTracksArray.<Object> Array of available audio tracks.
audioTracks[].titleString The title of the track.
audioTracks[].languageString The language of the track.
audioTracks[].encodeTypeNumber Refer to
AUDIO_ENCODING_TYPE.textTracksArray.<Object> Array of available text tracks.
textTracks[].titleString The title of the track.
textTracks[].languageString The language of the track.
textTracks[].encodeTypeNumber Refer to
TEXT_ENCODING_TYPE.textTracks[].characteristicsArray.<String> Characteristics of the track.
-
OTVPlayer.props.onWaiting(event)
Callback set by application to handle event onWaiting.
-
Name Type Description eventObject The event object. This will be empty.