Amazon Developer

as

Settings
Sign out
Notifications
Alexa
Amazon Appstore
Ring
AWS
Documentation
Support
Contact Us
My Cases
Get Started
Design and Develop
Publish
Reference
Support
Native
Skip to main content

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()

void setMode(AppendMode appendMode)
Sets the append mode of the SourceBuffer. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-mode

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()

TimeRange[] 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-buffered

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()

void setTimestampOffset(double timeStampOffsetSecs)
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-timestampoffset

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()

void setAppendWindowStart(double appendWindowStartSecs)
Sets the append window start position. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-appendwindowstart

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()

void setAppendWindowEnd(double appendWindowEndSecs)
Sets the append window end position. For further details see https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-sourcebuffer-appendwindowend

Parameters

appendWindowEndSecs
double — Required The new presentation timestamp (in seconds) for the end of the append window.

appendBuffer()

void appendBuffer(u8[] mediaSegmentDataBuffer)
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-appendbuffer

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()

void remove(double startSecs, double endSecs)
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-remove

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.
Last modified on October 22, 2026