MediaSource
This Media Source Extensions API interface represents a source of media data for an HTMLMediaElement object. A MediaSource object can be attached to a HTMLMediaElement to be played in the user agent.
interface MediaSource extends EventTarget {
readonly activeSourceBuffers: SourceBufferList;
duration: number;
onsourceclose: ((this: MediaSource, ev: Event) => any) | null;
onsourceended: ((this: MediaSource, ev: Event) => any) | null;
onsourceopen: ((this: MediaSource, ev: Event) => any) | null;
readonly readyState: ReadyState;
readonly sourceBuffers: SourceBufferList;
addEventListener<K extends keyof MediaSourceEventMap>(
type: K,
listener: (this: MediaSource, ev: MediaSourceEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;addSourceBuffer(type: string): SourceBuffer;
clearLiveSeekableRange(): void;
endOfStream(error?: EndOfStreamError): void;
removeEventListener<K extends keyof MediaSourceEventMap>(
type: K,
listener: (this: MediaSource, ev: MediaSourceEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;removeSourceBuffer(sourceBuffer: SourceBuffer): void;
setLiveSeekableRange(start: number, end: number): void;
}var MediaSource: {
prototype: MediaSource;
new (): MediaSource;
isTypeSupported(type: string): boolean;
};§Extends
§Properties
§
readonly activeSourceBuffers: SourceBufferList
[src]§
onsourceclose: ((this: MediaSource, ev: Event) => any) | null
[src]§
onsourceended: ((this: MediaSource, ev: Event) => any) | null
[src]§
onsourceopen: ((this: MediaSource, ev: Event) => any) | null
[src]§
readonly readyState: ReadyState
[src]§
readonly sourceBuffers: SourceBufferList
[src]§Methods
§
addEventListener<K extends keyof MediaSourceEventMap>(
[src]type: K,
listener: (this: MediaSource, ev: MediaSourceEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void§
addEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void§
addSourceBuffer(type: string): SourceBuffer
[src]§
endOfStream(error?: EndOfStreamError): void
[src]§
removeEventListener<K extends keyof MediaSourceEventMap>(
[src]type: K,
listener: (this: MediaSource, ev: MediaSourceEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void§
removeEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void§
removeSourceBuffer(sourceBuffer: SourceBuffer): void
[src]