Interface IHtmlMediaElement
interface IHtmlMediaElement
Extends com.amazon.apmf.IStandard
The HtmlMediaElement object.
Methods
initializeAsync()
Asynchronously initializes the W3CMedia stack.com.amazon.apmf.ISubscription*initializeAsync(IHtmlMediaElementInitStatusListener*initStatusListener)
Parameters
initStatusListener
IHtmlMediaElementInitStatusListener* — Required
IHtmlMediaElementInitStatusListener instance to notify
initialization completed.
Returns
com.amazon.apmf.ISubscription*
ISubscription object instance
deinitializeAsync()
Asynchronously deinitializes the W3CMedia stack.com.amazon.apmf.ISubscription*deinitializeAsync(IHtmlMediaElementDeInitStatusListener*deInitStatusListener)
Parameters
deInitStatusListener
IHtmlMediaElementDeInitStatusListener* — Required
IHtmlMediaElementDeInitStatusListener object instance to callback to notify
deinitialiation completed.
Returns
com.amazon.apmf.ISubscription*
ISubscription object instance
addEventListener()
Asynchronously recieve events through IHtmlMediaElementEventListener callbacks.com.amazon.apmf.ISubscription*addEventListener(IHtmlMediaElementEventListener*eventListener)
Parameters
eventListener
IHtmlMediaElementEventListener* — Required
IHtmlMediaElementEventListener instance for callback to notify events.
Returns
com.amazon.apmf.ISubscription*
ISubscription object instance
setVideoSurface()
Sets the video surface for video renderingvoidsetVideoSurface(com.amazon.kepler.graphics.IMediaSurface*videoSurface)
Parameters
videoSurface
com.amazon.kepler.graphics.IMediaSurface* — Required
IMediaSurface instance
clearVideoSurface()
Clears the video surface for video renderingvoidclearVideoSurface(com.amazon.kepler.graphics.IMediaSurface*videoSurface)
Parameters
videoSurface
com.amazon.kepler.graphics.IMediaSurface* — Required
IMediaSurface instance
getError()
Gets the last error of HtmlMediaElement. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-errorIMediaError?getError()
Returns
IMediaError?
The return value is optional and might be absent.
Pointer that receives IMediaError
setSource()
Gets the currently playing source media URL. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-currentsrcvoidsetSource(stringurl)
Parameters
url
string — Required
The url that is set for playback.
getCurrentSource()
string getCurrentSource()
Gets the currently playing source media URL.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-currentsrc
Returns
string
The url that is set for playback.
getBufferedRange()
Gets the TimeRange of buffered media data. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-bufferedTimeRange[]getBufferedRange()
Returns
TimeRange[]
TimeRange array.
getReadyState()
ReadyState getReadyState()
Gets the ready state of the media.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-readystate
Returns
ReadyState
returns ReadyState.
isSeeking()
bool isSeeking()
Checks if the player is currently seeking the media
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-seeking
Returns
bool
returns true if the player is seeking.
getCurrentTimeSecs()
double getCurrentTimeSecs()
Gets the current playback position in seconds
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-currenttime
Returns
double
returns the current playback position in
seconds.
setCurrentTime()
Seeks to the new playback granular position. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-currenttimevoidsetCurrentTime(doublepositionSecs)
Parameters
positionSecs
double — Required
The new playback position to seek (granular seek) to
in seconds.
return none
getDuration()
double getDuration()
Gets the duration of the media content in URL and MSE mode.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-duration
Returns
double
the duration of the media in seconds.
Applicable URL and MSE mode playback configurations.
For MSSE mode it will throw an exception as not supported.
isPaused()
bool isPaused()
Checks if the player is paused.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-paused
Returns
bool
returns true if playback is paused false otherwise.
setPlaybackRate()
Sets the media playback rate. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-playbackratevoidsetPlaybackRate(doubleplaybackRate)
Parameters
playbackRate
double — Required
The rate at playback. 1.0 is the normal playback
rate.
return none
getPlaybackRate()
double getPlaybackRate()
Gets the current media playback rate.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-playbackrate
Returns
double
returns the current rate at playback.
getSeekableRange()
Gets the TimeRange of the content which can be seeked to. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-seekableTimeRange[]getSeekableRange()
Returns
TimeRange[]
returns the seekable time ranges.
hasEnded()
bool hasEnded()
Checks if the playback has ended.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-ended
Returns
bool
returns whether the playback has ended or not.
true if ended, otherwise false.
isAutoplayEnabled()
bool isAutoplayEnabled()
Checks if auto play is enabled. If not enabled, call play API explicitly.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-autoplay
Returns
bool
returns whether autoplay is enabled or not.
true if enabled, otherwise false.
enableAutoplay()
void enableAutoplay()
Enable autoplay mode. Clients need not call play explicitly
after setSource.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-autoplay
disableAutoplay()
void disableAutoplay()
Disable autoplay. Clients need to call play explicitly after setSource.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-autoplay
play()
void play()
Starts or resumes the playback.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-play
pause()
void pause()
Pauses the playback.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-pause
getVolumeLevel()
double getVolumeLevel()
Gets the current volume level of audio stream in the range 0.0 to 1.0.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-volume
Returns
double
the volume level of audio stream.
setVolumeLevel()
Sets the volume level of audio stream in the range 0.0 to 1.0. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-volumevoidsetVolumeLevel(doublevolumeLevel)
Parameters
volumeLevel
double — Required
The volume level of the audio stream.
isAudioMuted()
bool isAudioMuted()
Checks if audio is muted or not.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-muted
Returns
bool
whether the audio is muted or not.
true if muted, false otherwise.
muteAudio()
void muteAudio()
Mutes the audio.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-muted
unmuteAudio()
void unmuteAudio()
Unmutes the audio.
For further details see
https://html.spec.whatwg.org/multipage/media.html#dom-media-muted
getAudioTrackList()
Gets the list of audio tracks of the content. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-audiotracksIAudioTrack*[]getAudioTrackList()
Returns
IAudioTrack*[]
the array of audio tracks.
getVideoTrackList()
Gets the list of video tracks of the content. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-videotracksIVideoTrack*[]getVideoTrackList()
Returns
IVideoTrack*[]
the array of video tracks.
getTextTrackList()
Gets the list of Text tracks of the content. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-texttracksITextTrack*[]getTextTrackList()
Returns
ITextTrack*[]
the array of text tracks.
addTextTrack()
Adds a text track (subtitles) to be played along with the content. For further details see https://html.spec.whatwg.org/multipage/media.html#dom-media-addtexttrackITextTrack*addTextTrack(TextTrackKindkind,string?label,string?language,SubtitleInfo?subtitleInfo)
Parameters
kind
TextTrackKind — Required
The kind of the text track as per the spec.
For further details see
https://html.spec.whatwg.org/multipage/media.html#text-track-kind .
label
string? — Optional
A user friendly label of the text track.
For further details see
https://html.spec.whatwg.org/multipage/media.html#text-track-label .
language
string? — Optional
The language of the text track.
For further details see
https://html.spec.whatwg.org/multipage/media.html#text-track-language .
subtitleInfo
SubtitleInfo? — Optional
Optional info about the out-of-band subtitle
that will be used to render this text track.
This is a custom (not w3c spec) addition. Use this param if you want this component
to parse and render captions.
Returns
ITextTrack*
the newly created text track instance.
clearMediaKeys()
void clearMediaKeys()
Unsets the MediaKeys provided by setMediaKeys API.
UnsupportedPlayerModeError This API is only supported in
PlayerMode::MSE and PlayerMode::MSSE player modes.
setMediaKeys()
Sets the MediaKeys used for decryption DRM protect content. For further details see https://www.w3.org/TR/encrypted-media/#dom-htmlmediaelement-setmediakeyscom.amazon.apmf.ISubscription*setMediaKeys(IMediaKeys*mediaKeys,IHtmlMediaElementKeysSetListener*keysSetListener)
Parameters
mediaKeys
IMediaKeys* — Required
The MediaKeys used to decrypt a DRM protected.
keysSetListener
IHtmlMediaElementKeysSetListener* — Required
IHtmlMediaElementKeysSetListener object to handle callback when MediaKeys is set.
Returns
com.amazon.apmf.ISubscription*
ISubscription object instance.
setMediaSampleSource()
Sets the MediaSampleSource object instance.voidsetMediaSampleSource(IMediaSampleSource*mediaSampleSource)
Parameters
mediaSampleSource
IMediaSampleSource* — Required
The MediaSampleSource object instance to set.

