Interface ISourceBuffer
interface ISourceBuffer
Extends com.amazon.apmf.IStandard
The SourceBuffer Object.
For further details see
https://www.w3.org/TR/2016/REC-media-source-20161117/#sourcebuffer
Methods
getMode()
AppendMode getMode()
Gets the append mode of the source buffer.
For further details see
https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-mode
Returns
AppendMode
the AppendMode of
SourceBuffer.
setMode()
Sets the append mode of the SourceBuffer. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-modevoidsetMode(AppendModeappendMode)
Parameters
appendMode
AppendMode — Required
The append mode of Source buffer
AppendMode
isUpdating()
bool isUpdating()
Checks if source buffer is in the process of updating the internal
Track buffers.
For further details see
https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-updating
Returns
bool
true if updating, false
otherwise.
getBufferedRange()
Returns the TimeRange of the media that is buffered in its internal Track buffers. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-bufferedTimeRange[]getBufferedRange()
Returns
TimeRange[]
TimeRange array.
getTimestampOffset()
double getTimestampOffset()
Gets the current timestamp offset set to SourceBuffer.
For further details see
https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-timestampoffset
Returns
double
The timestamp offset (in seconds) applied
to timestamps of subsequent media segments that are appended to SourceBuffer
setTimestampOffset()
Sets the timestamp offset that shouod be added to every coded frame. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-timestampoffsetvoidsetTimestampOffset(doubletimeStampOffsetSecs)
Parameters
timeStampOffsetSecs
double — Required
The timestamp offset (in seconds) that should
be applied to timestamps of subsequent media segments that are appended to
SourceBuffer
getAppendWindowStart()
double getAppendWindowStart()
Gets the append window start position.
For further details see
https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-appendwindowstart
Returns
double
The current presentation timestamp (in
seconds) for the start of the append window.
setAppendWindowStart()
Sets the append window start position. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-appendwindowstartvoidsetAppendWindowStart(doubleappendWindowStartSecs)
Parameters
appendWindowStartSecs
double — Required
The new presentation timestamp (in seconds)
of the start of the append window.
getAppendWindowEnd()
double getAppendWindowEnd()
Gets the append window end position.
For further details see
https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-appendwindowend
Returns
double
The current presentation timestamp (in
seconds) set for the end of the append window.
setAppendWindowEnd()
Sets the append window end position. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-appendwindowendvoidsetAppendWindowEnd(doubleappendWindowEndSecs)
Parameters
appendWindowEndSecs
double — Required
The new presentation timestamp (in seconds) for
the end of the append window.
appendBuffer()
Appends the media segment containing coded frames to internal Track buffer. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-appendbuffervoidappendBuffer(u8[]mediaSegmentDataBuffer)
Parameters
mediaSegmentDataBuffer
u8[] — Required
Media segment data buffer
abort()
void abort()
Aborts the current segment processing and resets the segment parser.
For further details see
https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-abort
remove()
Removes media for a specific time range from internal track buffer. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-removevoidremove(doublestartSecs,doubleendSecs)
Parameters
startSecs
double — Required
The start of the removal range (in seconds) measured from
presentation start time.
endSecs
double — Required
The end of the removal range (in seconds) measured from
presentation start time.

