UNPKG

media-stream-library

Version:

Media stream library for Node & the Web.

27 lines (26 loc) 1.03 kB
import { MediaTrack } from '../../utils/protocols/isom'; import { Sink } from '../component'; export declare class MseSink extends Sink { private readonly _videoEl; private _done?; private _lastCheckpointTime; onSourceOpen?: (mse: MediaSource, tracks: MediaTrack[]) => void; /** * Create a Media component. * * The constructor sets up two streams and connects them to the MediaSource. * * @param el - A video element to connect the media source to */ constructor(el: HTMLVideoElement); /** * Add a new sourceBuffer to the mediaSource and remove old ones. * @param el - The media element holding the media source. * @param mse - The media source the buffer should be attached to. * @param mimeType - MIME type and codecs, e.g.: 'video/mp4; codecs="avc1.4D0029, mp4a.40.2"' */ addSourceBuffer(el: HTMLVideoElement, mse: MediaSource, mimeType: string): SourceBuffer; get currentTime(): number; play(): Promise<void>; pause(): void; }