@vkontakte/videoplayer-tv 1.0.7-dev.ef2fa986.0 → 1.0.7

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/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-tv",
3
- "version": "1.0.7-dev.ef2fa986.0",
3
+ "version": "1.0.7",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer for smart TV based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
7
7
  "license": "GPL-3.0",
8
- "main": "./esnext.esm.js",
8
+ "main": "./esnext.cjs",
9
9
  "module": "./esnext.esm.js",
10
10
  "types": "./types/index.d.ts",
11
11
  "type": "module",
@@ -13,28 +13,49 @@
13
13
  ".": {
14
14
  "types": "./types/index.d.ts",
15
15
  "import": "./esnext.esm.js",
16
- "default": "./esnext.esm.js"
16
+ "require": "./esnext.cjs"
17
17
  },
18
18
  "./evergreen": {
19
19
  "types": "./types/index.d.ts",
20
- "import": "./evergreen.esm.js"
20
+ "import": "./evergreen.esm.js",
21
+ "require": "./evergreen.cjs"
21
22
  },
22
23
  "./esnext": {
23
24
  "types": "./types/index.d.ts",
24
- "import": "./esnext.esm.js"
25
+ "import": "./esnext.esm.js",
26
+ "require": "./esnext.cjs"
27
+ },
28
+ "./es2024": {
29
+ "types": "./types/index.d.ts",
30
+ "import": "./es2024.esm.js",
31
+ "require": "./es2024.cjs"
32
+ },
33
+ "./es2018": {
34
+ "types": "./types/index.d.ts",
35
+ "import": "./es2018.esm.js",
36
+ "require": "./es2018.cjs"
25
37
  },
26
38
  "./es2015": {
27
39
  "types": "./types/index.d.ts",
28
- "import": "./es2015.esm.js"
29
- }
40
+ "import": "./es2015.esm.js",
41
+ "require": "./es2015.cjs"
42
+ },
43
+ "./evergreen.esm.js": "./evergeen.esm.js",
44
+ "./esnext.esm.js": "./esnext.esm.js",
45
+ "./esnext.cjs": "./esnext.cjs",
46
+ "./es2018.esm.js": "./es2018.esm.js",
47
+ "./es2018.cjs": "./es2018.cjs",
48
+ "./es2015.esm.js": "./es2015.esm.js",
49
+ "./es2015.cjs": "./es2015.cjs"
30
50
  },
31
51
  "files": [
52
+ "*.cjs",
32
53
  "*.esm.js",
33
54
  "**/*.d.ts"
34
55
  ],
35
56
  "dependencies": {
36
- "@vkontakte/videoplayer-core": "2.0.157-dev.ef2fa986.0",
37
- "@vkontakte/videoplayer-shared": "1.0.86-dev.ef2fa986.0",
38
- "@vkontakte/videoplayer-statistics": "1.0.103-dev.ef2fa986.0"
57
+ "@vkontakte/videoplayer-core": "2.0.157",
58
+ "@vkontakte/videoplayer-shared": "1.0.86",
59
+ "@vkontakte/videoplayer-statistics": "1.0.103"
39
60
  }
40
61
  }
