Skip to main content
Module

x/evt/mod.ts>dom.MediaSource

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

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.

Properties

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

Methods

addSourceBuffer(type: string): SourceBuffer
clearLiveSeekableRange(): void
endOfStream(error?: EndOfStreamError): void
removeSourceBuffer(sourceBuffer: SourceBuffer): void
setLiveSeekableRange(start: number, end: number): void
addEventListener<K extends keyof MediaSourceEventMap>(
type: K,
listener: (this: MediaSource, ev: MediaSourceEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
addEventListener(
type: string,
options?: boolean | AddEventListenerOptions,
): void
removeEventListener<K extends keyof MediaSourceEventMap>(
type: K,
listener: (this: MediaSource, ev: MediaSourceEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
removeEventListener(
type: string,
options?: boolean | EventListenerOptions,
): void