@vkontakte/videoplayer 1.1.37-dev.aaebf6d2.0 → 1.1.38-beta.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 +17 -17
- package/es2015.esm.js +17 -17
- package/es2018.cjs.js +17 -17
- package/es2018.esm.js +17 -17
- package/esnext.cjs.js +17 -17
- package/esnext.esm.js +17 -17
- package/evergreen.esm.js +17 -17
- package/package.json +11 -11
- package/types/VKVideoPlayer/index.d.ts +86 -0
- package/types/components/Ads/admanWrapper.d.ts +82 -0
- package/types/components/Ads/utils.d.ts +1 -0
- package/types/config.d.ts +118 -0
- package/types/constans/controls.d.ts +27 -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 +51 -0
- package/types/constans/lang.d.ts +2 -0
- package/types/constans/storage-keys.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 +12 -0
- package/types/services/sentry.d.ts +28 -0
- package/types/services/statistics.d.ts +13 -0
- package/types/store/index.d.ts +277 -0
- package/types/store/micro/base.d.ts +8 -0
- package/types/store/micro/fakeIsPlaying.d.ts +13 -0
- package/types/store/micro/index.d.ts +2 -0
- package/types/store/micro/interactiveControlsOpacity.d.ts +13 -0
- package/types/store/micro/seekToInteractiveDisabledTooltip.d.ts +9 -0
- package/types/store/micro/showInteractiveTimeIndicatorTooltip.d.ts +15 -0
- package/types/store/utils.d.ts +30 -0
- package/types/translation/index.d.ts +6 -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/index.d.ts +467 -0
- package/types/utils/WebVttParser.d.ts +19 -0
- package/types/utils/changeVolume.d.ts +6 -0
- package/types/utils/clipboard.d.ts +1 -0
- package/types/utils/dom.d.ts +2 -0
- package/types/utils/fetchFile.d.ts +1 -0
- package/types/utils/findCurrentSubtltlePhrase.d.ts +2 -0
- package/types/utils/formatSeconds.d.ts +1 -0
- package/types/utils/fullscreen.d.ts +24 -0
- package/types/utils/getActualEpisode.d.ts +10 -0
- package/types/utils/getHotKeyMapData.d.ts +2 -0
- package/types/utils/getQualityLabel.d.ts +2 -0
- package/types/utils/grid.d.ts +6 -0
- package/types/utils/isIphoneOrOldIpad.d.ts +2 -0
- package/types/utils/keyboardHandleCases.d.ts +2 -0
- package/types/utils/menuNavigation.d.ts +13 -0
- package/types/utils/roundFps.d.ts +1 -0
- package/types/utils/sanitizeHtml.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 +1 -0
- package/types/utils/updatePlayerControlsInfo.d.ts +3 -0
- package/types/utils/userSettings.d.ts +13 -0
- package/types/utils/videoConfig.d.ts +2 -0
- package/types/utils/volumeChange.d.ts +5 -0
- package/types/utils/webAPI/annotationsApi/annotationsApi.d.ts +29 -0
- package/types/utils/webAPI/annotationsApi/errors.d.ts +7 -0
- package/types/utils/webAPI/language.d.ts +2 -0
- package/types/utils/webAPI/mediaSessionApi.d.ts +8 -0
- package/types/utils/webAPI/pictureInPictureApi/documentPictureInPictureApi.d.ts +23 -0
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApi.d.ts +38 -0
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApiFactory.d.ts +4 -0
- package/index.d.ts +0 -477
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import type { IConfig, IExternalTextTrack, IOptionalTuningConfig, IPlayer, ISources, PlaybackRate } from '@vkontakte/videoplayer-core';
|
|
2
|
+
import { ChromecastState, PlaybackState, VideoFormat } from '@vkontakte/videoplayer-core';
|
|
3
|
+
import { type ICurrentBrowserInfo, type IError, type ILogger, type IRectangle, type IValueObservable, type QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
4
|
+
import { InterfaceLanguage, VideoQuality } from '@vkontakte/videoplayer-shared';
|
|
5
|
+
import type { IUIConfig } from '../config';
|
|
6
|
+
import { SeekAction } from '@vkontakte/videoplayer-statistics';
|
|
7
|
+
import { type InteractiveRange } from '@vkontakte/videoplayer-interactive';
|
|
8
|
+
import type { Readable, Writable } from 'svelte/store';
|
|
9
|
+
import { AdmanWrapper } from '../components/Ads/admanWrapper';
|
|
10
|
+
import type { LanguageConfig } from '../translation/types';
|
|
11
|
+
import type { AdditionalButton, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, Position, VideoPlaybackRate, VideoQualityForRender, VideoQualityUI, VideoSubtitle, VideoSubtitleParsed } from '../types';
|
|
12
|
+
import { AdsPlaybackState, PictureInPictureType } from '../types';
|
|
13
|
+
import type { DebugData } from './utils';
|
|
14
|
+
import { type PlayPrevChapterDisabledTooltipKey } from '../constans';
|
|
15
|
+
import { GridTypes } from '../constans';
|
|
16
|
+
import { UIOneStat } from '../services/statistics';
|
|
17
|
+
export interface IAdsState {
|
|
18
|
+
position: Writable<number>;
|
|
19
|
+
duration: Writable<number>;
|
|
20
|
+
playbackState: Writable<AdsPlaybackState>;
|
|
21
|
+
canSkip: Writable<boolean>;
|
|
22
|
+
secondsToWatchBeforeSkip: Writable<number>;
|
|
23
|
+
postrollPassed: Writable<boolean>;
|
|
24
|
+
}
|
|
25
|
+
export interface IUIState {
|
|
26
|
+
controlsVisible: Writable<boolean>;
|
|
27
|
+
touched: Writable<boolean>;
|
|
28
|
+
controls: {
|
|
29
|
+
prevButton: Writable<IControlInfo | undefined>;
|
|
30
|
+
playButton: Writable<IControlInfo | undefined>;
|
|
31
|
+
replayButton: Writable<IControlInfo | undefined>;
|
|
32
|
+
nextButton: Writable<IControlInfo | undefined>;
|
|
33
|
+
playPrevChapterButton: Writable<IControlInfo | undefined>;
|
|
34
|
+
seekToInteractiveButton: Writable<IControlInfo | undefined>;
|
|
35
|
+
interactiveGraphButton: Writable<IControlInfo | undefined>;
|
|
36
|
+
liveButton: Writable<IControlInfo | undefined>;
|
|
37
|
+
time: Writable<IControlInfo | undefined>;
|
|
38
|
+
episodes: Writable<IControlInfo | undefined>;
|
|
39
|
+
volume: Writable<IControlInfo | undefined>;
|
|
40
|
+
subtitles: Writable<IControlInfo | undefined>;
|
|
41
|
+
settings: Writable<IControlInfo | undefined>;
|
|
42
|
+
context: Writable<IControlInfo | undefined>;
|
|
43
|
+
fullscreen: Writable<IControlInfo | undefined>;
|
|
44
|
+
chromecast: Writable<IControlInfo | undefined>;
|
|
45
|
+
pip: Writable<IControlInfo | undefined>;
|
|
46
|
+
vkLogo: Writable<IControlInfo | undefined>;
|
|
47
|
+
interactiveTimeIndicator: Writable<IControlInfo | undefined>;
|
|
48
|
+
disabledControls$: IDisabledControls;
|
|
49
|
+
additionalButtons: Writable<IControlInfo | undefined>[];
|
|
50
|
+
};
|
|
51
|
+
modals: {
|
|
52
|
+
hotKeyMap: {
|
|
53
|
+
show: Writable<boolean>;
|
|
54
|
+
data: Writable<HotKeyMapData>;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
isFullscreen: Writable<boolean>;
|
|
58
|
+
rotateAlpha: Writable<number>;
|
|
59
|
+
isAutoplay: Writable<boolean>;
|
|
60
|
+
debugPanelVisible: Writable<boolean>;
|
|
61
|
+
episodes: {
|
|
62
|
+
panelOpened$: Writable<boolean>;
|
|
63
|
+
openedByKeyboard$: Writable<boolean>;
|
|
64
|
+
};
|
|
65
|
+
contextMenu: {
|
|
66
|
+
visible$: Writable<boolean>;
|
|
67
|
+
btnRef$: Writable<HTMLButtonElement | undefined>;
|
|
68
|
+
openedByBtnKeyboard$: Writable<boolean>;
|
|
69
|
+
openedByHotKey$: Writable<boolean>;
|
|
70
|
+
lastActiveElem$: Writable<HTMLButtonElement | undefined>;
|
|
71
|
+
showContextMenuBtn$: Writable<boolean>;
|
|
72
|
+
position$: Writable<Position>;
|
|
73
|
+
};
|
|
74
|
+
playerSize: Writable<{
|
|
75
|
+
width: number;
|
|
76
|
+
height: number;
|
|
77
|
+
}>;
|
|
78
|
+
isMobile: Writable<boolean>;
|
|
79
|
+
mobileNotReportControlHidden$: Readable<boolean>;
|
|
80
|
+
mobileUnmuteButtonExpanded: Writable<boolean>;
|
|
81
|
+
mobileUnmuteButtonVisible: Writable<boolean>;
|
|
82
|
+
icon3DVideoVisible: Writable<boolean>;
|
|
83
|
+
settingsMenuVisible: Writable<boolean>;
|
|
84
|
+
settingsMenuOpenedByKeyboard: Writable<boolean>;
|
|
85
|
+
scrubbingInProgress: Writable<boolean>;
|
|
86
|
+
is3DVideo: Writable<boolean>;
|
|
87
|
+
isPictureInPictureActive$: Readable<boolean>;
|
|
88
|
+
pictureInPictureType$: Readable<PictureInPictureType>;
|
|
89
|
+
clientInfo$: Readable<ICurrentBrowserInfo>;
|
|
90
|
+
currentGridType$: Readable<GridTypes>;
|
|
91
|
+
interactiveHideMobileControls: Writable<boolean>;
|
|
92
|
+
additionalButtons$: Readable<AdditionalButton[]>;
|
|
93
|
+
overlayContainer$: Writable<HTMLDivElement | undefined>;
|
|
94
|
+
startedByKeyboard$: Writable<boolean>;
|
|
95
|
+
}
|
|
96
|
+
export interface IWebApi {
|
|
97
|
+
pictureInPictureApi?: IPictureInPictureApi;
|
|
98
|
+
annotationsApi?: IAnnotationsApi;
|
|
99
|
+
}
|
|
100
|
+
export interface IStore {
|
|
101
|
+
initVideo: (config: IConfig & {
|
|
102
|
+
subtitles?: Omit<IExternalTextTrack, 'type'>[];
|
|
103
|
+
}) => void;
|
|
104
|
+
videoId?: number;
|
|
105
|
+
isClip: boolean;
|
|
106
|
+
playerPhase: IPlayerPhase;
|
|
107
|
+
interfaceLanguage$: Readable<InterfaceLanguage | string>;
|
|
108
|
+
interactiveData?: IInteractiveData;
|
|
109
|
+
vsid: Readable<string | undefined>;
|
|
110
|
+
state: {
|
|
111
|
+
positionExact$: Readable<number>;
|
|
112
|
+
positionWithScrubbing$: Readable<number>;
|
|
113
|
+
duration$: Readable<number>;
|
|
114
|
+
playbackState$: Readable<PlaybackState>;
|
|
115
|
+
isPlaying$: Readable<boolean>;
|
|
116
|
+
isLoaderVisible: Readable<boolean>;
|
|
117
|
+
bufferedProgress$: Readable<number>;
|
|
118
|
+
isLive$: Readable<boolean | undefined>;
|
|
119
|
+
canChangePlaybackSpeed$: Readable<boolean | undefined>;
|
|
120
|
+
isActiveLive$: Readable<boolean | undefined>;
|
|
121
|
+
isOldestAvailableLive$: Readable<boolean | undefined>;
|
|
122
|
+
isRewindableLive$: Readable<boolean>;
|
|
123
|
+
isEnded$: Readable<boolean>;
|
|
124
|
+
volume$: Readable<number>;
|
|
125
|
+
muted$: Readable<boolean>;
|
|
126
|
+
trafficSavingEnabled$: Readable<boolean>;
|
|
127
|
+
currentQuality$: Readable<VideoQuality | undefined>;
|
|
128
|
+
autoQualityLimitingAvailable$: Readable<boolean>;
|
|
129
|
+
isAutoQualityEnabled$: Readable<boolean | undefined>;
|
|
130
|
+
availableQualities$: Readable<VideoQualityForRender[]>;
|
|
131
|
+
currentPlaybackRate$: Readable<number>;
|
|
132
|
+
availablePlaybackRates$: Readable<VideoPlaybackRate[]>;
|
|
133
|
+
currentSubtitle$: Writable<Omit<VideoSubtitle, 'selected'>>;
|
|
134
|
+
availableSubtitlesList$: Readable<VideoSubtitle[]>;
|
|
135
|
+
currentSubtitleCaptions$: Readable<VideoSubtitleParsed['texts']>;
|
|
136
|
+
isAutoSubtitleCaptionVisible$: Writable<boolean>;
|
|
137
|
+
chromecastState$: Readable<ChromecastState>;
|
|
138
|
+
chromecastDeviceName$: Readable<string | undefined>;
|
|
139
|
+
chromecastConnected$: Readable<boolean>;
|
|
140
|
+
currentFormat$: Readable<VideoFormat | undefined>;
|
|
141
|
+
throughputEstimation$: Readable<number | undefined>;
|
|
142
|
+
videoBitrate$: Readable<number | undefined>;
|
|
143
|
+
videoSize$: Readable<IRectangle | undefined>;
|
|
144
|
+
errorLog$: Readable<IError[]>;
|
|
145
|
+
crashed$: Readable<boolean>;
|
|
146
|
+
isAudioAvailable$: Readable<boolean>;
|
|
147
|
+
isAudioDisabled: boolean;
|
|
148
|
+
canDownload: boolean;
|
|
149
|
+
availableSources$: Readable<ISources | undefined>;
|
|
150
|
+
hasMpegSources$: Readable<boolean>;
|
|
151
|
+
isInteractive: boolean;
|
|
152
|
+
showInteractiveGraph: boolean;
|
|
153
|
+
showSeekToInteractive: boolean;
|
|
154
|
+
showPlayPrevChapter: boolean;
|
|
155
|
+
showInteractiveTimeIndicator: boolean;
|
|
156
|
+
isInteractiveTime$: Readable<boolean>;
|
|
157
|
+
interactiveEpisodes$: Readable<IVideoEpisode[]>;
|
|
158
|
+
graphIsOpened$: Writable<boolean>;
|
|
159
|
+
isInteractiveExpectation$: Writable<boolean>;
|
|
160
|
+
hasInteractiveBranches?: boolean;
|
|
161
|
+
playPrevChapterDisabledTooltip: PlayPrevChapterDisabledTooltipKey;
|
|
162
|
+
looped$: Writable<boolean>;
|
|
163
|
+
isFirstBytes$: Writable<boolean>;
|
|
164
|
+
};
|
|
165
|
+
ui: IUIState;
|
|
166
|
+
ads: IAdsState;
|
|
167
|
+
webApi: IWebApi;
|
|
168
|
+
actions: {
|
|
169
|
+
internal: {
|
|
170
|
+
preload: () => void;
|
|
171
|
+
firstStart: (showAds: boolean) => void;
|
|
172
|
+
pause: () => void;
|
|
173
|
+
togglePlay: () => void;
|
|
174
|
+
toggleMuted: () => void;
|
|
175
|
+
toggleSettingsMenu: (wasOpenedByKey?: boolean) => void;
|
|
176
|
+
openSettingsMenu: (wasOpenedByKey?: boolean) => void;
|
|
177
|
+
closeSettingsMenu: (wasOpenedByKey?: boolean) => void;
|
|
178
|
+
setTrafficSavingEnabled: (trafficSavingEnabled: boolean) => void;
|
|
179
|
+
setVolume: (volume: number, preferredVolume?: number) => void;
|
|
180
|
+
setQuality: (quality: VideoQualityUI) => void;
|
|
181
|
+
setPlaybackRate: (playbackRate: PlaybackRate) => void;
|
|
182
|
+
incrementPlaybackRate: () => void;
|
|
183
|
+
decrementPlaybackRate: () => void;
|
|
184
|
+
setSubtitle: (subtitle: VideoSubtitle) => void;
|
|
185
|
+
toggleSubtitle: () => void;
|
|
186
|
+
togglePictureInPicture: () => void;
|
|
187
|
+
startScrubbing: (progress: number) => void;
|
|
188
|
+
progressScrubbing: (progress: number) => void;
|
|
189
|
+
completeScrubbing: (progress: number) => void;
|
|
190
|
+
toggleChromecast: () => void;
|
|
191
|
+
seekTime: (time: number, action: SeekAction, forcePrecise?: boolean) => void;
|
|
192
|
+
seekEpisodeStartTime: (time: number) => void;
|
|
193
|
+
getNextEpisode: () => IVideoEpisode | undefined;
|
|
194
|
+
seekToNextEpisode: (episode?: IVideoEpisode) => void;
|
|
195
|
+
getPrevEpisode: () => IVideoEpisode | undefined;
|
|
196
|
+
seekToPrevEpisode: (episode?: IVideoEpisode) => void;
|
|
197
|
+
seekToPercent: (percent: number, action: SeekAction) => void;
|
|
198
|
+
switchToActiveLive: () => void;
|
|
199
|
+
switchFromAdsToVideo: (callPlay?: boolean) => void;
|
|
200
|
+
switchFromVideoToAds: () => void;
|
|
201
|
+
skipAd: () => void;
|
|
202
|
+
setWaitingLive: (state: boolean) => void;
|
|
203
|
+
setWaitingRecord: (state: boolean) => void;
|
|
204
|
+
clearDelayedBufferingCheckTimeout: () => void;
|
|
205
|
+
getDebugTextData: () => string;
|
|
206
|
+
getDebugPanelData: () => DebugData;
|
|
207
|
+
getVideoElement: () => HTMLVideoElement | null;
|
|
208
|
+
startLogging: () => void;
|
|
209
|
+
stopLogging: () => void;
|
|
210
|
+
videoRotate: (alphaDiff?: number) => void;
|
|
211
|
+
startCameraManualRotation(mx: number, my: number): void;
|
|
212
|
+
stopCameraManualRotation(immediate?: boolean): void;
|
|
213
|
+
moveCameraFocusPX(xpx: number, ypx: number, dt: number): void;
|
|
214
|
+
holdCamera(): void;
|
|
215
|
+
releaseCamera(): void;
|
|
216
|
+
getVideoEpisodes: () => IVideoEpisode[] | undefined;
|
|
217
|
+
getPreviewThumbsData: () => ITimelinePreviewThumbsData | undefined;
|
|
218
|
+
downloadVideo: () => void;
|
|
219
|
+
addLanguage: (config: LanguageConfig) => void;
|
|
220
|
+
setLanguage: (language: InterfaceLanguage | string) => void;
|
|
221
|
+
nextMovie: (movieId: number) => void;
|
|
222
|
+
correctSeekTimeToInteractive: (time: number) => number;
|
|
223
|
+
replayInteractive?: () => void;
|
|
224
|
+
setLooped: (isLooped: boolean) => void;
|
|
225
|
+
};
|
|
226
|
+
external: {
|
|
227
|
+
firstStart: (showAds: boolean) => void;
|
|
228
|
+
play: () => void;
|
|
229
|
+
pause: () => void;
|
|
230
|
+
seekTime: (time: number) => void;
|
|
231
|
+
seekEpisodeStartTime: (time: number) => void;
|
|
232
|
+
setPlaybackRate: (playbackRate: PlaybackRate) => void;
|
|
233
|
+
setAutoQualityLimits: (limits: QualityLimits) => void;
|
|
234
|
+
setMuted: (muted: boolean) => void;
|
|
235
|
+
setVolume: (volume: number) => void;
|
|
236
|
+
returnFocusToEpisodes: () => void;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
callbacks?: IVKVideoPlayerCallbacks;
|
|
240
|
+
setUiCallbacks: (uiCallbacks: IVKVideoPlayerUICallbacks) => void;
|
|
241
|
+
getAdmanWrapper: () => AdmanWrapper;
|
|
242
|
+
getLogger: () => ILogger;
|
|
243
|
+
destroy(): void;
|
|
244
|
+
}
|
|
245
|
+
interface IStoreParams {
|
|
246
|
+
interfaceLanguage: InterfaceLanguage | string;
|
|
247
|
+
videoId?: number;
|
|
248
|
+
isClip: boolean;
|
|
249
|
+
isLiveCatchUpMode?: boolean;
|
|
250
|
+
isAudioDisabled?: boolean;
|
|
251
|
+
canDownload?: boolean;
|
|
252
|
+
statAuthToken?: string;
|
|
253
|
+
callbacks?: IVKVideoPlayerCallbacks;
|
|
254
|
+
webApi?: IWebApi;
|
|
255
|
+
videoEpisodes?: IVideoEpisode[];
|
|
256
|
+
previewThumbsData?: ITimelinePreviewThumbsData;
|
|
257
|
+
uiConfig: IUIConfig;
|
|
258
|
+
coreConfig: IOptionalTuningConfig;
|
|
259
|
+
player?: IPlayer;
|
|
260
|
+
isInteractive: boolean;
|
|
261
|
+
interactiveRanges$?: IValueObservable<InteractiveRange[]>;
|
|
262
|
+
isInteractiveTime$?: IValueObservable<boolean>;
|
|
263
|
+
replayInteractive?: () => void;
|
|
264
|
+
hasInteractiveBranches?: boolean;
|
|
265
|
+
disabledControls: ControlsKeys;
|
|
266
|
+
playPrevChapterDisabledTooltip: PlayPrevChapterDisabledTooltipKey;
|
|
267
|
+
additionalButtons: AdditionalButton[];
|
|
268
|
+
looped?: boolean;
|
|
269
|
+
statistics: UIOneStat;
|
|
270
|
+
saveRate: boolean;
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Store приложения.
|
|
274
|
+
* Если будет слишком большим - можно разделить его на модули
|
|
275
|
+
*/
|
|
276
|
+
export declare const createStore: ({ interfaceLanguage, videoId, isClip, isLiveCatchUpMode, statAuthToken, isAudioDisabled, canDownload, callbacks, webApi, videoEpisodes, previewThumbsData, uiConfig, coreConfig, player: playerInstance, disabledControls, isInteractive, interactiveRanges$, isInteractiveTime$, replayInteractive, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, looped, statistics: uiStatistics, saveRate, }: IStoreParams) => IStore;
|
|
277
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Subscription } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { IMicroStore, IMicroStores, InitMicroStoreParams } from '../../types';
|
|
3
|
+
export declare class BaseMicroStore<StateName extends keyof IMicroStores = keyof IMicroStores> implements IMicroStore {
|
|
4
|
+
readonly stateName: StateName;
|
|
5
|
+
state$: IMicroStores[StateName];
|
|
6
|
+
subscription: Subscription;
|
|
7
|
+
init({ store, microStores, config }: InitMicroStoreParams): Subscription;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
2
|
+
import { BaseMicroStore } from './base';
|
|
3
|
+
import type { InitMicroStoreParams } from '../../types';
|
|
4
|
+
export default class FakeIsPlaying extends BaseMicroStore {
|
|
5
|
+
readonly stateName = "fakeIsPlaying$";
|
|
6
|
+
state$: {
|
|
7
|
+
toggle: () => void;
|
|
8
|
+
set(this: void, value: boolean | null): void;
|
|
9
|
+
update(this: void, updater: import("svelte/store").Updater<boolean | null>): void;
|
|
10
|
+
subscribe(this: void, run: import("svelte/store").Subscriber<boolean | null>, invalidate?: import("svelte/store").Invalidator<boolean | null> | undefined): import("svelte/store").Unsubscriber;
|
|
11
|
+
};
|
|
12
|
+
init(initStoreParams: InitMicroStoreParams): import("@vkontakte/videoplayer-shared").Subscription;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
2
|
+
import { BaseMicroStore } from './base';
|
|
3
|
+
import type { InitMicroStoreParams } from '../../types';
|
|
4
|
+
export default class InteractiveControlsOpacity extends BaseMicroStore {
|
|
5
|
+
readonly stateName = "interactiveControlsOpacity$";
|
|
6
|
+
state$: {
|
|
7
|
+
toggle: () => void;
|
|
8
|
+
set(this: void, value: boolean | null): void;
|
|
9
|
+
update(this: void, updater: import("svelte/store").Updater<boolean | null>): void;
|
|
10
|
+
subscribe(this: void, run: import("svelte/store").Subscriber<boolean | null>, invalidate?: import("svelte/store").Invalidator<boolean | null> | undefined): import("svelte/store").Unsubscriber;
|
|
11
|
+
};
|
|
12
|
+
init(initStoreParams: InitMicroStoreParams): import("@vkontakte/videoplayer-shared").Subscription;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseMicroStore } from './base';
|
|
2
|
+
import { type Writable } from 'svelte/store';
|
|
3
|
+
import type { SeekToInteractiveDisabledTooltipKey } from '../../constans';
|
|
4
|
+
import type { InitMicroStoreParams } from '../../types';
|
|
5
|
+
export default class SeekToInteractiveDisabledTooltip extends BaseMicroStore {
|
|
6
|
+
readonly stateName = "seekToInteractiveDisabledTooltip$";
|
|
7
|
+
state$: Writable<SeekToInteractiveDisabledTooltipKey>;
|
|
8
|
+
init(initStoreParams: InitMicroStoreParams): import("@vkontakte/videoplayer-shared").Subscription;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
2
|
+
import { BaseMicroStore } from './base';
|
|
3
|
+
import type { InitMicroStoreParams } from '../../types';
|
|
4
|
+
export default class ShowInteractiveTimeIndicatorTooltip extends BaseMicroStore {
|
|
5
|
+
readonly stateName = "showInteractiveTimeIndicatorTooltip$";
|
|
6
|
+
private timeout;
|
|
7
|
+
state$: {
|
|
8
|
+
set: (value: boolean, useTimeout?: boolean) => void;
|
|
9
|
+
clearTimeout: () => void;
|
|
10
|
+
update(this: void, updater: import("svelte/store").Updater<boolean>): void;
|
|
11
|
+
subscribe(this: void, run: import("svelte/store").Subscriber<boolean>, invalidate?: import("svelte/store").Invalidator<boolean> | undefined): import("svelte/store").Unsubscriber;
|
|
12
|
+
};
|
|
13
|
+
init(initStoreParams: InitMicroStoreParams): import("@vkontakte/videoplayer-shared").Subscription;
|
|
14
|
+
clearTimeout(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Readable } from 'svelte/store';
|
|
2
|
+
import type { IValueObservable } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import type { IPlayer, IConfig, IObservable } from '@vkontakte/videoplayer-core';
|
|
4
|
+
import type { IStore } from '.';
|
|
5
|
+
import type { IMicroStores } from '../types';
|
|
6
|
+
export declare const setStores: (store: IStore, microStores: IMicroStores) => void;
|
|
7
|
+
export declare const getStore: () => IStore;
|
|
8
|
+
export declare const getMicroStores: () => IMicroStores;
|
|
9
|
+
/**
|
|
10
|
+
* Создаёт readable store svelte'а из `IObservableValue` sdk
|
|
11
|
+
*/
|
|
12
|
+
export declare const storeFromObservable: <T>(observable$: IValueObservable<T>, onNewValueEmitted?: ((value: T) => void) | undefined) => Readable<T>;
|
|
13
|
+
export declare const storeFromObservableWithInitValue: <T>(observable$: IObservable<T>, initValue: T, onNewValueEmitted?: ((value: T) => void) | undefined) => Readable<T>;
|
|
14
|
+
export declare const constructDebugTextData: (player: IPlayer, config: IConfig, store: IStore) => string;
|
|
15
|
+
export type DebugData = {
|
|
16
|
+
version: string;
|
|
17
|
+
viewport: string;
|
|
18
|
+
provider?: string;
|
|
19
|
+
cdn?: string;
|
|
20
|
+
id?: number;
|
|
21
|
+
volume: number;
|
|
22
|
+
videoSize?: string;
|
|
23
|
+
buffer?: number;
|
|
24
|
+
speed?: number;
|
|
25
|
+
bitrate?: number;
|
|
26
|
+
currentVideoSegmentLength?: number;
|
|
27
|
+
currentAudioSegmentLength?: number;
|
|
28
|
+
};
|
|
29
|
+
export declare const constructDebugPanelData: (player: IPlayer, config: IConfig, store: IStore) => DebugData;
|
|
30
|
+
export declare const fetchVideoFile: (url: string, filename: string) => void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { InterfaceLanguage } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { Key, LanguageConfig } from './types';
|
|
3
|
+
export declare const addLanguage: ({ language, pack, fallback }: LanguageConfig) => void;
|
|
4
|
+
export declare const haveLanguage: (language: InterfaceLanguage | string) => boolean;
|
|
5
|
+
export declare const translate: (language: InterfaceLanguage | string, key: Key, params?: Record<string, string>, defaultLanguage?: InterfaceLanguage) => string;
|
|
6
|
+
export declare const t: (key: Key, params?: Record<string, string>) => string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { InterfaceLanguage } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
export type Key = 'auto_quality_invariant' | 'auto_quality' | 'menu_quality' | 'menu_playback_rate' | 'menu_traffic_saving' | 'menu_report' | 'menu_pip' | 'menu_copy_video_link' | 'menu_copy_video_link_with_timestamp' | 'menu_video_rotate' | 'menu_video_loop_on' | 'menu_video_loop_off' | 'menu_chromecast' | 'menu_copy_debug' | 'menu_save_debug' | 'menu_debug_overlay' | 'pip_dummy_title' | 'submenu_traffic_saving' | 'submenu_quality' | 'submenu_playback_rate' | 'submenu_settings' | 'auto_quality_option' | 'mobile_unmute' | 'playing_ads' | 'skip_ads_now' | 'skip_ads_after' | 'visit_advertiser' | 'aria_timeline' | 'aria_open_settings' | 'aria_timeline_value' | 'doubletap_seek_step' | 'playback_rate_1' | 'playback_rate' | 'video360' | 'subtitles_caption' | 'subtitles_auto' | 'subtitles_off' | 'subtitles_auto_caption' | 'subtitles_turn_on' | 'subtitles_turn_off' | 'traffic_saving_off' | 'traffic_saving_on' | 'traffic_saving_disable' | 'traffic_saving_enable' | 'traffic_saving_helper_text' | 'tooltip_previous' | 'tooltip_restart' | 'tooltip_play' | 'tooltip_pause' | 'tooltip_next' | 'tooltip_button_disabled' | 'tooltip_interactive_go_back' | 'tooltip_interactive_go_back_disabled' | 'tooltip_interactive_go_back_disabled_first' | 'tooltip_interactive_go_back_disabled_limit' | 'tooltip_chapter_without_interactive' | 'tooltip_interactive_of_chapter_completed' | 'tooltip_interactive_seek' | 'tooltip_interactive_graph_off' | 'tooltip_interactive_graph_on' | 'tooltip_live' | 'tooltip_episodes' | 'tooltip_volume' | 'tooltip_volume_muted' | 'tooltip_settings_on' | 'tooltip_subtitles_off' | 'tooltip_settings_off' | 'tooltip_subtitles_on' | 'tooltip_fullscreen_off' | 'tooltip_fullscreen_on' | 'tooltip_chromecast_off' | 'tooltip_chromecast_on' | 'tooltip_episode_finished' | 'tooltip_episode_unfinished' | 'tooltip_disabled_when_interactive' | 'tooltip_disabled_when_graph_on' | 'tooltip_interactive_interaction_time_indicator' | 'tooltip_vk_logo' | 'tooltip_vk_video_logo' | 'download_video_caption' | 'hotkey_helper_current_volume' | 'hotkey_map_modal_title' | 'hotkey_map_modal_close_btn_text' | 'hotkey_map_group_title_common' | 'hotkey_map_group_title_playback' | 'hotkey_map_group_title_subtitles' | 'hotkey_map_group_title_episodes' | 'hotkey_map_item_mute_description' | 'hotkey_map_item_mute_value' | 'hotkey_map_item_volume_down_description' | 'hotkey_map_item_volume_down_value' | 'hotkey_map_item_volume_up_description' | 'hotkey_map_item_volume_up_value' | 'hotkey_map_item_pip_description' | 'hotkey_map_item_pip_value' | 'hotkey_map_item_full_screen_description' | 'hotkey_map_item_full_screen_value' | 'hotkey_map_item_show_context_menu_description' | 'hotkey_map_item_show_context_menu_value' | 'hotkey_map_item_show_hotkey_map_description' | 'hotkey_map_item_show_hotkey_map_value' | 'hotkey_map_item_play_toggle_description' | 'hotkey_map_item_play_toggle_value' | 'hotkey_map_item_seek_backward_description' | 'hotkey_map_item_seek_backward_value' | 'hotkey_map_item_seek_forward_description' | 'hotkey_map_item_seek_forward_value' | 'hotkey_map_item_fast_seek_backward_description' | 'hotkey_map_item_fast_seek_backward_value' | 'hotkey_map_item_fast_seek_forward_description' | 'hotkey_map_item_fast_seek_forward_value' | 'hotkey_map_item_rate_down_description' | 'hotkey_map_item_rate_down_value' | 'hotkey_map_item_rate_up_description' | 'hotkey_map_item_rate_up_value' | 'hotkey_map_item_prev_frame_description' | 'hotkey_map_item_prev_frame_value' | 'hotkey_map_item_next_frame_description' | 'hotkey_map_item_next_frame_value' | 'hotkey_map_item_jump_seek_description' | 'hotkey_map_item_jump_seek_value' | 'hotkey_map_item_subtitles_toggle_description' | 'hotkey_map_item_subtitles_toggle_value' | 'hotkey_map_item_prev_episode_description' | 'hotkey_map_item_prev_episode_pc_value' | 'hotkey_map_item_prev_episode_mac_value' | 'hotkey_map_item_next_episode_description' | 'hotkey_map_item_next_episode_pc_value' | 'hotkey_map_item_next_episode_mac_value' | 'waiting_live_day_value' | 'waiting_live_hour_value' | 'waiting_live_minute_value' | 'waiting_live_second_value' | 'waiting_live_colon' | 'waiting_live_upcoming_title' | 'waiting_live_timer_title' | 'waiting_record_title' | 'aria_label_menu_traffic_saving' | 'aria_label_submenu_traffic_saving_off' | 'aria_label_submenu_traffic_saving_on' | 'aria_label_submenu_back' | 'aria_label_menu_quality' | 'aria_label_menu_rate' | 'aria_label_menu_subtitle' | 'aria_label_menu_download' | 'aria_label_new_tab_alert' | 'aria_label_menu_debug_overlay_enable' | 'aria_label_menu_debug_overlay_disable' | 'aria_label_menu_rotate' | 'aria_label_menu_loop' | 'aria_label_debug_panel' | 'aria_label_context_menu_open' | 'aria_label_context_menu_close' | 'aria_label_video_player' | 'aria_label_spherical_control';
|
|
3
|
+
export type LanguagePack = Record<Key, string>;
|
|
4
|
+
export type LanguageConfig = {
|
|
5
|
+
language: string;
|
|
6
|
+
fallback: InterfaceLanguage;
|
|
7
|
+
pack: LanguagePack;
|
|
8
|
+
};
|