videomail-client 16.1.1 → 16.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/cjs/index.cjs +1857 -1721
- package/dist/esm/index.js +1989 -1853
- package/dist/esm/types/events/params.d.ts +4 -3
- package/dist/esm/util/email/isRecipientSelectionValid.d.ts +4 -0
- package/dist/esm/wrappers/container.d.ts +1 -1
- package/dist/esm/wrappers/visuals/recorder/capture.d.ts +87 -0
- package/dist/esm/wrappers/visuals/recorder/connection.d.ts +46 -0
- package/dist/esm/wrappers/visuals/recorder/dimensions.d.ts +21 -0
- package/dist/esm/wrappers/visuals/recorder/media.d.ts +51 -0
- package/dist/esm/wrappers/visuals/recorder/mediaConstraints.d.ts +14 -0
- package/dist/esm/wrappers/visuals/recorder/progress.d.ts +11 -0
- package/dist/esm/wrappers/visuals/recorder/streamWriter.d.ts +56 -0
- package/dist/esm/wrappers/visuals/recorder.d.ts +13 -165
- package/dist/umd/index.js +1908 -1821
- package/package.json +5 -5
- /package/dist/esm/util/{trimEmail.d.ts → email/trimEmail.d.ts} +0 -0
|
@@ -40,10 +40,11 @@ export interface VideomailSubmittedParams {
|
|
|
40
40
|
response: Response;
|
|
41
41
|
}
|
|
42
42
|
export interface VideomailValidatingParams {
|
|
43
|
-
targetName?:
|
|
44
|
-
event?:
|
|
43
|
+
targetName?: string | undefined;
|
|
44
|
+
event?: Event | undefined;
|
|
45
45
|
}
|
|
46
46
|
export interface VideomailInvalidParams {
|
|
47
47
|
whyInvalid?: string | undefined;
|
|
48
|
-
invalidData?:
|
|
48
|
+
invalidData?: VideomailInvalidFormData | undefined;
|
|
49
49
|
}
|
|
50
|
+
export type VideomailInvalidFormData = Record<string, string | null | undefined>;
|
|
@@ -69,7 +69,7 @@ declare class Container extends Despot {
|
|
|
69
69
|
}): void;
|
|
70
70
|
suspend(): void;
|
|
71
71
|
recoverCamera(): Promise<boolean>;
|
|
72
|
-
validate(event?:
|
|
72
|
+
validate(event?: Event, force?: boolean): boolean;
|
|
73
73
|
disableForm(buttonsToo: boolean): void;
|
|
74
74
|
enableForm(buttonsToo: boolean): void;
|
|
75
75
|
hasForm(): boolean;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type AudioSample from "audio-sample";
|
|
2
|
+
import Frame from "canvas-to-buffer";
|
|
3
|
+
import type { VideomailCommandArgs } from "../../../types/command.js";
|
|
4
|
+
import type { Dimension } from "../../../types/dimension.js";
|
|
5
|
+
import type { VideomailUserMediaReadyParams } from "../../../types/events/params.js";
|
|
6
|
+
import type { VideomailClientOptions } from "../../../types/options.js";
|
|
7
|
+
import type Visuals from "../../visuals.js";
|
|
8
|
+
import type Replay from "../replay.js";
|
|
9
|
+
import RecorderMedia from "./media.js";
|
|
10
|
+
interface RecorderAnimationFrameApi {
|
|
11
|
+
requestAnimationFrame(callback: () => void): number;
|
|
12
|
+
cancelAnimationFrame(handle?: number): void;
|
|
13
|
+
}
|
|
14
|
+
export interface RecorderLoop {
|
|
15
|
+
complete?(): void;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
getElapsedTime(): number;
|
|
18
|
+
getRequestAnimationFrameObject(): RecorderAnimationFrameApi;
|
|
19
|
+
isRunning(): boolean;
|
|
20
|
+
on(eventName: "update", listener: (deltaTime: number, elapsedTime: number) => void): void;
|
|
21
|
+
setRequestAnimationFrameObject(animationFrameApi: RecorderAnimationFrameApi): void;
|
|
22
|
+
start(): void;
|
|
23
|
+
stop(): void;
|
|
24
|
+
}
|
|
25
|
+
export interface StopParams {
|
|
26
|
+
limitReached?: boolean;
|
|
27
|
+
}
|
|
28
|
+
interface PauseParams {
|
|
29
|
+
event?: MouseEvent;
|
|
30
|
+
}
|
|
31
|
+
declare abstract class RecorderCapture extends RecorderMedia {
|
|
32
|
+
protected readonly replay: Replay;
|
|
33
|
+
protected loop?: RecorderLoop | undefined;
|
|
34
|
+
protected originalAnimationFrameObject?: RecorderAnimationFrameApi | undefined;
|
|
35
|
+
protected recordingAudioSampleRate?: number | undefined;
|
|
36
|
+
private frameProgress?;
|
|
37
|
+
private sampleProgress?;
|
|
38
|
+
protected canvas?: HTMLCanvasElement | undefined;
|
|
39
|
+
protected ctx?: CanvasRenderingContext2D | undefined | null;
|
|
40
|
+
protected stopTime?: number | undefined;
|
|
41
|
+
protected waitingTime?: number | undefined;
|
|
42
|
+
protected frame?: Frame;
|
|
43
|
+
protected recordingBuffer?: Buffer | undefined;
|
|
44
|
+
protected abstract getRecorderWidth(responsive: boolean): Dimension | undefined;
|
|
45
|
+
protected abstract getRecorderHeight(responsive: boolean, useBoundingClientRect?: boolean): Dimension | undefined;
|
|
46
|
+
protected constructor(visuals: Visuals, replay: Replay, options: VideomailClientOptions);
|
|
47
|
+
protected onAudioSample(audioSample: AudioSample): void;
|
|
48
|
+
protected onUserMediaReady(params?: VideomailUserMediaReadyParams): void;
|
|
49
|
+
private calculateFrameProgress;
|
|
50
|
+
private calculateSampleProgress;
|
|
51
|
+
private updateOverallProgress;
|
|
52
|
+
protected updateFrameProgress(args?: VideomailCommandArgs): void;
|
|
53
|
+
protected updateSampleProgress(args?: VideomailCommandArgs): void;
|
|
54
|
+
protected preview(args?: VideomailCommandArgs): void;
|
|
55
|
+
private cancelAnimationFrame;
|
|
56
|
+
private getIntervalSum;
|
|
57
|
+
private getAvgInterval;
|
|
58
|
+
private getAvgFps;
|
|
59
|
+
private hasValidInterval;
|
|
60
|
+
getRecordingStats(): import("../../../index.js").RecordingStats | undefined;
|
|
61
|
+
getAudioSampleRate(): number | undefined;
|
|
62
|
+
stop(params?: StopParams): void;
|
|
63
|
+
back(cb: () => void): void;
|
|
64
|
+
protected reInitializeAudio(): void;
|
|
65
|
+
reset(): void;
|
|
66
|
+
validate(): boolean;
|
|
67
|
+
pause(params?: PauseParams): void;
|
|
68
|
+
resume(): void;
|
|
69
|
+
private onFlushed;
|
|
70
|
+
private draw;
|
|
71
|
+
private createLoop;
|
|
72
|
+
record(): void;
|
|
73
|
+
private setAnimationFrameObject;
|
|
74
|
+
protected restoreAnimationFrameObject(): void;
|
|
75
|
+
protected loopWithTimeouts(): void;
|
|
76
|
+
isPaused(): boolean | undefined;
|
|
77
|
+
protected isUserMediaPaused(): boolean;
|
|
78
|
+
protected isCaptureLoopRunning(): boolean;
|
|
79
|
+
protected stopCaptureLoop(): void;
|
|
80
|
+
protected startCaptureLoop(): void;
|
|
81
|
+
isRecording(): boolean;
|
|
82
|
+
getRecordingDimensions(): {
|
|
83
|
+
height: number;
|
|
84
|
+
width: number;
|
|
85
|
+
} | undefined;
|
|
86
|
+
}
|
|
87
|
+
export default RecorderCapture;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { VideomailCommand, VideomailCommandArgs } from "../../../types/command.js";
|
|
2
|
+
import type { VideomailClientOptions } from "../../../types/options.js";
|
|
3
|
+
import type { RecordingStats } from "../../../types/RecordingStats.js";
|
|
4
|
+
import RecorderStreamWriter from "./streamWriter.js";
|
|
5
|
+
type RecorderOutgoingCommandArgs = VideomailCommandArgs | RecordingStats;
|
|
6
|
+
declare abstract class RecorderConnection extends RecorderStreamWriter {
|
|
7
|
+
protected reconnectTimeout?: number | undefined;
|
|
8
|
+
protected connectionTimeout?: number | undefined;
|
|
9
|
+
protected userMediaLoaded?: boolean | undefined;
|
|
10
|
+
protected userMediaLoading: boolean;
|
|
11
|
+
protected unloaded?: boolean;
|
|
12
|
+
protected connectionFailed: boolean;
|
|
13
|
+
protected reconnectAttempts: number;
|
|
14
|
+
protected blocking: boolean;
|
|
15
|
+
protected connectingStartedAt?: number | undefined;
|
|
16
|
+
protected lastCloseEvent?: {
|
|
17
|
+
code: number;
|
|
18
|
+
reason: string;
|
|
19
|
+
wasClean: boolean;
|
|
20
|
+
} | undefined;
|
|
21
|
+
protected lastSocketError?: Record<string, unknown> | undefined;
|
|
22
|
+
protected pingInterval?: number | undefined;
|
|
23
|
+
protected abstract executeCommand(command: VideomailCommand): void;
|
|
24
|
+
abstract isUserMediaLoaded(): boolean | undefined;
|
|
25
|
+
abstract validate(): boolean;
|
|
26
|
+
protected constructor(options: VideomailClientOptions);
|
|
27
|
+
private canReconnectAfterStreamClose;
|
|
28
|
+
private shouldReportStreamClose;
|
|
29
|
+
private handleStreamClose;
|
|
30
|
+
private shouldIgnoreStreamClose;
|
|
31
|
+
private handleStreamError;
|
|
32
|
+
protected sendPings(): void;
|
|
33
|
+
protected stopPings(): void;
|
|
34
|
+
protected clearConnectionTimeout(): void;
|
|
35
|
+
protected clearReconnectTimeout(): void;
|
|
36
|
+
private handleConnectionFailure;
|
|
37
|
+
private retryConnection;
|
|
38
|
+
private canRetryConnection;
|
|
39
|
+
private shouldContinueReconnect;
|
|
40
|
+
private isOnline;
|
|
41
|
+
private failConnection;
|
|
42
|
+
private shouldIgnoreConnectionFailure;
|
|
43
|
+
protected initSocket(cb?: () => void): void;
|
|
44
|
+
protected writeCommand(command: string, args?: RecorderOutgoingCommandArgs, cb?: () => void): void;
|
|
45
|
+
}
|
|
46
|
+
export default RecorderConnection;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Dimension } from "../../../types/dimension.js";
|
|
2
|
+
import type { VideomailClientOptions } from "../../../types/options.js";
|
|
3
|
+
import type Visuals from "../../visuals.js";
|
|
4
|
+
import type UserMedia from "../userMedia.js";
|
|
5
|
+
interface RecorderDimensionsContext {
|
|
6
|
+
options: VideomailClientOptions;
|
|
7
|
+
visuals: Pick<Visuals, "getRatio" | "limitWidth">;
|
|
8
|
+
getRecorderElement: () => HTMLVideoElement | null | undefined;
|
|
9
|
+
getUserMedia: () => UserMedia | undefined;
|
|
10
|
+
}
|
|
11
|
+
declare class RecorderDimensions {
|
|
12
|
+
private readonly context;
|
|
13
|
+
constructor(context: RecorderDimensionsContext);
|
|
14
|
+
correctDimensions(): void;
|
|
15
|
+
getRecorderWidth(responsive: boolean): Dimension | undefined;
|
|
16
|
+
getRecorderHeight(responsive: boolean, useBoundingClientRect?: boolean): Dimension | undefined;
|
|
17
|
+
getRatio(): number | undefined;
|
|
18
|
+
calculateWidth(responsive: boolean): Dimension;
|
|
19
|
+
calculateHeight(responsive: boolean): Dimension;
|
|
20
|
+
}
|
|
21
|
+
export default RecorderDimensions;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type AudioSample from "audio-sample";
|
|
2
|
+
import type { VideomailUserMediaReadyParams } from "../../../types/events/params.js";
|
|
3
|
+
import type { VideomailClientOptions } from "../../../types/options.js";
|
|
4
|
+
import type Visuals from "../../visuals.js";
|
|
5
|
+
import UserMedia from "../userMedia.js";
|
|
6
|
+
import RecorderConnection from "./connection.js";
|
|
7
|
+
declare abstract class RecorderMedia extends RecorderConnection {
|
|
8
|
+
protected readonly visuals: Visuals;
|
|
9
|
+
protected recorderElement?: HTMLVideoElement | undefined | null;
|
|
10
|
+
protected userMedia?: UserMedia;
|
|
11
|
+
protected userMediaTimeout?: number | undefined;
|
|
12
|
+
protected retryTimeout?: number | undefined;
|
|
13
|
+
protected stopTimeout?: number | undefined;
|
|
14
|
+
protected mediaRequestId: number;
|
|
15
|
+
protected cameraRecovery?: Promise<boolean> | undefined;
|
|
16
|
+
protected resolveCameraRecovery?: ((restored: boolean) => void) | undefined;
|
|
17
|
+
protected resumeAfterCameraRecovery: boolean;
|
|
18
|
+
protected submitting: boolean;
|
|
19
|
+
protected built: boolean;
|
|
20
|
+
protected key?: string | undefined;
|
|
21
|
+
protected facingMode: ConstrainDOMString;
|
|
22
|
+
protected abstract onUserMediaReady(params?: VideomailUserMediaReadyParams): void;
|
|
23
|
+
protected abstract onAudioSample(audioSample: AudioSample): void;
|
|
24
|
+
protected abstract record(): void;
|
|
25
|
+
protected abstract pause(): void;
|
|
26
|
+
protected abstract resume(): void;
|
|
27
|
+
protected abstract isPaused(): boolean | undefined;
|
|
28
|
+
protected abstract isRecording(): boolean;
|
|
29
|
+
protected constructor(visuals: Visuals, options: VideomailClientOptions);
|
|
30
|
+
show(): void;
|
|
31
|
+
protected clearRetryTimeout(): void;
|
|
32
|
+
private showUserMedia;
|
|
33
|
+
private userMediaErrorCallback;
|
|
34
|
+
private getUserMediaCallback;
|
|
35
|
+
private loadGenuineUserMedia;
|
|
36
|
+
protected loadUserMedia(params?: VideomailUserMediaReadyParams): void;
|
|
37
|
+
protected isNotifying(): boolean | null | undefined;
|
|
38
|
+
private isHidden;
|
|
39
|
+
protected clearUserMediaTimeout(): void;
|
|
40
|
+
protected clearStopTimeout(): void;
|
|
41
|
+
isReady(): boolean | undefined;
|
|
42
|
+
protected finishCameraRecovery(restored: boolean): void;
|
|
43
|
+
protected cancelCameraRecovery(): void;
|
|
44
|
+
protected failCameraRecovery(exc: unknown): void;
|
|
45
|
+
recoverCamera(): Promise<boolean>;
|
|
46
|
+
protected switchFacingMode(): void;
|
|
47
|
+
hide(): void;
|
|
48
|
+
isUnloaded(): boolean | undefined;
|
|
49
|
+
isUserMediaLoaded(): boolean | undefined;
|
|
50
|
+
}
|
|
51
|
+
export default RecorderMedia;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Dimension } from "../../../types/dimension.js";
|
|
2
|
+
import type { VideomailUserMediaReadyParams } from "../../../types/events/params.js";
|
|
3
|
+
import type { VideomailClientOptions } from "../../../types/options.js";
|
|
4
|
+
interface UserMediaConstraintsParams {
|
|
5
|
+
options: VideomailClientOptions;
|
|
6
|
+
facingMode: ConstrainDOMString;
|
|
7
|
+
limitedWidth?: Dimension | undefined;
|
|
8
|
+
userMediaParams?: VideomailUserMediaReadyParams | undefined;
|
|
9
|
+
}
|
|
10
|
+
declare function createUserMediaConstraints({ options, facingMode, limitedWidth, userMediaParams, }: UserMediaConstraintsParams): {
|
|
11
|
+
audio: boolean;
|
|
12
|
+
video: MediaTrackConstraints;
|
|
13
|
+
};
|
|
14
|
+
export default createUserMediaConstraints;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { VideomailCommandArgs } from "../../../types/command.js";
|
|
2
|
+
import type { VideomailClientOptions } from "../../../types/options.js";
|
|
3
|
+
type ProgressKind = "frame" | "sample";
|
|
4
|
+
interface ConfirmedProgressParams {
|
|
5
|
+
args?: VideomailCommandArgs | undefined;
|
|
6
|
+
kind: ProgressKind;
|
|
7
|
+
options: VideomailClientOptions;
|
|
8
|
+
}
|
|
9
|
+
declare function calculateProgress(confirmedCount: number, totalCount: number): string;
|
|
10
|
+
declare function getConfirmedProgressNumber({ args, kind, options }: ConfirmedProgressParams): number;
|
|
11
|
+
export { calculateProgress, getConfirmedProgressNumber };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import websocket from "websocket-stream";
|
|
2
|
+
import type { VideomailClientOptions } from "../../../types/options.js";
|
|
3
|
+
import type { RecordingStats } from "../../../types/RecordingStats.js";
|
|
4
|
+
import BoundedWriteQueue from "../../../util/boundedWriteQueue.js";
|
|
5
|
+
import Despot from "../../../util/Despot.js";
|
|
6
|
+
export declare const PIPE_SYMBOL = "\u00B0\u00BA\u00A4\u00F8,\u00B8\u00B8,\u00F8\u00A4\u00BA\u00B0`\u00B0\u00BA\u00A4\u00F8,\u00B8,\u00F8\u00A4\u00B0\u00BA\u00A4\u00F8,\u00B8\u00B8,\u00F8\u00A4\u00BA\u00B0`\u00B0\u00BA\u00A4\u00F8,\u00B8 ";
|
|
7
|
+
export interface WriteStreamParams {
|
|
8
|
+
frameNumber?: number;
|
|
9
|
+
onFlushedCallback?: (params: WriteStreamParams) => void;
|
|
10
|
+
}
|
|
11
|
+
declare abstract class RecorderStreamWriter extends Despot {
|
|
12
|
+
protected readonly pendingWrites: BoundedWriteQueue<WriteStreamParams>;
|
|
13
|
+
protected samplesCount: number;
|
|
14
|
+
protected framesCount: number;
|
|
15
|
+
protected recordingStats?: RecordingStats;
|
|
16
|
+
protected confirmedFrameNumber: number;
|
|
17
|
+
protected confirmedSampleNumber: number;
|
|
18
|
+
protected backpressureTimeout?: number | undefined;
|
|
19
|
+
protected recordingDimensions?: Pick<HTMLCanvasElement, "width" | "height"> | undefined;
|
|
20
|
+
protected stream?: websocket.WebSocketDuplex | undefined;
|
|
21
|
+
protected streamBackpressured: boolean;
|
|
22
|
+
protected resumeAfterDrain: boolean;
|
|
23
|
+
protected mediaTransmissionStarted: boolean;
|
|
24
|
+
protected recordingActive: boolean;
|
|
25
|
+
protected recordingTransportFailed: boolean;
|
|
26
|
+
protected connecting: boolean;
|
|
27
|
+
protected connected: boolean;
|
|
28
|
+
protected reconnecting: boolean;
|
|
29
|
+
protected abstract isUserMediaPaused(): boolean;
|
|
30
|
+
protected abstract isCaptureLoopRunning(): boolean;
|
|
31
|
+
protected abstract stopCaptureLoop(): void;
|
|
32
|
+
protected abstract startCaptureLoop(): void;
|
|
33
|
+
protected abstract stopPings(): void;
|
|
34
|
+
protected abstract clearReconnectTimeout(): void;
|
|
35
|
+
abstract reset(): void;
|
|
36
|
+
protected constructor(options: VideomailClientOptions);
|
|
37
|
+
private hasExceededWebSocketSendBuffer;
|
|
38
|
+
protected writeStream(buffer: Buffer, opts?: WriteStreamParams): void;
|
|
39
|
+
private writeToStream;
|
|
40
|
+
private flushPendingWrites;
|
|
41
|
+
private isStaleStream;
|
|
42
|
+
private canPauseForBackpressure;
|
|
43
|
+
private pauseForBackpressure;
|
|
44
|
+
private resumeRecordingAfterDrain;
|
|
45
|
+
private canResumeAfterDrain;
|
|
46
|
+
private handleWriteFailure;
|
|
47
|
+
private failMediaTransmission;
|
|
48
|
+
private startBackpressureTimeout;
|
|
49
|
+
private shouldStartBackpressureTimeout;
|
|
50
|
+
private shouldIgnoreBackpressureTimeout;
|
|
51
|
+
protected failInterruptedRecording(): void;
|
|
52
|
+
protected handleStreamDrain(stream: websocket.WebSocketDuplex): void;
|
|
53
|
+
private clearBackpressureTimeout;
|
|
54
|
+
protected discardSocket(): void;
|
|
55
|
+
}
|
|
56
|
+
export default RecorderStreamWriter;
|
|
@@ -1,180 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { VideomailClientOptions } from "../../types/options.js";
|
|
3
|
-
import { RecordingStats } from "../../types/RecordingStats.js";
|
|
4
|
-
import Despot from "../../util/Despot.js";
|
|
1
|
+
import { VideomailCommand } from "../../types/command.js";
|
|
2
|
+
import type { VideomailClientOptions } from "../../types/options.js";
|
|
5
3
|
import { UnloadParams } from "../container.js";
|
|
6
4
|
import Visuals from "../visuals.js";
|
|
5
|
+
import RecorderCapture from "./recorder/capture.js";
|
|
7
6
|
import Replay from "./replay.js";
|
|
8
|
-
export
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
interface PauseParams {
|
|
12
|
-
event?: MouseEvent;
|
|
13
|
-
}
|
|
14
|
-
declare class Recorder extends Despot {
|
|
15
|
-
private readonly visuals;
|
|
16
|
-
private readonly replay;
|
|
17
|
-
private readonly pendingWrites;
|
|
18
|
-
private loop?;
|
|
19
|
-
private originalAnimationFrameObject;
|
|
20
|
-
private samplesCount;
|
|
21
|
-
private framesCount;
|
|
22
|
-
private recordingAudioSampleRate?;
|
|
23
|
-
private recordingStats?;
|
|
24
|
-
private confirmedFrameNumber;
|
|
25
|
-
private confirmedSampleNumber;
|
|
26
|
-
private recorderElement?;
|
|
27
|
-
private userMedia?;
|
|
28
|
-
private userMediaTimeout?;
|
|
29
|
-
private retryTimeout?;
|
|
30
|
-
private reconnectTimeout?;
|
|
31
|
-
private connectionTimeout?;
|
|
32
|
-
private backpressureTimeout?;
|
|
33
|
-
private stopTimeout?;
|
|
34
|
-
private frameProgress?;
|
|
35
|
-
private sampleProgress?;
|
|
36
|
-
private canvas?;
|
|
37
|
-
private recordingDimensions?;
|
|
38
|
-
private ctx?;
|
|
39
|
-
private userMediaLoaded?;
|
|
40
|
-
private userMediaLoading;
|
|
41
|
-
private mediaRequestId;
|
|
42
|
-
private cameraRecovery?;
|
|
43
|
-
private resolveCameraRecovery?;
|
|
44
|
-
private resumeAfterCameraRecovery;
|
|
45
|
-
private submitting;
|
|
46
|
-
private unloaded?;
|
|
47
|
-
private stopTime?;
|
|
48
|
-
private stream?;
|
|
49
|
-
private streamBackpressured;
|
|
50
|
-
private resumeAfterDrain;
|
|
51
|
-
private mediaTransmissionStarted;
|
|
52
|
-
private recordingActive;
|
|
53
|
-
private recordingTransportFailed;
|
|
54
|
-
private connecting;
|
|
55
|
-
private connected;
|
|
56
|
-
private connectionFailed;
|
|
57
|
-
private reconnecting;
|
|
58
|
-
private reconnectAttempts;
|
|
59
|
-
private blocking;
|
|
60
|
-
private built;
|
|
61
|
-
private key?;
|
|
62
|
-
private waitingTime?;
|
|
63
|
-
private connectingStartedAt?;
|
|
64
|
-
private lastCloseEvent?;
|
|
65
|
-
private lastSocketError?;
|
|
66
|
-
private pingInterval?;
|
|
67
|
-
private frame?;
|
|
68
|
-
private recordingBuffer?;
|
|
69
|
-
private facingMode;
|
|
7
|
+
export type { StopParams } from "./recorder/capture.js";
|
|
8
|
+
declare class Recorder extends RecorderCapture {
|
|
9
|
+
private readonly dimensions;
|
|
70
10
|
constructor(visuals: Visuals, replay: Replay, options: VideomailClientOptions);
|
|
71
|
-
|
|
72
|
-
private writeStream;
|
|
73
|
-
private writeToStream;
|
|
74
|
-
private flushPendingWrites;
|
|
75
|
-
private isStaleStream;
|
|
76
|
-
private canPauseForBackpressure;
|
|
77
|
-
private pauseForBackpressure;
|
|
78
|
-
private resumeRecordingAfterDrain;
|
|
79
|
-
private canResumeAfterDrain;
|
|
80
|
-
private handleWriteFailure;
|
|
81
|
-
private failMediaTransmission;
|
|
82
|
-
private startBackpressureTimeout;
|
|
83
|
-
private shouldStartBackpressureTimeout;
|
|
84
|
-
private shouldIgnoreBackpressureTimeout;
|
|
85
|
-
private failInterruptedRecording;
|
|
86
|
-
private handleStreamDrain;
|
|
87
|
-
private canReconnectAfterStreamClose;
|
|
88
|
-
private shouldReportStreamClose;
|
|
89
|
-
private handleStreamClose;
|
|
90
|
-
private shouldIgnoreStreamClose;
|
|
91
|
-
private handleStreamError;
|
|
92
|
-
private sendPings;
|
|
93
|
-
private stopPings;
|
|
94
|
-
private onAudioSample;
|
|
95
|
-
show(): void;
|
|
96
|
-
private onUserMediaReady;
|
|
97
|
-
private clearRetryTimeout;
|
|
98
|
-
private clearConnectionTimeout;
|
|
99
|
-
private clearBackpressureTimeout;
|
|
100
|
-
private clearReconnectTimeout;
|
|
101
|
-
private handleConnectionFailure;
|
|
102
|
-
private retryConnection;
|
|
103
|
-
private canRetryConnection;
|
|
104
|
-
private shouldContinueReconnect;
|
|
105
|
-
private discardSocket;
|
|
106
|
-
private isOnline;
|
|
107
|
-
private failConnection;
|
|
108
|
-
private shouldIgnoreConnectionFailure;
|
|
109
|
-
private calculateFrameProgress;
|
|
110
|
-
private calculateSampleProgress;
|
|
111
|
-
private updateOverallProgress;
|
|
112
|
-
private updateFrameProgress;
|
|
113
|
-
private updateSampleProgress;
|
|
114
|
-
private preview;
|
|
115
|
-
private initSocket;
|
|
116
|
-
private showUserMedia;
|
|
117
|
-
private userMediaErrorCallback;
|
|
118
|
-
private getUserMediaCallback;
|
|
119
|
-
private loadGenuineUserMedia;
|
|
120
|
-
private configureVideoConstraints;
|
|
121
|
-
private loadUserMedia;
|
|
122
|
-
private executeCommand;
|
|
123
|
-
private isNotifying;
|
|
124
|
-
private isHidden;
|
|
125
|
-
private writeCommand;
|
|
126
|
-
private cancelAnimationFrame;
|
|
127
|
-
private getIntervalSum;
|
|
128
|
-
private getAvgInterval;
|
|
129
|
-
private getAvgFps;
|
|
130
|
-
private hasValidInterval;
|
|
131
|
-
getRecordingStats(): RecordingStats | undefined;
|
|
132
|
-
getAudioSampleRate(): number | undefined;
|
|
133
|
-
stop(params?: StopParams): void;
|
|
134
|
-
back(cb: () => void): void;
|
|
135
|
-
private reInitializeAudio;
|
|
11
|
+
protected executeCommand(command: VideomailCommand): void;
|
|
136
12
|
unload(params?: UnloadParams): void;
|
|
137
|
-
reset(): void;
|
|
138
|
-
private clearUserMediaTimeout;
|
|
139
|
-
private clearStopTimeout;
|
|
140
|
-
validate(): boolean;
|
|
141
|
-
isReady(): boolean | undefined;
|
|
142
|
-
private finishCameraRecovery;
|
|
143
|
-
private cancelCameraRecovery;
|
|
144
|
-
private failCameraRecovery;
|
|
145
|
-
recoverCamera(): Promise<boolean>;
|
|
146
|
-
pause(params?: PauseParams): void;
|
|
147
|
-
resume(): void;
|
|
148
|
-
private onFlushed;
|
|
149
|
-
private draw;
|
|
150
|
-
private createLoop;
|
|
151
|
-
record(): void;
|
|
152
|
-
private setAnimationFrameObject;
|
|
153
|
-
private restoreAnimationFrameObject;
|
|
154
|
-
private loopWithTimeouts;
|
|
155
13
|
private correctDimensions;
|
|
156
|
-
private switchFacingMode;
|
|
157
14
|
private initEvents;
|
|
158
15
|
private buildElement;
|
|
159
16
|
build(): void;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
hide(): void;
|
|
163
|
-
isUnloaded(): boolean | undefined;
|
|
164
|
-
getRecorderWidth(responsive: boolean): Dimension | undefined;
|
|
165
|
-
getRecordingDimensions(): {
|
|
166
|
-
height: number;
|
|
167
|
-
width: number;
|
|
168
|
-
} | undefined;
|
|
169
|
-
getRecorderHeight(responsive: boolean, useBoundingClientRect?: boolean): Dimension | undefined;
|
|
17
|
+
getRecorderWidth(responsive: boolean): import("../../types/dimension.js").Dimension | undefined;
|
|
18
|
+
getRecorderHeight(responsive: boolean, useBoundingClientRect?: boolean): import("../../types/dimension.js").Dimension | undefined;
|
|
170
19
|
getRatio(): number | undefined;
|
|
171
|
-
calculateWidth(responsive: boolean): Dimension;
|
|
172
|
-
calculateHeight(responsive: boolean): Dimension;
|
|
20
|
+
calculateWidth(responsive: boolean): import("../../types/dimension.js").Dimension;
|
|
21
|
+
calculateHeight(responsive: boolean): import("../../types/dimension.js").Dimension;
|
|
173
22
|
getRawVisualUserMedia(): HTMLVideoElement | null | undefined;
|
|
174
23
|
isConnected(): boolean;
|
|
175
24
|
isConnecting(): boolean;
|
|
176
|
-
limitWidth(width?: number): Dimension | undefined;
|
|
177
|
-
limitHeight(height: number | undefined): Dimension;
|
|
178
|
-
isUserMediaLoaded(): boolean | undefined;
|
|
25
|
+
limitWidth(width?: number): import("../../types/dimension.js").Dimension | undefined;
|
|
26
|
+
limitHeight(height: number | undefined): import("../../types/dimension.js").Dimension;
|
|
179
27
|
}
|
|
180
28
|
export default Recorder;
|