@vkontakte/videoplayer 1.1.86 → 1.1.87-dev.04ce2cd1.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 +423 -56
- package/es2015.esm.js +423 -56
- package/es2018.cjs +423 -56
- package/es2018.esm.js +423 -56
- package/es2024.cjs +423 -56
- package/es2024.esm.js +423 -56
- package/esnext.cjs +423 -56
- package/esnext.esm.js +423 -56
- package/evergreen.esm.js +423 -56
- package/package.json +5 -5
- package/types/VKVideoPlayer/HTMLElement.d.ts +1 -1
- package/types/VKVideoPlayer/index.svelte.d.ts +173 -173
- package/types/components/Ads/admanWrapper.d.ts +79 -75
- package/types/components/Ads/types.d.ts +27 -27
- package/types/components/Controls/contants/desktopButtonsLeftIds.d.ts +8 -8
- package/types/components/Controls/contants/desktopButtonsLeftWeights.d.ts +2 -4
- package/types/components/Controls/contants/desktopButtonsRightIds.d.ts +8 -8
- package/types/components/Controls/contants/desktopButtonsRightWeights.d.ts +2 -4
- package/types/components/Controls/types.d.ts +27 -27
- package/types/components/Controls/utils/isInnerButtonGuard.d.ts +1 -1
- package/types/components/Icons/constants.d.ts +5 -5
- package/types/components/Icons/utils.d.ts +1 -1
- package/types/components/Menus/constants/contextMenuItemIds.d.ts +10 -10
- package/types/components/Menus/constants/contextMenuItemWeights.d.ts +2 -4
- package/types/components/Menus/constants/index.d.ts +4 -4
- package/types/components/Menus/constants/openSubMenuItemsIds.d.ts +1 -1
- package/types/components/Menus/constants/settingsMenuItemIds.d.ts +10 -10
- package/types/components/Menus/constants/settingsMenuItemWeights.d.ts +2 -4
- package/types/components/Menus/constants/subMenuIds.d.ts +6 -6
- package/types/components/Menus/subMenuTabs/rootMenuItems.d.ts +26 -26
- package/types/components/Menus/subMenuTabs/sharedMenuItems.d.ts +7 -7
- package/types/components/Menus/subMenuTabs/subMenuItems.d.ts +4 -10
- package/types/components/Menus/subMenuTabs/types.d.ts +108 -108
- package/types/components/Menus/subMenuTabs/utils.d.ts +2 -2
- package/types/components/Menus/types.d.ts +64 -61
- package/types/components/Menus/utils/getCurrentQualityDisplayValue.d.ts +12 -12
- package/types/components/Menus/utils/getQualityIcon.d.ts +2 -2
- package/types/components/Menus/utils/getSubMenusStack.svelte.d.ts +7 -7
- package/types/components/Menus/utils/menuNavigation.d.ts +5 -5
- package/types/components/Root/types.d.ts +79 -79
- package/types/components/Root/utils.d.ts +2 -2
- package/types/components/Timeline/PreviewTrack/useTransitionToPreviewTrack.svelte.d.ts +15 -15
- package/types/components/Timeline/consts.d.ts +2 -2
- package/types/components/shared/interpolateUtils.d.ts +2 -2
- package/types/config.d.ts +270 -260
- package/types/constans/controls.d.ts +21 -21
- package/types/constans/grid.d.ts +9 -9
- package/types/constans/index.d.ts +8 -8
- package/types/constans/interactives.d.ts +4 -4
- package/types/constans/keyboard.d.ts +43 -48
- package/types/index.d.ts +16 -16
- package/types/services/statistics.d.ts +13 -13
- package/types/store/index.d.ts +391 -391
- package/types/store/micro/base.d.ts +6 -6
- package/types/store/micro/fakeIsPlaying.d.ts +8 -10
- package/types/store/micro/graphIsOpened.d.ts +11 -13
- package/types/store/micro/index.d.ts +1 -1
- package/types/store/micro/interactiveControlsOpacity.d.ts +8 -10
- package/types/store/micro/notifications.d.ts +7 -10
- package/types/store/micro/pictureInPicture.d.ts +6 -9
- package/types/store/micro/seekToInteractiveDisabledTooltip.d.ts +8 -7
- package/types/store/micro/showInteractiveTimeIndicatorTooltip.d.ts +13 -12
- package/types/store/utils.d.ts +36 -36
- package/types/translation/index.d.ts +2 -2
- package/types/translation/labels.d.ts +1 -1
- package/types/translation/packs/en.d.ts +1 -1
- package/types/translation/packs/ru.d.ts +1 -1
- package/types/translation/types.d.ts +5 -5
- package/types/types/index.d.ts +534 -516
- package/types/types/svg.d.d.ts +5 -0
- package/types/utils/CaptionsPrepared.d.ts +15 -15
- package/types/utils/WebVttParser.d.ts +11 -11
- package/types/utils/attachments/defferedDisableByCondition.d.ts +3 -3
- package/types/utils/changeVolume.d.ts +6 -6
- package/types/utils/elementHelpers.d.ts +2 -2
- package/types/utils/findCurrentSubtltlePhrase.d.ts +1 -1
- package/types/utils/fullscreen.d.ts +14 -14
- package/types/utils/getActualEpisode.d.ts +7 -7
- package/types/utils/getControlInfo.d.ts +5 -7
- package/types/utils/getHotKeyMapData.d.ts +1 -1
- package/types/utils/grid.d.ts +1 -1
- package/types/utils/hooks/useIosSafariFullscreen.d.ts +2 -2
- package/types/utils/hooks/useIosSafariFullscreenSubtitles.d.ts +3 -3
- package/types/utils/keyboardHandleCases.d.ts +1 -1
- package/types/utils/notificationShowManager.d.ts +7 -6
- package/types/utils/roundFps.d.ts +1 -1
- package/types/utils/sanitizeHtml.d.ts +3 -3
- package/types/utils/sorts.d.ts +2 -2
- package/types/utils/stack/index.d.ts +7 -7
- package/types/utils/stack/node.d.ts +3 -3
- package/types/utils/subtitles.d.ts +8 -8
- package/types/utils/timeout.d.ts +2 -2
- package/types/utils/updatePlayerControlBlocks.d.ts +2 -2
- package/types/utils/updatePlayerControlsInfo.d.ts +2 -2
- package/types/utils/userSettings.d.ts +26 -21
- package/types/utils/videoConfig.d.ts +6 -2
- package/types/utils/volumeChange.d.ts +1 -1
- package/types/utils/webAPI/annotationsApi/annotationsApi.d.ts +31 -31
- package/types/utils/webAPI/annotationsApi/errors.d.ts +1 -1
- package/types/utils/webAPI/focusLock.d.ts +30 -30
- package/types/utils/webAPI/focusManager.d.ts +15 -15
- package/types/utils/webAPI/language.d.ts +1 -1
- package/types/utils/webAPI/mediaSessionApi.d.ts +14 -14
- package/types/utils/webAPI/pictureInPictureApi/documentPictureInPictureApi.svelte.d.ts +41 -41
- package/types/utils/webAPI/pictureInPictureApi/factory.d.ts +2 -2
- package/types/utils/webAPI/pictureInPictureApi/index.d.ts +4 -4
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApi.d.ts +46 -46
- package/types/utils/webAPI/pictureInPictureApi/types.d.ts +4 -4
- package/types/utils/webAPI/pictureInPictureApi/utils.d.ts +3 -3
- package/types/utils/webAPI/slotsApi.d.ts +41 -41
package/types/types/index.d.ts
CHANGED
|
@@ -1,644 +1,662 @@
|
|
|
1
|
-
import type { VideoQuality, VideoFormat, ISources, IExternalTextTrack, IAudioStream } from
|
|
2
|
-
import type { IValueObservable, InterfaceLanguage, Subscription, IRectangle, DevNullEntry } from
|
|
3
|
-
import type { Chapter, Manifest, ManifestVideo, VideoInfo, Interactives, IInteractiveOptions } from
|
|
4
|
-
import { PlaybackState } from
|
|
5
|
-
import type { MediascopePixelTypes, SeekAction, ThinOneStat } from
|
|
6
|
-
import type { Writable, Readable } from
|
|
7
|
-
import type { IDpipConfig, ISDKConfig, IUIConfig } from
|
|
8
|
-
import type { IStore } from
|
|
9
|
-
import { Controls, GridTypes
|
|
10
|
-
import type
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
import type {
|
|
14
|
-
import type {
|
|
1
|
+
import type { VideoQuality, VideoFormat, ISources, IExternalTextTrack, IAudioStream } from "@vkontakte/videoplayer-core";
|
|
2
|
+
import type { IValueObservable, InterfaceLanguage, Subscription, IRectangle, DevNullEntry } from "@vkontakte/videoplayer-shared";
|
|
3
|
+
import type { Chapter, Manifest, ManifestVideo, VideoInfo, Interactives, IInteractiveOptions } from "@vkontakte/videoplayer-interactive";
|
|
4
|
+
import type { PlaybackState } from "@vkontakte/videoplayer-core";
|
|
5
|
+
import type { MediascopePixelTypes, SeekAction, ThinOneStat } from "@vkontakte/videoplayer-statistics";
|
|
6
|
+
import type { Writable, Readable } from "svelte/store";
|
|
7
|
+
import type { IDpipConfig, ISDKConfig, IUIConfig } from "../config";
|
|
8
|
+
import type { IStore } from "../store";
|
|
9
|
+
import type { Controls, GridTypes } from "../constans";
|
|
10
|
+
import { type SeekToInteractiveDisabledTooltipKey } from "../constans";
|
|
11
|
+
import type { Key } from "../translation/types";
|
|
12
|
+
import type { IUIStatistics } from "../services/statistics";
|
|
13
|
+
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from "../components/Menus/subMenuTabs/types";
|
|
14
|
+
import type { AdditionalDesktopControlPanelButton } from "../components/Controls/types";
|
|
15
|
+
import type { AdmanInitParams } from "../components/Ads/types";
|
|
15
16
|
export declare const enum UIType {
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
DESKTOP = "desktop",
|
|
18
|
+
MOBILE = "mobile"
|
|
18
19
|
}
|
|
19
20
|
export declare const enum AdditionalVideoQuality {
|
|
20
|
-
|
|
21
|
+
AUTO = "auto"
|
|
21
22
|
}
|
|
22
23
|
export type VideoQualityUI = VideoQuality | AdditionalVideoQuality;
|
|
24
|
+
export type ControlWillChange = "bottom";
|
|
25
|
+
export type TransitionInfo = {
|
|
26
|
+
duration: string;
|
|
27
|
+
timingFunction: string;
|
|
28
|
+
};
|
|
29
|
+
export type ControlWillChangeParams = {
|
|
30
|
+
type: ControlWillChange;
|
|
31
|
+
from: IControlInfo;
|
|
32
|
+
to: IControlInfo;
|
|
33
|
+
transitionInfo?: TransitionInfo;
|
|
34
|
+
};
|
|
23
35
|
export interface IVKVideoPlayerCallbacks {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
36
|
+
onInited?: () => void;
|
|
37
|
+
onDomReady?: () => void;
|
|
38
|
+
onStarted?: () => void;
|
|
39
|
+
onEnded?: () => void;
|
|
40
|
+
onPlay?: () => void;
|
|
41
|
+
onLooped?: () => void;
|
|
42
|
+
onPause?: () => void;
|
|
43
|
+
onVolumeChange?: (volume: number) => void;
|
|
44
|
+
onFullscreenEnter?: () => void;
|
|
45
|
+
onFullscreenExit?: () => void;
|
|
46
|
+
onMute?: () => void;
|
|
47
|
+
onUnmute?: (volume: number) => void;
|
|
48
|
+
onSubtitleOff?: () => void;
|
|
49
|
+
onSubtitleOn?: (lang: string, id: string) => void;
|
|
50
|
+
onAvailableSubtitlesChanged?: (subtitles: AvailableVideoSubtitle[]) => void;
|
|
51
|
+
onAvailableAudioStreamsChanged?: (audioStreams: AvailableAudioStream[]) => void;
|
|
52
|
+
onAudioStreamChanged?: (id: string) => void;
|
|
53
|
+
onAudioDisabledHint?: () => void;
|
|
54
|
+
onAudioDoesNotExistHint?: () => void;
|
|
55
|
+
onEpisodeClicked?: (byKeyboard: boolean) => void;
|
|
56
|
+
onEpisodeChanged?: (episode: IVideoEpisode) => void;
|
|
57
|
+
onTimeupdate?: (duration: number, position: number) => void;
|
|
58
|
+
onSeek?: (from: number, to: number, type: ThinOneStat.ActionSeekType | SeekAction) => void;
|
|
59
|
+
onCrashed?: (reason?: string) => void;
|
|
60
|
+
onRecoverableError?: (reason?: string) => void;
|
|
61
|
+
onCurrentFormatChanged?: (currentFormat: VideoFormat | undefined) => void;
|
|
62
|
+
onThroughputEstimationChanged?: (throughputEstimation: number | undefined) => void;
|
|
63
|
+
onVideoBitrateChanged?: (videoBitrate: number | undefined) => void;
|
|
64
|
+
onPlayerPhaseChanged?: (value?: PlayerPhase) => void;
|
|
65
|
+
onPlaybackStateChanged?: (value?: PlaybackState) => void;
|
|
66
|
+
onIsLiveChanged?: (value?: boolean) => void;
|
|
67
|
+
onIsActiveLiveChanged?: (value?: boolean) => void;
|
|
68
|
+
onIsAudioAvailableChanged?: (value?: boolean) => void;
|
|
69
|
+
onCopyVideoLink?: (withTimestamp: boolean, currentTimestamp: number) => string;
|
|
70
|
+
onOpenHotKeyMap?: (mapData: HotKeyMapData) => void;
|
|
71
|
+
onCurrentQualityChanged?: (currentQuality: VideoQuality | undefined) => void;
|
|
72
|
+
onAvailableQualitiesChanged?: (availableQualities: VideoQuality[]) => void;
|
|
73
|
+
onAudioLanguagesAvailable?: () => void;
|
|
74
|
+
onPiPEnter?: () => void;
|
|
75
|
+
onPiPExit?: () => void;
|
|
76
|
+
onLiveTime?: (liveTime: number | undefined) => void;
|
|
77
|
+
onLiveEnded?: () => void;
|
|
78
|
+
onReplayInteractiveVideo?: () => void;
|
|
79
|
+
onInteractiveChapterChanged?: (chapter: Chapter, video: ManifestVideo) => void;
|
|
80
|
+
onInteractiveHistoryChanged?: (chapterIds: string[]) => void;
|
|
81
|
+
onDisabledInteractiveClick?: () => void;
|
|
82
|
+
onDisabledPlayPrevChapterClick?: (message: string | undefined) => void;
|
|
83
|
+
onDisabledSeekToInteractiveClick?: (message: string | undefined) => void;
|
|
84
|
+
onDisabledTimelineClick?: (position: number) => void;
|
|
85
|
+
onInteractiveTimeIndicatorClick?: () => void;
|
|
86
|
+
onInteractiveTimeIndicatorHintDeactivated?: () => void;
|
|
87
|
+
onExternalFullscreenExit?: () => void;
|
|
88
|
+
onPrevVideoClick?: () => boolean;
|
|
89
|
+
onNextVideoClick?: () => boolean;
|
|
90
|
+
onNextVideoAnnouncementShow?: () => void;
|
|
91
|
+
onNextVideoAnnouncementClick?: () => void;
|
|
92
|
+
onNextVideoAnnouncementAuto?: () => void;
|
|
93
|
+
onNextVideoAnnouncementCancel?: () => void;
|
|
94
|
+
onSetAutoplayNextEnabled?: (state: boolean) => void;
|
|
95
|
+
onTrafficSavingEnabledChanged?: (isEnabled: boolean) => void;
|
|
96
|
+
onHighQualityEnabledChanged?: (isEnabled: boolean) => void;
|
|
97
|
+
onAutoQualityEnabledChanged?: (isEnabled: boolean) => void;
|
|
98
|
+
onCurrentPlaybackRateChanged?: (rate: number) => void;
|
|
99
|
+
onStalledChanged?: (isStalled: boolean) => void;
|
|
100
|
+
onLogoClicked?: () => void;
|
|
101
|
+
onCopyEmbedCodeClicked?: () => string;
|
|
102
|
+
onVSIDChanged?: (vsid?: string) => void;
|
|
103
|
+
onAutoplaySoundProhibited?: () => void;
|
|
104
|
+
onDevNullLog?: (entry: DevNullEntry) => void;
|
|
105
|
+
onTitleClicked?: () => void;
|
|
106
|
+
onRichSeekActiveChanged?: (active: boolean) => void;
|
|
107
|
+
uiInfo?: {
|
|
108
|
+
onUpcomingLiveViewStateChanged?: (value: IUpcomingLiveViewControlInfo) => void;
|
|
109
|
+
onControlsVisibleChanged?: (value?: boolean) => void;
|
|
110
|
+
onIsMobileChanged?: (value?: boolean) => void;
|
|
111
|
+
onPrevButtonChanged?: (value?: IControlInfo) => void;
|
|
112
|
+
onPrevButtonMouseEnter?: (value?: IControlInfo) => void;
|
|
113
|
+
onPrevButtonMouseLeave?: (value?: IControlInfo) => void;
|
|
114
|
+
onPlayButtonChanged?: (value?: IControlInfo) => void;
|
|
115
|
+
onReplayButtonChanged?: (value?: IControlInfo) => void;
|
|
116
|
+
onNextButtonChanged?: (value?: IControlInfo) => void;
|
|
117
|
+
onNextButtonMouseEnter?: (value?: IControlInfo) => void;
|
|
118
|
+
onNextButtonMouseLeave?: (value?: IControlInfo) => void;
|
|
119
|
+
onPlayPrevChapterChanged?: (value?: IControlInfo) => void;
|
|
120
|
+
onSeekToInteractiveButtonChanged?: (value?: IControlInfo) => void;
|
|
121
|
+
onGraphButtonChanged?: (value?: IControlInfo) => void;
|
|
122
|
+
onLiveButtonChanged?: (value?: IControlInfo) => void;
|
|
123
|
+
onTimeUpdateChanged?: (value?: IControlInfo) => void;
|
|
124
|
+
onEpisodesChanged?: (value?: IControlInfo) => void;
|
|
125
|
+
onVolumeChanged?: (value?: IControlInfo) => void;
|
|
126
|
+
onSubtitlesChanged?: (value?: IControlInfo) => void;
|
|
127
|
+
onSettingsChanged?: (value?: IControlInfo) => void;
|
|
128
|
+
onFullscreenChanged?: (value?: IControlInfo) => void;
|
|
129
|
+
onChromecastChanged?: (value?: IControlInfo) => void;
|
|
130
|
+
onPipChanged?: (value?: IControlInfo) => void;
|
|
131
|
+
onTheaterModeChanged?: (value?: IControlInfo) => void;
|
|
132
|
+
onVkLogoChanged?: (value?: IControlInfo) => void;
|
|
133
|
+
onTimelineChanged?: (value?: IControlInfo) => void;
|
|
134
|
+
onTimelineMouseEnter?: () => void;
|
|
135
|
+
onTimelineMouseLeave?: () => void;
|
|
136
|
+
onInteractiveTimeIndicatorChanged?: (value?: IControlInfo) => void;
|
|
137
|
+
onPlayerSizeChanged?: (value?: {
|
|
138
|
+
width: number;
|
|
139
|
+
height: number;
|
|
140
|
+
}) => void;
|
|
141
|
+
onReportProblem?: () => void;
|
|
142
|
+
onSettingsMenu?: (value: {
|
|
143
|
+
name?: string;
|
|
144
|
+
visible: boolean;
|
|
145
|
+
size: IRectangle;
|
|
146
|
+
position: Position;
|
|
147
|
+
}) => void;
|
|
148
|
+
onLoopedChanged?: (looped: boolean) => void;
|
|
149
|
+
onTopLeftControlBlockChanged?: (value?: IControlInfo) => void;
|
|
150
|
+
onTopRightControlBlockChanged?: (value?: IControlInfo) => void;
|
|
151
|
+
onMiddleControlBlockChanged?: (value?: IControlInfo) => void;
|
|
152
|
+
onBottomControlBlockChanged?: (value?: IControlInfo) => void;
|
|
153
|
+
onBottomLeftControlBlockChanged?: (value?: IControlInfo) => void;
|
|
154
|
+
onBottomRightControlBlockChanged?: (value?: IControlInfo) => void;
|
|
155
|
+
onTitleChanged?: (value?: IControlInfo) => void;
|
|
156
|
+
onControlWillChange?: (params: ControlWillChangeParams) => void;
|
|
157
|
+
onPreviewTimelineActiveChanged?: (active: boolean) => void;
|
|
158
|
+
};
|
|
159
|
+
adsInfo?: {
|
|
160
|
+
onLoadStarted?: () => void;
|
|
161
|
+
onLoadEnded?: () => void;
|
|
162
|
+
onLoadError?: () => void;
|
|
163
|
+
onInit?: () => void;
|
|
164
|
+
onReady?: () => void;
|
|
165
|
+
onStarted?: (adsSection: AdsSection) => void;
|
|
166
|
+
onPaused?: () => void;
|
|
167
|
+
onResumed?: () => void;
|
|
168
|
+
onTimeRemained?: (timeRemained: AdsTimeRemained) => void;
|
|
169
|
+
onCompleted?: (adsSection: AdsSection) => void;
|
|
170
|
+
onEmpty?: () => void;
|
|
171
|
+
onClicked?: (adsSection: AdsSection) => void;
|
|
172
|
+
onClosed?: (adsSection: AdsSection) => void;
|
|
173
|
+
onError?: (message: string) => void;
|
|
174
|
+
};
|
|
161
175
|
}
|
|
162
176
|
export interface IVKVideoPlayerUICallbacks {
|
|
163
|
-
|
|
177
|
+
onStarted?: (isMuted: boolean) => void;
|
|
164
178
|
}
|
|
165
179
|
export interface IVKVideoPlayerStatistics extends Partial<IUIStatistics> {
|
|
166
|
-
|
|
180
|
+
config: ISDKConfig["statistics"];
|
|
167
181
|
}
|
|
168
182
|
export interface IVideoEpisodesNormalizedTimeline {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
183
|
+
from: number;
|
|
184
|
+
width: number;
|
|
185
|
+
loadedWidth: number;
|
|
186
|
+
filledWidth: number;
|
|
187
|
+
interactive?: boolean;
|
|
188
|
+
completed?: boolean;
|
|
175
189
|
}
|
|
176
190
|
export interface IVideoEpisode {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
191
|
+
time: number;
|
|
192
|
+
text: string;
|
|
193
|
+
interactive?: boolean;
|
|
194
|
+
completed?: boolean;
|
|
181
195
|
}
|
|
182
196
|
export interface ITimelinePreviewThumbsData {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
}
|
|
192
|
-
export type VideoLiveStatus =
|
|
197
|
+
countPerImage: number;
|
|
198
|
+
countPerRow: number;
|
|
199
|
+
countTotal: number;
|
|
200
|
+
frameHeight: number;
|
|
201
|
+
frameWidth: number;
|
|
202
|
+
frequency: number;
|
|
203
|
+
isUV: boolean;
|
|
204
|
+
links: string[];
|
|
205
|
+
}
|
|
206
|
+
export type VideoLiveStatus = "no_video" | "deleted" | "waiting" | "started" | "finished" | "upcoming" | "failed" | "postlive";
|
|
193
207
|
export interface IVideoLive {
|
|
194
|
-
|
|
195
|
-
|
|
208
|
+
status: VideoLiveStatus;
|
|
209
|
+
startTime?: number;
|
|
196
210
|
}
|
|
197
211
|
export interface IVideoDataBase {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
title: string;
|
|
213
|
+
thumbUrl?: string;
|
|
214
|
+
unitedVideoId?: number;
|
|
215
|
+
/**
|
|
216
|
+
* duration используется только для инициализации адмана.
|
|
217
|
+
*/
|
|
218
|
+
duration?: AdmanInitParams["duration"];
|
|
219
|
+
adsParams?: AdmanInitParams["params"];
|
|
220
|
+
adsExternalApi?: AdmanInitParams["externalApi"];
|
|
221
|
+
adsJson?: AdmanInitParams["json"];
|
|
222
|
+
videoEpisodes?: IVideoEpisode[];
|
|
223
|
+
previewThumbsData?: ITimelinePreviewThumbsData;
|
|
224
|
+
isClip?: boolean;
|
|
225
|
+
subtitles?: Array<Omit<IExternalTextTrack, "type">>;
|
|
226
|
+
subtitlesForcedLanguage?: string;
|
|
227
|
+
sources?: ISources;
|
|
228
|
+
live?: IVideoLive;
|
|
215
229
|
}
|
|
216
230
|
export interface IVideoDataWithSources extends IVideoDataBase {
|
|
217
|
-
|
|
231
|
+
sources: ISources;
|
|
218
232
|
}
|
|
219
233
|
export interface IVideoDataWithLive extends IVideoDataBase {
|
|
220
|
-
|
|
234
|
+
live: IVideoLive;
|
|
221
235
|
}
|
|
222
236
|
export type IVideoData = IVideoDataWithSources | IVideoDataWithLive;
|
|
223
|
-
export interface IInteractiveData extends Pick<IInteractiveOptions,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
237
|
+
export interface IInteractiveData extends Pick<IInteractiveOptions, "initChapterId" | "historyApi" | "projectInfo"> {
|
|
238
|
+
manifest: string | Manifest;
|
|
239
|
+
visitedChapters?: string[];
|
|
240
|
+
videosInfo?: VideoInfo[];
|
|
241
|
+
videoLoader?: IInteractiveOptions["vkVideoLoader"];
|
|
242
|
+
tooltipHelpHintActive?: boolean;
|
|
229
243
|
}
|
|
230
244
|
/**
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
245
|
+
* @deprecated
|
|
246
|
+
*
|
|
247
|
+
* Старый механизм добавления кнопок, будет удален в будущих релизах
|
|
248
|
+
*/
|
|
235
249
|
export interface AdditionalButtonDeprecated {
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
250
|
+
iconUrl: string;
|
|
251
|
+
onClick?: (event?: MouseEvent) => void;
|
|
252
|
+
tooltip?: string;
|
|
253
|
+
ariaLabel?: string;
|
|
254
|
+
testId?: string;
|
|
255
|
+
hideOnDesktopGridTypes?: GridTypes[];
|
|
256
|
+
hideOnMobile?: boolean;
|
|
243
257
|
}
|
|
244
258
|
/**
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
export type VideoPlayerView =
|
|
259
|
+
* Определяет внешний вид плеера и его функциональность.
|
|
260
|
+
* preview - обрезанная функциональность плеера для показать трейлеров, например;
|
|
261
|
+
* full - полная функциональность плеера доступна.
|
|
262
|
+
*/
|
|
263
|
+
export type VideoPlayerView = "preview" | "full";
|
|
250
264
|
export interface IVKVideoPlayerConfig {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
265
|
+
videos: IVideoData[];
|
|
266
|
+
videoIndex?: number;
|
|
267
|
+
interactiveData?: IInteractiveData;
|
|
268
|
+
albumId?: string;
|
|
269
|
+
statPlace?: "embed" | "direct" | string;
|
|
270
|
+
statAuthToken?: string;
|
|
271
|
+
statUserSalt?: string;
|
|
272
|
+
statTrackCode?: string;
|
|
273
|
+
statVKAppId?: string;
|
|
274
|
+
refreshStatAuthToken?: () => Promise<string | undefined>;
|
|
275
|
+
preload?: boolean;
|
|
276
|
+
autoplay?: boolean;
|
|
277
|
+
repeat?: boolean;
|
|
278
|
+
loop?: boolean;
|
|
279
|
+
volume?: number;
|
|
280
|
+
muted?: boolean;
|
|
281
|
+
fromTime?: number;
|
|
282
|
+
canRewindLive?: boolean;
|
|
283
|
+
supportLink?: string;
|
|
284
|
+
showAds?: boolean;
|
|
285
|
+
adsSlotId?: number;
|
|
286
|
+
adsParams?: AdmanInitParams["params"];
|
|
287
|
+
/** @deprecated */
|
|
288
|
+
adsPreviewParam?: number;
|
|
289
|
+
adsAutoplayParam?: boolean;
|
|
290
|
+
interfaceLanguage?: InterfaceLanguage | string;
|
|
291
|
+
isCyrillicRelatedInterface?: boolean;
|
|
292
|
+
logoClickable?: boolean;
|
|
293
|
+
logoHidden?: boolean;
|
|
294
|
+
/** @deprecated */
|
|
295
|
+
isMobile?: boolean;
|
|
296
|
+
isTouch?: boolean;
|
|
297
|
+
/** @deprecated */
|
|
298
|
+
isMediaSessionEnabled?: boolean;
|
|
299
|
+
/** @deprecated */
|
|
300
|
+
isPictureInPictureEnabled?: boolean;
|
|
301
|
+
isAudioDisabled?: boolean;
|
|
302
|
+
isLiveCatchUpMode?: boolean;
|
|
303
|
+
canDownload?: boolean;
|
|
304
|
+
fullScreenTarget?: HTMLElement;
|
|
305
|
+
failoverHosts?: string[];
|
|
306
|
+
showThumbTimer?: boolean;
|
|
307
|
+
is3DVideo?: boolean;
|
|
308
|
+
callbacks?: IVKVideoPlayerCallbacks;
|
|
309
|
+
additionalButtons?: (AdditionalButtonDeprecated | AdditionalDesktopControlPanelButton)[];
|
|
310
|
+
additionalSettingsMenuItems?: AdditionalSettingsMenuItem[];
|
|
311
|
+
additionalContextMenuItems?: AdditionalContextMenuItem[];
|
|
312
|
+
refDomain?: string;
|
|
313
|
+
volumeMultiplier?: number;
|
|
314
|
+
saveRate?: boolean;
|
|
315
|
+
deviceId?: string;
|
|
316
|
+
playerId?: string;
|
|
317
|
+
showEndScreen?: boolean;
|
|
318
|
+
showAutoplayNext?: boolean;
|
|
319
|
+
showNextPrevButtons?: boolean;
|
|
320
|
+
pipEnabled?: boolean;
|
|
321
|
+
playerView?: VideoPlayerView;
|
|
322
|
+
mediascopePixels?: MediascopePixelTypes.Pixel[];
|
|
323
|
+
getVideoDeeplink?: (timestamp: number) => string;
|
|
310
324
|
}
|
|
311
325
|
export interface IControlInfo {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
326
|
+
left: number;
|
|
327
|
+
right: number;
|
|
328
|
+
top: number;
|
|
329
|
+
bottom: number;
|
|
330
|
+
isDisplayed: boolean;
|
|
317
331
|
}
|
|
318
332
|
/**
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
333
|
+
* Информация о upcoming live view.
|
|
334
|
+
* `default` — это view, когда показывается таймер обратного отсчёта до начала трансляции.
|
|
335
|
+
* `expired` — это view, когда таймер истёк, но трансляцию так и не начали (ожидаем поток).
|
|
336
|
+
*/
|
|
323
337
|
export interface IUpcomingLiveViewControlInfo extends IControlInfo {
|
|
324
|
-
|
|
325
|
-
|
|
338
|
+
type: "default" | "expired";
|
|
339
|
+
size: "s" | "m" | "l";
|
|
326
340
|
}
|
|
327
341
|
export interface IPlayerControlsRef {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
342
|
+
prevButton?: HTMLButtonElement;
|
|
343
|
+
playButton?: HTMLButtonElement;
|
|
344
|
+
replayButton?: HTMLElement | HTMLButtonElement;
|
|
345
|
+
nextButton?: HTMLButtonElement;
|
|
346
|
+
playPrevChapterButton?: HTMLButtonElement;
|
|
347
|
+
seekToInteractiveButton?: HTMLButtonElement;
|
|
348
|
+
interactiveGraphButton?: HTMLButtonElement;
|
|
349
|
+
liveButton?: HTMLElement;
|
|
350
|
+
time?: HTMLElement;
|
|
351
|
+
episodes?: HTMLElement;
|
|
352
|
+
volume?: HTMLButtonElement;
|
|
353
|
+
subtitles?: HTMLButtonElement;
|
|
354
|
+
settings?: HTMLElement;
|
|
355
|
+
context?: HTMLButtonElement;
|
|
356
|
+
fullscreen?: HTMLElement;
|
|
357
|
+
chromecast?: HTMLButtonElement;
|
|
358
|
+
pip?: HTMLButtonElement;
|
|
359
|
+
"theater-mode-button"?: HTMLButtonElement;
|
|
360
|
+
vkLogo?: HTMLButtonElement;
|
|
361
|
+
interactiveTimeIndicator?: HTMLElement;
|
|
362
|
+
timeline?: HTMLElement;
|
|
363
|
+
autoplayNextToggle?: HTMLButtonElement;
|
|
350
364
|
}
|
|
351
365
|
export interface IPlayerDesktopControlsWidth {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
366
|
+
prevButton: number;
|
|
367
|
+
playButton: number;
|
|
368
|
+
replayButton: number;
|
|
369
|
+
nextButton: number;
|
|
370
|
+
playPrevChapterButton: number;
|
|
371
|
+
seekToInteractiveButton: number;
|
|
372
|
+
interactiveGraphButton: number;
|
|
373
|
+
liveButton: number;
|
|
374
|
+
time: number;
|
|
375
|
+
episodes: number;
|
|
376
|
+
volume: number;
|
|
377
|
+
subtitles: number;
|
|
378
|
+
settings: number;
|
|
379
|
+
context: number;
|
|
380
|
+
fullscreen: number;
|
|
381
|
+
chromecast: number;
|
|
382
|
+
vkLogo: number;
|
|
383
|
+
additionalButtons: number[];
|
|
370
384
|
}
|
|
371
385
|
export type ControlBlocksRefs = {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
386
|
+
/**
|
|
387
|
+
* Контейнер для контролов, которые отображаются в левом верхнем углу.
|
|
388
|
+
*/
|
|
389
|
+
topLeft?: HTMLElement | undefined;
|
|
390
|
+
/**
|
|
391
|
+
* Контейнер для контролов, которые отображаются в левом верхнем углу.
|
|
392
|
+
*/
|
|
393
|
+
topRight?: HTMLElement | undefined;
|
|
394
|
+
/**
|
|
395
|
+
* Контейнер для контролов, который появляется снизу.
|
|
396
|
+
*/
|
|
397
|
+
bottom?: HTMLElement | undefined;
|
|
398
|
+
/**
|
|
399
|
+
* Контейнер для контролов, который появляется в середине плеера.
|
|
400
|
+
*/
|
|
401
|
+
middle?: HTMLElement | undefined;
|
|
402
|
+
bottomLeft?: HTMLElement | undefined;
|
|
403
|
+
bottomRight?: HTMLElement | undefined;
|
|
390
404
|
};
|
|
391
405
|
export declare const enum PlayerPhase {
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
406
|
+
Thumb = "thumb",
|
|
407
|
+
Video = "video",
|
|
408
|
+
Ads = "ads",
|
|
409
|
+
Crashed = "crashed",
|
|
410
|
+
LiveWaitingStart = "LiveWaitingStart",
|
|
411
|
+
LiveWaitingRecover = "LiveWaitingRecover",
|
|
412
|
+
LiveWaitingRecord = "LiveWaitingRecord"
|
|
399
413
|
}
|
|
400
414
|
export declare const enum AdsSection {
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
415
|
+
Preroll = "preroll",
|
|
416
|
+
Midroll = "midroll",
|
|
417
|
+
Postroll = "postroll"
|
|
404
418
|
}
|
|
405
419
|
export declare const enum AdsPlaybackState {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
420
|
+
INACTIVE = "inactive",
|
|
421
|
+
PLAYING = "playing",
|
|
422
|
+
PAUSED = "paused"
|
|
409
423
|
}
|
|
410
424
|
export type AdsTimeRemained = {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
425
|
+
currentTime: number;
|
|
426
|
+
duration: number;
|
|
427
|
+
percent: number;
|
|
428
|
+
remained: number;
|
|
415
429
|
};
|
|
416
430
|
export type VideoQualityForRender = {
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
431
|
+
value: VideoQualityUI;
|
|
432
|
+
displayValue: string;
|
|
433
|
+
selected: boolean;
|
|
420
434
|
};
|
|
421
435
|
export type VideoPlaybackRate = {
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
436
|
+
value: number;
|
|
437
|
+
displayValue: string;
|
|
438
|
+
selected: boolean;
|
|
425
439
|
};
|
|
426
440
|
export type MediaSessionApiMetadata = {
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
441
|
+
title: string;
|
|
442
|
+
artist?: string;
|
|
443
|
+
thumbUrl?: string;
|
|
430
444
|
};
|
|
431
445
|
export type MediaSessionApiActionHandler = [MediaSessionAction, MediaSessionActionHandler | null];
|
|
432
446
|
export interface PictureInPictureResizeEvent extends Event {
|
|
433
|
-
|
|
447
|
+
target: PictureInPictureWindow;
|
|
434
448
|
}
|
|
435
449
|
export interface DocumentPictureInPictureRequestWindow {
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
450
|
+
width?: number;
|
|
451
|
+
height?: number;
|
|
452
|
+
initialAspectRatio?: number;
|
|
453
|
+
copyStyleSheets: boolean;
|
|
440
454
|
}
|
|
441
455
|
export interface DocumentPictureInPicture {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
456
|
+
onenter?: (event: Event) => void;
|
|
457
|
+
window: Window;
|
|
458
|
+
requestWindow: (params: DocumentPictureInPictureRequestWindow) => Promise<Window>;
|
|
445
459
|
}
|
|
446
460
|
export declare enum PictureInPictureType {
|
|
447
|
-
|
|
448
|
-
|
|
461
|
+
PictureInPicture = 0,
|
|
462
|
+
DocumentPictureInPicture = 1
|
|
449
463
|
}
|
|
450
464
|
export interface IPictureInPictureApiInfo {
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
465
|
+
isActive$: IValueObservable<boolean>;
|
|
466
|
+
isEnabled$: IValueObservable<boolean>;
|
|
467
|
+
type: PictureInPictureType;
|
|
454
468
|
}
|
|
455
469
|
export interface PictureInPictureSettings extends IDpipConfig {
|
|
456
|
-
|
|
470
|
+
enabled: boolean;
|
|
457
471
|
}
|
|
458
472
|
export interface Size {
|
|
459
|
-
|
|
460
|
-
|
|
473
|
+
width: number;
|
|
474
|
+
height: number;
|
|
461
475
|
}
|
|
462
476
|
export interface ExternalPictureInPictureEventHandlers {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
477
|
+
enterpictureinpicture?: VoidFunction;
|
|
478
|
+
leavepictureinpicture?: VoidFunction;
|
|
479
|
+
resize?: (size: Size) => void;
|
|
466
480
|
}
|
|
467
481
|
export interface IPictureInPictureApi {
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
482
|
+
isSupported(): boolean;
|
|
483
|
+
isActive(): boolean;
|
|
484
|
+
setContext(svelteContext: Map<unknown, unknown>): void;
|
|
485
|
+
request(): Promise<void>;
|
|
486
|
+
exit(): Promise<void>;
|
|
487
|
+
info: IPictureInPictureApiInfo;
|
|
488
|
+
setEnabled(enabled: boolean): void;
|
|
489
|
+
dispose(): Promise<void>;
|
|
490
|
+
assignPlayerContainer(playerContainer: HTMLElement): void;
|
|
491
|
+
updateVideoElement(): void;
|
|
492
|
+
setExternalEventHandlers(externalEventHandlers: ExternalPictureInPictureEventHandlers): void;
|
|
479
493
|
}
|
|
480
494
|
export interface IAnnotationsApi {
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
495
|
+
/** @deprecated Больше не используется. Контейнер теперь определяется самостоятельно */
|
|
496
|
+
registryRootContainer: (container: HTMLElement) => void;
|
|
497
|
+
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
498
|
+
addLayer: (layerName: string) => HTMLElement | never;
|
|
499
|
+
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
500
|
+
getLayer: (layerName: string) => HTMLElement | undefined;
|
|
501
|
+
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
502
|
+
removeLayer: (layerName: string) => void;
|
|
503
|
+
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
504
|
+
clearLayer: (layerName: string) => void;
|
|
505
|
+
/** @deprecated Метод больше не является публичным */
|
|
506
|
+
detach: () => void;
|
|
507
|
+
/** @deprecated Больше нет необходимости переназначать контейнер для аннотаций в ходе работы плеера */
|
|
508
|
+
reattach: () => void;
|
|
509
|
+
/** @private */
|
|
510
|
+
init: (container: HTMLElement) => void;
|
|
511
|
+
add: (annotationName: string, annotation: HTMLElement) => void | never;
|
|
512
|
+
get: (annotationName: string) => HTMLElement | never;
|
|
513
|
+
remove: (annotationName: string) => void | never;
|
|
514
|
+
clear: () => void;
|
|
515
|
+
destroy: () => void;
|
|
502
516
|
}
|
|
503
517
|
export type AvailableVideoSubtitle = {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
518
|
+
id: string;
|
|
519
|
+
language: string;
|
|
520
|
+
title: string;
|
|
507
521
|
};
|
|
508
|
-
export type AvailableAudioStream = Required<Pick<IAudioStream,
|
|
522
|
+
export type AvailableAudioStream = Required<Pick<IAudioStream, "id" | "language" | "label">>;
|
|
509
523
|
export type VideoSubtitle = {
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
524
|
+
value: string;
|
|
525
|
+
displayValue: string;
|
|
526
|
+
selected: boolean;
|
|
527
|
+
isAuto?: boolean;
|
|
528
|
+
language: string;
|
|
515
529
|
};
|
|
516
530
|
export type VideoSubtitleParsed = {
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
531
|
+
startTime: number;
|
|
532
|
+
endTime: number;
|
|
533
|
+
lang: string;
|
|
534
|
+
texts: ({
|
|
535
|
+
type: "text";
|
|
536
|
+
value: string;
|
|
537
|
+
} | {
|
|
538
|
+
type: "timestamp";
|
|
539
|
+
value: number;
|
|
540
|
+
})[];
|
|
527
541
|
};
|
|
528
542
|
export type VideoSubtitlesParsed = {
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
543
|
+
id: string;
|
|
544
|
+
lang: string;
|
|
545
|
+
isAuto: boolean;
|
|
546
|
+
subtitles: VideoSubtitleParsed[];
|
|
533
547
|
}[];
|
|
534
548
|
export type ControlsEnumType = keyof typeof Controls;
|
|
535
549
|
export type ControlsKeys = ControlsEnumType[];
|
|
536
550
|
export interface IPlayerPhase extends Readable<PlayerPhase> {
|
|
537
|
-
|
|
551
|
+
is: (playerPhase: PlayerPhase) => boolean;
|
|
538
552
|
}
|
|
539
553
|
export interface IDisabledControls extends Writable<Set<ControlsEnumType>> {
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
554
|
+
add: (addData: ControlsEnumType | ControlsKeys) => void;
|
|
555
|
+
remove: (removeData: ControlsEnumType | ControlsKeys) => void;
|
|
556
|
+
includes: (includeData: ControlsEnumType | ControlsKeys) => boolean;
|
|
543
557
|
}
|
|
544
558
|
export interface HotKeyMapItem {
|
|
545
|
-
|
|
546
|
-
|
|
559
|
+
description: string;
|
|
560
|
+
value: string;
|
|
547
561
|
}
|
|
548
562
|
export interface HotKeyMapGroup {
|
|
549
|
-
|
|
550
|
-
|
|
563
|
+
title: string;
|
|
564
|
+
items: HotKeyMapItem[];
|
|
551
565
|
}
|
|
552
566
|
export interface HotKeyMapData {
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
567
|
+
title: string;
|
|
568
|
+
groups: HotKeyMapGroup[];
|
|
569
|
+
closeBtnText: string;
|
|
556
570
|
}
|
|
557
571
|
export declare enum HotKeyHelperType {
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
572
|
+
PLAY = "PLAY",
|
|
573
|
+
PAUSE = "PAUSE",
|
|
574
|
+
REPLAY = "REPLAY",
|
|
575
|
+
BACKWARD_SEEK = "BACKWARD_SEEK",
|
|
576
|
+
FORWARD_SEEK = "FORWARD_SEEK",
|
|
577
|
+
SUBTITLES_ON = "SUBTITLES_ON",
|
|
578
|
+
SUBTITLES_OFF = "SUBTITLES_OFF",
|
|
579
|
+
RATE_UP = "RATE_UP",
|
|
580
|
+
RATE_DOWN = "RATE_DOWN",
|
|
581
|
+
EPISODE_PREV = "EPISODE_PREV",
|
|
582
|
+
EPISODE_NEXT = "EPISODE_NEXT",
|
|
583
|
+
MUTE = "MUTE",
|
|
584
|
+
VOLUME = "VOLUME"
|
|
571
585
|
}
|
|
572
586
|
export interface HotKeyHelperData {
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
587
|
+
type: HotKeyHelperType;
|
|
588
|
+
text?: string;
|
|
589
|
+
t?: {
|
|
590
|
+
key: Key;
|
|
591
|
+
value?: string;
|
|
592
|
+
};
|
|
579
593
|
}
|
|
580
594
|
export declare enum EpisodesModes {
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
595
|
+
FULL = "FULL",
|
|
596
|
+
COUNT = "COUNT",
|
|
597
|
+
SHORT = "SHORT"
|
|
584
598
|
}
|
|
585
599
|
export type IToggleable<T> = T & {
|
|
586
|
-
|
|
600
|
+
toggle: () => void;
|
|
587
601
|
};
|
|
588
602
|
type MicroStoreWritableBase<T = unknown> = Writable<T>;
|
|
589
603
|
type ToggleableMicroStore = IToggleable<MicroStoreWritableBase<boolean | null>>;
|
|
590
604
|
export type PictureInPictureMicroStore = {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
605
|
+
isActive$: Writable<boolean>;
|
|
606
|
+
isEnabled$: Writable<boolean>;
|
|
607
|
+
type$: Writable<PictureInPictureType | undefined>;
|
|
594
608
|
};
|
|
595
609
|
export type NotificationsMicroStore = {
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
610
|
+
notificationsToShow$: Writable<Partial<Record<NotificationId, boolean>>>;
|
|
611
|
+
showNotification: (id: NotificationId) => void;
|
|
612
|
+
closeNotification: (id: NotificationId) => void;
|
|
613
|
+
};
|
|
614
|
+
export type PreviewPlayerMicroStore = {
|
|
615
|
+
timelineActive$: Writable<boolean>;
|
|
599
616
|
};
|
|
600
617
|
export interface IMicroStores {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
618
|
+
fakeIsPlaying$: ToggleableMicroStore;
|
|
619
|
+
interactiveControlsOpacity$: ToggleableMicroStore;
|
|
620
|
+
seekToInteractiveDisabledTooltip$: MicroStoreWritableBase<SeekToInteractiveDisabledTooltipKey>;
|
|
621
|
+
showInteractiveTimeIndicatorTooltip$: MicroStoreWritableBase<boolean> & {
|
|
622
|
+
set: (newValue: boolean, useTimeout: boolean) => void;
|
|
623
|
+
clearTimeout: () => void;
|
|
624
|
+
};
|
|
625
|
+
graphIsOpened$: ToggleableMicroStore;
|
|
626
|
+
pictureInPicture$: PictureInPictureMicroStore;
|
|
627
|
+
notifications$: NotificationsMicroStore;
|
|
628
|
+
previewPlayer$: PreviewPlayerMicroStore;
|
|
611
629
|
}
|
|
612
630
|
export interface InitMicroStoreParams {
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
631
|
+
store: IStore;
|
|
632
|
+
microStores: IMicroStores;
|
|
633
|
+
config: IVKVideoPlayerConfig;
|
|
634
|
+
uiConfig: IUIConfig;
|
|
635
|
+
interactiveController?: Interactives;
|
|
618
636
|
}
|
|
619
637
|
export interface IMicroStore<StateName extends keyof IMicroStores = keyof IMicroStores> {
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
638
|
+
readonly stateName: StateName;
|
|
639
|
+
state$: IMicroStores[StateName];
|
|
640
|
+
subscription: Subscription;
|
|
641
|
+
init: (initStoreParams: InitMicroStoreParams) => Subscription;
|
|
624
642
|
}
|
|
625
643
|
export type IMicroStoresRoot = {
|
|
626
|
-
|
|
627
|
-
|
|
644
|
+
subscribers: IMicroStore[];
|
|
645
|
+
stores: IMicroStores;
|
|
628
646
|
};
|
|
629
647
|
export type Position = {
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
648
|
+
top?: number;
|
|
649
|
+
left?: number;
|
|
650
|
+
bottom?: number;
|
|
651
|
+
right?: number;
|
|
634
652
|
};
|
|
635
653
|
export interface Caption {
|
|
636
|
-
|
|
637
|
-
|
|
654
|
+
timeAppeared?: number | null;
|
|
655
|
+
value: string;
|
|
638
656
|
}
|
|
639
|
-
export type NotificationId =
|
|
657
|
+
export type NotificationId = "slow_video";
|
|
640
658
|
export declare enum PlaybackStateExtended {
|
|
641
|
-
|
|
659
|
+
BUFFERING = "buffering"
|
|
642
660
|
}
|
|
643
661
|
export type PlaybackStateRealistic = PlaybackState | PlaybackStateExtended;
|
|
644
662
|
export {};
|