@vkontakte/videoplayer-interactive 1.0.60-dev.74465ac5.0 → 1.0.60-dev.7be47b47.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/esnext.esm.js +6 -6
- package/package.json +4 -4
- package/types/index.d.ts +9 -8
- package/types/manifest/index.d.ts +3 -3
- package/types/manifest/utils.d.ts +33 -32
- package/types/modules/Graph/Graph.d.ts +47 -46
- package/types/modules/Graph/index.d.ts +1 -1
- package/types/modules/Interactives/Interactives.d.ts +138 -135
- package/types/modules/Interactives/Layout.d.ts +11 -11
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +31 -31
- package/types/modules/Interactives/containers/Container.d.ts +19 -19
- package/types/modules/Interactives/containers/index.d.ts +4 -4
- package/types/modules/Interactives/containers/types.d.ts +6 -6
- package/types/modules/Interactives/containers/utils.d.ts +3 -3
- package/types/modules/Interactives/controls/AreaControl.d.ts +17 -16
- package/types/modules/Interactives/controls/ButtonControl.d.ts +21 -20
- package/types/modules/Interactives/controls/Control.d.ts +42 -41
- package/types/modules/Interactives/controls/TextControl.d.ts +14 -13
- package/types/modules/Interactives/controls/index.d.ts +6 -6
- package/types/modules/Interactives/controls/types.d.ts +22 -19
- package/types/modules/Interactives/controls/utils.d.ts +10 -10
- package/types/modules/Interactives/index.d.ts +14 -95
- package/types/modules/Interactives/styles/index.d.ts +1 -1
- package/types/modules/Interactives/types.d.ts +64 -64
- package/types/modules/Interactives/utils/BlinkAnimationRef.d.ts +10 -10
- package/types/modules/Interactives/utils/ControlFillAnimation/ControlFillAnimation.d.ts +30 -30
- package/types/modules/Interactives/utils/ControlFillAnimation/index.d.ts +1 -1
- package/types/modules/Interactives/utils/ControlFillAnimation/utils.d.ts +9 -9
- package/types/modules/Interactives/utils/ControlTap/ControlTap.d.ts +12 -12
- package/types/modules/Interactives/utils/ControlTap/index.d.ts +1 -1
- package/types/modules/Interactives/utils/ControlTap/utils.d.ts +3 -3
- package/types/modules/Interactives/utils/GameController.d.ts +66 -66
- package/types/modules/Interactives/utils/GroupsStack.d.ts +18 -20
- package/types/modules/Interactives/utils/HistoryController.d.ts +39 -40
- package/types/modules/Interactives/utils/InteractiveEvents.d.ts +30 -29
- package/types/modules/Interactives/utils/ResizeManager.d.ts +10 -10
- package/types/modules/Interactives/utils/SelectBranches.d.ts +15 -15
- package/types/modules/Interactives/utils/SelectBranches.types.d.ts +53 -53
- package/types/modules/Interactives/utils/angleUtils.d.ts +13 -13
- package/types/modules/Interactives/utils/createControlText.d.ts +2 -2
- package/types/modules/Interactives/utils/emitOnError.d.ts +10 -10
- package/types/modules/Interactives/utils/events.d.ts +67 -67
- package/types/modules/Interactives/utils/events.types.d.ts +35 -32
- package/types/modules/Interactives/utils/fallbackStrategies.d.ts +15 -14
- package/types/modules/Interactives/utils/functionUtils.d.ts +9 -2
- package/types/modules/Interactives/utils/gameUtils.d.ts +22 -21
- package/types/modules/Interactives/utils/getInteractiveRanges.d.ts +5 -5
- package/types/modules/Interactives/utils/renderingUtils.d.ts +48 -53
- package/types/modules/Loaders/index.d.ts +1 -1
- package/types/modules/Loaders/movikaProjectIdLoader/index.d.ts +1 -1
- package/types/modules/Loaders/vkVideoLoader/CustomVkVideoLoader.d.ts +8 -8
- package/types/modules/Loaders/vkVideoLoader/index.d.ts +1 -1
- package/types/modules/Loaders/vkVideoLoader/types.d.ts +231 -231
- package/types/modules/Loaders/vkVideoLoader/utils.d.ts +1 -1
- package/types/modules/ManifestController/Loadable.d.ts +5 -5
- package/types/modules/ManifestController/ManifestController.d.ts +29 -29
- package/types/modules/ManifestController/index.d.ts +1 -1
- package/types/modules/ManifestController/utils.d.ts +6 -6
- package/types/modules/SeamlessController/InstanceManager.d.ts +10 -10
- package/types/modules/SeamlessController/SeamlessController.d.ts +30 -27
- package/types/modules/SeamlessController/utils.d.ts +6 -6
- package/types/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +8 -8
- package/types/modules/SeekToInteractiveController/index.d.ts +1 -1
- package/types/types/CustomError.d.ts +9 -9
- package/types/types/index.d.ts +2 -2
- package/types/utils/CssVarsManager.d.ts +21 -21
- package/types/utils/Error.d.ts +6 -6
- package/types/utils/EventEmitter.d.ts +10 -10
- package/types/utils/LastFrame.d.ts +29 -29
- package/types/utils/LastFrameCanvasAPI.d.ts +17 -17
- package/types/utils/MultiMap.d.ts +8 -8
- package/types/utils/Raf.d.ts +11 -11
- package/types/utils/chapterHelpers.d.ts +1 -1
- package/types/utils/compareVersions.d.ts +12 -12
- package/types/utils/extractVkMovieId.d.ts +1 -1
- package/types/utils/getVideoContentSize.d.ts +3 -3
- package/types/utils/hexToRgb.d.ts +2 -2
- package/types/utils/throttle.d.ts +1 -1
- package/types/utils/typeCheck.d.ts +7 -7
- package/es2015.cjs +0 -285
- package/es2015.esm.js +0 -285
- package/es2018.cjs +0 -285
- package/es2018.esm.js +0 -285
- package/es2024.cjs +0 -285
- package/es2024.esm.js +0 -285
- package/esnext.cjs +0 -285
- package/evergreen.esm.js +0 -285
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import type { InterfaceLanguage } from
|
|
2
|
-
import type { IOptionalTuningConfig, IPlayer } from
|
|
3
|
-
import type { IOneStat } from
|
|
4
|
-
import type { Loaders } from
|
|
5
|
-
import type { HistoryApi, HistorySettings } from
|
|
6
|
-
import type { Chapter, ManifestVideo } from
|
|
7
|
-
export type { VideoInfo } from
|
|
1
|
+
import type { InterfaceLanguage } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IOptionalTuningConfig, IPlayer } from "@vkontakte/videoplayer-core";
|
|
3
|
+
import type { IOneStat } from "@vkontakte/videoplayer-statistics";
|
|
4
|
+
import type { Loaders } from "../ManifestController/Loadable";
|
|
5
|
+
import type { HistoryApi, HistorySettings } from "./utils/HistoryController";
|
|
6
|
+
import type { Chapter, ManifestVideo } from "../../manifest";
|
|
7
|
+
export type { VideoInfo } from "@interactiveplatform/movika-graph-editor";
|
|
8
8
|
export type InteractiveProjectInfo = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
videoId: string;
|
|
10
|
+
pid?: string;
|
|
11
|
+
title?: string;
|
|
12
|
+
variantPayloadType?: string;
|
|
13
13
|
};
|
|
14
|
-
export type RequiredOptions =
|
|
15
|
-
export type IOptionalInteractiveOptions = Partial<Omit<IInteractiveOptions, RequiredOptions |
|
|
16
|
-
|
|
14
|
+
export type RequiredOptions = "parentElement" | "fullscreenTargetElement";
|
|
15
|
+
export type IOptionalInteractiveOptions = Partial<Omit<IInteractiveOptions, RequiredOptions | "config">> & Required<Pick<IInteractiveOptions, RequiredOptions>> & {
|
|
16
|
+
config?: Partial<IInteractiveOptions["config"]>;
|
|
17
17
|
};
|
|
18
18
|
export type AnimationsFeatureToggles = Partial<{
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
areaControlShadow: boolean;
|
|
20
|
+
controlsExpectTimeBlinkAnimation: boolean;
|
|
21
|
+
controlsTapPlace: boolean;
|
|
22
|
+
controlsFillAnimation: boolean;
|
|
23
|
+
controlsHideAnimation: boolean;
|
|
24
24
|
}>;
|
|
25
25
|
export interface IInteractiveOptions {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
26
|
+
parentElement: HTMLElement;
|
|
27
|
+
fullscreenTargetElement: HTMLElement;
|
|
28
|
+
lang: InterfaceLanguage | string;
|
|
29
|
+
config: {
|
|
30
|
+
historyMaxLength: number;
|
|
31
|
+
noInteractionEventTimeout: number;
|
|
32
|
+
};
|
|
33
|
+
graph: boolean;
|
|
34
|
+
lastFrame: boolean;
|
|
35
|
+
initSeamless: boolean;
|
|
36
|
+
permanentTextControls: boolean;
|
|
37
|
+
interactiveTimeOpenUri: boolean;
|
|
38
|
+
loaders: Partial<Loaders>;
|
|
39
|
+
initChapterId?: string;
|
|
40
|
+
projectInfo?: InteractiveProjectInfo;
|
|
41
|
+
historyApi?: HistoryApi;
|
|
42
|
+
historySettings?: HistorySettings;
|
|
43
|
+
coreConfig?: IOptionalTuningConfig;
|
|
44
|
+
vkVideoLoader?: (owner_id: string, video_id: string) => unknown;
|
|
45
|
+
createOneStat?: (video: any, configOverwrite?: any) => IOneStat | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated
|
|
48
|
+
* */
|
|
49
|
+
disableControlsOnPause?: boolean;
|
|
50
|
+
disableTextControlContainerVisibilityEvents?: boolean;
|
|
51
|
+
isTouch?: boolean;
|
|
52
|
+
animationsFeatureToggles?: AnimationsFeatureToggles;
|
|
53
|
+
enableAvPlayerSupport?: boolean;
|
|
54
|
+
endChapterHistoryFix?: boolean;
|
|
55
55
|
}
|
|
56
56
|
export type ChapterChangedData = {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
chapter: Chapter;
|
|
58
|
+
manifestVideo: ManifestVideo;
|
|
59
59
|
};
|
|
60
60
|
export type PlayerChangedData<T = any> = {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
player: IPlayer;
|
|
62
|
+
config: T;
|
|
63
63
|
};
|
|
64
64
|
export interface EachTickData {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
subjectId: string;
|
|
66
|
+
subjectName: string;
|
|
67
|
+
range: number[];
|
|
68
|
+
currentTime: number;
|
|
69
|
+
isInteractiveTime: boolean;
|
|
70
70
|
}
|
|
71
71
|
export type IgnoreExpectState = {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
72
|
+
isExpectTime: boolean;
|
|
73
|
+
hasOtherExpect: boolean;
|
|
74
|
+
hasOpenURIEvent: boolean;
|
|
75
|
+
hasOpenURIEventInCurrentContainer: boolean;
|
|
76
|
+
isAllOpenURIEventsValid: boolean;
|
|
77
|
+
isExpectEventForCurrentContainer: boolean;
|
|
78
|
+
hasShouldOpenNowEvent: boolean;
|
|
79
79
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare const BLINK_ANIM_CLASSNAME_PREFIX = "interactive-blink-anim-reference";
|
|
2
2
|
export declare const blinkAnimClassNames: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
common: string;
|
|
4
|
+
animation: string;
|
|
5
|
+
disabled: string;
|
|
6
6
|
};
|
|
7
7
|
export declare class BlinkAnimationRef {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
private _RAFId;
|
|
9
|
+
private _element;
|
|
10
|
+
get element(): HTMLDivElement | undefined;
|
|
11
|
+
create(): void;
|
|
12
|
+
restart(): void;
|
|
13
|
+
private cleanupRAF;
|
|
14
|
+
destroy(): void;
|
|
15
15
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
export type Options = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
startTime: number;
|
|
3
|
+
endTime: number;
|
|
4
|
+
rotateAngle: number;
|
|
5
|
+
borderRadius: string;
|
|
6
|
+
debug?: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare class ControlFillAnimation {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
9
|
+
fillAnimationElement: HTMLDivElement;
|
|
10
|
+
private fillAnimationFillerElement;
|
|
11
|
+
private fillAnimationFillerWrapperElement;
|
|
12
|
+
private startTime;
|
|
13
|
+
private endTime;
|
|
14
|
+
private shouldFillHeight;
|
|
15
|
+
private widthExpansionCoef;
|
|
16
|
+
private isDebug;
|
|
17
|
+
private fromLeft;
|
|
18
|
+
private useSkew;
|
|
19
|
+
private rotateAngle;
|
|
20
|
+
constructor(opts: Options);
|
|
21
|
+
updateDimension(opts: {
|
|
22
|
+
width: number;
|
|
23
|
+
height: number;
|
|
24
|
+
borderWidth: number;
|
|
25
|
+
}): void;
|
|
26
|
+
updateAnimation(currentTime: number): void;
|
|
27
|
+
/**
|
|
28
|
+
* Когда мы применяем scew для контрол, расстояние между крайними left & right
|
|
29
|
+
* точками становится больше. Это значит, что нужно увеличивать
|
|
30
|
+
* элемент-заполнитель, чтобы он заполнял контрол полностью. Этот метод
|
|
31
|
+
* возвращает коэффцицент увеличения для элемента-заполнителя.
|
|
32
|
+
*/
|
|
33
|
+
private calcWidthExpansionCoef;
|
|
34
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./ControlFillAnimation";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const CONTROL_FILL_ANIMATION_CLASSNAME_PREFIX = "interactive-control-fill-animation";
|
|
2
2
|
export declare const controlFillAnimationClassNames: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
common: string;
|
|
4
|
+
fillerWrapper: string;
|
|
5
|
+
filler: string;
|
|
6
|
+
fillHeight: string;
|
|
7
|
+
fillWidth: string;
|
|
8
|
+
fromTop: string;
|
|
9
|
+
fromBottom: string;
|
|
10
|
+
fromLeft: string;
|
|
11
|
+
fromRight: string;
|
|
12
12
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
type Options = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
controlRotateAngleRad: number;
|
|
3
|
+
circleDiameterPx?: number;
|
|
4
|
+
useDimensionsBasedSize?: boolean;
|
|
5
|
+
clickCancelCondition: () => boolean;
|
|
6
6
|
};
|
|
7
7
|
export declare class ControlTap {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
element: HTMLDivElement;
|
|
9
|
+
controlRotateAngleRad: number;
|
|
10
|
+
clickCancelCondition: () => boolean;
|
|
11
|
+
circleDiameterPx: number;
|
|
12
|
+
useDimensionsBasedSize: boolean;
|
|
13
|
+
constructor({ controlRotateAngleRad, clickCancelCondition, circleDiameterPx, useDimensionsBasedSize }: Options);
|
|
14
|
+
onElementClick: (e: MouseEvent) => void;
|
|
15
|
+
onAnimationEnd: (e: TransitionEvent) => void;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from "./ControlTap";
|
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
import { type ISubscription, type IValueSubject } from
|
|
2
|
-
import { type IPlayer } from
|
|
3
|
-
import type { InteractiveEventsType } from
|
|
4
|
-
import type { ChapterBranch } from
|
|
5
|
-
import type { EventEmitter } from
|
|
6
|
-
import { CustomError } from
|
|
7
|
-
import type { SelectBranchesType } from
|
|
8
|
-
import type { IgnoreExpectState, AnimationsFeatureToggles, IInteractiveOptions } from
|
|
9
|
-
import type { ChoiceContainer } from
|
|
10
|
-
import { type GlobalEvents } from
|
|
11
|
-
import { GameStates } from
|
|
12
|
-
type Features = Pick<AnimationsFeatureToggles,
|
|
1
|
+
import { type ISubscription, type IValueSubject } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import { type IPlayer } from "@vkontakte/videoplayer-core";
|
|
3
|
+
import type { InteractiveEventsType } from "./InteractiveEvents";
|
|
4
|
+
import type { ChapterBranch } from "../../../manifest";
|
|
5
|
+
import type { EventEmitter } from "../../../utils/EventEmitter";
|
|
6
|
+
import type { CustomError } from "../../../utils/Error";
|
|
7
|
+
import type { SelectBranchesType } from "./SelectBranches";
|
|
8
|
+
import type { IgnoreExpectState, AnimationsFeatureToggles, IInteractiveOptions } from "../types";
|
|
9
|
+
import type { ChoiceContainer } from "../containers";
|
|
10
|
+
import { type GlobalEvents } from "./events";
|
|
11
|
+
import { GameStates } from "./gameUtils";
|
|
12
|
+
type Features = Pick<AnimationsFeatureToggles, "controlsHideAnimation"> & Pick<IInteractiveOptions, "enableAvPlayerSupport">;
|
|
13
13
|
type ConstructorArg = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
14
|
+
player: IPlayer;
|
|
15
|
+
container: ChoiceContainer;
|
|
16
|
+
branches: ChapterBranch[];
|
|
17
|
+
selectBranches: ReturnType<SelectBranchesType>;
|
|
18
|
+
interactiveEvents: InteractiveEventsType;
|
|
19
|
+
globalEventEmitter: EventEmitter;
|
|
20
|
+
globalEvents: GlobalEvents;
|
|
21
|
+
getContainerEventState: () => IgnoreExpectState;
|
|
22
|
+
permanentTextControls: boolean;
|
|
23
|
+
interactiveTimeOpenUri: boolean;
|
|
24
|
+
disabledControls$: IValueSubject<boolean>;
|
|
25
|
+
onRemove: () => void;
|
|
26
|
+
onError: (error: CustomError) => void;
|
|
27
|
+
disableTextControlContainerVisibilityEvents?: boolean;
|
|
28
|
+
features: Features;
|
|
29
29
|
};
|
|
30
30
|
export declare class GameController {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
31
|
+
container: ChoiceContainer;
|
|
32
|
+
branches: ChapterBranch[];
|
|
33
|
+
selectBranches: ReturnType<SelectBranchesType>;
|
|
34
|
+
subscription: ISubscription;
|
|
35
|
+
player: IPlayer;
|
|
36
|
+
interactiveEvents: InteractiveEventsType;
|
|
37
|
+
getContainerEventState: () => IgnoreExpectState;
|
|
38
|
+
isPermanentText: boolean;
|
|
39
|
+
interactiveTimeOpenUri: boolean;
|
|
40
|
+
disabledControls$: IValueSubject<boolean>;
|
|
41
|
+
onRemove: () => void;
|
|
42
|
+
globalEventEmitter: EventEmitter;
|
|
43
|
+
gameState: GameStates;
|
|
44
|
+
isSelectedControlEvent: boolean;
|
|
45
|
+
isSelectedContainerEvent: boolean;
|
|
46
|
+
globalEvents: GlobalEvents;
|
|
47
|
+
onError: ConstructorArg["onError"];
|
|
48
|
+
disableTextControlContainerVisibilityEvents: boolean;
|
|
49
|
+
features: Features;
|
|
50
|
+
constructor({ player, container, branches, selectBranches, interactiveEvents, globalEvents, globalEventEmitter, getContainerEventState, permanentTextControls, interactiveTimeOpenUri, disabledControls$, onRemove, onError, disableTextControlContainerVisibilityEvents, features }: ConstructorArg);
|
|
51
|
+
private emitContainerVisibilityEvent;
|
|
52
|
+
registerEvents(): void;
|
|
53
|
+
hide: () => void;
|
|
54
|
+
show: () => void;
|
|
55
|
+
selectContainerEvent(isEOV?: boolean): void;
|
|
56
|
+
onStartTime(): void;
|
|
57
|
+
onEndTime(): void;
|
|
58
|
+
onBeforeStartTime(): void;
|
|
59
|
+
onEndOfVideo: () => void;
|
|
60
|
+
whilePlaying: () => void;
|
|
61
|
+
onResize(isInteractiveTime: boolean): void;
|
|
62
|
+
reset(): void;
|
|
63
|
+
removeView(withTransition?: boolean | undefined): void;
|
|
64
|
+
fakeRemoveView(remove?: boolean): void;
|
|
65
|
+
updateControlsShadowStyles(isDark?: boolean): void;
|
|
66
|
+
toggleBlinkAnimation(value: boolean): void;
|
|
67
|
+
isInteracted(): boolean;
|
|
68
|
+
isRemovedOrDestroyed(includeWillRemovedState?: boolean): boolean;
|
|
69
|
+
destroy(withTransition?: boolean): void;
|
|
70
70
|
}
|
|
71
71
|
export {};
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import type { EventActionKeys } from
|
|
2
|
-
export type TPriority =
|
|
1
|
+
import type { EventActionKeys } from "../../../manifest";
|
|
2
|
+
export type TPriority = "chapter" | "container" | "control";
|
|
3
3
|
export type TPayload = {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
actionType: EventActionKeys;
|
|
5
|
+
action: AnyFn;
|
|
6
6
|
};
|
|
7
7
|
export type TMapInitiator = {
|
|
8
|
-
|
|
9
|
-
};
|
|
10
|
-
type TMapPriority = {
|
|
11
|
-
[priority in TPriority]?: TMapInitiator;
|
|
8
|
+
[initiator: string]: TPayload[];
|
|
12
9
|
};
|
|
10
|
+
type TMapPriority = { [priority in TPriority]? : TMapInitiator };
|
|
13
11
|
type TMap = {
|
|
14
|
-
|
|
12
|
+
[timestamp: number]: TMapPriority;
|
|
15
13
|
};
|
|
16
14
|
export type TMapFlattened = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
timestamp: number;
|
|
16
|
+
priority: TPriority;
|
|
17
|
+
initiator: string;
|
|
20
18
|
} & TPayload;
|
|
21
|
-
type GetAndRemoveArgType = Partial<Omit<TMapFlattened, keyof TPayload>> & Pick<TMapFlattened,
|
|
19
|
+
type GetAndRemoveArgType = Partial<Omit<TMapFlattened, keyof TPayload>> & Pick<TMapFlattened, "timestamp">;
|
|
22
20
|
export type TGroupsStack = ReturnType<typeof GroupsStack>;
|
|
23
21
|
export declare function GroupsStack(): {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
22
|
+
map: TMap;
|
|
23
|
+
remove: (args: GetAndRemoveArgType) => boolean;
|
|
24
|
+
add: (args: TMapFlattened) => void;
|
|
25
|
+
removeAll: () => void;
|
|
26
|
+
get: (args: GetAndRemoveArgType) => TMapPriority | TMapInitiator | TPayload[] | null;
|
|
27
|
+
getLte: (timestamp: number) => TMap;
|
|
28
|
+
getGte: (timestamp: number) => TMap;
|
|
31
29
|
};
|
|
32
30
|
export {};
|
|
@@ -1,52 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { IValueSubject } from
|
|
3
|
-
import { EventEmitter } from
|
|
4
|
-
import type { VideoId } from
|
|
5
|
-
import type { VideoInfo } from
|
|
6
|
-
import type { Interactives } from
|
|
7
|
-
import { CustomError } from
|
|
1
|
+
import { Subject } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IValueSubject, Nullable } from "@vkontakte/videoplayer-shared";
|
|
3
|
+
import type { EventEmitter } from "../../../utils/EventEmitter";
|
|
4
|
+
import type { Manifest, VideoId } from "../../../manifest";
|
|
5
|
+
import type { VideoInfo } from "..";
|
|
6
|
+
import type { Interactives } from "..";
|
|
7
|
+
import { CustomError } from "../../../utils/Error";
|
|
8
8
|
export interface HistoryApi {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
get: (rawId: string) => Promise<number[]>;
|
|
10
|
+
save: (rawId: string, videoIds: number[]) => Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
export interface HistorySettings {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
maxLength: number;
|
|
14
|
+
initChapterId?: string;
|
|
15
15
|
}
|
|
16
16
|
interface HistoryControllerParams {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
globalEventEmitter: EventEmitter;
|
|
18
|
+
interactiveController: Interactives;
|
|
19
|
+
settings: HistorySettings;
|
|
20
|
+
videoId?: string;
|
|
21
|
+
historyApi?: Nullable<HistoryApi>;
|
|
22
22
|
}
|
|
23
23
|
export interface HistoryControllerState {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
history$: IValueSubject<string[]>;
|
|
25
|
+
hasPrevChapter$: IValueSubject<boolean>;
|
|
26
|
+
prevChapter$: IValueSubject<Nullable<string>>;
|
|
27
|
+
isInitialChapter$: IValueSubject<boolean>;
|
|
28
|
+
isGoBackLimited$: IValueSubject<boolean>;
|
|
29
29
|
}
|
|
30
30
|
interface HistoryInitedEventData {
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
initChapterId: string;
|
|
32
|
+
videosInfo?: VideoInfo[];
|
|
33
33
|
}
|
|
34
34
|
export default class HistoryController {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
#private;
|
|
36
|
+
state: HistoryControllerState;
|
|
37
|
+
events: {
|
|
38
|
+
inited$: Subject<HistoryInitedEventData>;
|
|
39
|
+
destroyed$: Subject<void>;
|
|
40
|
+
error$: Subject<CustomError>;
|
|
41
|
+
};
|
|
42
|
+
constructor({ globalEventEmitter, videoId, interactiveController, historyApi, settings }: HistoryControllerParams);
|
|
43
|
+
setManifest(manifest: Manifest): Promise<void>;
|
|
44
|
+
get inited(): boolean;
|
|
45
|
+
updateHistory(chapterIds: string[], shouldSave?: boolean): Promise<void>;
|
|
46
|
+
goBack(): Promise<void>;
|
|
47
|
+
getProjectHistory(): Promise<void>;
|
|
48
|
+
getInitialChapterId(): string;
|
|
49
|
+
getInitialVideoId(): VideoId | null;
|
|
50
|
+
destroy(): void;
|
|
51
51
|
}
|
|
52
|
-
export {};
|