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