RDK Media Player

API
Published: October 24, 2019
Edited: November 29, 2019

Methods

play

Parameters:  none

Return Value:  void

Description:  starts video playback

pause

Parameters:  none

Return Value:  void

Description:  pauses video playback. Equivalent to speed = 1

stop

Parameters:  none

Return Value:  void

Description:  stops video playback. Video is not expected to resume.

setSpeed

Parameters:  speed - Number overshootCorrection - Number (milliseconds)

Return Value:  void

Description:  sets the speed and adjusts the position of the video by the number of milliseconds specified by overshootCorrectionrn

setPositionRelative

Parameters:  seconds - Number

Return Value:  void

Description:  Sets the position of the video by adding the given number of seconds. seconds may be positive or negative, but should not cause the position to be less than zero or greater than the duration.rn

requestStatus

Parameters:  none

Return Value:  void

Description:  Requests the onStatus event to be firedrn

setAdditionalAuth

Parameters:  params - Object

Return Value:  void

Description:  provides a set of k/v pairs required for additional authentication and authorizationrn

Properties

Properties

url

Read or Write:   r/w

Data Type:   String

Description:   video content URL

contentOptions

Read or Write:   r/w

Data Type:   Object

Description:   hash of k/v pairs required for content playback

autoPlayt

Read or Write:   r/w

Data Type:   Boolean

Description:   when true, video starts playing immediately; when false, playback must be manually started.

audioLanguage

Read or Write:   r/w

Data Type:   String

Description:   primary audio language. If set to a value that does not exist for the content, value will not be changed.

secondaryAudioLanguaget

Read or Write:   r/w

Data Type:   String

Description:   secondary audio language. If set to a value that does not exist for the content, value will not be changed

closedCaptionsLanguaget

Read or Write:   r/w

Data Type:   String

Description:   closed captions language. If set to a value that does not exist for the content, value will not be changed.

closedCaptionsEnabledt

Read or Write:   r/w

Data Type:   Boolean

Description:   when true, closed captioning is enabled; when false, closed captioning is disabled

closedCaptionsOptionst

Read or Write:   r/w

Data Type:   Object

Description:   caption options

position

Read or Write:   r/w

Data Type:   Number

Description:   position of video

speed

Read or Write:   r/w

Data Type:   Number

Description:   playback speed

volume

Read or Write:   r/w

Data Type:   Number

Description:   a value from 0 to 100. Defaults to 100.

zoomt

Read or Write:   r/w

Data Type:   String

Description:   "FULL" or "NONE". When FULL, content is stretched to width and height of player. When NONE, content is best fit to width or height of player without distorting the video's aspect ratio.

durationt

Read or Write:   r

Data Type:   Number

Description:   duration of video in milliseconds

availableAudioLanguages

Read or Write:   r

Data Type:   String [ ]

Description:   array of the available audio languages for this video

availableClosedCaptionsLanguagest

Read or Write:   r

Data Type:   String [ ]

Description:   array of the available captions langu ages for this video

availableSpeeds

Read or Write:   r

Data Type:   String [ ]

Description:   array of the available playback speeds for this video

tsbEnabled

Read or Write:   r/w

Data Type:   Boolean

Description:   when false, TSB will not be available. when true, TSB may be available if video and device support it.

Events

onMediaOpened

Payload:  
mediaType – String – has one of the following values: live, liveTSB, recorded
width – Number
height – Number
availableSpeeds – Number
availableAudioLanguages – String [ ]
availableClosedCaptionsLanguages – String [ ]
customProperties – Object
mediaSegments – Object

Description:   Fired when video content has been opened

onClosed

Payload:   none

Description:   fired when the video stream is closed

onPlayerInitialized

Payload:   none

Description:   fired when the video player is initialized

onBuffering

Payload:   none

Description:   fired when video starts buffering. playback is not possible at this time.

onPlaying

Payload:   none

Description:   fired when video starts playing for the first time

onPaused

Payload:   none

Description:   fired when video is paused (or speed is set to 0)

onComplete

Payload:   none

Description:   fired when video is reaches its end, VOD or cDVR for example

onIndividualizing

Payload:   none

Description:   fired when player is individualizing. Playback is not possible. Not all instances will fire this event

onAcquiringLicense

Payload:   none

Description:   fired when player is acquiring a license. Playback is not yet possible. Not all instances will fire this event.

onProgress

Payload:   position – Number – current position in milliseconds
duration – Number – length of content in milliseconds (recorded video only)
speed – Number – current playback speed
start – Number – start position of the TSB buffer, -1 when no buffer available
end – Number – end position of the TSB buffer, -1 when no buffer available

Description:   fired periodically when player progresses

onWarning

Payload:   code – Number
description – String

Description:   fired when a warning occurs. video playback will likely continue.

onError

Payload:   code – Number
description – String

Description:   fired when an error occurs. video playback will terminate.

onSpeedChange

Payload:   speed – Number

Description:   fired when playback speed changes

onDRMMetadata

Payload:   props – Objec

Description:   fired when DRM metadata is acquired. Contains DRM related properties

onSegmentStarted

Payload:   segmentType – String
duration – Number
segmentId – String
segment – Object

Description:   fired when a new segment is started.

onSegmentCompleted

Payload:   segmentType – String
duration – Number
segmentId – String
segment – Object

Description:   fired when a segment is has completed

onSegmentWatched

Payload:   segmentType – String
duration – Number
segmentId – String
segment – Object

Description:   fired when a segment has been started and completed

onBufferWarning

Payload:   warningType – String – one of BUFFER_UNDERFLOW or BUFFER_OVERFLOW
bufferSize – Number – total size of buffer
bufferFillSize – Number – current filled size of buffer

onPlaybackSpeedsChanged

Payload:   availableSpeeds – String [ ]

Description:   fired when playback speeds have changed. This may happen when the video switches from one segment to the next.

onAdditionalAuthRequired

Payload:   locator – String
eventId – String

Description:   fired when video needs additional auth to continue playback

onBitrateChanges

Payload:   bitrate – Number
reason – String – descriptive reason for change

Description:   fired when the player selects a new bitrate to playback with. this can happen multiple times for adaptive streams, or once at the start of non-adaptive

onStatus

Payload:   position duration width height bufferPercentage connectionURL dynamicProps isBuffering isLive netStreamInfo

Description:   fired in response to requestStatus