Interface IHtmlMediaElement3
interface IHtmlMediaElement3
Extends IHtmlMediaElement2
The HtmlMediaElement3 object.
Extension to HtmlMediaElement2 adding new method
to get audio effect session ID and
set playback range.
Methods
getAudioEffectSessionId()
i32 getAudioEffectSessionId()
Get audio effect session ID corresponding to
IAudioStreamPlayback2 instance created by
HtmlMediaElement.
This API should be called when client have
audio effect as per the [IAudioEffect].
See [IAudioEffect] documentation for more details.
While calling this API, client must ensure
at least one “canplay” event is received.
See https://html.spec.whatwg.org/multipage/media.html#event-media-canplay
for more details.
Returns
i32
audio effect session ID
setPlaybackRangeSecs()
Sets the start position and stop position of media playback for this MediaElement instance. This is particularly useful for gapless playback. This is currently only supported for URL mode. start position must be less than stop position. This API must be called after calling setSource(string) API.voidsetPlaybackRangeSecs(doublestartPosition,doublestopPosition)
Parameters
startPosition
double — Required
start position in seconds
stopPosition
double — Required
stop position in seconds
setVolumeLevelWithFade()
Sets the volume level of audio stream in the range 0.0 to 1.0 with Audio fade effectvoidsetVolumeLevelWithFade(doublevolumeLevel,u32fadeDuration,com.amazon.kepler.audio.AudioFadeTypefadeType)
Parameters
volumeLevel
double — Required
The target audio volume level in the range 0.0 to 1.0
fadeDuration
u32 — Required
duration of the audio fade effect in milliseconds. If the value is
is 0, target volume is immediately applied without fading.
A larger than 2000 ms value will be capped to 2000 ms
fadeType
com.amazon.kepler.audio.AudioFadeType — Required
AudioFadeType effect to be used duing volume level change
Throws
InvalidInputError— when volume level is not in the range 0.0 to 1.0

