AudioPlayer
Brief
AudioPlayer
is a component that implements the HTMLAudioElement
interface
-
that extends
HTMLMediaElement
interface.
Remarks
This is a typescript class and not a react native component. Apps
- need to create an instance of
AudioPlayer
and use it to start buffering - the content without starting playback. It does not render the media controls GUI.
-
Apps are expected to build their own media controls UI and control the playback experience.
Extends
MediaPlayer
Constructors
new AudioPlayer()
new AudioPlayer(
audioType
?,audioUsage
?):AudioPlayer
Parameters
audioType?
Type of audio to play.
audioUsage?
Reason for audio playback.
Returns
Brief
Creates a AudioPlayer
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.
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.
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.
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.
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.
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.
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.
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
deinitialize()
deinitialize():
Promise
<void
>
Returns
Promise
<void
>
Promise that is resolved when the 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
Brief
DeInitiailzes the player synchronously
Overrides
MediaPlayer.deinitializeSync
initialize()
initialize():
Promise
<void
>
Returns
Promise
<void
>
Promise that is resolved when the player is initialized.
Brief
Initiailzes the player. Wait for the promise to be fulfilled before calling any other function.
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
triggerTMOAIfNeeded()
triggerTMOAIfNeeded(
cue
):void
Parameters
cue
Returns
void
Inherited from
MediaPlayer.triggerTMOAIfNeeded
Last updated: Sep 30, 2025