Skip to main content
Module

x/evt/lib/types/lib.dom.ts>MediaSource

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

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