videomail-client
Version:
A wicked npm package to record videos directly in the browser, wohooo!
117 lines (116 loc) • 3.66 kB
TypeScript
import { Dimension } from "../../types/dimension";
import { VideomailClientOptions } from "../../types/options";
import { RecordingStats } from "../../types/RecordingStats";
import Despot from "../../util/Despot";
import { UnloadParams } from "../container";
import Visuals from "../visuals";
import Replay from "./replay";
export interface StopParams {
limitReached?: boolean;
}
interface PauseParams {
event?: MouseEvent;
}
declare class Recorder extends Despot {
private readonly visuals;
private readonly replay;
private loop?;
private originalAnimationFrameObject;
private samplesCount;
private framesCount;
private recordingStats?;
private confirmedFrameNumber;
private confirmedSampleNumber;
private recorderElement?;
private userMedia?;
private userMediaTimeout?;
private retryTimeout?;
private frameProgress?;
private sampleProgress?;
private canvas?;
private ctx?;
private userMediaLoaded?;
private userMediaLoading;
private submitting;
private unloaded?;
private stopTime?;
private stream?;
private connecting;
private connected;
private blocking;
private built;
private key?;
private waitingTime?;
private pingInterval?;
private frame?;
private recordingBuffer?;
private facingMode;
constructor(visuals: Visuals, replay: Replay, options: VideomailClientOptions);
private writeStream;
private sendPings;
private stopPings;
private onAudioSample;
show(): void;
private onUserMediaReady;
private clearRetryTimeout;
private calculateFrameProgress;
private calculateSampleProgress;
private updateOverallProgress;
private updateFrameProgress;
private updateSampleProgress;
private preview;
private initSocket;
private showUserMedia;
private userMediaErrorCallback;
private getUserMediaCallback;
private loadGenuineUserMedia;
private loadUserMedia;
private executeCommand;
private isNotifying;
private isHidden;
private writeCommand;
private cancelAnimationFrame;
private getIntervalSum;
private getAvgInterval;
private getAvgFps;
getRecordingStats(): RecordingStats | undefined;
getAudioSampleRate(): number | undefined;
stop(params?: StopParams): void;
back(cb: () => void): void;
private reInitializeAudio;
unload(params?: UnloadParams): void;
reset(): void;
private clearUserMediaTimeout;
validate(): boolean;
isReady(): boolean | undefined;
pause(params?: PauseParams): void;
resume(): void;
private onFlushed;
private draw;
private createLoop;
record(): void;
private setAnimationFrameObject;
private restoreAnimationFrameObject;
private loopWithTimeouts;
private correctDimensions;
private switchFacingMode;
private initEvents;
private buildElement;
build(): void;
isPaused(): boolean | undefined;
isRecording(): boolean;
hide(): void;
isUnloaded(): boolean | undefined;
getRecorderWidth(responsive: boolean): Dimension | undefined;
getRecorderHeight(responsive: boolean, useBoundingClientRect?: boolean): Dimension | undefined;
getRatio(): number | undefined;
calculateWidth(responsive: boolean): Dimension;
calculateHeight(responsive: boolean): Dimension;
getRawVisualUserMedia(): HTMLVideoElement | null | undefined;
isConnected(): boolean;
isConnecting(): boolean;
limitWidth(width?: number): Dimension | undefined;
limitHeight(height: number | undefined): Dimension;
isUserMediaLoaded(): boolean | undefined;
}
export default Recorder;