VideoPlayer
Brief
VideoPlayer is a component that implements the HTMLVideoElement
interface
that extends HTMLMediaElement
interface.
Remarks
This is a typescript class and not a react native component. Apps need
to create an instance of VideoPlayer
and use it to start buffering the content
without rendering video on screen. It doesn't render video to the screen by
default, nor does it render the media controls GUI. Apps are expected to build
their own media controls UI and control the playback experience. When the app
wants to show the video on screen, it must add KeplerVideoSurfaceView
React
Native component to the render tree, receive onSurfaceViewCreated
event and
pass the surface handle obtained in the event callback to VideoPlayer
through
the setSurfaceHandle
API.
Extends
MediaPlayer
Implements
Constructors
new VideoPlayer()
new VideoPlayer():
VideoPlayer
Returns
Brief
Constructor to create a video player instance
Overrides
MediaPlayer.constructor
Properties
controls?
optional
controls:boolean
Enable or disable the UI for media controls. For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-controls.
Implementation of
Inherited from
MediaPlayer.controls
mediaControlHandler
mediaControlHandler:
KeplerMediaControlHandler
=null
Inherited from
MediaPlayer.mediaControlHandler
mediaControlServer
mediaControlServer:
IMediaControlServerAsync
Inherited from
MediaPlayer.mediaControlServer
mediaControlStateUtil
mediaControlStateUtil:
MediaControlStateUtil
=null
Inherited from
MediaPlayer.mediaControlStateUtil
mediaKeys?
optional
mediaKeys:MediaKeys
Brief
The media keys to use to decrypt DRM protected content. For additional information, see https://www.w3.org/TR/encrypted-media/#dom-htmlmediaelement-mediakeys.
Implementation of
Inherited from
MediaPlayer.mediaKeys
mSessionId
mSessionId:
IMediaSessionId
Inherited from
MediaPlayer.mSessionId
newlyIntroducedCues
newlyIntroducedCues:
Set
<VTTCue
>
TODO
Create a TextTrackManager and TextTrackRenderer.
Inherited from
MediaPlayer.newlyIntroducedCues
seekIntervalInSec_
seekIntervalInSec_:
number
=DEFAULT_SEEK_SECONDS
Inherited from
MediaPlayer.seekIntervalInSec_
tmoa?
optional
tmoa:TimeMarchesOnAlgo
=null
Inherited from
MediaPlayer.tmoa
HAVE_CURRENT_DATA
readonly
static
HAVE_CURRENT_DATA:number
=2
For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-have_current_data.
Implementation of
HTMLVideoElement
.HAVE_CURRENT_DATA
Inherited from
MediaPlayer.HAVE_CURRENT_DATA
HAVE_ENOUGH_DATA
readonly
static
HAVE_ENOUGH_DATA:number
=4
For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-have_enough_data.
Implementation of
HTMLVideoElement
.HAVE_ENOUGH_DATA
Inherited from
MediaPlayer.HAVE_ENOUGH_DATA
HAVE_FUTURE_DATA
readonly
static
HAVE_FUTURE_DATA:number
=3
For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-have_future_data.
Implementation of
HTMLVideoElement
.HAVE_FUTURE_DATA
Inherited from
MediaPlayer.HAVE_FUTURE_DATA
HAVE_METADATA
readonly
static
HAVE_METADATA:number
=1
For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-have_metadata.
Implementation of
HTMLVideoElement
.HAVE_METADATA
Inherited from
MediaPlayer.HAVE_METADATA
HAVE_NOTHING
readonly
static
HAVE_NOTHING:number
=0
For additional information, see https://html.spec.whatwg.org/multipage/media.html#dom-media-have_nothing.
Implementation of
Inherited from
MediaPlayer.HAVE_NOTHING
isAppManifestParsed
static
isAppManifestParsed:boolean
=false
Inherited from
MediaPlayer.isAppManifestParsed
isPlayerSessionEnabled
static
isPlayerSessionEnabled:boolean
=true
Inherited from
MediaPlayer.isPlayerSessionEnabled
mediaSessionID_
static
mediaSessionID_:number
=0
Inherited from
MediaPlayer.mediaSessionID_
playerSessionClient
static
playerSessionClient:PlayerSessionClient
=null
Inherited from
MediaPlayer.playerSessionClient
Methods
addCue()
addCue(
cue
):void
TextTrackManager Should take care of these
Parameters
cue
Returns
void
Inherited from
MediaPlayer.addCue
clearCaptionViewHandle()
clearCaptionViewHandle(
captionViewHandle
):void
Parameters
captionViewHandle
string
Returns
void
Brief
Clears the captions view handle to the player. @param[in] captionViewHandle Handle to the captions view.
Inherited from
MediaPlayer.clearCaptionViewHandle
clearSurfaceHandle()
clearSurfaceHandle(
surfaceHandle
):void
Parameters
surfaceHandle
string
Returns
void
Brief
Sets the surface handle to which video is rendered.
@param[in] surfaceHandle
The surface handle returned by onSurfaceViewCreated
event emitted
by KeplerVideoSurfaceView
component.
deinitialize()
deinitialize():
Promise
<void
>
Returns
Promise
<void
>
Promise that is resolved when player is deInitialized.
Brief
DeInitiailzes the player.
Overrides
MediaPlayer.deinitialize
deinitializeSync()
deinitializeSync(
timeoutInMs
):MediaPlayerDeInitStatus
Parameters
timeoutInMs
number
time out threshold set by client to return the deinit control.
Returns
MediaPlayerDeInitStatus
MediaPlayerDeInitStatus
Brief
DeInitiailzes the player synchronously
Overrides
MediaPlayer.deinitializeSync
getVideoPlaybackQuality()
getVideoPlaybackQuality():
VideoPlaybackQuality
Returns
Brief
Fetches video playback quality attributes.
Implementation of
HTMLVideoElement
.getVideoPlaybackQuality
initialize()
initialize():
Promise
<void
>
Returns
Promise
<void
>
Promise that is resolved when player is initialized..
Brief
Initiailzes the player. Wait for the promise to be fulfilled before calling any other fucntion.
Overrides
MediaPlayer.initialize
removeCue()
removeCue(
cue
):void
Parameters
cue
Returns
void
Inherited from
MediaPlayer.removeCue
runTMOAlgo()
runTMOAlgo():
void
Returns
void
Inherited from
MediaPlayer.runTMOAlgo
setCaptionViewHandle()
setCaptionViewHandle(
captionViewHandle
):void
Parameters
captionViewHandle
string
Returns
void
Brief
Sets the captions view handle to the player. @param[in] captionViewHandle Handle to the captions view.
Inherited from
MediaPlayer.setCaptionViewHandle
setMediaControlFocus()
setMediaControlFocus(
componentInstance
,mediaControlHandler
?):Promise
<void
>
Parameters
componentInstance
IComponentInstance
mediaControlHandler?
IMediaControlHandlerAsync
Returns
Promise
<void
>
Brief
setup the component instance with current mediaplayer being used and pass mediaControlHandler in case client wants to opt handling of mediacontrol commands.
Overrides
MediaPlayer.setMediaControlFocus
setSurfaceHandle()
setSurfaceHandle(
surfaceHandle
):void
Parameters
surfaceHandle
string
Returns
void
Brief
Sets the surface handle to which video is rendered.
@param[in] surfaceHandle
The surface handle returned by the onSurfaceViewCreated
event emitted
by KeplerVideoSurfaceView
component.
triggerTMOAIfNeeded()
triggerTMOAIfNeeded(
cue
):void
Parameters
cue
Returns
void
Inherited from
MediaPlayer.triggerTMOAIfNeeded
Last updated: Oct 02, 2025