@vkontakte/videoplayer-interactive 1.0.63-dev.baccd7d5.0 → 1.0.63-dev.ef2fa986.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.esm.js +286 -0
- package/esnext.esm.js +286 -0
- package/evergreen.esm.js +286 -0
- package/package.json +7 -5
- package/types/index.d.ts +11 -2
- package/{manifest → types/manifest}/index.d.ts +3 -3
- package/types/manifest/utils.d.ts +48 -0
- package/types/modules/Graph/Graph.d.ts +54 -0
- package/types/modules/Graph/index.d.ts +1 -0
- package/types/modules/Interactives/Interactives.d.ts +143 -0
- package/types/modules/Interactives/Layout.d.ts +16 -0
- package/types/modules/Interactives/containers/ChoiceContainer.d.ts +34 -0
- package/types/modules/Interactives/containers/Container.d.ts +21 -0
- package/types/modules/Interactives/containers/index.d.ts +4 -0
- package/types/modules/Interactives/containers/types.d.ts +11 -0
- package/{modules → types/modules}/Interactives/containers/utils.d.ts +3 -3
- package/types/modules/Interactives/controls/AreaControl.d.ts +21 -0
- package/types/modules/Interactives/controls/ButtonControl.d.ts +25 -0
- package/types/modules/Interactives/controls/Control.d.ts +48 -0
- package/types/modules/Interactives/controls/TextControl.d.ts +18 -0
- package/types/modules/Interactives/controls/index.d.ts +6 -0
- package/types/modules/Interactives/controls/types.d.ts +38 -0
- package/types/modules/Interactives/controls/utils.d.ts +14 -0
- package/types/modules/Interactives/index.d.ts +16 -0
- package/types/modules/Interactives/styles/index.d.ts +1 -0
- package/types/modules/Interactives/types.d.ts +79 -0
- package/types/modules/Interactives/utils/BlinkAnimationRef.d.ts +15 -0
- package/types/modules/Interactives/utils/ControlFillAnimation/ControlFillAnimation.d.ts +34 -0
- package/types/modules/Interactives/utils/ControlFillAnimation/index.d.ts +1 -0
- package/types/modules/Interactives/utils/ControlFillAnimation/utils.d.ts +12 -0
- package/types/modules/Interactives/utils/ControlTap/ControlTap.d.ts +17 -0
- package/types/modules/Interactives/utils/ControlTap/index.d.ts +1 -0
- package/{modules → types/modules}/Interactives/utils/ControlTap/utils.d.ts +3 -3
- package/types/modules/Interactives/utils/GameController.d.ts +71 -0
- package/types/modules/Interactives/utils/GroupsStack.d.ts +30 -0
- package/types/modules/Interactives/utils/HistoryController.d.ts +51 -0
- package/types/modules/Interactives/utils/InteractiveEvents.d.ts +32 -0
- package/types/modules/Interactives/utils/ResizeManager.d.ts +15 -0
- package/types/modules/Interactives/utils/SelectBranches.d.ts +23 -0
- package/types/modules/Interactives/utils/SelectBranches.types.d.ts +78 -0
- package/{modules → types/modules}/Interactives/utils/angleUtils.d.ts +12 -12
- package/types/modules/Interactives/utils/createControlText.d.ts +4 -0
- package/types/modules/Interactives/utils/emitOnError.d.ts +13 -0
- package/types/modules/Interactives/utils/events.d.ts +79 -0
- package/types/modules/Interactives/utils/events.types.d.ts +55 -0
- package/{modules → types/modules}/Interactives/utils/fallbackStrategies.d.ts +13 -13
- package/types/modules/Interactives/utils/functionUtils.d.ts +12 -0
- package/{modules → types/modules}/Interactives/utils/gameUtils.d.ts +20 -20
- package/{modules → types/modules}/Interactives/utils/getInteractiveRanges.d.ts +5 -5
- package/types/modules/Interactives/utils/renderingUtils.d.ts +75 -0
- package/types/modules/Loaders/index.d.ts +1 -0
- package/types/modules/Loaders/movikaProjectIdLoader/index.d.ts +1 -0
- package/types/modules/Loaders/vkVideoLoader/CustomVkVideoLoader.d.ts +10 -0
- package/types/modules/Loaders/vkVideoLoader/index.d.ts +1 -0
- package/types/modules/Loaders/vkVideoLoader/types.d.ts +257 -0
- package/{modules → types/modules}/Loaders/vkVideoLoader/utils.d.ts +1 -1
- package/{modules → types/modules}/ManifestController/Loadable.d.ts +5 -5
- package/types/modules/ManifestController/ManifestController.d.ts +34 -0
- package/types/modules/ManifestController/index.d.ts +1 -0
- package/{modules → types/modules}/ManifestController/utils.d.ts +5 -5
- package/types/modules/SeamlessController/InstanceManager.d.ts +15 -0
- package/types/modules/SeamlessController/SeamlessController.d.ts +33 -0
- package/types/modules/SeamlessController/utils.d.ts +9 -0
- package/types/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +10 -0
- package/types/modules/SeekToInteractiveController/index.d.ts +1 -0
- package/types/types/CustomError.d.ts +13 -0
- package/types/types/index.d.ts +2 -0
- package/types/utils/CssVarsManager.d.ts +23 -0
- package/types/utils/Error.d.ts +8 -0
- package/types/utils/EventEmitter.d.ts +12 -0
- package/types/utils/LastFrame.d.ts +35 -0
- package/types/utils/LastFrameCanvasAPI.d.ts +19 -0
- package/types/utils/MultiMap.d.ts +10 -0
- package/types/utils/Raf.d.ts +13 -0
- package/{utils → types/utils}/chapterHelpers.d.ts +1 -1
- package/types/utils/compareVersions.d.ts +14 -0
- package/{utils → types/utils}/extractVkMovieId.d.ts +1 -1
- package/types/utils/getVideoContentSize.d.ts +5 -0
- package/{utils → types/utils}/hexToRgb.d.ts +2 -2
- package/{utils → types/utils}/typeCheck.d.ts +6 -6
- package/index.d.ts +0 -11
- package/manifest/utils.d.ts +0 -48
- package/modules/Graph/Graph.d.ts +0 -54
- package/modules/Graph/index.d.ts +0 -1
- package/modules/Interactives/Interactives.d.ts +0 -143
- package/modules/Interactives/Layout.d.ts +0 -16
- package/modules/Interactives/containers/ChoiceContainer.d.ts +0 -34
- package/modules/Interactives/containers/Container.d.ts +0 -21
- package/modules/Interactives/containers/index.d.ts +0 -4
- package/modules/Interactives/containers/types.d.ts +0 -11
- package/modules/Interactives/controls/AreaControl.d.ts +0 -21
- package/modules/Interactives/controls/ButtonControl.d.ts +0 -25
- package/modules/Interactives/controls/Control.d.ts +0 -48
- package/modules/Interactives/controls/TextControl.d.ts +0 -18
- package/modules/Interactives/controls/index.d.ts +0 -6
- package/modules/Interactives/controls/types.d.ts +0 -35
- package/modules/Interactives/controls/utils.d.ts +0 -14
- package/modules/Interactives/index.d.ts +0 -16
- package/modules/Interactives/styles/index.d.ts +0 -1
- package/modules/Interactives/types.d.ts +0 -79
- package/modules/Interactives/utils/BlinkAnimationRef.d.ts +0 -15
- package/modules/Interactives/utils/ControlFillAnimation/ControlFillAnimation.d.ts +0 -34
- package/modules/Interactives/utils/ControlFillAnimation/index.d.ts +0 -1
- package/modules/Interactives/utils/ControlFillAnimation/utils.d.ts +0 -12
- package/modules/Interactives/utils/ControlTap/ControlTap.d.ts +0 -17
- package/modules/Interactives/utils/ControlTap/index.d.ts +0 -1
- package/modules/Interactives/utils/GameController.d.ts +0 -71
- package/modules/Interactives/utils/GroupsStack.d.ts +0 -32
- package/modules/Interactives/utils/HistoryController.d.ts +0 -52
- package/modules/Interactives/utils/InteractiveEvents.d.ts +0 -32
- package/modules/Interactives/utils/ResizeManager.d.ts +0 -15
- package/modules/Interactives/utils/SelectBranches.d.ts +0 -23
- package/modules/Interactives/utils/SelectBranches.types.d.ts +0 -78
- package/modules/Interactives/utils/createControlText.d.ts +0 -4
- package/modules/Interactives/utils/emitOnError.d.ts +0 -13
- package/modules/Interactives/utils/events.d.ts +0 -79
- package/modules/Interactives/utils/events.types.d.ts +0 -52
- package/modules/Interactives/utils/functionUtils.d.ts +0 -5
- package/modules/Interactives/utils/renderingUtils.d.ts +0 -75
- package/modules/Loaders/index.d.ts +0 -1
- package/modules/Loaders/movikaProjectIdLoader/index.d.ts +0 -1
- package/modules/Loaders/vkVideoLoader/CustomVkVideoLoader.d.ts +0 -10
- package/modules/Loaders/vkVideoLoader/index.d.ts +0 -1
- package/modules/Loaders/vkVideoLoader/types.d.ts +0 -257
- package/modules/ManifestController/ManifestController.d.ts +0 -34
- package/modules/ManifestController/index.d.ts +0 -1
- package/modules/SeamlessController/InstanceManager.d.ts +0 -15
- package/modules/SeamlessController/SeamlessController.d.ts +0 -34
- package/modules/SeamlessController/utils.d.ts +0 -9
- package/modules/SeekToInteractiveController/SeekToInteractiveController.d.ts +0 -10
- package/modules/SeekToInteractiveController/index.d.ts +0 -1
- package/types/CustomError.d.ts +0 -13
- package/utils/CssVarsManager.d.ts +0 -23
- package/utils/Error.d.ts +0 -8
- package/utils/EventEmitter.d.ts +0 -12
- package/utils/LastFrame.d.ts +0 -35
- package/utils/LastFrameCanvasAPI.d.ts +0 -19
- package/utils/MultiMap.d.ts +0 -10
- package/utils/Raf.d.ts +0 -13
- package/utils/compareVersions.d.ts +0 -14
- package/utils/getVideoContentSize.d.ts +0 -5
- /package/{constants.d.ts → types/constants.d.ts} +0 -0
- /package/{env.d.ts → types/env.d.ts} +0 -0
- /package/{modules → types/modules}/Interactives/styles/utils.d.ts +0 -0
- /package/{modules → types/modules}/Loaders/movikaProjectIdLoader/movikaProjectIdLoader.d.ts +0 -0
- /package/types/{dom.d.ts → types/dom.d.ts} +0 -0
- /package/{utils → types/utils}/debounce.d.ts +0 -0
- /package/{utils → types/utils}/throttle.d.ts +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { type Container } from
|
|
1
|
+
import { type Container } from "../../../manifest";
|
|
2
2
|
export type Subject = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
id: string;
|
|
4
|
+
isRemoved: boolean;
|
|
5
5
|
};
|
|
6
6
|
export type InteractiveRange = {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
subjects: Subject[];
|
|
8
|
+
range: [number, number];
|
|
9
9
|
};
|
|
10
10
|
export type InteractiveRanges = Array<InteractiveRange>;
|
|
11
11
|
export declare const getInteractiveRanges: (containers?: Container[]) => InteractiveRanges;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type Control } from "../../../manifest";
|
|
2
|
+
import { type Dimensions } from "../controls";
|
|
3
|
+
export declare const classnamesPrefix = "interactive";
|
|
4
|
+
export declare const controlStylesFallbacks: {
|
|
5
|
+
textColor: string;
|
|
6
|
+
textSize: number;
|
|
7
|
+
textContent: string;
|
|
8
|
+
roundCorners: number;
|
|
9
|
+
borderWidth: number;
|
|
10
|
+
borderWidthRawValue: string;
|
|
11
|
+
roundCornersRawValue: string;
|
|
12
|
+
borderColor: string;
|
|
13
|
+
borderAlpha: number;
|
|
14
|
+
backgroundColor: string;
|
|
15
|
+
backgroundAlpha: number;
|
|
16
|
+
innerSizesDependOn: string;
|
|
17
|
+
angle: number;
|
|
18
|
+
shadowColorLight: string;
|
|
19
|
+
shadowColorDark: string;
|
|
20
|
+
shadowColorAlpha: number;
|
|
21
|
+
};
|
|
22
|
+
type ControlStylesFallbacks = typeof controlStylesFallbacks;
|
|
23
|
+
export declare enum ALIGN_ITEMS {
|
|
24
|
+
top = "flex-start",
|
|
25
|
+
bottom = "flex-end",
|
|
26
|
+
center = "center"
|
|
27
|
+
}
|
|
28
|
+
export declare enum JUSTIFY_CONTENT {
|
|
29
|
+
start = "flex-start",
|
|
30
|
+
end = "flex-end",
|
|
31
|
+
center = "center"
|
|
32
|
+
}
|
|
33
|
+
export type SetTextPositionStylesProps = {
|
|
34
|
+
target: HTMLElement;
|
|
35
|
+
props: Control["props"]["text"] & {
|
|
36
|
+
alignment: Control["layoutParams"]["alignment"];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export declare const setTextPositionStyles: ({ target, props }: SetTextPositionStylesProps) => void;
|
|
40
|
+
type SetTextStylesProps = {
|
|
41
|
+
target: HTMLElement;
|
|
42
|
+
props: Control["props"];
|
|
43
|
+
fallback: ControlStylesFallbacks;
|
|
44
|
+
dependsOn: Dimensions;
|
|
45
|
+
};
|
|
46
|
+
export declare const setTextStyles: ({ target, props, fallback, dependsOn }: SetTextStylesProps) => void;
|
|
47
|
+
type SetBackgroundStylesProps = {
|
|
48
|
+
target: HTMLElement;
|
|
49
|
+
props: Control["props"];
|
|
50
|
+
fallback: ControlStylesFallbacks;
|
|
51
|
+
};
|
|
52
|
+
export declare const setBackgroundStyles: ({ target, props, fallback }: SetBackgroundStylesProps) => void;
|
|
53
|
+
type SetBorderStylesProps = {
|
|
54
|
+
target: HTMLElement;
|
|
55
|
+
props: Control["props"];
|
|
56
|
+
fallback: ControlStylesFallbacks;
|
|
57
|
+
dependsOn: Dimensions;
|
|
58
|
+
useRawValues?: boolean;
|
|
59
|
+
};
|
|
60
|
+
export declare const setBorderStyles: ({ target, props, fallback, dependsOn, useRawValues }: SetBorderStylesProps) => void;
|
|
61
|
+
type SetShadowStylesProps = {
|
|
62
|
+
target: HTMLElement;
|
|
63
|
+
props?: Control["props"];
|
|
64
|
+
fallback: ControlStylesFallbacks;
|
|
65
|
+
isDark: boolean;
|
|
66
|
+
baseDimension: string;
|
|
67
|
+
};
|
|
68
|
+
export declare const setShadowStyles: ({ target, isDark, baseDimension, fallback }: SetShadowStylesProps) => void;
|
|
69
|
+
type SetAngleProps = {
|
|
70
|
+
target: HTMLElement;
|
|
71
|
+
fallback: ControlStylesFallbacks;
|
|
72
|
+
layoutParams: Control["layoutParams"];
|
|
73
|
+
};
|
|
74
|
+
export declare const setAngle: ({ target, layoutParams, fallback }: SetAngleProps) => void;
|
|
75
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { movikaProjectIdLoader } from "./movikaProjectIdLoader";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { movikaProjectIdLoader } from "./movikaProjectIdLoader";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { GetVKVideoParams, VKVideoLoaderInterface } from "./types";
|
|
2
|
+
export declare class CustomVkVideoLoader implements VKVideoLoaderInterface {
|
|
3
|
+
private _requestData;
|
|
4
|
+
private _mediaMap;
|
|
5
|
+
private _abortController;
|
|
6
|
+
constructor(options: GetVKVideoParams);
|
|
7
|
+
resolve({ actions, result, errors, ...args }: Record<string, any>): Promise<Promise<Record<string, any>>>;
|
|
8
|
+
private _transform;
|
|
9
|
+
private _send;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CustomVkVideoLoader } from "./CustomVkVideoLoader";
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import type { ManifestVideo, ManifestVideoVariant } from "../../../manifest";
|
|
2
|
+
export type { Extension, Standard } from "../../../manifest";
|
|
3
|
+
export interface GetVKVideoParams {
|
|
4
|
+
access_token: string;
|
|
5
|
+
owner_id?: number;
|
|
6
|
+
videos?: string;
|
|
7
|
+
album_id?: number;
|
|
8
|
+
count?: number;
|
|
9
|
+
offset?: number;
|
|
10
|
+
extended?: boolean;
|
|
11
|
+
fields?: string;
|
|
12
|
+
v: number;
|
|
13
|
+
}
|
|
14
|
+
export interface FullRequestParams {
|
|
15
|
+
baseURL: string;
|
|
16
|
+
requestParams: GetVKVideoParams;
|
|
17
|
+
}
|
|
18
|
+
export interface VKVideoLoaderInterface {
|
|
19
|
+
resolve(arg: Record<string, any>): Promise<Record<string, any>>;
|
|
20
|
+
}
|
|
21
|
+
export type ExtendedManifestVideoVariant = ManifestVideoVariant & {
|
|
22
|
+
vkVideoModel?: VideoVideoFull;
|
|
23
|
+
};
|
|
24
|
+
export type ExtendedManifestVideo = Omit<ManifestVideo, "variants"> & {
|
|
25
|
+
variants: ExtendedManifestVideoVariant[];
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* video.get
|
|
29
|
+
*
|
|
30
|
+
* Returns detailed information about videos.
|
|
31
|
+
*/
|
|
32
|
+
export interface VideoGetParams {
|
|
33
|
+
/**
|
|
34
|
+
* ID of the user or community that owns the video(s).
|
|
35
|
+
*/
|
|
36
|
+
owner_id?: number;
|
|
37
|
+
group_id?: number;
|
|
38
|
+
for_user_id?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Video IDs, in the following format: "<owner_id>_<media_id>,<owner_id>_<media_id>", Use a negative value to designate a community ID. Example: "-4363_136089719,13245770_137352259"
|
|
41
|
+
*/
|
|
42
|
+
videos?: string;
|
|
43
|
+
/**
|
|
44
|
+
* ID of the album containing the video(s).
|
|
45
|
+
*/
|
|
46
|
+
album_id?: number;
|
|
47
|
+
width?: number;
|
|
48
|
+
/**
|
|
49
|
+
* Number of videos to return.
|
|
50
|
+
*/
|
|
51
|
+
count?: number;
|
|
52
|
+
/**
|
|
53
|
+
* Offset needed to return a specific subset of videos.
|
|
54
|
+
*/
|
|
55
|
+
offset?: number;
|
|
56
|
+
need_privacy?: 0 | 1;
|
|
57
|
+
need_embed?: 0 | 1;
|
|
58
|
+
/**
|
|
59
|
+
* '1' - to return an extended response with additional fields
|
|
60
|
+
*/
|
|
61
|
+
extended?: 0 | 1;
|
|
62
|
+
fields?: string;
|
|
63
|
+
device_id?: string;
|
|
64
|
+
ok_session_key?: string;
|
|
65
|
+
united_video_only?: 0 | 1;
|
|
66
|
+
ok_client_params?: string;
|
|
67
|
+
}
|
|
68
|
+
export interface VideoGetResponse {
|
|
69
|
+
/**
|
|
70
|
+
* Total number
|
|
71
|
+
*/
|
|
72
|
+
[key: string]: unknown;
|
|
73
|
+
count: number;
|
|
74
|
+
items: VideoVideoFull;
|
|
75
|
+
}
|
|
76
|
+
export interface VideoVideoFull {
|
|
77
|
+
[key: string]: any;
|
|
78
|
+
/**
|
|
79
|
+
* List of video episodes with timecodes
|
|
80
|
+
*/
|
|
81
|
+
episodes?: VideoEpisode[];
|
|
82
|
+
qualities_info?: VideoQualityInfo[];
|
|
83
|
+
/**
|
|
84
|
+
* Video duration in seconds
|
|
85
|
+
*/
|
|
86
|
+
duration?: number;
|
|
87
|
+
image?: VideoVideoImage[];
|
|
88
|
+
first_frame?: VideoVideoImage[];
|
|
89
|
+
files?: VideoVideoFiles;
|
|
90
|
+
trailer?: VideoVideoFiles;
|
|
91
|
+
timeline_thumbs?: VideoTimelineThumbs;
|
|
92
|
+
}
|
|
93
|
+
export interface VideoVideoFiles {
|
|
94
|
+
/**
|
|
95
|
+
* URL of the external player
|
|
96
|
+
*/
|
|
97
|
+
external?: string;
|
|
98
|
+
/**
|
|
99
|
+
* URL of the mpeg4 file with 144p quality
|
|
100
|
+
*/
|
|
101
|
+
mp4_144?: string;
|
|
102
|
+
/**
|
|
103
|
+
* URL of the mpeg4 file with 240p quality
|
|
104
|
+
*/
|
|
105
|
+
mp4_240?: string;
|
|
106
|
+
/**
|
|
107
|
+
* URL of the mpeg4 file with 360p quality
|
|
108
|
+
*/
|
|
109
|
+
mp4_360?: string;
|
|
110
|
+
/**
|
|
111
|
+
* URL of the mpeg4 file with 480p quality
|
|
112
|
+
*/
|
|
113
|
+
mp4_480?: string;
|
|
114
|
+
/**
|
|
115
|
+
* URL of the mpeg4 file with 720p quality
|
|
116
|
+
*/
|
|
117
|
+
mp4_720?: string;
|
|
118
|
+
/**
|
|
119
|
+
* URL of the mpeg4 file with 1080p quality
|
|
120
|
+
*/
|
|
121
|
+
mp4_1080?: string;
|
|
122
|
+
/**
|
|
123
|
+
* URL of the mpeg4 file with 2K quality
|
|
124
|
+
*/
|
|
125
|
+
mp4_1440?: string;
|
|
126
|
+
/**
|
|
127
|
+
* URL of the mpeg4 file with 4K quality
|
|
128
|
+
*/
|
|
129
|
+
mp4_2160?: string;
|
|
130
|
+
/**
|
|
131
|
+
* URL of the flv file with 320p quality
|
|
132
|
+
*/
|
|
133
|
+
flv_320?: string;
|
|
134
|
+
/**
|
|
135
|
+
* Instant streaming mp4 URL
|
|
136
|
+
*/
|
|
137
|
+
src?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Live stream URL
|
|
140
|
+
*/
|
|
141
|
+
live?: string;
|
|
142
|
+
/**
|
|
143
|
+
* HLS playlist URL
|
|
144
|
+
*/
|
|
145
|
+
hls?: string;
|
|
146
|
+
/**
|
|
147
|
+
* RTMP stream URL
|
|
148
|
+
*/
|
|
149
|
+
rtmp?: string;
|
|
150
|
+
/**
|
|
151
|
+
* OKMP RTMP stream URL
|
|
152
|
+
*/
|
|
153
|
+
okmp_rtmp?: string;
|
|
154
|
+
/**
|
|
155
|
+
* WebSocket stream URL
|
|
156
|
+
*/
|
|
157
|
+
ws?: string;
|
|
158
|
+
/**
|
|
159
|
+
* CMAF stream URL
|
|
160
|
+
*/
|
|
161
|
+
cmaf?: string;
|
|
162
|
+
/**
|
|
163
|
+
* DASH manifest URL
|
|
164
|
+
*/
|
|
165
|
+
dash_uni?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Separated DASH manifest URL
|
|
168
|
+
*/
|
|
169
|
+
dash_sep?: string;
|
|
170
|
+
/**
|
|
171
|
+
* VP9 DASH manifest URL
|
|
172
|
+
*/
|
|
173
|
+
dash_webm?: string;
|
|
174
|
+
/**
|
|
175
|
+
* HEVC DASH manifest URL
|
|
176
|
+
*/
|
|
177
|
+
dash_hevc?: string;
|
|
178
|
+
/**
|
|
179
|
+
* VP9 DASH manifest URL live
|
|
180
|
+
*/
|
|
181
|
+
dash_webm_live?: string;
|
|
182
|
+
/**
|
|
183
|
+
* HLS live playback URL
|
|
184
|
+
*/
|
|
185
|
+
hls_live_playback?: string;
|
|
186
|
+
/**
|
|
187
|
+
* DASH live playback URL
|
|
188
|
+
*/
|
|
189
|
+
dash_live_playback?: string;
|
|
190
|
+
/**
|
|
191
|
+
* HLS ondemand URL
|
|
192
|
+
*/
|
|
193
|
+
hls_ondemand?: string;
|
|
194
|
+
/**
|
|
195
|
+
* DASH ondemand URL
|
|
196
|
+
*/
|
|
197
|
+
dash_ondemand?: string;
|
|
198
|
+
/**
|
|
199
|
+
* Failover host
|
|
200
|
+
*/
|
|
201
|
+
failover_host?: string;
|
|
202
|
+
/**
|
|
203
|
+
* UV migration location info
|
|
204
|
+
*/
|
|
205
|
+
united_migration_location?: string;
|
|
206
|
+
/**
|
|
207
|
+
* UV migration video size in location
|
|
208
|
+
*/
|
|
209
|
+
united_migration_size?: number;
|
|
210
|
+
}
|
|
211
|
+
export interface VideoQualityInfo {
|
|
212
|
+
/**
|
|
213
|
+
* Size of video: 144, 240, 360 and etc
|
|
214
|
+
*/
|
|
215
|
+
quality?: number;
|
|
216
|
+
/**
|
|
217
|
+
* List of quality features
|
|
218
|
+
*/
|
|
219
|
+
params?: Array<"neurohd">;
|
|
220
|
+
}
|
|
221
|
+
export interface VideoEpisode {
|
|
222
|
+
/**
|
|
223
|
+
* Seconds from start of the video
|
|
224
|
+
*/
|
|
225
|
+
time?: number;
|
|
226
|
+
/**
|
|
227
|
+
* Description of episode
|
|
228
|
+
*/
|
|
229
|
+
text?: string;
|
|
230
|
+
}
|
|
231
|
+
export interface VideoTimelineThumbs {
|
|
232
|
+
count_per_image?: number;
|
|
233
|
+
count_per_row?: number;
|
|
234
|
+
count_total?: number;
|
|
235
|
+
frame_height?: number;
|
|
236
|
+
frame_width?: number;
|
|
237
|
+
links?: string[];
|
|
238
|
+
is_uv?: boolean;
|
|
239
|
+
frequency?: number;
|
|
240
|
+
}
|
|
241
|
+
export interface VideoVideoImage {
|
|
242
|
+
id?: string;
|
|
243
|
+
/**
|
|
244
|
+
* Image url
|
|
245
|
+
*/
|
|
246
|
+
url: string;
|
|
247
|
+
/**
|
|
248
|
+
* Image width
|
|
249
|
+
*/
|
|
250
|
+
width: number;
|
|
251
|
+
/**
|
|
252
|
+
* Image height
|
|
253
|
+
*/
|
|
254
|
+
height: number;
|
|
255
|
+
theme?: "light" | "dark";
|
|
256
|
+
with_padding?: 1;
|
|
257
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { FullRequestParams, VideoVideoImage } from
|
|
1
|
+
import type { FullRequestParams, VideoVideoImage } from "./types";
|
|
2
2
|
export declare function createRequestURL({ baseURL, requestParams }: FullRequestParams): string;
|
|
3
3
|
export declare function findMaxResolutionFrame(frames?: VideoVideoImage[]): VideoVideoImage | undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
type LoaderTypes =
|
|
1
|
+
type LoaderTypes = "chapterLoaders" | "manifestLoaders";
|
|
2
2
|
export type Loaders = Record<LoaderTypes, AnyFn[]>;
|
|
3
3
|
interface ILoadable {
|
|
4
|
-
|
|
4
|
+
exec(type: LoaderTypes, inputArg: Record<string, any>): Promise<any>;
|
|
5
5
|
}
|
|
6
6
|
export declare class Loadable implements ILoadable {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
loaders: Loaders;
|
|
8
|
+
constructor(loaders: Partial<Loaders>);
|
|
9
|
+
exec(type: LoaderTypes, inputArg: Record<string, any>): Promise<any>;
|
|
10
10
|
}
|
|
11
11
|
export declare function addErrorMessage(errObj: Record<string, Array<string>> | null, loaderName: string, message: string): Record<string, Array<string>>;
|
|
12
12
|
export declare function defaultLoader({ actions, errors, chapterId, ...args }: Record<string, any>): Record<string, any>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { IValueSubject, Nullable } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { ChapterBranch, ManifestVideo, Chapter, Manifest, GraphEditChapter, GraphViewChapter, AnyManifest } from "../../manifest";
|
|
3
|
+
import { Loadable, type Loaders } from "./Loadable";
|
|
4
|
+
type BranchesData = {
|
|
5
|
+
chapter: Chapter;
|
|
6
|
+
graph: GraphEditChapter | GraphViewChapter | undefined;
|
|
7
|
+
media: ManifestVideo;
|
|
8
|
+
};
|
|
9
|
+
export declare class ManifestController extends Loadable {
|
|
10
|
+
manifest: Nullable<Manifest>;
|
|
11
|
+
chapter: Nullable<Chapter>;
|
|
12
|
+
media: Nullable<ManifestVideo>;
|
|
13
|
+
graph: Nullable<Manifest["graph"]>;
|
|
14
|
+
prevChapter$: IValueSubject<Chapter | null>;
|
|
15
|
+
onError: (err: unknown) => void;
|
|
16
|
+
constructor(loaders: Partial<Loaders>, onError: (err: unknown) => void);
|
|
17
|
+
release(): this;
|
|
18
|
+
setManifest(source: AnyManifest | string): Promise<ManifestController>;
|
|
19
|
+
setInitial(): Promise<ManifestController>;
|
|
20
|
+
setNext(chapterId?: string | undefined): Promise<ManifestController>;
|
|
21
|
+
errorHandler(errors: unknown): void;
|
|
22
|
+
getInitial(): Nullable<BranchesData>;
|
|
23
|
+
getByChapterId(chapterId?: string | undefined): Nullable<BranchesData>;
|
|
24
|
+
getBranches(chapterId?: string | undefined): BranchesData[];
|
|
25
|
+
getByBranches(branches?: ChapterBranch[]): BranchesData[];
|
|
26
|
+
getCurrent(): {
|
|
27
|
+
chapter: Nullable<Chapter>;
|
|
28
|
+
media: Nullable<ManifestVideo>;
|
|
29
|
+
graph: Nullable<Manifest["graph"]>;
|
|
30
|
+
};
|
|
31
|
+
isInitialChapter(): boolean;
|
|
32
|
+
isEndChapter(): boolean;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ManifestController } from "./ManifestController";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { Manifest, AnyManifest, Media, Chapter, GraphEditChapter, GraphViewChapter } from
|
|
1
|
+
import type { Manifest, AnyManifest, Media, Chapter, GraphEditChapter, GraphViewChapter } from "../../manifest";
|
|
2
2
|
type ManifestInfo = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
manifest: AnyManifest;
|
|
4
|
+
manifestURL: string;
|
|
5
5
|
};
|
|
6
6
|
export declare const convertToObject: (manifest: AnyManifest | string) => Promise<Partial<ManifestInfo>>;
|
|
7
7
|
export declare function fetchManifest(manifest: AnyManifest | string): Promise<Manifest>;
|
|
8
8
|
export declare function getInitialChapter(manifest: Manifest): Chapter | undefined;
|
|
9
9
|
export declare function getChapter(chapters: Chapter[], chapterId?: string): Chapter | undefined;
|
|
10
|
-
export declare function getGraphItem(graphObj: Manifest[
|
|
11
|
-
export declare function getMedia(media: Media, videoId?: string): Media[
|
|
10
|
+
export declare function getGraphItem(graphObj: Manifest["graph"], chapterId: string): GraphEditChapter | GraphViewChapter | undefined;
|
|
11
|
+
export declare function getMedia(media: Media, videoId?: string): Media["videos"][0] | undefined;
|
|
12
12
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ISubscription } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IPlayer } from "@vkontakte/videoplayer-core";
|
|
3
|
+
import type { IOneStat } from "@vkontakte/videoplayer-statistics";
|
|
4
|
+
export interface InstanceStatistics {
|
|
5
|
+
oneStat: IOneStat;
|
|
6
|
+
statSubscription: ISubscription;
|
|
7
|
+
}
|
|
8
|
+
export interface Instance {
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
container: HTMLElement;
|
|
11
|
+
player: IPlayer;
|
|
12
|
+
subscription: ISubscription;
|
|
13
|
+
statistics?: InstanceStatistics;
|
|
14
|
+
}
|
|
15
|
+
export default function InstanceManager(): Record<string, any>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { IConfig, IPlayer, PlaybackRate, VideoQuality } from "@vkontakte/videoplayer-core";
|
|
2
|
+
import type { Nullable } from "@vkontakte/videoplayer-shared";
|
|
3
|
+
import { ValueSubject } from "@vkontakte/videoplayer-shared";
|
|
4
|
+
import type { ManifestVideo, Extension } from "../../manifest";
|
|
5
|
+
import type { Interactives } from "../Interactives";
|
|
6
|
+
import { type InstanceStatistics } from "./InstanceManager";
|
|
7
|
+
import type { Instance } from "./InstanceManager";
|
|
8
|
+
interface CreatePlayerParams extends Omit<IConfig, "sources" | "container"> {
|
|
9
|
+
media: ManifestVideo;
|
|
10
|
+
chapterId: string;
|
|
11
|
+
prefetch?: boolean;
|
|
12
|
+
setAsActive?: boolean;
|
|
13
|
+
autoplay?: boolean;
|
|
14
|
+
preferredExt?: Array<Extension>;
|
|
15
|
+
quality?: VideoQuality;
|
|
16
|
+
playbackRate?: PlaybackRate;
|
|
17
|
+
title?: string;
|
|
18
|
+
}
|
|
19
|
+
export type ActivePlayer = Nullable<Pick<Instance, "player" | "config" | "statistics">>;
|
|
20
|
+
export default function SeamlessController(interactiveController?: Interactives): {
|
|
21
|
+
map: Map<string, Record<string, Instance>>;
|
|
22
|
+
createPlayer: (params: CreatePlayerParams) => Promise<{
|
|
23
|
+
player: IPlayer;
|
|
24
|
+
config: IConfig;
|
|
25
|
+
statistics: Nullable<InstanceStatistics>;
|
|
26
|
+
}>;
|
|
27
|
+
removePlayer: (listId: string, itemId?: string) => void;
|
|
28
|
+
removeAll: () => void;
|
|
29
|
+
init: () => Promise<void>;
|
|
30
|
+
setInteractiveController: (instance: Interactives) => void;
|
|
31
|
+
getActivePlayer: () => Record<string, unknown>;
|
|
32
|
+
activePlayerChanged: ValueSubject<ActivePlayer>;
|
|
33
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IPlayer, ISources } from "@vkontakte/videoplayer-core";
|
|
2
|
+
import type { ManifestVideo, Extension } from "../../manifest";
|
|
3
|
+
import type { VideoQuality } from "@vkontakte/videoplayer-core";
|
|
4
|
+
export declare function genPlayerCfgVideoData(mediaObj: ManifestVideo, allowList?: Array<Extension>): {
|
|
5
|
+
sources: ISources;
|
|
6
|
+
thumbUrl?: string | null;
|
|
7
|
+
title: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const setVideoQuality: (player: IPlayer, quality: VideoQuality) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IPlayer } from "@vkontakte/videoplayer-core";
|
|
2
|
+
import type { ChapterContainer } from "../../manifest";
|
|
3
|
+
export declare class SeekToInteractiveController {
|
|
4
|
+
private _containers;
|
|
5
|
+
private _player;
|
|
6
|
+
setPlayer: (player: IPlayer) => void;
|
|
7
|
+
setContainers: (containers: ChapterContainer[]) => void;
|
|
8
|
+
deleteContainer: (id: string) => void;
|
|
9
|
+
getNextInteractiveTime: (offsetMs?: number) => number | null;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SeekToInteractiveController } from "./SeekToInteractiveController";
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
+
}
|