@vkontakte/videoplayer-interactive 1.0.19-dev.c9e593de.0 → 1.0.19-dev.d5db4341.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 +2 -3
- package/types/manifest/index.d.ts +3 -0
- package/types/manifest/utils.d.ts +11 -0
- package/types/modules/Graph/Graph.d.ts +2 -2
- package/types/modules/Interactives/Interactives.d.ts +21 -16
- package/types/modules/Interactives/Layout.d.ts +7 -7
- package/types/modules/Interactives/controls/Control.d.ts +3 -4
- package/types/modules/Interactives/controls/types.d.ts +4 -5
- package/types/modules/Interactives/index.d.ts +2 -1
- package/types/modules/Interactives/types.d.ts +12 -15
- 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 +4 -4
- 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 +2 -3
- 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/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/LastFrame.d.ts +1 -1
- package/types/utils/chapterHelpers.d.ts +1 -1
- package/types/utils/extractVkMovieId.d.ts +2 -2
- package/types/movika.core/manifest/index.d.ts +0 -23
- 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,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,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,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];
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Chapter as Chapter_3_2, ChapterContainer as ChapterContainer_3_2, ChapterBranch as ChapterBranch_3_2 } from './manifest_3_2/chapter';
|
|
2
|
-
import type { Manifest_3_2, ManifestVideo as ManifestVideo_3_2, ManifestVideoVariant as ManifestVideoVariant_3_2, Media as Media_3_2, Metadata as Metadata_3_2 } from './manifest_3_2/manifest';
|
|
3
|
-
import type { Chapter as Chapter_3_3, ChapterContainer as ChapterContainer_3_3, ChapterBranch as ChapterBranch_3_3 } from './manifest_3_3/chapter';
|
|
4
|
-
import type { Manifest_3_3, ManifestVideo as ManifestVideo_3_3, ManifestVideoVariant as ManifestVideoVariant_3_3, Media as Media_3_3, Metadata as Metadata_3_3, ManifestVideoVariantType, Extensions, Standard } from './manifest_3_3/manifest';
|
|
5
|
-
import type { Control, ControlLayoutParams } from './manifest_3_3/control';
|
|
6
|
-
export type Container = ChapterContainer_3_2 | ChapterContainer_3_3;
|
|
7
|
-
export type Media = Media_3_2 | Media_3_3;
|
|
8
|
-
export type Chapter = Chapter_3_2 | Chapter_3_3;
|
|
9
|
-
export type Manifest = Manifest_3_2 | Manifest_3_3;
|
|
10
|
-
export type Metadata = Metadata_3_2 | Metadata_3_3;
|
|
11
|
-
export type ManifestVideo = ManifestVideo_3_2 | ManifestVideo_3_3;
|
|
12
|
-
export type ManifestVideoVariant = ManifestVideoVariant_3_2 | ManifestVideoVariant_3_3;
|
|
13
|
-
export type ChapterBranch = ChapterBranch_3_2 | ChapterBranch_3_3;
|
|
14
|
-
export type { ManifestVideoVariantType, Extensions, Standard };
|
|
15
|
-
export type LatestMedia = Media_3_3;
|
|
16
|
-
export type LatestChapter = Chapter_3_3;
|
|
17
|
-
export type LatestManifest = Manifest_3_3;
|
|
18
|
-
export type LatestContainer = ChapterContainer_3_3;
|
|
19
|
-
export type LatestControl = Control;
|
|
20
|
-
export type LatestControlLayoutParams = ControlLayoutParams;
|
|
21
|
-
export * from './migrations';
|
|
22
|
-
export * from './types';
|
|
23
|
-
export * from './utils';
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { Control } from './control';
|
|
2
|
-
export type ChapterEventType = 'onSuspense';
|
|
3
|
-
export type ContainerEventType = 'onSuspense';
|
|
4
|
-
export type ChapterSuspenseActionType = 'setNextBranch' | 'setWeightlessRandomBranch' | 'setRandomBranch' | 'setMaxWeightBranch' | 'setMinWeightBranch' | 'setDefaultBranch' | 'continuePlayback' | 'openURI';
|
|
5
|
-
export type ContainerSuspenseActionType = 'setNextBranch' | 'continuePlayback';
|
|
6
|
-
export interface ChapterEvent {
|
|
7
|
-
type: ChapterEventType;
|
|
8
|
-
action: {
|
|
9
|
-
type: ChapterSuspenseActionType;
|
|
10
|
-
args: {
|
|
11
|
-
branchId?: string;
|
|
12
|
-
shouldOpenNow: boolean;
|
|
13
|
-
isDetachContainer?: boolean;
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export interface ChapterBranch {
|
|
18
|
-
id: string;
|
|
19
|
-
chapterId: string;
|
|
20
|
-
weight?: number;
|
|
21
|
-
manifestUrl?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface ContainerEvent {
|
|
24
|
-
type: ContainerEventType;
|
|
25
|
-
action: {
|
|
26
|
-
type: ContainerSuspenseActionType;
|
|
27
|
-
args: {
|
|
28
|
-
branchId?: string;
|
|
29
|
-
shouldOpenNow: boolean;
|
|
30
|
-
isDetachContainer?: boolean;
|
|
31
|
-
uri?: string;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export interface ChapterContainer {
|
|
36
|
-
id: string;
|
|
37
|
-
/**
|
|
38
|
-
* Interactivity start time in milliseconds
|
|
39
|
-
*/
|
|
40
|
-
startTime: number;
|
|
41
|
-
/**
|
|
42
|
-
* Interactivity end time in milliseconds
|
|
43
|
-
*/
|
|
44
|
-
endTime?: number | null;
|
|
45
|
-
controls: Control[];
|
|
46
|
-
layout: {
|
|
47
|
-
type: 'Relative';
|
|
48
|
-
};
|
|
49
|
-
type: 'Choice' | 'TextInput';
|
|
50
|
-
events?: ContainerEvent[];
|
|
51
|
-
}
|
|
52
|
-
export interface Chapter {
|
|
53
|
-
id: string;
|
|
54
|
-
videoId?: string;
|
|
55
|
-
containers: ChapterContainer[];
|
|
56
|
-
branches: ChapterBranch[];
|
|
57
|
-
events?: ChapterEvent[];
|
|
58
|
-
label: string;
|
|
59
|
-
x: number;
|
|
60
|
-
y: number;
|
|
61
|
-
order: 'start' | 'end' | 'simple';
|
|
62
|
-
}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
export type ControlType = 'Text' | 'Button' | 'Area';
|
|
2
|
-
export type ControlEventType = 'onClick';
|
|
3
|
-
export type ControlActionType = 'setNextBranch' | 'continuePlayback' | 'openURI';
|
|
4
|
-
export interface ControlEvent {
|
|
5
|
-
type: ControlEventType;
|
|
6
|
-
action: {
|
|
7
|
-
type: ControlActionType;
|
|
8
|
-
args: {
|
|
9
|
-
branchId?: string;
|
|
10
|
-
shouldOpenNow: boolean;
|
|
11
|
-
isDetachContainer?: boolean;
|
|
12
|
-
uri?: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export interface ControlLayoutParams {
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
angle: number;
|
|
22
|
-
innerSizesDependOn?: 'video' | 'self';
|
|
23
|
-
}
|
|
24
|
-
export interface ControlProps {
|
|
25
|
-
text?: {
|
|
26
|
-
value: string;
|
|
27
|
-
gravityHorizontal: 'start' | 'end' | 'center';
|
|
28
|
-
gravityVertical: 'top' | 'bottom' | 'center';
|
|
29
|
-
color: string;
|
|
30
|
-
alpha: number;
|
|
31
|
-
size: number;
|
|
32
|
-
paddings?: {
|
|
33
|
-
top: number;
|
|
34
|
-
right: number;
|
|
35
|
-
bottom: number;
|
|
36
|
-
left: number;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated accepted but no one uses
|
|
40
|
-
*/
|
|
41
|
-
alignment?: 'left' | 'right' | 'center';
|
|
42
|
-
};
|
|
43
|
-
background: {
|
|
44
|
-
type: 'color';
|
|
45
|
-
color: string;
|
|
46
|
-
alpha: number;
|
|
47
|
-
src?: string;
|
|
48
|
-
};
|
|
49
|
-
shape: {
|
|
50
|
-
type: 'rectangle';
|
|
51
|
-
roundCorners: number;
|
|
52
|
-
border: {
|
|
53
|
-
width: number;
|
|
54
|
-
color: string;
|
|
55
|
-
alpha: number;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
export interface Control {
|
|
60
|
-
id: string;
|
|
61
|
-
type: 'Button' | 'Area';
|
|
62
|
-
label: string;
|
|
63
|
-
subtype: ControlType;
|
|
64
|
-
layoutParams: ControlLayoutParams;
|
|
65
|
-
props: ControlProps;
|
|
66
|
-
events?: ControlEvent[];
|
|
67
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { Chapter } from './chapter';
|
|
2
|
-
export type ManifestVideoVariantType = 'custom' | 'mp4' | 'hls' | 'dash' | 'mpeg';
|
|
3
|
-
export type Extensions = Exclude<ManifestVideoVariantType, 'custom'>;
|
|
4
|
-
export type Standard = '144p' | '240p' | '360p' | '480p' | '720p' | '1080p' | '1440p' | '2160p' | '4320p';
|
|
5
|
-
export interface CustomManifestVideoVariant {
|
|
6
|
-
type: Extract<ManifestVideoVariantType, 'custom'>;
|
|
7
|
-
payload: {
|
|
8
|
-
type: string;
|
|
9
|
-
id: string;
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export interface DefaultManifestVideoVariant {
|
|
13
|
-
type: Extensions;
|
|
14
|
-
url: string;
|
|
15
|
-
size?: number | null;
|
|
16
|
-
standard?: Standard | null;
|
|
17
|
-
resolution?: string | null;
|
|
18
|
-
bitrate?: number | null;
|
|
19
|
-
cover?: string | null;
|
|
20
|
-
preview?: string | null;
|
|
21
|
-
}
|
|
22
|
-
export type ManifestVideoVariant = CustomManifestVideoVariant | DefaultManifestVideoVariant;
|
|
23
|
-
export interface ManifestVideo {
|
|
24
|
-
id: string;
|
|
25
|
-
duration?: number | null;
|
|
26
|
-
shortlink?: string | null;
|
|
27
|
-
variants: ManifestVideoVariant[];
|
|
28
|
-
title?: string;
|
|
29
|
-
}
|
|
30
|
-
export type Media = {
|
|
31
|
-
videos: ManifestVideo[];
|
|
32
|
-
};
|
|
33
|
-
export interface Metadata {
|
|
34
|
-
id: string;
|
|
35
|
-
version: '3.2';
|
|
36
|
-
build: number;
|
|
37
|
-
initChapterId?: string;
|
|
38
|
-
created: string;
|
|
39
|
-
updated: string;
|
|
40
|
-
types?: string[];
|
|
41
|
-
/**
|
|
42
|
-
* @deprecated
|
|
43
|
-
*/
|
|
44
|
-
media?: Media | string;
|
|
45
|
-
}
|
|
46
|
-
export interface Manifest_3_2 {
|
|
47
|
-
metadata: Metadata;
|
|
48
|
-
media: Media;
|
|
49
|
-
chapters: Chapter[];
|
|
50
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export interface ManifestDataTemplate {
|
|
2
|
-
/**
|
|
3
|
-
* uuid
|
|
4
|
-
*/
|
|
5
|
-
id: string;
|
|
6
|
-
/**
|
|
7
|
-
* Template name
|
|
8
|
-
*/
|
|
9
|
-
name: string;
|
|
10
|
-
/**
|
|
11
|
-
* Chapter type this template can be applied to
|
|
12
|
-
*/
|
|
13
|
-
chapterType: 'start' | 'simple' | 'end';
|
|
14
|
-
/**
|
|
15
|
-
* Template includes stringified JSON object that applied to chapter
|
|
16
|
-
*/
|
|
17
|
-
template: string;
|
|
18
|
-
/**
|
|
19
|
-
* Template data type to apply to
|
|
20
|
-
*/
|
|
21
|
-
type: 'container';
|
|
22
|
-
/**
|
|
23
|
-
* Manifest version of template
|
|
24
|
-
*/
|
|
25
|
-
manifestVersion: string;
|
|
26
|
-
/**
|
|
27
|
-
* Date when template was created
|
|
28
|
-
*/
|
|
29
|
-
created?: number;
|
|
30
|
-
/**
|
|
31
|
-
* Date when template was updated
|
|
32
|
-
*/
|
|
33
|
-
updated?: number;
|
|
34
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import type { Control } from './control';
|
|
2
|
-
export type ChapterEventType = 'onSuspense';
|
|
3
|
-
export type ContainerEventType = 'onSuspense';
|
|
4
|
-
export type ChapterSuspenseActionType = 'setNextBranch' | 'setWeightlessRandomBranch' | 'setRandomBranch' | 'setMaxWeightBranch' | 'setMinWeightBranch' | 'setDefaultBranch' | 'continuePlayback' | 'openURI' | 'expect';
|
|
5
|
-
export type ContainerSuspenseActionType = 'setNextBranch' | 'continuePlayback' | 'expect';
|
|
6
|
-
export interface ChapterEvent {
|
|
7
|
-
type: ChapterEventType;
|
|
8
|
-
action: {
|
|
9
|
-
type: ChapterSuspenseActionType;
|
|
10
|
-
args: {
|
|
11
|
-
branchId?: string;
|
|
12
|
-
shouldOpenNow: boolean;
|
|
13
|
-
isDetachContainer?: boolean;
|
|
14
|
-
uri?: string;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
export interface ChapterBranch {
|
|
19
|
-
id: string;
|
|
20
|
-
chapterId: string;
|
|
21
|
-
weight?: number;
|
|
22
|
-
manifestUrl?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface ContainerEvent {
|
|
25
|
-
type: ContainerEventType;
|
|
26
|
-
action: {
|
|
27
|
-
type: ContainerSuspenseActionType;
|
|
28
|
-
args: {
|
|
29
|
-
branchId?: string;
|
|
30
|
-
shouldOpenNow: boolean;
|
|
31
|
-
isDetachContainer?: boolean;
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
export interface ChapterContainer {
|
|
36
|
-
id: string;
|
|
37
|
-
/**
|
|
38
|
-
* Interactivity start time in milliseconds
|
|
39
|
-
*/
|
|
40
|
-
startTime: number;
|
|
41
|
-
/**
|
|
42
|
-
* Interactivity end time in milliseconds
|
|
43
|
-
*/
|
|
44
|
-
endTime?: number | null;
|
|
45
|
-
controls: Control[];
|
|
46
|
-
layout: {
|
|
47
|
-
type: 'Relative';
|
|
48
|
-
};
|
|
49
|
-
type: 'Choice' | 'TextInput';
|
|
50
|
-
events?: ContainerEvent[];
|
|
51
|
-
}
|
|
52
|
-
export interface Chapter {
|
|
53
|
-
id: string;
|
|
54
|
-
videoId?: string;
|
|
55
|
-
containers: ChapterContainer[];
|
|
56
|
-
branches: ChapterBranch[];
|
|
57
|
-
events?: ChapterEvent[];
|
|
58
|
-
label: string;
|
|
59
|
-
order: 'start' | 'end' | 'simple';
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* ------------ WARNING! ------------
|
|
63
|
-
* This is editor specific type only.
|
|
64
|
-
* Not used in stored manifest
|
|
65
|
-
*/
|
|
66
|
-
export declare enum ChapterError {
|
|
67
|
-
NoVideo = 0,
|
|
68
|
-
NoEOV = 1,
|
|
69
|
-
NoBranches = 2
|
|
70
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
export type ControlType = 'Text' | 'Button' | 'Area';
|
|
2
|
-
export type ControlEventType = 'onClick';
|
|
3
|
-
export type ControlActionType = 'setNextBranch' | 'continuePlayback' | 'openURI';
|
|
4
|
-
export interface ControlEvent {
|
|
5
|
-
type: ControlEventType;
|
|
6
|
-
action: {
|
|
7
|
-
type: ControlActionType;
|
|
8
|
-
args: {
|
|
9
|
-
branchId?: string;
|
|
10
|
-
shouldOpenNow: boolean;
|
|
11
|
-
isDetachContainer?: boolean;
|
|
12
|
-
uri?: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export interface ControlLayoutParams {
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
width: number;
|
|
20
|
-
height: number;
|
|
21
|
-
angle: number;
|
|
22
|
-
innerSizesDependOn?: 'video' | 'self';
|
|
23
|
-
}
|
|
24
|
-
export interface ControlProps {
|
|
25
|
-
text?: {
|
|
26
|
-
value: string;
|
|
27
|
-
gravityHorizontal: 'start' | 'end' | 'center';
|
|
28
|
-
gravityVertical: 'top' | 'bottom' | 'center';
|
|
29
|
-
color: string;
|
|
30
|
-
alpha: number;
|
|
31
|
-
size: number;
|
|
32
|
-
paddings?: {
|
|
33
|
-
top: number;
|
|
34
|
-
right: number;
|
|
35
|
-
bottom: number;
|
|
36
|
-
left: number;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated accepted but no one uses
|
|
40
|
-
*/
|
|
41
|
-
alignment?: 'left' | 'right' | 'center';
|
|
42
|
-
};
|
|
43
|
-
background: {
|
|
44
|
-
type: 'color';
|
|
45
|
-
color: string;
|
|
46
|
-
alpha: number;
|
|
47
|
-
src?: string;
|
|
48
|
-
};
|
|
49
|
-
shape: {
|
|
50
|
-
type: 'rectangle';
|
|
51
|
-
roundCorners: number;
|
|
52
|
-
border: {
|
|
53
|
-
width: number;
|
|
54
|
-
color: string;
|
|
55
|
-
alpha: number;
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
export interface Control {
|
|
60
|
-
id: string;
|
|
61
|
-
type: ControlType;
|
|
62
|
-
label: string;
|
|
63
|
-
layoutParams: ControlLayoutParams;
|
|
64
|
-
props: ControlProps;
|
|
65
|
-
events?: ControlEvent[];
|
|
66
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
export interface GraphBackground {
|
|
2
|
-
color?: string;
|
|
3
|
-
grid?: {
|
|
4
|
-
enabled?: boolean;
|
|
5
|
-
color?: string;
|
|
6
|
-
};
|
|
7
|
-
}
|
|
8
|
-
export interface GraphCustomChapter {
|
|
9
|
-
id: string;
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
}
|
|
13
|
-
export interface GraphEditDefaultChapter {
|
|
14
|
-
flipTo?: {
|
|
15
|
-
enabled?: boolean;
|
|
16
|
-
backgroundColor?: string;
|
|
17
|
-
textColor?: string;
|
|
18
|
-
};
|
|
19
|
-
controls?: {
|
|
20
|
-
enabled?: boolean;
|
|
21
|
-
backgroundColor?: string;
|
|
22
|
-
textColor?: string;
|
|
23
|
-
};
|
|
24
|
-
hover?: {
|
|
25
|
-
enabled?: boolean;
|
|
26
|
-
borderColor?: string;
|
|
27
|
-
shadowColor?: string;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export type GraphEditChapter = GraphCustomChapter & GraphEditDefaultChapter;
|
|
31
|
-
export interface GraphViewDefaultChapter extends GraphEditDefaultChapter {
|
|
32
|
-
watchAgain?: {
|
|
33
|
-
enabled?: boolean;
|
|
34
|
-
backgroundColor?: string;
|
|
35
|
-
textColor?: string;
|
|
36
|
-
};
|
|
37
|
-
preview?: {
|
|
38
|
-
enabled?: boolean;
|
|
39
|
-
backgroundColor?: string;
|
|
40
|
-
textColor?: string;
|
|
41
|
-
};
|
|
42
|
-
goBlind?: boolean;
|
|
43
|
-
}
|
|
44
|
-
export type GraphViewChapter = Pick<GraphCustomChapter, 'id'> & Partial<Pick<GraphCustomChapter, 'x' | 'y'>> & GraphViewDefaultChapter;
|
|
45
|
-
export interface GraphDefaultBranch {
|
|
46
|
-
display?: boolean;
|
|
47
|
-
color?: string;
|
|
48
|
-
connectionColor?: string;
|
|
49
|
-
actionConnectionColor?: string;
|
|
50
|
-
actionIconColor?: string;
|
|
51
|
-
inactionConnectionColor?: string;
|
|
52
|
-
inactionIconColor?: string;
|
|
53
|
-
displayActionConnections?: boolean;
|
|
54
|
-
}
|
|
55
|
-
export interface GraphBranch extends GraphDefaultBranch {
|
|
56
|
-
id: string;
|
|
57
|
-
}
|
|
58
|
-
export interface GraphDesign {
|
|
59
|
-
edit: {
|
|
60
|
-
background?: GraphBackground;
|
|
61
|
-
defaultChapter?: GraphEditDefaultChapter;
|
|
62
|
-
chapters: GraphEditChapter[];
|
|
63
|
-
defaultBranch?: GraphDefaultBranch;
|
|
64
|
-
branches?: GraphBranch[];
|
|
65
|
-
};
|
|
66
|
-
view: {
|
|
67
|
-
background?: GraphBackground;
|
|
68
|
-
defaultChapter?: GraphViewDefaultChapter;
|
|
69
|
-
chapters?: GraphViewChapter[];
|
|
70
|
-
defaultBranch?: GraphDefaultBranch;
|
|
71
|
-
branches?: GraphBranch[];
|
|
72
|
-
};
|
|
73
|
-
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Chapter } from './chapter';
|
|
2
|
-
import type { GraphDesign } from './graph';
|
|
3
|
-
export type ManifestVideoVariantType = 'custom' | 'mp4' | 'hls' | 'dash' | 'mpeg';
|
|
4
|
-
export type Extensions = Exclude<ManifestVideoVariantType, 'custom'>;
|
|
5
|
-
export type Standard = '144p' | '240p' | '360p' | '480p' | '720p' | '1080p' | '1440p' | '2160p' | '4320p';
|
|
6
|
-
export interface CustomManifestVideoVariant {
|
|
7
|
-
type: Extract<ManifestVideoVariantType, 'custom'>;
|
|
8
|
-
payload: {
|
|
9
|
-
type: string;
|
|
10
|
-
id: string;
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
export interface DefaultManifestVideoVariant {
|
|
14
|
-
type: Extensions;
|
|
15
|
-
url: string;
|
|
16
|
-
size?: number | null;
|
|
17
|
-
standard?: Standard | null;
|
|
18
|
-
resolution?: string | null;
|
|
19
|
-
bitrate?: number | null;
|
|
20
|
-
cover?: string | null;
|
|
21
|
-
preview?: string | null;
|
|
22
|
-
}
|
|
23
|
-
export type ManifestVideoVariant = CustomManifestVideoVariant | DefaultManifestVideoVariant;
|
|
24
|
-
export interface ManifestVideo {
|
|
25
|
-
id: string;
|
|
26
|
-
duration?: number | null;
|
|
27
|
-
shortlink?: string | null;
|
|
28
|
-
variants: ManifestVideoVariant[];
|
|
29
|
-
title?: string;
|
|
30
|
-
}
|
|
31
|
-
export type Media = {
|
|
32
|
-
videos: ManifestVideo[];
|
|
33
|
-
};
|
|
34
|
-
export interface Metadata {
|
|
35
|
-
id: string;
|
|
36
|
-
version: '3.3';
|
|
37
|
-
build: number;
|
|
38
|
-
initChapterId?: string;
|
|
39
|
-
created: string;
|
|
40
|
-
updated: string;
|
|
41
|
-
types?: string[];
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated
|
|
44
|
-
*/
|
|
45
|
-
media?: Media | string;
|
|
46
|
-
}
|
|
47
|
-
export interface Manifest_3_3 {
|
|
48
|
-
metadata: Metadata;
|
|
49
|
-
media: Media;
|
|
50
|
-
chapters: Chapter[];
|
|
51
|
-
graph: GraphDesign;
|
|
52
|
-
}
|