Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/evt/lib/types/index.ts>dom.MediaStream

💧EventEmitter's typesafe replacement
Go to Latest
interface dom.MediaStream
implements EventTarget
import { type dom } from "https://deno.land/x/evt@v2.4.16/lib/types/index.ts";
const { MediaStream } = dom;

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.

Properties

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

Methods

addTrack(track: MediaStreamTrack): void
clone(): MediaStream
getAudioTracks(): MediaStreamTrack[]
getTrackById(trackId: string): MediaStreamTrack | null
getTracks(): MediaStreamTrack[]
getVideoTracks(): MediaStreamTrack[]
removeTrack(track: MediaStreamTrack): void
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
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