@vkontakte/videoplayer-interactive 1.0.63-dev.55dfadaf.0 → 1.0.63-dev.baccd7d5.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/index.d.ts +11 -0
- package/{types/manifest → manifest}/index.d.ts +3 -3
- package/manifest/utils.d.ts +48 -0
- package/modules/Graph/Graph.d.ts +54 -0
- package/modules/Graph/index.d.ts +1 -0
- package/modules/Interactives/Interactives.d.ts +143 -0
- package/modules/Interactives/Layout.d.ts +16 -0
- package/modules/Interactives/containers/ChoiceContainer.d.ts +34 -0
- package/modules/Interactives/containers/Container.d.ts +21 -0
- package/modules/Interactives/containers/index.d.ts +4 -0
- package/modules/Interactives/containers/types.d.ts +11 -0
- package/{types/modules → modules}/Interactives/containers/utils.d.ts +3 -3
- package/modules/Interactives/controls/AreaControl.d.ts +21 -0
- package/modules/Interactives/controls/ButtonControl.d.ts +25 -0
- package/modules/Interactives/controls/Control.d.ts +48 -0
- package/modules/Interactives/controls/TextControl.d.ts +18 -0
- package/modules/Interactives/controls/index.d.ts +6 -0
- package/modules/Interactives/controls/types.d.ts +35 -0
- package/modules/Interactives/controls/utils.d.ts +14 -0
- package/modules/Interactives/index.d.ts +16 -0
- package/modules/Interactives/styles/index.d.ts +1 -0
- package/modules/Interactives/types.d.ts +79 -0
- package/modules/Interactives/utils/BlinkAnimationRef.d.ts +15 -0
- package/modules/Interactives/utils/ControlFillAnimation/ControlFillAnimation.d.ts +34 -0
- package/modules/Interactives/utils/ControlFillAnimation/index.d.ts +1 -0
- package/modules/Interactives/utils/ControlFillAnimation/utils.d.ts +12 -0
- package/modules/Interactives/utils/ControlTap/ControlTap.d.ts +17 -0
- package/modules/Interactives/utils/ControlTap/index.d.ts +1 -0
- package/{types/modules → modules}/Interactives/utils/ControlTap/utils.d.ts +3 -3
- package/modules/Interactives/utils/GameController.d.ts +71 -0
- package/modules/Interactives/utils/GroupsStack.d.ts +32 -0
- package/modules/Interactives/utils/HistoryController.d.ts +52 -0
- package/modules/Interactives/utils/InteractiveEvents.d.ts +32 -0
- package/modules/Interactives/utils/ResizeManager.d.ts +15 -0
- package/modules/Interactives/utils/SelectBranches.d.ts +23 -0
- package/modules/Interactives/utils/SelectBranches.types.d.ts +78 -0
- package/{types/modules → modules}/Interactives/utils/angleUtils.d.ts +12 -12
- package/modules/Interactives/utils/createControlText.d.ts +4 -0
- package/modules/Interactives/utils/emitOnError.d.ts +13 -0
- package/modules/Interactives/utils/events.d.ts +79 -0
- package/modules/Interactives/utils/events.types.d.ts +52 -0
- package/{types/modules → modules}/Interactives/utils/fallbackStrategies.d.ts +13 -13
- package/modules/Interactives/utils/functionUtils.d.ts +5 -0
- package/{types/modules → modules}/Interactives/utils/gameUtils.d.ts +20 -20
- package/{types/modules → modules}/Interactives/utils/getInteractiveRanges.d.ts +5 -5
- package/modules/Interactives/utils/renderingUtils.d.ts +75 -0
- package/modules/Loaders/index.d.ts +1 -0
- package/modules/Loaders/movikaProjectIdLoader/index.d.ts +1 -0
- package/modules/Loaders/vkVideoLoader/CustomVkVideoLoader.d.ts +10 -0
- package/modules/Loaders/vkVideoLoader/index.d.ts +1 -0
- package/modules/Loaders/vkVideoLoader/types.d.ts +257 -0
- package/{types/modules → modules}/Loaders/vkVideoLoader/utils.d.ts +1 -1
- package/{types/modules → modules}/ManifestController/Loadable.d.ts +5 -5
- package/modules/ManifestController/ManifestController.d.ts +34 -0
- package/modules/ManifestController/index.d.ts +1 -0
- package/{types/modules → modules}/ManifestController/utils.d.ts +5 -5
- package/modules/SeamlessController/InstanceManager.d.ts +15 -0
- package/modules/SeamlessController/SeamlessController.d.ts +34 -0
- package/modules/SeamlessController/utils.d.ts +9 -0
- package/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +10 -0
- package/modules/SeekToInteractiveController/index.d.ts +1 -0
- package/package.json +9 -32
- package/types/CustomError.d.ts +13 -0
- package/types/index.d.ts +2 -11
- package/utils/CssVarsManager.d.ts +23 -0
- package/utils/Error.d.ts +8 -0
- package/utils/EventEmitter.d.ts +12 -0
- package/utils/LastFrame.d.ts +35 -0
- package/utils/LastFrameCanvasAPI.d.ts +19 -0
- package/utils/MultiMap.d.ts +10 -0
- package/utils/Raf.d.ts +13 -0
- package/{types/utils → utils}/chapterHelpers.d.ts +1 -1
- package/utils/compareVersions.d.ts +14 -0
- package/{types/utils → utils}/extractVkMovieId.d.ts +1 -1
- package/utils/getVideoContentSize.d.ts +5 -0
- package/{types/utils → utils}/hexToRgb.d.ts +2 -2
- package/{types/utils → utils}/typeCheck.d.ts +6 -6
- package/es2015.cjs +0 -286
- package/es2015.esm.js +0 -286
- package/es2018.cjs +0 -286
- package/es2018.esm.js +0 -286
- package/es2024.cjs +0 -286
- package/es2024.esm.js +0 -286
- package/esnext.cjs +0 -286
- package/esnext.esm.js +0 -286
- package/evergreen.esm.js +0 -286
- package/types/manifest/utils.d.ts +0 -48
- package/types/modules/Graph/Graph.d.ts +0 -54
- package/types/modules/Graph/index.d.ts +0 -1
- package/types/modules/Interactives/Interactives.d.ts +0 -143
- package/types/modules/Interactives/Layout.d.ts +0 -16
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +0 -34
- package/types/modules/Interactives/containers/Container.d.ts +0 -21
- package/types/modules/Interactives/containers/index.d.ts +0 -4
- package/types/modules/Interactives/containers/types.d.ts +0 -11
- package/types/modules/Interactives/controls/AreaControl.d.ts +0 -21
- package/types/modules/Interactives/controls/ButtonControl.d.ts +0 -25
- package/types/modules/Interactives/controls/Control.d.ts +0 -48
- package/types/modules/Interactives/controls/TextControl.d.ts +0 -18
- package/types/modules/Interactives/controls/index.d.ts +0 -6
- package/types/modules/Interactives/controls/types.d.ts +0 -38
- package/types/modules/Interactives/controls/utils.d.ts +0 -14
- package/types/modules/Interactives/index.d.ts +0 -16
- package/types/modules/Interactives/styles/index.d.ts +0 -1
- package/types/modules/Interactives/types.d.ts +0 -79
- package/types/modules/Interactives/utils/BlinkAnimationRef.d.ts +0 -15
- package/types/modules/Interactives/utils/ControlFillAnimation/ControlFillAnimation.d.ts +0 -34
- package/types/modules/Interactives/utils/ControlFillAnimation/index.d.ts +0 -1
- package/types/modules/Interactives/utils/ControlFillAnimation/utils.d.ts +0 -12
- package/types/modules/Interactives/utils/ControlTap/ControlTap.d.ts +0 -17
- package/types/modules/Interactives/utils/ControlTap/index.d.ts +0 -1
- package/types/modules/Interactives/utils/GameController.d.ts +0 -71
- package/types/modules/Interactives/utils/GroupsStack.d.ts +0 -30
- package/types/modules/Interactives/utils/HistoryController.d.ts +0 -51
- package/types/modules/Interactives/utils/InteractiveEvents.d.ts +0 -32
- package/types/modules/Interactives/utils/ResizeManager.d.ts +0 -15
- package/types/modules/Interactives/utils/SelectBranches.d.ts +0 -23
- package/types/modules/Interactives/utils/SelectBranches.types.d.ts +0 -78
- package/types/modules/Interactives/utils/createControlText.d.ts +0 -4
- package/types/modules/Interactives/utils/emitOnError.d.ts +0 -13
- package/types/modules/Interactives/utils/events.d.ts +0 -79
- package/types/modules/Interactives/utils/events.types.d.ts +0 -55
- package/types/modules/Interactives/utils/functionUtils.d.ts +0 -12
- package/types/modules/Interactives/utils/renderingUtils.d.ts +0 -75
- package/types/modules/Loaders/index.d.ts +0 -1
- package/types/modules/Loaders/movikaProjectIdLoader/index.d.ts +0 -1
- package/types/modules/Loaders/vkVideoLoader/CustomVkVideoLoader.d.ts +0 -10
- package/types/modules/Loaders/vkVideoLoader/index.d.ts +0 -1
- package/types/modules/Loaders/vkVideoLoader/types.d.ts +0 -257
- package/types/modules/ManifestController/ManifestController.d.ts +0 -34
- package/types/modules/ManifestController/index.d.ts +0 -1
- package/types/modules/SeamlessController/InstanceManager.d.ts +0 -15
- package/types/modules/SeamlessController/SeamlessController.d.ts +0 -33
- package/types/modules/SeamlessController/utils.d.ts +0 -9
- package/types/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +0 -10
- package/types/modules/SeekToInteractiveController/index.d.ts +0 -1
- package/types/types/CustomError.d.ts +0 -13
- package/types/types/index.d.ts +0 -2
- package/types/utils/CssVarsManager.d.ts +0 -23
- package/types/utils/Error.d.ts +0 -8
- package/types/utils/EventEmitter.d.ts +0 -12
- package/types/utils/LastFrame.d.ts +0 -35
- package/types/utils/LastFrameCanvasAPI.d.ts +0 -19
- package/types/utils/MultiMap.d.ts +0 -10
- package/types/utils/Raf.d.ts +0 -13
- package/types/utils/compareVersions.d.ts +0 -14
- package/types/utils/getVideoContentSize.d.ts +0 -5
- /package/{types/constants.d.ts → constants.d.ts} +0 -0
- /package/{types/env.d.ts → env.d.ts} +0 -0
- /package/{types/modules → modules}/Interactives/styles/utils.d.ts +0 -0
- /package/{types/modules → modules}/Loaders/movikaProjectIdLoader/movikaProjectIdLoader.d.ts +0 -0
- /package/types/{types/dom.d.ts → dom.d.ts} +0 -0
- /package/{types/utils → utils}/debounce.d.ts +0 -0
- /package/{types/utils → utils}/throttle.d.ts +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare enum ErrorSeverityEnum {
|
|
2
|
+
RECOVERABLE = 1,// Errors that do not break the library. Can be fixed by the library
|
|
3
|
+
CRITICAL = 2
|
|
4
|
+
}
|
|
5
|
+
export declare enum ErrorCategoryEnum {
|
|
6
|
+
VIDEO = 0,
|
|
7
|
+
INTERACTIVES = 1,
|
|
8
|
+
GRAPH = 2,
|
|
9
|
+
MANIFEST = 3,
|
|
10
|
+
LOADERS = 4,
|
|
11
|
+
HISTORY = 5,
|
|
12
|
+
SEAMLESS = 6
|
|
13
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
export type
|
|
2
|
-
export
|
|
3
|
-
export type { IInteractiveOptions, InteractiveRange, InteractiveProjectInfo, PlayerChangedData, VideoInfo } from "./modules/Interactives";
|
|
4
|
-
export { ManifestController } from "./modules/ManifestController";
|
|
5
|
-
export * from "./manifest";
|
|
6
|
-
export { compareVersions } from "./utils/compareVersions";
|
|
7
|
-
export { CustomError } from "./utils/Error";
|
|
8
|
-
export * from "./utils/chapterHelpers";
|
|
9
|
-
export declare const SDKInfo: {
|
|
10
|
-
version: string;
|
|
11
|
-
};
|
|
1
|
+
export type * from './dom';
|
|
2
|
+
export * from './CustomError';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare class CssVarsManager {
|
|
2
|
+
rootElement: HTMLElement;
|
|
3
|
+
private readonly isCssVarsSupported;
|
|
4
|
+
private rootElementProps;
|
|
5
|
+
constructor(rootElement: HTMLElement);
|
|
6
|
+
private static checkCssVarsSupport;
|
|
7
|
+
/**
|
|
8
|
+
* Возвращает значение CSS-переменной или фолбэк из JS.
|
|
9
|
+
*/
|
|
10
|
+
getPropValue(propKey: string): string | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Применяет несколько свойств
|
|
13
|
+
*/
|
|
14
|
+
setup(props: Record<string, string>): void;
|
|
15
|
+
/**
|
|
16
|
+
* Удаляет все сохранённые переменные со стилевого элемента
|
|
17
|
+
*/
|
|
18
|
+
cleanup(): void;
|
|
19
|
+
/**
|
|
20
|
+
* Применяет одну переменную
|
|
21
|
+
*/
|
|
22
|
+
setProp(key: string, value: string): void;
|
|
23
|
+
}
|
package/utils/Error.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ErrorSeverityEnum, ErrorCategoryEnum } from '#/types';
|
|
2
|
+
export declare class CustomError {
|
|
3
|
+
severity: ErrorSeverityEnum;
|
|
4
|
+
category: ErrorCategoryEnum;
|
|
5
|
+
data: unknown;
|
|
6
|
+
constructor(severity: ErrorSeverityEnum, category: ErrorCategoryEnum, ...varArgs: unknown[]);
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class EventEmitter {
|
|
2
|
+
listeners: Record<string, Function[]>;
|
|
3
|
+
addListener(eventName: string, fn: Function): EventEmitter;
|
|
4
|
+
on(eventName: string, fn: Function): EventEmitter;
|
|
5
|
+
once(eventName: string, fn: Function): EventEmitter;
|
|
6
|
+
off(eventName: string, fn: Function): EventEmitter;
|
|
7
|
+
reset(): void;
|
|
8
|
+
removeListener(eventName: string, fn: Function): EventEmitter;
|
|
9
|
+
emit(eventName: string, ...args: unknown[]): boolean;
|
|
10
|
+
listenerCount(eventName: string): number;
|
|
11
|
+
rawListeners(eventName: string): Function[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Chapter } from '#/manifest';
|
|
2
|
+
import { LastFrameCanvasAPI } from './LastFrameCanvasAPI';
|
|
3
|
+
type ConstructorParams = {
|
|
4
|
+
parentElement: HTMLElement;
|
|
5
|
+
endOffsetMs?: number;
|
|
6
|
+
onError: (err?: Error) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare class LastFrame {
|
|
9
|
+
lastFrameCanvas: LastFrameCanvasAPI;
|
|
10
|
+
endOffsetMs: number;
|
|
11
|
+
currentChapter?: Chapter;
|
|
12
|
+
currentVideoDurationMs: number;
|
|
13
|
+
rootElement: HTMLElement;
|
|
14
|
+
private _containerTimeFrameShouldReceived;
|
|
15
|
+
private _endTimeFrameReceived;
|
|
16
|
+
private _shouldCallSkip;
|
|
17
|
+
private _callbacks?;
|
|
18
|
+
constructor({ parentElement, endOffsetMs, onError }: ConstructorParams);
|
|
19
|
+
destroy(): void;
|
|
20
|
+
setVideoDuration(videoDurationMs: number): void;
|
|
21
|
+
setVideoElement(videoElement: HTMLVideoElement): void;
|
|
22
|
+
setCurrentChapter(chapter: Chapter): void;
|
|
23
|
+
show(): void;
|
|
24
|
+
hide(): void;
|
|
25
|
+
updateCanvasDimensions(shouldSave?: boolean): Promise<void>;
|
|
26
|
+
draw(): void;
|
|
27
|
+
isChapterEndTime(currentTimeMs: number): boolean;
|
|
28
|
+
isContainerTime(currentTimeMs: number): boolean | undefined;
|
|
29
|
+
onEachTick: (timeMs?: number) => void;
|
|
30
|
+
onSeek: () => void;
|
|
31
|
+
reset(): void;
|
|
32
|
+
private _onError;
|
|
33
|
+
}
|
|
34
|
+
export declare function waitForMs(waitTimeMs?: number): Promise<unknown>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class LastFrameCanvasAPI {
|
|
2
|
+
rootElement: HTMLCanvasElement;
|
|
3
|
+
canvasImgSrc?: CanvasImageSource;
|
|
4
|
+
private _prevSizeId;
|
|
5
|
+
constructor();
|
|
6
|
+
clear(): void;
|
|
7
|
+
isImageDrawn(): boolean;
|
|
8
|
+
destroy(): void;
|
|
9
|
+
show(): void;
|
|
10
|
+
hide(): void;
|
|
11
|
+
setCanvasImageSource(canvasImgSrc: CanvasImageSource): void;
|
|
12
|
+
draw(): void;
|
|
13
|
+
updateCanvasDimensions(dimensions: {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}, shouldSave?: boolean): Promise<void>;
|
|
17
|
+
save(): Promise<HTMLImageElement>;
|
|
18
|
+
restore(imgEl: HTMLImageElement): void;
|
|
19
|
+
}
|
package/utils/Raf.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class Raf {
|
|
2
|
+
raf: number | undefined;
|
|
3
|
+
fn: VoidFunction | undefined;
|
|
4
|
+
fns: Array<VoidFunction>;
|
|
5
|
+
constructor(fn?: VoidFunction);
|
|
6
|
+
addFn: (fn: VoidFunction, shouldRequest?: boolean) => void;
|
|
7
|
+
removeFn: (fn: VoidFunction, shouldRequest?: boolean) => void;
|
|
8
|
+
updateFn: () => void;
|
|
9
|
+
forceRequestAnimation: () => void;
|
|
10
|
+
requestAnimation: () => void;
|
|
11
|
+
cancelAnimation: () => void;
|
|
12
|
+
release(): void;
|
|
13
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Manifest, ManifestVideoVariant, ManifestVideo, VideoId } from
|
|
1
|
+
import type { Manifest, ManifestVideoVariant, ManifestVideo, VideoId } from '#/manifest';
|
|
2
2
|
export declare const chapterIdsToVKVideoIds: (chapterIds: string[], interactiveManifest: Manifest) => number[];
|
|
3
3
|
export declare const getVideoRawIdByMedia: (mediaVideo: ManifestVideo) => string | undefined;
|
|
4
4
|
export declare const isVKVariantItem: (variantItem: ManifestVideoVariant) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compares 2 versions
|
|
3
|
+
*
|
|
4
|
+
* Results 0 if v1 = v2
|
|
5
|
+
*
|
|
6
|
+
* Results 1 if v1 > v2
|
|
7
|
+
*
|
|
8
|
+
* Results -1 if v1 < v2
|
|
9
|
+
*
|
|
10
|
+
* @param {string} v1 version 1
|
|
11
|
+
* @param {string} v2 version 2
|
|
12
|
+
* @returns {number} result status
|
|
13
|
+
*/
|
|
14
|
+
export declare const compareVersions: (v1?: string, v2?: string) => number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ManifestVideo } from
|
|
1
|
+
import type { ManifestVideo } from '#/manifest';
|
|
2
2
|
export declare const extractVkMovieId: (media: ManifestVideo) => [] | [string, string];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare enum TypesEnum {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
Object = "Object",
|
|
3
|
+
String = "String",
|
|
4
|
+
Array = "Array",
|
|
5
|
+
Number = "Number",
|
|
6
|
+
Function = "Function",
|
|
7
|
+
Boolean = "Boolean"
|
|
8
8
|
}
|
|
9
9
|
type TypesEnumKeys = `${TypesEnum}`;
|
|
10
10
|
export declare const isType: (value: unknown, is: TypesEnumKeys) => boolean;
|