@vkontakte/videoplayer-shared 1.0.100 → 1.0.101-beta.1
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/es2015.cjs +4 -4
- package/es2015.esm.js +4 -4
- package/esnext.cjs +4 -4
- package/esnext.esm.js +4 -4
- package/evergreen.esm.js +4 -4
- package/package.json +1 -1
- package/types/AppTracer/AppTracer.d.ts +17 -2
- package/types/audio/AudioGraph.d.ts +37 -0
- package/types/audio/AudioPluginChain.d.ts +41 -0
- package/types/audio/AudioSourceConnection.d.ts +36 -0
- package/types/audio/global.d.d.ts +3 -0
- package/types/audio/index.d.ts +5 -0
- package/types/audio/plugins/EqualizerPlugin.d.ts +31 -0
- package/types/audio/plugins/NormalizerPlugin.d.ts +23 -0
- package/types/audio/plugins/VolumeFaderPlugin.d.ts +39 -0
- package/types/audio/types.d.ts +132 -0
- package/types/index.d.ts +2 -0
- package/types/reactive/combineLatest.d.ts +6 -0
- package/types/reactive/index.d.ts +1 -0
- package/types/types/DebugData.d.ts +25 -0
- package/types/types/index.d.ts +7 -1
- package/types/utils/browser.d.ts +5 -1
- package/types/utils/clearVideoElement.d.ts +1 -1
- package/types/utils/index.d.ts +1 -0
- package/types/utils/suppressAbort.d.ts +1 -1
- package/types/utils/timers/WorkerTimersBackend.d.ts +28 -0
- package/types/utils/timers/index.d.ts +3 -0
- package/types/utils/timers/sharedTimers.d.ts +1 -0
- package/types/utils/timers/timers.d.ts +6 -0
- package/types/utils/timers/types.d.ts +30 -0
- package/types/utils/timers/worker.d.ts +28 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type DebugData = {
|
|
2
|
+
version?: string;
|
|
3
|
+
viewport?: string;
|
|
4
|
+
provider?: string;
|
|
5
|
+
cdn?: string;
|
|
6
|
+
id?: number;
|
|
7
|
+
volume: number;
|
|
8
|
+
muted: boolean;
|
|
9
|
+
videoSize?: string;
|
|
10
|
+
videoBuffer?: number;
|
|
11
|
+
audioBuffer?: number;
|
|
12
|
+
nativeVideoBuffer?: number;
|
|
13
|
+
nativeAudioBuffer?: number;
|
|
14
|
+
position?: number;
|
|
15
|
+
speed?: number;
|
|
16
|
+
bitrate?: number;
|
|
17
|
+
liveLatency?: number;
|
|
18
|
+
currentVideoSegmentLength?: number;
|
|
19
|
+
currentAudioSegmentLength?: number;
|
|
20
|
+
vsid?: string;
|
|
21
|
+
videoCodec?: string;
|
|
22
|
+
audioCodec?: string;
|
|
23
|
+
hdr?: boolean;
|
|
24
|
+
audioLanguage?: string;
|
|
25
|
+
};
|
package/types/types/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
export type SafeAny = any;
|
|
2
|
-
export
|
|
2
|
+
export declare enum ErrorOrigin {
|
|
3
|
+
MediaError = "mediaError",
|
|
4
|
+
SegmentFetcher = "segment_fetcher",
|
|
5
|
+
SegmentAppend = "segment_append",
|
|
6
|
+
Hangup = "hangup",
|
|
7
|
+
Stall = "stall"
|
|
8
|
+
}
|
|
3
9
|
export interface IError {
|
|
4
10
|
/**
|
|
5
11
|
* Код или другой идентификатор для статистики
|
package/types/utils/browser.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
type TimerMethod = "setTimeout" | "setInterval" | "clearTimeout" | "clearInterval";
|
|
2
|
+
type BrowserWindow = Window & typeof globalThis & Record<TimerMethod, never>;
|
|
3
|
+
export declare const getWindow: () => BrowserWindow;
|
|
4
|
+
export declare const getTimerWindow: () => Window & typeof globalThis;
|
|
2
5
|
export declare const isBrowserWindow: (root?: any) => root is Window;
|
|
6
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const clearVideoElement: (video: HTMLMediaElement
|
|
1
|
+
export declare const clearVideoElement: (video: HTMLMediaElement) => void;
|
package/types/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const isAbortError: (e:
|
|
1
|
+
export declare const isAbortError: (e: unknown) => e is DOMException;
|
|
2
2
|
export declare const suppressAbort: (e: Error | unknown) => void | never;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Milliseconds } from "../semanticTypes";
|
|
2
|
+
import type { TimerId } from "./types";
|
|
3
|
+
export type WorkerTimerRecord = {
|
|
4
|
+
callback: VoidFunction;
|
|
5
|
+
repeat: boolean;
|
|
6
|
+
delay: Milliseconds;
|
|
7
|
+
startedAt: Milliseconds;
|
|
8
|
+
};
|
|
9
|
+
export type WorkerTimersBackendHandlers = {
|
|
10
|
+
onReady: VoidFunction;
|
|
11
|
+
onFatalError: (orphaned: Map<TimerId, WorkerTimerRecord>) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare class WorkerTimersBackend {
|
|
14
|
+
private readonly worker;
|
|
15
|
+
private readonly handlers;
|
|
16
|
+
private readonly records;
|
|
17
|
+
private ticks;
|
|
18
|
+
private constructor();
|
|
19
|
+
static create(handlers: WorkerTimersBackendHandlers): WorkerTimersBackend | null;
|
|
20
|
+
get activeCount(): number;
|
|
21
|
+
get deliveredTicks(): number;
|
|
22
|
+
set(id: TimerId, callback: VoidFunction, delay: Milliseconds, repeat: boolean): void;
|
|
23
|
+
clear(id: TimerId): void;
|
|
24
|
+
destroy(): Map<TimerId, WorkerTimerRecord>;
|
|
25
|
+
private postCommand;
|
|
26
|
+
private handleMessage;
|
|
27
|
+
private handleError;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const timers: unknown;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ITimers, TimerModule, TimersDiagnostics } from "./types";
|
|
2
|
+
export declare const createTimers: (module: TimerModule) => ITimers;
|
|
3
|
+
export declare const retainTimers: (modules: TimerModule[]) => void;
|
|
4
|
+
export declare const releaseTimers: () => void;
|
|
5
|
+
export declare const resetTimers: () => void;
|
|
6
|
+
export declare const getTimersDiagnostics: () => TimersDiagnostics;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Milliseconds } from "../semanticTypes";
|
|
2
|
+
export type TimerId = number;
|
|
3
|
+
export declare enum TimerModule {
|
|
4
|
+
SHARED = "shared",
|
|
5
|
+
CORE = "core",
|
|
6
|
+
STATISTICS = "statistics",
|
|
7
|
+
INTERACTIVE = "interactive",
|
|
8
|
+
UI = "ui",
|
|
9
|
+
UI_TV = "ui-tv"
|
|
10
|
+
}
|
|
11
|
+
export declare enum WorkerState {
|
|
12
|
+
IDLE = "idle",
|
|
13
|
+
STARTING = "starting",
|
|
14
|
+
READY = "ready",
|
|
15
|
+
FAILED = "failed"
|
|
16
|
+
}
|
|
17
|
+
export interface ITimers {
|
|
18
|
+
setTimeout: (callback: VoidFunction, delay?: Milliseconds) => TimerId;
|
|
19
|
+
clearTimeout: (id?: TimerId) => void;
|
|
20
|
+
setInterval: (callback: VoidFunction, delay?: Milliseconds) => TimerId;
|
|
21
|
+
clearInterval: (id?: TimerId) => void;
|
|
22
|
+
}
|
|
23
|
+
export type TimersDiagnostics = {
|
|
24
|
+
workerModules: TimerModule[];
|
|
25
|
+
workerState: WorkerState;
|
|
26
|
+
liveConsumers: number;
|
|
27
|
+
activeWindowTimers: number;
|
|
28
|
+
activeWorkerTimers: number;
|
|
29
|
+
workerTicks: number;
|
|
30
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { TimerId } from "./types";
|
|
2
|
+
export declare enum TimerWorkerCommandName {
|
|
3
|
+
PING = "ping",
|
|
4
|
+
SET = "set",
|
|
5
|
+
CLEAR = "clear"
|
|
6
|
+
}
|
|
7
|
+
export declare enum TimerWorkerMessageName {
|
|
8
|
+
READY = "ready",
|
|
9
|
+
TICK = "tick"
|
|
10
|
+
}
|
|
11
|
+
export type TimerWorkerCommand = {
|
|
12
|
+
type: TimerWorkerCommandName.PING;
|
|
13
|
+
} | {
|
|
14
|
+
type: TimerWorkerCommandName.SET;
|
|
15
|
+
id: TimerId;
|
|
16
|
+
delay: number;
|
|
17
|
+
repeat: boolean;
|
|
18
|
+
} | {
|
|
19
|
+
type: TimerWorkerCommandName.CLEAR;
|
|
20
|
+
id: TimerId;
|
|
21
|
+
};
|
|
22
|
+
export type TimerWorkerMessage = {
|
|
23
|
+
type: TimerWorkerMessageName.READY;
|
|
24
|
+
} | {
|
|
25
|
+
type: TimerWorkerMessageName.TICK;
|
|
26
|
+
id: TimerId;
|
|
27
|
+
};
|
|
28
|
+
export declare function timerWorker(): void;
|