MediaStream
A stream of media content. A stream consists of several tracks such as video or audio tracks. Each track is specified as an instance of MediaStreamTrack.
interface MediaStream extends EventTarget {
readonly active: boolean;
readonly id: string;
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null;
addEventListener<K extends keyof MediaStreamEventMap>(
type: K,
listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void;addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void;addTrack(track: MediaStreamTrack): void;
clone(): MediaStream;
getAudioTracks(): MediaStreamTrack[];
getTrackById(trackId: string): MediaStreamTrack | null;
getTracks(): MediaStreamTrack[];
getVideoTracks(): MediaStreamTrack[];
removeEventListener<K extends keyof MediaStreamEventMap>(
type: K,
listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void;removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void;removeTrack(track: MediaStreamTrack): void;
}var MediaStream: {
prototype: MediaStream;
new (): MediaStream;
new (stream: MediaStream): MediaStream;
new (tracks: MediaStreamTrack[]): MediaStream;
};§Extends
§Properties
§
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null
[src]§
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null
[src]§Methods
§
addEventListener<K extends keyof MediaStreamEventMap>(
[src]type: K,
listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void§
addEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void§
addTrack(track: MediaStreamTrack): void
[src]§
clone(): MediaStream
[src]§
getAudioTracks(): MediaStreamTrack[]
[src]§
getTrackById(trackId: string): MediaStreamTrack | null
[src]§
getTracks(): MediaStreamTrack[]
[src]§
getVideoTracks(): MediaStreamTrack[]
[src]§
removeEventListener<K extends keyof MediaStreamEventMap>(
[src]type: K,
listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void§
removeEventListener(
[src]type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void§
removeTrack(track: MediaStreamTrack): void
[src]