@vkontakte/videoplayer-interactive 1.0.19-dev.c3a364e7.0 → 1.0.19-dev.d432d6cd.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/es2015.cjs.js +6 -6
- package/es2015.esm.js +6 -6
- package/es2018.cjs.js +6 -6
- package/es2018.esm.js +6 -6
- package/esnext.cjs.js +6 -6
- package/esnext.esm.js +6 -6
- package/evergreen.esm.js +6 -6
- package/package.json +5 -5
- package/types/index.d.ts +3 -4
- package/types/manifest/index.d.ts +3 -0
- package/types/manifest/utils.d.ts +11 -0
- package/types/modules/Graph/Graph.d.ts +16 -12
- package/types/modules/Interactives/Interactives.d.ts +99 -83
- package/types/modules/Interactives/Layout.d.ts +11 -7
- package/types/modules/Interactives/controls/AreaControl.d.ts +2 -11
- package/types/modules/Interactives/controls/ButtonControl.d.ts +2 -11
- package/types/modules/Interactives/controls/Control.d.ts +20 -12
- package/types/modules/Interactives/controls/TextControl.d.ts +2 -11
- package/types/modules/Interactives/controls/index.d.ts +4 -3
- package/types/modules/Interactives/controls/types.d.ts +24 -0
- package/types/modules/Interactives/index.d.ts +4 -4
- package/types/modules/Interactives/types.d.ts +38 -7
- package/types/modules/Interactives/utils/GameController.d.ts +35 -16
- package/types/modules/Interactives/utils/GroupsStack.d.ts +31 -21
- package/types/modules/Interactives/utils/HistoryController.d.ts +8 -8
- package/types/modules/Interactives/utils/InteractiveEvents.d.ts +16 -10
- package/types/modules/Interactives/utils/ResizeManager.d.ts +8 -1
- package/types/modules/Interactives/utils/SelectBranches.d.ts +15 -51
- package/types/modules/Interactives/utils/SelectBranches.types.d.ts +73 -0
- package/types/modules/Interactives/utils/events.d.ts +8 -0
- package/types/modules/Interactives/utils/fallbackStrategies.d.ts +23 -6
- package/types/modules/Interactives/utils/gameUtils.d.ts +28 -26
- package/types/modules/Interactives/utils/getInteractiveRanges.d.ts +4 -4
- package/types/modules/Interactives/utils/renderingUtils.d.ts +64 -59
- package/types/modules/Loaders/vkVideoLoader/types.d.ts +2 -2
- package/types/modules/Loaders/vkVideoLoader/utils.d.ts +1 -1
- package/types/modules/ManifestController/Loadable.d.ts +4 -7
- package/types/modules/ManifestController/ManifestController.d.ts +11 -12
- package/types/modules/ManifestController/utils.d.ts +6 -6
- package/types/modules/SeamlessController/SeamlessController.d.ts +10 -12
- package/types/modules/SeamlessController/utils.d.ts +2 -2
- package/types/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +2 -2
- package/types/utils/EventManager.d.ts +3 -3
- package/types/utils/LastFrame.d.ts +1 -1
- package/types/utils/Raf.d.ts +1 -1
- package/types/utils/chapterHelpers.d.ts +1 -1
- package/types/utils/extractVkMovieId.d.ts +2 -2
- package/types/modules/Interactives/controls/constants.d.ts +0 -5
- package/types/movika.core/manifest/index.d.ts +0 -19
- package/types/movika.core/manifest/manifest_3_2/chapter.d.ts +0 -62
- package/types/movika.core/manifest/manifest_3_2/control.d.ts +0 -67
- package/types/movika.core/manifest/manifest_3_2/manifest.d.ts +0 -50
- package/types/movika.core/manifest/manifest_3_2/template.d.ts +0 -34
- package/types/movika.core/manifest/manifest_3_3/chapter.d.ts +0 -70
- package/types/movika.core/manifest/manifest_3_3/control.d.ts +0 -66
- package/types/movika.core/manifest/manifest_3_3/graph.d.ts +0 -73
- package/types/movika.core/manifest/manifest_3_3/manifest.d.ts +0 -52
- package/types/movika.core/manifest/manifest_3_3/template.d.ts +0 -34
- package/types/movika.core/manifest/migrations/index.d.ts +0 -1
- package/types/movika.core/manifest/migrations/migrateManifestToLatestVersion.d.ts +0 -1
- package/types/movika.core/manifest/migrations/migrate_from_3_0_to_3_1.d.ts +0 -21
- package/types/movika.core/manifest/migrations/migrate_from_3_1_to_3_2.d.ts +0 -2
- package/types/movika.core/manifest/migrations/migrate_from_3_2_to_3_3.d.ts +0 -8
- package/types/movika.core/manifest/types.d.ts +0 -29
- package/types/movika.core/manifest/utils.d.ts +0 -5
|
@@ -1,54 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
containerId: any;
|
|
17
|
-
branches?: any[] | undefined;
|
|
18
|
-
onEvent: any;
|
|
19
|
-
isEOV?: (() => boolean) | undefined;
|
|
20
|
-
isDisabled?: (() => boolean) | undefined;
|
|
21
|
-
}) => void;
|
|
22
|
-
onContainerEvent: ({ action, container: { id: containerId, endTime }, branches, isEOV, autoSelected, }: {
|
|
23
|
-
action: any;
|
|
24
|
-
container: {
|
|
25
|
-
id: any;
|
|
26
|
-
endTime: any;
|
|
27
|
-
};
|
|
28
|
-
branches?: any[] | undefined;
|
|
29
|
-
isEOV?: boolean | undefined;
|
|
30
|
-
autoSelected?: boolean | undefined;
|
|
31
|
-
}) => void;
|
|
32
|
-
onChapterEvent: ({ chapterId, action, branches }: {
|
|
33
|
-
chapterId: any;
|
|
34
|
-
action: any;
|
|
35
|
-
branches?: any[] | undefined;
|
|
36
|
-
}) => (() => void) | undefined;
|
|
37
|
-
onExpectEvent: ({ subjectId, subjectName, action }: {
|
|
38
|
-
subjectId: any;
|
|
39
|
-
subjectName: any;
|
|
40
|
-
action: any;
|
|
41
|
-
}) => void;
|
|
42
|
-
expectEventHandler: ({ subjectId, subjectName }: {
|
|
43
|
-
subjectId: any;
|
|
44
|
-
subjectName: any;
|
|
45
|
-
}) => void;
|
|
46
|
-
setManifestChapterEvents: (chapter: any) => void;
|
|
47
|
-
setManifestContainerEvents: ({ container, branches, isEOV }: {
|
|
48
|
-
container: any;
|
|
49
|
-
branches: any;
|
|
50
|
-
isEOV?: boolean | undefined;
|
|
51
|
-
}) => void;
|
|
1
|
+
import type { Chapter } from '../../../manifest';
|
|
2
|
+
import type { SelectBranchesArg, OnControlEventArg, ContinuePlaybackArg, ExpectEventHandlerArg, OnChapterEventArg, OnContainerEventArg, OnExpectEventArg, SetManifestContainerEventsArg, ActionMap, AnyAction } from './SelectBranches.types';
|
|
3
|
+
export declare const defaultArgs: {
|
|
4
|
+
readonly shouldOpenNow: true;
|
|
5
|
+
readonly isDetachContainer: true;
|
|
6
|
+
};
|
|
7
|
+
export declare const extendArgs: <T extends AnyAction>(action: T, rewrite?: boolean) => T;
|
|
8
|
+
export declare const SelectBranches: ({ globalEventEmitter, player, interactiveEvents, removeControllers, }: SelectBranchesArg) => {
|
|
9
|
+
onControlEvent: ({ action, controlType, controlId, containerId, branches, onEvent, isEOV, isDisabled, }: OnControlEventArg) => void;
|
|
10
|
+
onContainerEvent: ({ action, container: { id: containerId, endTime }, branches, isEOV, autoSelected, }: OnContainerEventArg) => void;
|
|
11
|
+
onChapterEvent: ({ chapterId, action, branches }: OnChapterEventArg) => (() => ContinuePlaybackArg<"chapter">) | undefined;
|
|
12
|
+
onExpectEvent: <T extends keyof ActionMap>({ subjectId, subjectName }: OnExpectEventArg<T>) => void;
|
|
13
|
+
expectEventHandler: <T extends keyof ActionMap>({ subjectId, subjectName }: ExpectEventHandlerArg<T>) => void;
|
|
14
|
+
setManifestChapterEvents: (chapter: Chapter) => void;
|
|
15
|
+
setManifestContainerEvents: ({ container, branches, isEOV }: SetManifestContainerEventsArg) => void;
|
|
52
16
|
stopExpect: () => void;
|
|
53
17
|
state: {
|
|
54
18
|
isExpect: boolean;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { ChapterContainer, Control, ChapterBranch, ControlEvent, ContainerEvent, ChapterEvent } from '../../../manifest';
|
|
2
|
+
import type { EventEmitter } from '../../../utils/EventEmitter';
|
|
3
|
+
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
4
|
+
import type { InteractiveEventsType } from './InteractiveEvents';
|
|
5
|
+
export type SubjectName = 'chapter' | 'container' | 'control';
|
|
6
|
+
export type SelectBranchesArg = {
|
|
7
|
+
globalEventEmitter: EventEmitter;
|
|
8
|
+
player: IPlayer;
|
|
9
|
+
interactiveEvents: InteractiveEventsType;
|
|
10
|
+
removeControllers?: AnyFn;
|
|
11
|
+
};
|
|
12
|
+
export type OnControlEventArg = {
|
|
13
|
+
action: ControlEvent['action'];
|
|
14
|
+
controlType: Control['type'];
|
|
15
|
+
controlId: Control['id'];
|
|
16
|
+
containerId: ChapterContainer['id'];
|
|
17
|
+
onEvent: AnyFn;
|
|
18
|
+
branches?: ChapterBranch[];
|
|
19
|
+
isEOV?: () => boolean;
|
|
20
|
+
isDisabled?: () => boolean;
|
|
21
|
+
};
|
|
22
|
+
export type OnContainerEventArg = {
|
|
23
|
+
action: ContainerEvent['action'];
|
|
24
|
+
container: ChapterContainer;
|
|
25
|
+
autoSelected?: boolean;
|
|
26
|
+
branches?: ChapterBranch[];
|
|
27
|
+
isEOV?: boolean;
|
|
28
|
+
};
|
|
29
|
+
export type OnChapterEventArg = {
|
|
30
|
+
action: ChapterEvent['action'];
|
|
31
|
+
chapterId: string;
|
|
32
|
+
branches?: ChapterBranch[];
|
|
33
|
+
};
|
|
34
|
+
export type SetManifestContainerEventsArg = {
|
|
35
|
+
container: ChapterContainer;
|
|
36
|
+
branches: ChapterBranch[];
|
|
37
|
+
isEOV?: boolean;
|
|
38
|
+
};
|
|
39
|
+
export type AnyAction = ControlEvent['action'] | ContainerEvent['action'] | ChapterEvent['action'];
|
|
40
|
+
export type ActionMap = {
|
|
41
|
+
control: ControlEvent['action'];
|
|
42
|
+
container: ContainerEvent['action'];
|
|
43
|
+
chapter: ChapterEvent['action'];
|
|
44
|
+
};
|
|
45
|
+
export type SubjectType<T extends keyof ActionMap> = T extends 'control' ? Control['type'] : undefined;
|
|
46
|
+
export type EventActionCommon<T extends keyof ActionMap> = {
|
|
47
|
+
subjectId: string;
|
|
48
|
+
subjectName: T;
|
|
49
|
+
subjectType?: SubjectType<T>;
|
|
50
|
+
};
|
|
51
|
+
export type EventActionCommonWithAction<T extends keyof ActionMap> = EventActionCommon<T> & {
|
|
52
|
+
action: ActionMap[T];
|
|
53
|
+
};
|
|
54
|
+
export type OpenURIArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
|
|
55
|
+
payload: {
|
|
56
|
+
URI?: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export type ChangeManifestArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
|
|
60
|
+
payload: {
|
|
61
|
+
behaviour?: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export type ChangeChapterArg<T extends keyof ActionMap> = EventActionCommonWithAction<T> & {
|
|
65
|
+
payload: {
|
|
66
|
+
chapterId: string;
|
|
67
|
+
autoSelect: boolean;
|
|
68
|
+
behaviour?: string;
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
export type ContinuePlaybackArg<T extends keyof ActionMap> = EventActionCommonWithAction<T>;
|
|
72
|
+
export type OnExpectEventArg<T extends keyof ActionMap> = EventActionCommon<T>;
|
|
73
|
+
export type ExpectEventHandlerArg<T extends keyof ActionMap> = EventActionCommon<T>;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare const EVENT_NAMES: {
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Используйте interactivesInstance.events.graphVisibilityChanged$
|
|
4
|
+
* & interactivesInstance.events.watchAgainIsClicked$
|
|
5
|
+
*/
|
|
2
6
|
readonly graph: "graph";
|
|
3
7
|
readonly interactives: "interactives";
|
|
4
8
|
readonly chapterChanged: "chapter-changed";
|
|
@@ -9,6 +13,10 @@ export declare const EVENT_NAMES: {
|
|
|
9
13
|
readonly historyInited: "history-inited";
|
|
10
14
|
readonly historyDestroyed: "history-destroyed";
|
|
11
15
|
};
|
|
16
|
+
/**
|
|
17
|
+
* @deprecated Используйте interactivesInstance.events.graphVisibilityChanged$ &
|
|
18
|
+
* interactivesInstance.events.watchAgainIsClicked$
|
|
19
|
+
*/
|
|
12
20
|
export declare const graphEventTypes: {
|
|
13
21
|
readonly visibility: "visibility";
|
|
14
22
|
readonly watchAgainClicked: "watchAgainClicked";
|
|
@@ -1,6 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
1
|
+
import { type ChapterBranch } from '../../../manifest';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a random number in the range [0, limit) or [limit, 0) if the 'limit'
|
|
4
|
+
* value is negative
|
|
5
|
+
*/
|
|
6
|
+
export declare const getRandomNumber: (limit: number) => number;
|
|
7
|
+
/**
|
|
8
|
+
* Finds the value with minimal weight number
|
|
9
|
+
*/
|
|
10
|
+
export declare const minFallbackStrategy: (branches: ChapterBranch[]) => Nullable<ChapterBranch>;
|
|
11
|
+
/**
|
|
12
|
+
* Finds the value with maximal weight number
|
|
13
|
+
*/
|
|
14
|
+
export declare const maxFallbackStrategy: (branches: ChapterBranch[]) => Nullable<ChapterBranch>;
|
|
15
|
+
/**
|
|
16
|
+
* Finds first branch with `isDefault === true` value
|
|
17
|
+
*/
|
|
18
|
+
export declare const defaultFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the random branch
|
|
21
|
+
*/
|
|
22
|
+
export declare const weightlessRandomFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch;
|
|
23
|
+
export declare const weightyRandomFallbackStrategy: (branches: ChapterBranch[]) => ChapterBranch;
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export function
|
|
1
|
+
import { type Control, type Chapter, type ChapterContainer } from '../../../manifest';
|
|
2
|
+
import type { GameController } from './GameController';
|
|
3
|
+
export declare enum GameStates {
|
|
4
|
+
nothing = 0,
|
|
5
|
+
beforeInteractive = 1,
|
|
6
|
+
interactive = 2,
|
|
7
|
+
afterInteractive = 3,
|
|
8
|
+
end = 4,
|
|
9
|
+
removed = 5,
|
|
10
|
+
destroyed = 6
|
|
11
|
+
}
|
|
12
|
+
export declare const isControlsExist: (controls: Control[]) => boolean;
|
|
13
|
+
export declare const isLastChapter: (chapter: Chapter) => boolean;
|
|
14
|
+
export declare const hasEndTemplate: (chapter: Chapter) => boolean;
|
|
15
|
+
export declare const isBeforeStartTime: (currentTime: number, container: ChapterContainer) => boolean;
|
|
16
|
+
export declare const isInteractiveTime: (currentTime: number, container: ChapterContainer) => boolean;
|
|
17
|
+
export declare const isAfterInteractiveTime: (currentTime: number, container: ChapterContainer) => boolean;
|
|
18
|
+
type AnyEvent = ChapterContainer['events'] | Chapter['events'] | Control['events'];
|
|
19
|
+
export declare const isExpectEvent: (events?: AnyEvent) => boolean;
|
|
20
|
+
export declare const getExpectEvent: (events?: AnyEvent) => import("@interactiveplatform/movika-graph-editor").ChapterEvent | import("@interactiveplatform/movika-graph-editor").ContainerEvent | import("@interactiveplatform/movika-graph-editor").ControlEvent | undefined;
|
|
21
|
+
export declare const isOneCtrlOneContainer: (controls: Control[]) => boolean;
|
|
22
|
+
export declare const isOneTextCtrlContainer: (controls: Control[]) => boolean;
|
|
23
|
+
export declare function excludeTextControl(containers?: ChapterContainer[]): ChapterContainer[];
|
|
24
|
+
export declare const isEOVEndTime: (target: HTMLVideoElement, endTime: ChapterContainer["endTime"]) => boolean;
|
|
25
|
+
export declare function partial<T extends unknown[], U extends unknown[], R>(fn: (...args: [...T, ...U]) => R, ...presetArgs: T): (...laterArgs: U) => R;
|
|
26
|
+
export declare function partial<T extends Record<string, unknown>, P extends Partial<T>>(fn: (args: T) => unknown, presetArgs: P): (laterArgs: Omit<T, keyof P>) => ReturnType<typeof fn>;
|
|
27
|
+
export declare const shouldIgnoreContainerEvent: (container: ChapterContainer, gameControllers: GameController[]) => boolean;
|
|
28
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type Container } from '../../../
|
|
2
|
-
export type
|
|
1
|
+
import { type Container } from '../../../manifest';
|
|
2
|
+
export type InteractiveRange = {
|
|
3
3
|
subjects: string[];
|
|
4
4
|
range: [number, number];
|
|
5
5
|
};
|
|
6
|
-
export type
|
|
7
|
-
export declare const getInteractiveRanges: (containers?: Container[]) =>
|
|
6
|
+
export type InteractiveRanges = Array<InteractiveRange>;
|
|
7
|
+
export declare const getInteractiveRanges: (containers?: Container[]) => InteractiveRanges;
|
|
@@ -1,62 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export const
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { type Control } from '../../../manifest';
|
|
2
|
+
import { type Dimensions } from '../../../modules/Interactives/controls';
|
|
3
|
+
export declare const classnamesPrefix = "interactive";
|
|
4
|
+
export declare const rootElClassName = "interactive-controls-container";
|
|
5
|
+
export declare const getRootEl: () => Element | null;
|
|
6
|
+
export declare const DISABLE_OPACITY = 0.4;
|
|
7
|
+
export declare const controlStylesFallbacks: {
|
|
8
|
+
textColor: string;
|
|
9
|
+
textSize: number;
|
|
10
|
+
textContent: string;
|
|
11
|
+
roundCorners: number;
|
|
12
|
+
borderWidth: number;
|
|
13
|
+
borderColor: string;
|
|
14
|
+
borderAlpha: number;
|
|
15
|
+
backgroundColor: string;
|
|
16
|
+
backgroundAlpha: number;
|
|
17
|
+
innerSizesDependOn: string;
|
|
18
|
+
angle: number;
|
|
19
|
+
};
|
|
20
|
+
type ControlStylesFallbacks = typeof controlStylesFallbacks;
|
|
21
|
+
export declare enum ALIGN_ITEMS {
|
|
22
|
+
top = "flex-start",
|
|
23
|
+
bottom = "flex-end",
|
|
24
|
+
center = "center"
|
|
17
25
|
}
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
export declare enum JUSTIFY_CONTENT {
|
|
27
|
+
start = "flex-start",
|
|
28
|
+
end = "flex-end",
|
|
29
|
+
center = "center"
|
|
22
30
|
}
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
export { center_1 as center };
|
|
31
|
+
export declare enum TEXT_ALIGN {
|
|
32
|
+
start = "left",
|
|
33
|
+
end = "right",
|
|
34
|
+
center = "center"
|
|
28
35
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
target:
|
|
43
|
-
props:
|
|
44
|
-
fallback:
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
target:
|
|
49
|
-
props:
|
|
50
|
-
fallback:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
fallback: any;
|
|
62
|
-
}): void;
|
|
36
|
+
type SetTextPositionStylesProps = {
|
|
37
|
+
target: HTMLElement;
|
|
38
|
+
props: Control['props'];
|
|
39
|
+
};
|
|
40
|
+
export declare const setTextPositionStyles: ({ target, props }: SetTextPositionStylesProps) => void;
|
|
41
|
+
type SetTextStylesProps = {
|
|
42
|
+
target: HTMLElement;
|
|
43
|
+
props: Control['props'];
|
|
44
|
+
fallback: ControlStylesFallbacks;
|
|
45
|
+
dependsOn: Dimensions;
|
|
46
|
+
};
|
|
47
|
+
export declare const setTextStyles: ({ target, props, fallback, dependsOn }: SetTextStylesProps) => void;
|
|
48
|
+
type SetBackgroundStylesProps = {
|
|
49
|
+
target: HTMLElement;
|
|
50
|
+
props: Control['props'];
|
|
51
|
+
fallback: ControlStylesFallbacks;
|
|
52
|
+
};
|
|
53
|
+
export declare const setBackgroundStyles: ({ target, props, fallback }: SetBackgroundStylesProps) => void;
|
|
54
|
+
type SetBorderStylesProps = {
|
|
55
|
+
target: HTMLElement;
|
|
56
|
+
props: Control['props'];
|
|
57
|
+
fallback: ControlStylesFallbacks;
|
|
58
|
+
dependsOn: Dimensions;
|
|
59
|
+
};
|
|
60
|
+
export declare const setBorderStyles: ({ target, props, fallback, dependsOn }: SetBorderStylesProps) => void;
|
|
61
|
+
type SetAngleProps = {
|
|
62
|
+
target: HTMLElement;
|
|
63
|
+
fallback: ControlStylesFallbacks;
|
|
64
|
+
layoutParams: Control['layoutParams'];
|
|
65
|
+
};
|
|
66
|
+
export declare const setAngle: ({ target, layoutParams, fallback }: SetAngleProps) => void;
|
|
67
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ManifestVideo, ManifestVideoVariant } from '../../../
|
|
2
|
-
export type {
|
|
1
|
+
import type { ManifestVideo, ManifestVideoVariant } from '../../../manifest';
|
|
2
|
+
export type { Extension, Standard } from '../../../manifest';
|
|
3
3
|
export interface GetVKVideoParams {
|
|
4
4
|
access_token: string;
|
|
5
5
|
owner_id?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ManifestVideoVariant } from '../../../
|
|
1
|
+
import type { ManifestVideoVariant } from '../../../manifest';
|
|
2
2
|
import type { FullRequestParams, VideoVideoImage } from './types';
|
|
3
3
|
export declare function createRequestURL({ baseURL, requestParams }: FullRequestParams): string;
|
|
4
4
|
export declare function findMaxResolutionFrame(frames?: VideoVideoImage[]): VideoVideoImage | undefined;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
readonly manifestLoaders: "manifestLoaders";
|
|
4
|
-
};
|
|
5
|
-
type LoaderTypes = (typeof LoaderTypes)[keyof typeof LoaderTypes];
|
|
1
|
+
type LoaderTypes = 'chapterLoaders' | 'manifestLoaders';
|
|
2
|
+
export type Loaders = Record<LoaderTypes, Function[]>;
|
|
6
3
|
interface ILoadable {
|
|
7
4
|
exec(type: LoaderTypes, inputArg: Record<string, any>): Promise<any>;
|
|
8
5
|
}
|
|
9
6
|
export declare class Loadable implements ILoadable {
|
|
10
|
-
loaders:
|
|
11
|
-
constructor(loaders:
|
|
7
|
+
loaders: Loaders;
|
|
8
|
+
constructor(loaders: Partial<Loaders>);
|
|
12
9
|
exec(type: LoaderTypes, inputArg: Record<string, any>): Promise<any>;
|
|
13
10
|
}
|
|
14
11
|
export declare function addErrorMessage(errObj: Record<string, Array<string>> | null, loaderName: string, message: string): Record<string, Array<string>>;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import type { IValueSubject } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import type { ChapterBranch, ManifestVideo,
|
|
3
|
-
import type { GraphEditChapter, GraphViewChapter } from '../../movika.core/manifest/manifest_3_3/graph';
|
|
2
|
+
import type { ChapterBranch, ManifestVideo, Chapter, Manifest, GraphEditChapter, GraphViewChapter, AnyManifest } from '../../manifest';
|
|
4
3
|
import { Loadable } from './Loadable';
|
|
5
4
|
type BranchesData = {
|
|
6
|
-
chapter:
|
|
5
|
+
chapter: Chapter;
|
|
7
6
|
graph: GraphEditChapter | GraphViewChapter | undefined;
|
|
8
7
|
media: ManifestVideo;
|
|
9
8
|
};
|
|
10
9
|
export declare class ManifestController extends Loadable {
|
|
11
|
-
manifest: Nullable<
|
|
12
|
-
chapter: Nullable<
|
|
13
|
-
media: Nullable<
|
|
14
|
-
graph: Nullable<
|
|
15
|
-
prevChapter$: IValueSubject<
|
|
10
|
+
manifest: Nullable<Manifest>;
|
|
11
|
+
chapter: Nullable<Chapter>;
|
|
12
|
+
media: Nullable<ManifestVideo>;
|
|
13
|
+
graph: Nullable<Manifest['graph']>;
|
|
14
|
+
prevChapter$: IValueSubject<Chapter | null>;
|
|
16
15
|
onError: Function;
|
|
17
16
|
constructor(loaders: any, onError: Function);
|
|
18
17
|
release(): this;
|
|
19
|
-
setManifest(source:
|
|
18
|
+
setManifest(source: AnyManifest | string): Promise<ManifestController>;
|
|
20
19
|
setInitial(): Promise<ManifestController>;
|
|
21
20
|
setNext(chapterId?: string | undefined): Promise<ManifestController>;
|
|
22
21
|
errorHandler(errors: unknown): void;
|
|
@@ -25,9 +24,9 @@ export declare class ManifestController extends Loadable {
|
|
|
25
24
|
getBranches(chapterId?: string | undefined): BranchesData[];
|
|
26
25
|
getByBranches(branches?: ChapterBranch[]): BranchesData[];
|
|
27
26
|
getCurrent(): {
|
|
28
|
-
chapter: Nullable<
|
|
29
|
-
media: Nullable<
|
|
30
|
-
graph: Nullable<import("
|
|
27
|
+
chapter: Nullable<Chapter>;
|
|
28
|
+
media: Nullable<ManifestVideo>;
|
|
29
|
+
graph: Nullable<import("@interactiveplatform/movika-graph-editor").GraphDesign>;
|
|
31
30
|
};
|
|
32
31
|
isInitialChapter(): boolean;
|
|
33
32
|
isEndChapter(): boolean;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Manifest,
|
|
1
|
+
import type { Manifest, AnyManifest, Media, Chapter } from '../../manifest';
|
|
2
2
|
type ManifestInfo = {
|
|
3
|
-
manifest:
|
|
3
|
+
manifest: AnyManifest;
|
|
4
4
|
manifestURL: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const convertToObject: (manifest:
|
|
7
|
-
export declare function fetchManifest(manifest:
|
|
6
|
+
export declare const convertToObject: (manifest: AnyManifest | string) => Promise<Partial<ManifestInfo>>;
|
|
7
|
+
export declare function fetchManifest(manifest: AnyManifest | string): Promise<Manifest>;
|
|
8
8
|
export declare function getInitialChapter(manifest: any): Chapter | undefined;
|
|
9
9
|
export declare function getChapter(chapters: Chapter[], chapterId?: string): Chapter | undefined;
|
|
10
|
-
export declare function getGraphItem(graphObj:
|
|
11
|
-
export declare function getMedia(media: Media, videoId?: string): import("
|
|
10
|
+
export declare function getGraphItem(graphObj: Manifest['graph'], chapterId: string): import("@interactiveplatform/movika-graph-editor").GraphEditChapter | import("@interactiveplatform/movika-graph-editor").GraphViewChapter | undefined;
|
|
11
|
+
export declare function getMedia(media: Media, videoId?: string): import("@interactiveplatform/movika-graph-editor").ManifestVideo | undefined;
|
|
12
12
|
export {};
|
|
@@ -1,32 +1,30 @@
|
|
|
1
1
|
import type { IConfig, PlaybackRate, VideoQuality } from '@vkontakte/videoplayer-core';
|
|
2
|
-
import {
|
|
3
|
-
import type { ManifestVideo,
|
|
2
|
+
import { ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import type { ManifestVideo, Extension } from '../../manifest';
|
|
4
|
+
import { type Interactives } from '../../modules/Interactives';
|
|
5
|
+
import type { Instance } from './InstanceManager';
|
|
4
6
|
interface CreatePlayerParams extends Omit<IConfig, 'sources' | 'container'> {
|
|
5
7
|
media: ManifestVideo;
|
|
6
8
|
chapterId: string;
|
|
7
9
|
prefetch?: boolean;
|
|
8
10
|
setAsActive?: boolean;
|
|
9
11
|
autoplay?: boolean;
|
|
10
|
-
preferredExt?: Array<
|
|
12
|
+
preferredExt?: Array<Extension>;
|
|
11
13
|
quality?: VideoQuality;
|
|
12
14
|
playbackRate?: PlaybackRate;
|
|
13
15
|
title?: string;
|
|
14
16
|
}
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
playerCreated: string;
|
|
18
|
-
};
|
|
19
|
-
export default function SeamlessController(interactiveController?: Record<string, any>): {
|
|
20
|
-
on: (eventName: string, fn: Function) => EventEmitter;
|
|
21
|
-
off: (eventName: string, fn: Function) => EventEmitter;
|
|
17
|
+
export type ActivePlayer = Nullable<Pick<Instance, 'player' | 'config' | 'statistics'>>;
|
|
18
|
+
export default function SeamlessController(interactiveController?: Interactives): {
|
|
22
19
|
init: () => Promise<void>;
|
|
23
|
-
setInteractiveController: (instance:
|
|
24
|
-
createPlayer: ({ media, chapterId, prefetch, setAsActive, autoplay, preferredExt, title, playbackRate }: CreatePlayerParams) => Promise<{
|
|
20
|
+
setInteractiveController: (instance: Interactives) => void;
|
|
21
|
+
createPlayer: ({ media, chapterId, prefetch, setAsActive, autoplay, preferredExt, title, playbackRate, }: CreatePlayerParams) => Promise<{
|
|
25
22
|
player: any;
|
|
26
23
|
config: any;
|
|
27
24
|
statistics: any;
|
|
28
25
|
}>;
|
|
29
26
|
removeAll: () => void;
|
|
30
27
|
getActivePlayer: () => Record<string, any>;
|
|
28
|
+
activePlayerChanged: ValueSubject<ActivePlayer>;
|
|
31
29
|
};
|
|
32
30
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IPlayer, ISources } from '@vkontakte/videoplayer-core';
|
|
2
|
-
import type { ManifestVideo,
|
|
2
|
+
import type { ManifestVideo, Extension } from '../../manifest';
|
|
3
3
|
import { VideoQuality } from '@vkontakte/videoplayer-core';
|
|
4
|
-
export declare function genPlayerCfgVideoData(mediaObj: ManifestVideo, allowList?: Array<
|
|
4
|
+
export declare function genPlayerCfgVideoData(mediaObj: ManifestVideo, allowList?: Array<Extension>): {
|
|
5
5
|
sources: ISources;
|
|
6
6
|
thumbUrl?: string | null;
|
|
7
7
|
title: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { IPlayer } from '@vkontakte/videoplayer-core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ChapterContainer } from '../../manifest';
|
|
3
3
|
export declare class SeekToInteractiveController {
|
|
4
4
|
private _containers;
|
|
5
5
|
private _player;
|
|
6
6
|
setPlayer: (player: IPlayer) => void;
|
|
7
|
-
setContainers: (containers:
|
|
7
|
+
setContainers: (containers: ChapterContainer[]) => void;
|
|
8
8
|
deleteContainer: (id: string) => void;
|
|
9
9
|
getNextInteractiveTime: (offsetMs?: number) => number | null;
|
|
10
10
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Binding } from './Binding';
|
|
2
2
|
import { MultiMap } from './MultiMap';
|
|
3
3
|
import type { HtmlEventType } from '../types';
|
|
4
|
-
type OptionsType =
|
|
4
|
+
type OptionsType = boolean | AddEventListenerOptions;
|
|
5
5
|
export declare class EventManager {
|
|
6
6
|
bindingMap: MultiMap<Binding> | null;
|
|
7
7
|
release(): void;
|
|
8
|
-
listen(target: Element, type: HtmlEventType, listener: EventListener, options
|
|
9
|
-
listenOnce(target: Element, type: HtmlEventType, listener: EventListener, options
|
|
8
|
+
listen(target: Element, type: HtmlEventType, listener: EventListener, options?: OptionsType): void;
|
|
9
|
+
listenOnce(target: Element, type: HtmlEventType, listener: EventListener, options?: OptionsType): void;
|
|
10
10
|
unlisten(target: Element, type: HtmlEventType, listener: EventListener): void;
|
|
11
11
|
removeAll(): void;
|
|
12
12
|
}
|
package/types/utils/Raf.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare class Raf {
|
|
|
2
2
|
raf: number | undefined;
|
|
3
3
|
fn: VoidFunction | undefined;
|
|
4
4
|
fns: Array<VoidFunction>;
|
|
5
|
-
constructor(fn
|
|
5
|
+
constructor(fn?: VoidFunction);
|
|
6
6
|
addFn: (fn: VoidFunction, shouldRequest?: boolean) => void;
|
|
7
7
|
removeFn: (fn: VoidFunction, shouldRequest?: boolean) => void;
|
|
8
8
|
updateFn: () => void;
|
|
@@ -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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ManifestVideo } from '../
|
|
2
|
-
export declare const extractVkMovieId: (media: ManifestVideo) =>
|
|
1
|
+
import type { ManifestVideo } from '../manifest';
|
|
2
|
+
export declare const extractVkMovieId: (media: ManifestVideo) => [] | [string, string];
|