Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

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,
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,
options?: boolean | EventListenerOptions,
): void;
removeTrack(track: MediaStreamTrack): void;
}
var MediaStream: {
prototype: MediaStream;
new (): MediaStream;
new (stream: MediaStream): MediaStream;
new (tracks: MediaStreamTrack[]): MediaStream;
}
;

§Extends

§Properties

§
readonly active: boolean
[src]
§
readonly id: string
[src]
§
onaddtrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null
[src]
§
onremovetrack: ((this: MediaStream, ev: MediaStreamTrackEvent) => any) | null
[src]

§Methods

§
addEventListener<K extends keyof MediaStreamEventMap>(
type: K,
listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
[src]
§
addTrack(track: MediaStreamTrack): void
[src]
§
getAudioTracks(): MediaStreamTrack[]
[src]
§
getTrackById(trackId: string): MediaStreamTrack | null
[src]
§
getVideoTracks(): MediaStreamTrack[]
[src]
§
removeEventListener<K extends keyof MediaStreamEventMap>(
type: K,
listener: (this: MediaStream, ev: MediaStreamEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
[src]
§
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void
[src]
§
removeTrack(track: MediaStreamTrack): void
[src]