Interface IMediaSource
interface IMediaSource
Extends com.amazon.apmf.IStandard
MediaSource object.
https://www.w3.org/TR/2016/REC-media-source-20161117/
Methods
getSourceBuffers()
Gets the list of source buffers added to MediaSource. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-sourcebuffersISourceBuffer*[]getSourceBuffers()
Returns
ISourceBuffer*[]
the list of source buffers added to MediaSource.
This interface is now updated to return list of ISourceBuffer
extension i.e. list of ISourceBuffer2.
getActiveSourceBuffers()
Get the list of active source buffers being used by MediaSource. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-activesourcebuffersISourceBuffer*[]getActiveSourceBuffers()
Returns
ISourceBuffer*[]
the list of active source buffers
being used by MediaSource.
This interface is now updated to return list of ISourceBuffer
extension i.e. list of ISourceBuffer2.
getMediaSourceReadyState()
MediaSourceReadyState getMediaSourceReadyState()
Gets the ready state of the MediaSource.
For further details see
https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-readystate
Returns
MediaSourceReadyState
returns the ready state of MediaSource.
addSourceBuffer()
Adds a SourceBuffer to the media source. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-addsourcebufferISourceBuffer*addSourceBuffer(stringmimeType,ISourceBufferConfig?sourceBufferConfig)
Parameters
mimeType
string — Required
MimeType type of the content that the SourceBuffer will
be configured for.
sourceBufferConfig
ISourceBufferConfig? — Optional
Optional Source Buffer config
to let component know the properties of the content. If null, then default
config values are used.
Returns
ISourceBuffer*
a new instance of ISourceBuffer object.
This interface is updated to create and return ISourceBuffer
extension i.e. ISourceBuffer2.
removeSourceBuffer()
Removes a SourceBuffer from a MediaSource For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-removesourcebuffervoidremoveSourceBuffer(ISourceBuffer*sourceBuffer)
Parameters
sourceBuffer
ISourceBuffer* — Required
SourceBuffer object instance to be removed from
MediaSource.
This interface is updated to remove ISourceBuffer
extension i.e. ISourceBuffer2.
endOfStream()
Signal end of stream to MediaSource. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-endofstreamvoidendOfStream(EndOfStreamErroreosError)
Parameters
eosError
EndOfStreamError — Required
The reason for end of stream
EndOfStreamError
This API is deprecated, use IMediaSource2::endOfStream2
setLiveSeekableRange()
Sets the Live Seekable Time Range to the MediaSource. This modifies TimeRange values returned by HtmlMediaElement_getSeekableRange API. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-setliveseekablerangevoidsetLiveSeekableRange(doublestartSecs,doubleendSecs)
Parameters
startSecs
double — Required
The start of the range, in seconds, measured from
presentation start time.
endSecs
double — Required
The end of range, in seconds, measured from presentation
start time.
clearLiveSeekableRange()
void clearLiveSeekableRange()
Clears previously set Live Seekable Range.
For further details see
https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-clearliveseekablerange
isTypeSupported()
Checks if MediaSource supports the mime type of the media segment appened to the SourceBufer. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-istypesupportedboolisTypeSupported(stringmimeType)
Parameters
mimeType
string — Required
The mime type of the content.
Returns
bool
true if mime type is supported, false
otherwise.
setDuration()
Sets the duration of the media URL provided in setSource API.voidsetDuration(doubledurationSecs)
Parameters
durationSecs
double — Required
the duration of the media in seconds.
Applicable only for URL mode playback