@@ -13,6 +13,8 @@ export interface RootProps {
13
13
  live: IVideoLive | undefined;
14
14
  preload: boolean;
15
15
  autoplay: boolean;
16
+ volume?: number | undefined;
17
+ muted?: boolean | undefined;
16
18
  fromTime: number;
17
19
  showAds: boolean;
18
20
  adsExternalApi?: AdmanInitParams["externalApi"];
@@ -3,6 +3,9 @@ export type FocusContext = {
3
3
  };
4
4
  export declare class FocusManager {
5
5
  static readonly CONTEXT_KEY = "focusManager";
6
+ private readonly root;
7
+ constructor(root: HTMLElement);
8
+ destroy(): void;
6
9
  unmountedElement(col: number, row: number, layer: string, isFocused: boolean): void;
7
10
  private moveFocusVertical;
8
11
  private moveFocusHorizontal;
@@ -3,4 +3,4 @@ import type { IStore, IStoreParams } from "./types";
3
3
  * Store приложения.
4
4
  * Если будет слишком большим - можно разделить его на модули
5
5
  */
6
- export declare const createStore: ({ interfaceLanguage, isCyrillicRelatedInterface, videoId, isLiveCatchUpMode, statAuthToken, isAudioDisabled, callbacks, previewThumbsData, uiConfig, coreConfig, player: playerInstance, stopPlayer, looped, statistics: uiStatistics, saveRate, internalsExposure, playerId, metaConfig, app, video, deviceCapabilities }: IStoreParams) => IStore;
6
+ export declare const createStore: ({ interfaceLanguage, isCyrillicRelatedInterface, videoId, isLiveCatchUpMode, statAuthToken, isAudioDisabled, canDownload, callbacks, webApi, previewThumbsData, uiConfig, coreConfig, player: playerInstance, stopPlayer, looped, statistics: uiStatistics, saveRate, internalsExposure, playerId, metaConfig, app, video, deviceCapabilities }: IStoreParams) => IStore;
@@ -1,19 +1,20 @@
1
1
  import { type Readable, type Writable } from "svelte/store";
2
- import type { PlayerPhase } from "../types";
3
- import { type AdsPlaybackState, type IPlayerPhase, type ITimelinePreviewThumbsData, type IVideoData, type IVKVideoPlayerCallbacks, type IVKVideoPlayerUICallbacks, type PlaybackStateRealistic, type VideoPlaybackRate, type VideoQualityForRender, type VideoQualityUI, type VideoSubtitle, type VideoSubtitleParsed } from "../types";
2
+ import type { AdsPlaybackState } from "../types";
3
+ import { type IPlayerPhase, type ITimelinePreviewThumbsData, type IVideoData, type IVKVideoPlayerCallbacks, type IVKVideoPlayerUICallbacks, type PlaybackStateRealistic, type Position, type VideoPlaybackRate, type VideoQualityForRender, type VideoQualityUI, type VideoSubtitle, type VideoSubtitleParsed } from "../types";
4
+ import type { FocusManager } from "../utils/webAPI/focusManager";
4
5
  import type { PlaybackState } from "@vkontakte/videoplayer-core";
5
6
  import { type IAudioStream, type IConfig, type IDashURLSource, type IExternalTextTrack, type IHLSLiveSource, type IHLSSource, type IMpegSource, type IOptionalTuningConfig, type IPlayer, type ITextTrack, type IVideoStream, type PlaybackRate, type URLSource } from "@vkontakte/videoplayer-core";
6
- import { type IComponentLogger, type IError, type ILogger, type InterfaceLanguage, type InternalsExposure, type IRectangle, type ISubscription, type ITracer, type IValueObservable, type QualityLimits, type Subject, type Subscription, type ValueSubject, type VideoQuality } from "@vkontakte/videoplayer-shared";
7
+ import type { InterfaceLanguage, VideoQuality } from "@vkontakte/videoplayer-shared";
8
+ import { type IError, type ILogger, type InternalsExposure, type IRectangle, type QualityLimits } from "@vkontakte/videoplayer-shared";
7
9
  import type { Key, LanguageConfig } from "../translation/types";
8
10
  import type { QualitySettingsAppliesTo } from "../utils/userSettings";
11
+ import type { SeekAction } from "@vkontakte/videoplayer-statistics";
9
12
  import type { DebugData } from "./utils";
10
13
  import type { AdmanWrapper } from "../components/Ads/admanWrapper";
11
14
  import type { ISDKConfig, IUIConfig } from "../config";
12
15
  import type { UIOneStat } from "../services/statistics";
13
16
  import type { AndroidTvPlayer } from "../AndroidTvPlayer";
14
17
  import type { DeviceCapabilities } from "../services/DeviceCapabilities";
15
- import type { SeekAction, ThinOneStat } from "@vkontakte/videoplayer-statistics";
16
- import type { t as globalT } from "../translation";
17
18
  export type ControlBlocksRefs = {
18
19
  /**
19
20
  * Контейнер для контролов, которые отображаются в левом верхнем углу.
@@ -120,23 +121,124 @@ export interface ISources {
120
121
  [VideoFormat.HLS_LIVE_CMAF]?: IHLSLiveSource;
121
122
  [VideoFormat.WEB_RTC_LIVE]?: URLSource;
122
123
  }
124
+ export interface Size {
125
+ width: number;
126
+ height: number;
127
+ }
123
128
  export interface IUIState {
129
+ /**
130
+ * Точечно скрываем контролы.
131
+ */
132
+ hiddenControls: Partial<Record<keyof IPlayerControlsRef, Writable<boolean>>>;
133
+ /**
134
+ * Определяет, могут ли вообще контролы быть показаны.
135
+ */
136
+ isControlsAvailable: Writable<boolean>;
137
+ controlBlocks: { [key in keyof Required<ControlBlocksRefs>] : Writable<IControlInfo | undefined> };
138
+ touched: Writable<boolean>;
139
+ controls: {
140
+ prevButton: Writable<IControlInfo | undefined>;
141
+ playButton: Writable<IControlInfo | undefined>;
142
+ replayButton: Writable<IControlInfo | undefined>;
143
+ nextButton: Writable<IControlInfo | undefined>;
144
+ playPrevChapterButton: Writable<IControlInfo | undefined>;
145
+ seekToInteractiveButton: Writable<IControlInfo | undefined>;
146
+ interactiveGraphButton: Writable<IControlInfo | undefined>;
147
+ liveButton: Writable<IControlInfo | undefined>;
148
+ time: Writable<IControlInfo | undefined>;
149
+ episodes: Writable<IControlInfo | undefined>;
150
+ volume: Writable<IControlInfo | undefined>;
151
+ subtitles: Writable<IControlInfo | undefined>;
152
+ settings: Writable<IControlInfo | undefined>;
153
+ context: Writable<IControlInfo | undefined>;
154
+ fullscreen: Writable<IControlInfo | undefined>;
155
+ chromecast: Writable<IControlInfo | undefined>;
156
+ pip: Writable<IControlInfo | undefined>;
157
+ "theater-mode-button": Writable<IControlInfo | undefined>;
158
+ vkLogo: Writable<IControlInfo | undefined>;
159
+ interactiveTimeIndicator: Writable<IControlInfo | undefined>;
160
+ timeline: Writable<IControlInfo | undefined>;
161
+ autoplayNextToggle: Writable<IControlInfo | undefined>;
162
+ additionalButtons: Writable<IControlInfo | undefined>[];
163
+ };
164
+ modals: {
165
+ hotKeyMap: {
166
+ show: Writable<boolean>;
167
+ data: Writable<HotKeyMapData>;
168
+ };
169
+ };
170
+ isFullscreen: Writable<boolean>;
171
+ isFullscreenOpenedByKeyboard: Writable<boolean>;
124
172
  isAutoplay: Writable<boolean>;
125
173
  debugPanelVisible: Writable<boolean>;
174
+ episodes: {
175
+ panelOpened$: Writable<boolean>;
176
+ openedByKeyboard$: Writable<boolean>;
177
+ };
178
+ contextMenu: {
179
+ visible$: Writable<boolean>;
180
+ btnRef$: Writable<HTMLButtonElement | undefined>;
181
+ openedByBtnKeyboard$: Writable<boolean>;
182
+ openedByHotKey$: Writable<boolean>;
183
+ lastActiveElem$: Writable<HTMLButtonElement | undefined>;
184
+ showContextMenuBtn$: Writable<boolean>;
185
+ position$: Writable<Position>;
186
+ };
187
+ playerSize: Writable<Size>;
188
+ isMobile: Writable<boolean>;
189
+ icon3DVideoVisible: Writable<boolean>;
190
+ scrubbingInProgress: Writable<boolean>;
191
+ volumeChangingInProgress: Writable<boolean>;
192
+ interactiveHideMobileControls: Writable<boolean>;
193
+ overlayContainer$: Writable<HTMLDivElement | undefined>;
194
+ startedByKeyboard$: Writable<boolean>;
195
+ autoplayNextEnabled$: Writable<boolean>;
196
+ timerNextVideoRunning$: Writable<boolean>;
197
+ settingsMenu: {
198
+ visible$: Writable<boolean>;
199
+ ref$: Writable<HTMLElement | undefined>;
200
+ openedByBtnKeyboard$: Writable<boolean>;
201
+ };
202
+ settingsSubMenu: {
203
+ visible$: Writable<boolean>;
204
+ ref$: Writable<HTMLElement | undefined>;
205
+ name$: Writable<string | undefined>;
206
+ };
207
+ /**
208
+ * Отключаем любое действие пользователя.
209
+ */
210
+ userActionsDisabled: Writable<boolean>;
211
+ /**
212
+ * Положение заголовка названия видео.
213
+ */
214
+ videoTitleInfo: Writable<IControlInfo | undefined>;
215
+ /**
216
+ * Ускорение видео х2.
217
+ */
218
+ doubleForwardOn$: Writable<boolean>;
219
+ /**
220
+ * Определяет, что двойное ускорение видео доступно.
221
+ */
222
+ doubleForwardAvailable$: Readable<false>;
223
+ previewTrackActive: Writable<boolean>;
224
+ previewTrackDragInProgress: Writable<boolean>;
225
+ previewTrackAvailable: Readable<boolean>;
226
+ isPreviewTrackHorizontallyAligned: Readable<boolean>;
126
227
  isShowLoader: Readable<boolean>;
127
228
  controlsVisible: Readable<boolean>;
128
229
  settingsVisible: Readable<boolean>;
129
- isLoaderVisible: Readable<boolean>;
130
230
  }
131
231
  export interface IUIStore {
132
232
  state: IUIState;
133
233
  action: {
234
+ startVolumeChanging(): void;
235
+ stopVolumeChanging(): void;
236
+ setControlsAvailibility(availability: boolean): void;
134
237
  onUserInput(): void;
135
238
  clearShowByInput(): void;
136
239
  onBackButton(): boolean;
137
240
  setSettingsVisibility(value: boolean): void;
138
241
  onPlay(): void;
139
- clearDelayedBufferingCheckTimeout(): void;
140
242
  };
141
243
  resolveDependency(store: IStore): void;
142
244
  }
@@ -153,105 +255,9 @@ export interface IAdsState {
153
255
  secondsToWatchBeforeSkip: Writable<number>;
154
256
  postrollPassed: Writable<boolean>;
155
257
  }
156
- export type SubtitlesStore = {
157
- state: {
158
- actionSetSubtitle$: Subject<string>;
159
- actionSubtitlesSwitched$: Subject<{
160
- enabled: boolean;
161
- lang: string;
162
- auto: boolean;
163
- }>;
164
- availableSubtitlesList$: Readable<VideoSubtitle[]>;
165
- currentSubtitleCaptions$: Readable<VideoSubtitleParsed["texts"]>;
166
- };
167
- action: {
168
- subtitlesDestroy(): void;
169
- setSubtitle(subtitle?: VideoSubtitle): void;
170
- toggleSubtitle(external: boolean): void;
171
- externalChangeSubtitle(enabled: boolean, id?: string): void;
172
- };
173
- };
174
- export type PlayerState = {
175
- positionExact$: Readable<number>;
176
- positionWithScrubbing$: Readable<number>;
177
- duration$: Readable<number>;
178
- playbackState$: Readable<PlaybackState | undefined>;
179
- playbackStateRealistic$: Readable<PlaybackStateRealistic | undefined>;
180
- isPlaying$: Readable<boolean>;
181
- bufferedProgress$: Readable<number>;
182
- isLive$: Readable<boolean | undefined>;
183
- canChangePlaybackSpeed$: Readable<boolean | undefined>;
184
- isActiveLive$: Readable<boolean | undefined>;
185
- isOldestAvailableLive$: Readable<boolean | undefined>;
186
- isRewindableLive$: Readable<boolean>;
187
- isEnded$: Readable<boolean>;
188
- volume$: Readable<number>;
189
- muted$: Readable<boolean>;
190
- trafficSavingEnabled$: Readable<boolean>;
191
- highQualityEnabled$: Readable<boolean>;
192
- availableVideoStreams$: Readable<IVideoStream[]>;
193
- availableAudioStreams$: Readable<IAudioStream[]>;
194
- videoStream$: Readable<IVideoStream | undefined>;
195
- audioStream$: Readable<IAudioStream | undefined>;
196
- currentQuality$: Readable<VideoQuality | undefined>;
197
- autoQualityLimitingAvailable$: Readable<boolean>;
198
- isAutoQualityEnabled$: Readable<boolean | undefined>;
199
- availableQualities$: Readable<VideoQualityForRender[]>;
200
- currentPlaybackRate$: Readable<number>;
201
- availablePlaybackRates$: Readable<VideoPlaybackRate[]>;
202
- availableTextTracks$: Readable<ITextTrack[]>;
203
- currentFormat$: Readable<VideoFormat | undefined>;
204
- throughputEstimation$: Readable<number | undefined>;
205
- videoBitrate$: Readable<number | undefined>;
206
- videoSize$: Readable<IRectangle | undefined>;
207
- errorLog$: Readable<IError[]>;
208
- crashed$: Readable<boolean>;
209
- isAudioAvailable$: Readable<boolean>;
210
- isAudioDisabled: boolean;
211
- canDownload: boolean;
212
- availableSources$: Readable<ISources | undefined>;
213
- hasMpegSources$: Readable<boolean>;
214
- looped$: Writable<boolean>;
215
- loadedMetadata$: Writable<boolean>;
216
- /**
217
- * Определяет, можно ли в целом увидеть/выбрать Авто режим выбора качества.
218
- */
219
- isAutoQualityAvailable$: Readable<boolean>;
220
- scrubbingProgress$: Writable<number | undefined>;
221
- isBuffering$: IValueObservable<boolean>;
222
- pendingQuality$: Writable<VideoQuality | undefined>;
223
- actionSeek$: ValueSubject<SeekAction | ThinOneStat.ActionSeekType>;
224
- actionRewind$: Subject<void>;
225
- actionQuality$: Subject<ThinOneStat.ActionQualityType>;
226
- };
227
- export type PlayerStore = {
228
- state: PlayerState;
229
- actions: {
230
- setLooped: (isLooped: boolean) => void;
231
- seekToPercent(percent: number, action: SeekAction, forcePrecise?: boolean): void;
232
- seekToTime(time: number, action: SeekAction, forcePrecise?: boolean): void;
233
- seekExternal(time: number): void;
234
- setAutoQualityLimitsExternal(limits: QualityLimits): void;
235
- setPlaybackRateExternal(playbackRate: PlaybackRate): void;
236
- startScrubbing(progress: number): void;
237
- completeScrubbing(progress: number, forcePrecise?: boolean): void;
238
- setLiveLowLatency(isLowLatency: boolean): void;
239
- switchToActiveLive(): void;
240
- progressScrubbing(progress: number): void;
241
- setTrafficSavingEnabled(trafficSavingEnabled: boolean): void;
242
- setHighQualityEnabled(highQualityEnabled: boolean): void;
243
- incrementPlaybackRate(): VideoPlaybackRate;
244
- decrementPlaybackRate(): VideoPlaybackRate;
245
- togglePlay(): void;
246
- setPlaybackRate(playbackRate: PlaybackRate, saveToLocalStorage?: boolean): void;
247
- setQuality(quality: VideoQualityUI, qualityInfo?: SetQualityInfo): void;
248
- setVideoStream(stream: IVideoStream): void;
249
- setAudioStream(stream: IAudioStream): void;
250
- selectInitialStream<T extends IVideoStream | IAudioStream>(streams: T[]): T | undefined;
251
- externalChangeAudioStream(id: string): void;
252
- destroy(): void;
253
- };
254
- };
258
+ export interface IWebApi {
259
+ focusManager?: FocusManager;
260
+ }
255
261
  export interface IStore {
256
262
  initVideo: (config: IConfig & {
257
263
  subtitles?: Omit<IExternalTextTrack, "type">[];
@@ -265,13 +271,61 @@ export interface IStore {
265
271
  i18n: (key: Key, params?: Record<string, string>) => string;
266
272
  app: AndroidTvPlayer;
267
273
  video: IVideoData;
268
- playerState: PlayerState;
269
- ui: IUIState;
270
- subtitles: {
274
+ state: {
275
+ positionExact$: Readable<number>;
276
+ positionWithScrubbing$: Readable<number>;
277
+ duration$: Readable<number>;
278
+ playbackState$: Readable<PlaybackState | undefined>;
279
+ playbackStateRealistic$: Readable<PlaybackStateRealistic | undefined>;
280
+ isPlaying$: Readable<boolean>;
281
+ isLoaderVisible: Readable<boolean>;
282
+ bufferedProgress$: Readable<number>;
283
+ isLive$: Readable<boolean | undefined>;
284
+ canChangePlaybackSpeed$: Readable<boolean | undefined>;
285
+ isActiveLive$: Readable<boolean | undefined>;
286
+ isOldestAvailableLive$: Readable<boolean | undefined>;
287
+ isRewindableLive$: Readable<boolean>;
288
+ isEnded$: Readable<boolean>;
289
+ volume$: Readable<number>;
290
+ muted$: Readable<boolean>;
291
+ trafficSavingEnabled$: Readable<boolean>;
292
+ highQualityEnabled$: Readable<boolean>;
293
+ availableVideoStreams$: Readable<IVideoStream[]>;
294
+ availableAudioStreams$: Readable<IAudioStream[]>;
295
+ videoStream$: Readable<IVideoStream | undefined>;
296
+ audioStream$: Readable<IAudioStream | undefined>;
297
+ currentQuality$: Readable<VideoQuality | undefined>;
298
+ autoQualityLimitingAvailable$: Readable<boolean>;
299
+ isAutoQualityEnabled$: Readable<boolean | undefined>;
300
+ availableQualities$: Readable<VideoQualityForRender[]>;
301
+ currentPlaybackRate$: Readable<number>;
302
+ availablePlaybackRates$: Readable<VideoPlaybackRate[]>;
303
+ currentSubtitle$: Readable<Omit<VideoSubtitle, "selected">>;
304
+ availableTextTracks$: Readable<ITextTrack[]>;
271
305
  availableSubtitlesList$: Readable<VideoSubtitle[]>;
272
306
  currentSubtitleCaptions$: Readable<VideoSubtitleParsed["texts"]>;
307
+ isAutoSubtitleCaptionVisible$: Writable<boolean>;
308
+ currentFormat$: Readable<VideoFormat | undefined>;
309
+ throughputEstimation$: Readable<number | undefined>;
310
+ videoBitrate$: Readable<number | undefined>;
311
+ videoSize$: Readable<IRectangle | undefined>;
312
+ errorLog$: Readable<IError[]>;
313
+ crashed$: Readable<boolean>;
314
+ isAudioAvailable$: Readable<boolean>;
315
+ isAudioDisabled: boolean;
316
+ canDownload: boolean;
317
+ availableSources$: Readable<ISources | undefined>;
318
+ hasMpegSources$: Readable<boolean>;
319
+ looped$: Writable<boolean>;
320
+ loadedMetadata$: Writable<boolean>;
321
+ /**
322
+ * Определяет, можно ли в целом увидеть/выбрать Авто режим выбора качества.
323
+ */
324
+ isAutoQualityAvailable$: Readable<boolean>;
273
325
  };
326
+ ui: IUIState;
274
327
  ads: IAdsState;
328
+ webApi: IWebApi;
275
329
  actions: {
276
330
  internal: {
277
331
  preload: () => void;
@@ -279,12 +333,19 @@ export interface IStore {
279
333
  play: () => void;
280
334
  pause: () => void;
281
335
  togglePlay: () => void;
336
+ toggleMuted: () => void;
337
+ openSettingsMenu: (wasOpenedByKey?: boolean, tick?: () => Promise<void>) => void;
338
+ closeSettingsMenu: (fromSubMenu?: boolean) => void;
282
339
  setTrafficSavingEnabled: (trafficSavingEnabled: boolean, appliesTo?: QualitySettingsAppliesTo) => void;
283
340
  setHighQualityEnabled: (highQualityEnabled: boolean, appliesTo?: QualitySettingsAppliesTo) => void;
341
+ setVolume: (volume: number) => void;
342
+ setMuted: (muted: boolean) => void;
343
+ startVolumeChanging(): void;
344
+ stopVolumeChanging(): void;
284
345
  setAudioStream: (stream: IAudioStream) => void;
285
346
  setVideoStream: (stream: IVideoStream) => void;
286
347
  setQuality: (quality: VideoQualityUI, info?: SetQualityInfo) => void;
287
- setPlaybackRate: (playbackRate: PlaybackRate, saveToLocalStorage?: boolean) => void;
348
+ setPlaybackRate: (playbackRate: PlaybackRate) => void;
288
349
  incrementPlaybackRate: () => VideoPlaybackRate;
289
350
  decrementPlaybackRate: () => VideoPlaybackRate;
290
351
  setSubtitle: (subtitle?: VideoSubtitle) => void;
@@ -307,6 +368,7 @@ export interface IStore {
307
368
  getDebugPanelData: () => DebugData;
308
369
  getVideoElement: () => HTMLVideoElement | null;
309
370
  getPreviewThumbsData: () => ITimelinePreviewThumbsData | undefined;
371
+ downloadVideo: () => void;
310
372
  addLanguage: (config: LanguageConfig) => void;
311
373
  setLanguage: (language: InterfaceLanguage | string) => void;
312
374
  stopPlayer?: () => void;
@@ -325,9 +387,13 @@ export interface IStore {
325
387
  seekTime: (time: number) => void;
326
388
  setPlaybackRate: (playbackRate: PlaybackRate) => void;
327
389
  setAutoQualityLimits: (limits: QualityLimits) => void;
390
+ setMuted: (muted: boolean) => void;
328
391
  toggleSubtitle: () => void;
329
392
  changeSubtitle: (enabled: boolean, id?: string) => void;
393
+ setVolume: (volume: number) => void;
330
394
  setLiveLowLatency: (isLowLatency: boolean) => void;
395
+ hideControls: () => void;
396
+ showControls: () => void;
331
397
  setQuality: (quality: VideoQualityUI) => void;
332
398
  setTrafficSavingEnabled: (trafficSavingEnabled: boolean) => void;
333
399
  setHighQualityEnabled: (highQualityEnabled: boolean) => void;
@@ -348,8 +414,10 @@ export interface IStoreParams {
348
414
  videoId?: number;
349
415
  isLiveCatchUpMode?: boolean;
350
416
  isAudioDisabled?: boolean;
417
+ canDownload?: boolean;
351
418
  statAuthToken?: string;
352
419
  callbacks?: IVKVideoPlayerCallbacks;
420
+ webApi?: IWebApi;
353
421
  previewThumbsData?: ITimelinePreviewThumbsData;
354
422
  uiConfig: IUIConfig;
355
423
  coreConfig: IOptionalTuningConfig;
@@ -365,83 +433,3 @@ export interface IStoreParams {
365
433
  video: IVideoData;
366
434
  deviceCapabilities: DeviceCapabilities;
367
435
  }
368
- export type InitVideoConfig = IConfig & {
369
- subtitles?: Omit<IExternalTextTrack, "type">[];
370
- subtitlesForcedLanguage?: string;
371
- };
372
- export type I18nStore = {
373
- i18n: (key: Key, params?: Record<string, string>) => string;
374
- isCyrillicRelatedInterface$: Writable<boolean>;
375
- interfaceLanguage$: Writable<string>;
376
- interfaceLanguageUpdated$: Writable<number>;
377
- setLanguage: (language: InterfaceLanguage | string) => Promise<void>;
378
- };
379
- export type I18nStoreParams = {
380
- uiConfig: IUIConfig;
381
- interfaceLanguage: InterfaceLanguage | string;
382
- isCyrillicRelatedInterface: boolean;
383
- uiStatistics?: UIOneStat;
384
- };
385
- export type PlayerStoreParams = {
386
- player: IPlayer;
387
- config: IUIConfig;
388
- i18n: typeof globalT;
389
- looped: boolean;
390
- subscription: ISubscription;
391
- tracer: ITracer;
392
- log: IComponentLogger;
393
- playerPhase$: Readable<PlayerPhase>;
394
- admanWrapper: AdmanWrapper;
395
- onPlay: () => void;
396
- saveRate: boolean;
397
- videoId?: number;
398
- isAudioDisabled?: boolean;
399
- callbacks?: IVKVideoPlayerCallbacks;
400
- };
401
- export type StatisticStoreParams = {
402
- actionSeek$: ValueSubject<SeekAction | ThinOneStat.ActionSeekType>;
403
- actionRewind$: Subject<void>;
404
- actionQuality$: Subject<ThinOneStat.ActionQualityType>;
405
- actionSetSubtitle$: Subject<string>;
406
- actionSubtitlesSwitched$: Subject<{
407
- enabled: boolean;
408
- lang: string;
409
- auto: boolean;
410
- }>;
411
- uiStore: IUIStore;
412
- player: IPlayer;
413
- admanWrapper: AdmanWrapper;
414
- log: IComponentLogger;
415
- statAuthToken?: string;
416
- uiStatistics?: UIOneStat;
417
- };
418
- export type SubscriptionStoreParams = {
419
- subscription: Subscription;
420
- videoElement: Writable<HTMLVideoElement | null>;
421
- player: IPlayer;
422
- admanWrapper: AdmanWrapper;
423
- actionSeek$: ValueSubject<SeekAction | ThinOneStat.ActionSeekType>;
424
- selectInitialStream: <T extends IVideoStream | IAudioStream>(streams: T[]) => T | undefined;
425
- callbacks?: IVKVideoPlayerCallbacks;
426
- };
427
- export type SubscriptionStore = {
428
- actions: {
429
- setUiCallbacks: (payload: IVKVideoPlayerUICallbacks) => void;
430
- };
431
- };
432
- export type SubtitlesStoreParams = {
433
- subscription: ISubscription;
434
- i18n: typeof globalT;
435
- tracer: ITracer;
436
- videoConfig: Writable<InitVideoConfig>;
437
- interfaceLanguageUpdated$: Writable<number>;
438
- availableTextTracks$: Readable<ITextTrack[]>;
439
- player: IPlayer;
440
- interfaceLanguage$: Writable<string>;
441
- positionExact$: Readable<number>;
442
- currentPlaybackRate$: Readable<number>;
443
- isPlaying$: Readable<boolean>;
444
- videoElement: Writable<HTMLVideoElement | null>;
445
- callbacks?: IVKVideoPlayerCallbacks;
446
- uiStatistics?: UIOneStat;
447
- };
@@ -1,3 +1,2 @@
1
1
  import type { IUIStore } from "./types";
2
- import type { IUIConfig } from "../config";
3
- export declare function createUiStore(uiConfig: IUIConfig): IUIStore;
2
+ export declare function createUiStore(): IUIStore;
@@ -1,6 +1,6 @@
1
1
  import { type Readable } from "svelte/store";
2
- import { type IValueObservable } from "@vkontakte/videoplayer-shared";
3
- import type { IConfig, IObservable, IPlayer } from "@vkontakte/videoplayer-core";
2
+ import type { IValueObservable } from "@vkontakte/videoplayer-shared";
3
+ import type { IPlayer, IConfig, IObservable } from "@vkontakte/videoplayer-core";
4
4
  import type { ISDKConfig } from "../config";
5
5
  import type { IStore } from "./types";
6
6
  export declare const setStores: (store: IStore) => void;
@@ -0,0 +1,5 @@
1
+ import type { IStore } from "../store/types";
2
+ export declare const getNextVolumeUp: (currentVolume: number, step: number) => number;
3
+ export declare const getNextVolumeDown: (currentVolume: number, step: number) => number;
4
+ export declare const volumeDiscreteChangeUp: (store: IStore, currentVolume: number, step: number) => void;
5
+ export declare const volumeDiscreteChangeDown: (store: IStore, currentVolume: number, step: number) => void;
@@ -1,2 +0,0 @@
1
- import type { I18nStore, I18nStoreParams } from "./types";
2
- export declare function createI18n({ uiConfig, isCyrillicRelatedInterface, interfaceLanguage, uiStatistics }: I18nStoreParams): I18nStore;
@@ -1,2 +0,0 @@
1
- import { type PlayerStore, type PlayerStoreParams } from "./types";
2
- export declare function createPlayerState({ player, config, i18n, looped, subscription, tracer, log, playerPhase$, admanWrapper, onPlay, saveRate, videoId, isAudioDisabled, callbacks }: PlayerStoreParams): PlayerStore;
@@ -1,2 +0,0 @@
1
- import type { StatisticStoreParams } from "./types";
2
- export declare function statisticCreate({ actionSeek$, actionRewind$, actionQuality$, actionSetSubtitle$, actionSubtitlesSwitched$, uiStore, player, admanWrapper, log, statAuthToken, uiStatistics }: StatisticStoreParams): void;
@@ -1,2 +0,0 @@
1
- import type { SubscriptionStore, SubscriptionStoreParams } from "./types";
2
- export declare function subscriptionCreate({ subscription, videoElement, player, admanWrapper, actionSeek$, selectInitialStream, callbacks }: SubscriptionStoreParams): SubscriptionStore;
@@ -1,2 +0,0 @@
1
- import type { SubtitlesStore, SubtitlesStoreParams } from "./types";
2
- export declare function subtitlesCreate({ subscription, i18n, tracer, videoConfig, interfaceLanguageUpdated$, availableTextTracks$, player, interfaceLanguage$, positionExact$, currentPlaybackRate$, isPlaying$, videoElement, callbacks, uiStatistics }: SubtitlesStoreParams): SubtitlesStore;