Interface SourceBuffer
appendWindowEnd: number;
appendWindowStart: number;
buffered: TimeRanges;
mode: AppendMode;
onabort: ((this: SourceBuffer, ev: Event) => any) | null;
onerror: ((this: SourceBuffer, ev: Event) => any) | null;
onupdate: ((this: SourceBuffer, ev: Event) => any) | null;
onupdateend: ((this: SourceBuffer, ev: Event) => any) | null;
onupdatestart: ((this: SourceBuffer, ev: Event) => any) | null;
timestampOffset: number;
updating: boolean;
abort(): void;
addEventListener<K extends keyof SourceBufferEventMap>(
type: K,
listener: (this: SourceBuffer, ev: SourceBufferEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;
appendBuffer(data: BufferSource): void;
changeType(type: string): void;
dispatchEvent(event: Event): boolean;
remove(start: number, end: number): void;
removeEventListener<K extends keyof SourceBufferEventMap>(
type: K,
listener: (this: SourceBuffer, ev: SourceBufferEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;
}
Hierarchy
- EventTarget
- SourceBuffer
Properties
appendWindowEnd
The appendWindowEnd property of the timestamp range that can be used to filter what media data is appended to the SourceBuffer.
appendWindowStart
The appendWindowStart property of the timestamp range that can be used to filter what media data is appended to the SourceBuffer.
Readonlybuffered
The buffered read-only property of the buffered in the SourceBuffer as a normalized TimeRanges object.
mode
The mode property of the SourceBuffer interface controls whether media segments can be appended to the SourceBuffer in any order, or in a strict sequence.
onabort
onerror
onupdate
onupdateend
onupdatestart
timestampOffset
The timestampOffset property of the media segments that are appended to the SourceBuffer.
Readonlyupdating
The updating read-only property of the currently being updated — i.e., whether an SourceBuffer.appendBuffer() or SourceBuffer.remove() operation is currently in progress.
Methods
abort
The
abort()method of the SourceBuffer interface aborts the current segment and resets the segment parser.Returns void
addEventListener
- addEventListener<K extends keyof SourceBufferEventMap>(
type: K,
listener: (this: SourceBuffer, ev: SourceBufferEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): voidThe
addEventListener()method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.Type Parameters
- K extends keyof SourceBufferEventMap
Parameters
- type: K
- listener: (this: SourceBuffer, ev: SourceBufferEventMap[K]) => any
Optionaloptions: boolean | AddEventListenerOptions
Returns void
- addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): voidThe
addEventListener()method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.Parameters
- type: string
- listener: EventListenerOrEventListenerObject
Optionaloptions: boolean | AddEventListenerOptions
Returns void
appendBuffer
changeType
dispatchEvent
The
dispatchEvent()method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.Parameters
- event: Event
Returns boolean
remove
The
remove()method of the SourceBuffer interface removes media segments within a specific time range from theSourceBuffer.Parameters
- start: number
- end: number
Returns void
removeEventListener
- removeEventListener<K extends keyof SourceBufferEventMap>(
type: K,
listener: (this: SourceBuffer, ev: SourceBufferEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): voidThe
removeEventListener()method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.Type Parameters
- K extends keyof SourceBufferEventMap
Parameters
- type: K
- listener: (this: SourceBuffer, ev: SourceBufferEventMap[K]) => any
Optionaloptions: boolean | EventListenerOptions
Returns void
- removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): voidThe
removeEventListener()method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target.Parameters
- type: string
- listener: EventListenerOrEventListenerObject
Optionaloptions: boolean | EventListenerOptions
Returns void
The
SourceBufferinterface represents a chunk of media to be passed into an HTMLMediaElement and played, via a MediaSource object.MDN Reference