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
VideoPlayerMethods
clearSurfaceHandle()
clearSurfaceHandle(surfaceHandle:Sets the surface handle to which video is rendered.string):void
Parameters
surfaceHandle
string
deinitialize()
deinitialize(): Promise<void>
DeInitiailzes the player.
Returns
Promise<void>
Promise that is resolved when player is deInitialized.
deinitializeSync()
deinitializeSync(timeoutInMs:DeInitiailzes the player synchronouslynumber):NativeInterfaces.MediaPlayerDeInitStatus
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:setup the component instance with current mediaplayer being used and pass mediaControlHandler in case client wants to opt handling of mediacontrol commands.IComponentInstance, mediaControlHandler?:any):Promise<void>
Parameters
componentInstance
IComponentInstance
mediaControlHandler?
any
Returns
Promise<void>
setSurfaceHandle()
setSurfaceHandle(surfaceHandle:Sets the surface handle to which video is rendered.string):void
Parameters
surfaceHandle
string
