VideoPlayer
*
VideoPlayer is a component that implements the HTMLVideoElement interface
that extends HTMLMediaElement interface.
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
Methods
clearSurfaceHandle()
clearSurfaceHandle(surfaceHandle:
string):void
Sets the surface handle to which video is rendered.
param[in] surfaceHandle The surface handle returned by onSurfaceViewCreated event emitted
by KeplerVideoSurfaceView component.
Parameters
surfaceHandle
string
deinitialize()
deinitialize():
Promise<void>
DeInitiailzes the player.
Returns
Promise<void>
Promise that is resolved when player is deInitialized.
deinitializeSync()
deinitializeSync(timeoutInMs:
number):NativeInterfaces.MediaPlayerDeInitStatus
DeInitiailzes the player synchronously
Parameters
timeoutInMs
number
time out threshold set by client to return the deinit control.
Returns
NativeInterfaces.MediaPlayerDeInitStatus
MediaPlayerDeInitStatus
getVideoPlaybackQuality()
getVideoPlaybackQuality():
VideoPlaybackQuality
Fetches video playback quality attributes.
Returns
VideoPlaybackQuality
handleEvent()
handleEvent(event:
NativeInterfaces.NativeMediaElementEvent):void
Parameters
event
NativeInterfaces.NativeMediaElementEvent
initialize()
initialize():
Promise<void>
Initiailzes the player. Wait for the promise to be fulfilled before calling any other fucntion.
Returns
Promise<void>
Promise that is resolved when player is initialized..
setMediaControlFocus()
setMediaControlFocus(componentInstance:
IComponentInstance, mediaControlHandler?:any):Promise<void>
setup the component instance with current mediaplayer being used and pass mediaControlHandler in case client wants to opt handling of mediacontrol commands.
Parameters
componentInstance
IComponentInstance
mediaControlHandler?
any
Returns
Promise<void>
setSurfaceHandle()
setSurfaceHandle(surfaceHandle:
string):void
Sets the surface handle to which video is rendered.
param[in] surfaceHandle The surface handle returned by the onSurfaceViewCreated event emitted
by KeplerVideoSurfaceView component.
Parameters
surfaceHandle
string
Last updated: Jul 31, 2026

