@vkontakte/videoplayer 1.1.93-dev.cd8858cd1.0 → 1.1.93

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.
Files changed (32) hide show
  1. package/es2015.cjs +33 -33
  2. package/es2015.esm.js +32 -32
  3. package/esnext.cjs +33 -33
  4. package/esnext.esm.js +32 -32
  5. package/evergreen.esm.js +32 -32
  6. package/package.json +5 -5
  7. package/types/VKVideoPlayer/index.svelte.d.ts +0 -1
  8. package/types/store/composition.d.ts +1 -9
  9. package/types/store/index.d.ts +1 -1
  10. package/types/store/modules/index.d.ts +1 -9
  11. package/types/store/modules/infrastructure/index.d.ts +1 -1
  12. package/types/store/modules/infrastructure/infrastructure.module.d.ts +1 -6
  13. package/types/store/modules/infrastructure/infrastructure.token.d.ts +1 -5
  14. package/types/store/types.d.ts +7 -12
  15. package/types/translation/types.d.ts +0 -1
  16. package/types/store/connectors/statisticsConnector.d.ts +0 -15
  17. package/types/store/modules/languageStore/index.d.ts +0 -9
  18. package/types/store/modules/languageStore/languageStore.module.d.ts +0 -3
  19. package/types/store/modules/languageStore/languageStore.store.d.ts +0 -51
  20. package/types/store/modules/languageStore/languageStore.token.d.ts +0 -6
  21. package/types/store/modules/playbackRateStore/index.d.ts +0 -6
  22. package/types/store/modules/playbackRateStore/playbackRateStore.module.d.ts +0 -8
  23. package/types/store/modules/playbackRateStore/playbackRateStore.store.d.ts +0 -40
  24. package/types/store/modules/playbackRateStore/playbackRateStore.token.d.ts +0 -6
  25. package/types/store/modules/qualityStore/index.d.ts +0 -6
  26. package/types/store/modules/qualityStore/qualityStore.module.d.ts +0 -8
  27. package/types/store/modules/qualityStore/qualityStore.store.d.ts +0 -37
  28. package/types/store/modules/qualityStore/qualityStore.token.d.ts +0 -6
  29. package/types/store/modules/subtitlesStore/index.d.ts +0 -9
  30. package/types/store/modules/subtitlesStore/subtitlesStore.module.d.ts +0 -8
  31. package/types/store/modules/subtitlesStore/subtitlesStore.store.d.ts +0 -130
  32. package/types/store/modules/subtitlesStore/subtitlesStore.token.d.ts +0 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer",
3
- "version": "1.1.93-dev.cd8858cd1.0",
3
+ "version": "1.1.93",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -43,9 +43,9 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "@adtech/rbadman": "2.2.57",
46
- "@vkontakte/videoplayer-core": "2.0.162-dev.cd8858cd1.0",
47
- "@vkontakte/videoplayer-interactive": "1.0.68-dev.cd8858cd1.0",
48
- "@vkontakte/videoplayer-shared": "1.0.91-dev.cd8858cd1.0",
49
- "@vkontakte/videoplayer-statistics": "1.0.108-dev.cd8858cd1.0"
46
+ "@vkontakte/videoplayer-core": "2.0.162",
47
+ "@vkontakte/videoplayer-interactive": "1.0.68",
48
+ "@vkontakte/videoplayer-shared": "1.0.91",
49
+ "@vkontakte/videoplayer-statistics": "1.0.108"
50
50
  }
51
51
  }
@@ -69,7 +69,6 @@ export declare class VKVideoPlayer extends HTMLElement {
69
69
  private readonly createOneStat;
70
70
  private createThinOneStat;
71
71
  private createStatisticsForVideo;
72
- private attachStatistics;
73
72
  private createAppTracerForVideo;
74
73
  private createAdsParamsForVideo;
75
74
  private createPlayer;
@@ -1,17 +1,13 @@
1
1
  import type { IUIConfig } from "../config";
2
2
  import type { IVKVideoPlayerConfig } from "../types";
3
- import type { IUIStatistics } from "../services/statistics";
4
3
  import type { IStore } from "./index";
5
- import type { FakeIsPlayingStore, GraphIsOpenedStore, InteractiveControlsOpacityStore, LanguageStore, NotificationsStore, PictureInPictureStore, SeekToInteractiveDisabledTooltipStore, ShowInteractiveTimeIndicatorTooltipStore, SubtitlesStore, QualityStore, PlaybackRateStore } from "./modules";
6
- import type { AppTracer } from "@vkontakte/videoplayer-shared";
4
+ import type { FakeIsPlayingStore, GraphIsOpenedStore, InteractiveControlsOpacityStore, NotificationsStore, PictureInPictureStore, SeekToInteractiveDisabledTooltipStore, ShowInteractiveTimeIndicatorTooltipStore } from "./modules";
7
5
  import type { Interactives } from "@vkontakte/videoplayer-interactive";
8
6
  export interface ICompositionParams {
9
7
  legacyStore: IStore;
10
8
  uiConfig: IUIConfig;
11
9
  config: IVKVideoPlayerConfig;
12
10
  interactiveController: Interactives | undefined;
13
- getStatisticsService: () => IUIStatistics | undefined;
14
- getAppTracer: () => AppTracer | undefined;
15
11
  }
16
12
  export interface ICompositionResult {
17
13
  stores: {
@@ -22,10 +18,6 @@ export interface ICompositionResult {
22
18
  showInteractiveTimeIndicatorTooltipStore: ShowInteractiveTimeIndicatorTooltipStore;
23
19
  graphIsOpenedStore: GraphIsOpenedStore;
24
20
  interactiveControlsOpacityStore: InteractiveControlsOpacityStore;
25
- languageStore: LanguageStore;
26
- subtitlesStore: SubtitlesStore;
27
- qualityStore: QualityStore;
28
- playbackRateStore: PlaybackRateStore;
29
21
  };
30
22
  /** Очистка ресурсов */
31
23
  destroy(): void;
@@ -4,4 +4,4 @@ export type { IStore, IAdsState, IUIState, EnrichedStore } from "./types";
4
4
  * Store приложения.
5
5
  * Если будет слишком большим - можно разделить его на модули
6
6
  */
7
- export declare const createStore: ({ interfaceLanguage, isCyrillicRelatedInterface, initialVideoId, isTouch, isLiveCatchUpMode, isAudioDisabled, canDownload, callbacks, webApi, videoEpisodes: initialVideoEpisodes, previewThumbsData: initialPreviewThumbsData, uiConfig, coreConfig, player: playerInstance, disabledControls, isInteractive, interactiveRanges$, isInteractiveTime$, replayInteractive, stopPlayer, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalSettingsMenuItems, additionalContextMenuItems, playPrevVideo, playNextVideo, onVideoChanged, looped, getStatisticsService, saveRate, internalsExposure, playerView, playerId, metaConfig, getAppTracer, getAdmanWrapper, logger, adsEnabled }: IStoreParams) => IStore;
7
+ export declare const createStore: ({ interfaceLanguage, isCyrillicRelatedInterface, initialVideoId, isTouch, isLiveCatchUpMode, statAuthToken, isAudioDisabled, canDownload, callbacks, webApi, videoEpisodes: initialVideoEpisodes, previewThumbsData: initialPreviewThumbsData, uiConfig, coreConfig, player: playerInstance, disabledControls, isInteractive, interactiveRanges$, isInteractiveTime$, replayInteractive, stopPlayer, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalSettingsMenuItems, additionalContextMenuItems, playPrevVideo, playNextVideo, onVideoChanged, looped, getStatisticsService, saveRate, internalsExposure, playerView, playerId, metaConfig, getAppTracer, getAdmanWrapper, logger, adsEnabled }: IStoreParams) => IStore;
@@ -1,4 +1,4 @@
1
- export { SUBSCRIPTION_TOKEN, PLAYER_TOKEN, LOGGER_TOKEN, UI_CONFIG_TOKEN, PLAYER_CONFIG_TOKEN, LEGACY_STORE_TOKEN, INTERACTIVE_CONTROLLER_TOKEN, GET_STATISTICS_SERVICE_TOKEN, APP_TRACER_TOKEN, registerInfrastructure } from "./infrastructure";
1
+ export { SUBSCRIPTION_TOKEN, PLAYER_TOKEN, LOGGER_TOKEN, UI_CONFIG_TOKEN, PLAYER_CONFIG_TOKEN, LEGACY_STORE_TOKEN, INTERACTIVE_CONTROLLER_TOKEN, registerInfrastructure } from "./infrastructure";
2
2
  export type { InfrastructureParams } from "./infrastructure";
3
3
  export { registerModules } from "./utils";
4
4
  export type { Module } from "./utils";
@@ -8,8 +8,6 @@ export type { GraphIsOpenedStoreState, GraphIsOpenedStore, GraphIsOpenedStoreAct
8
8
  export { graphIsOpenedModule, GRAPH_IS_OPENED_STORE_TOKEN } from "./graphIsOpenedStore";
9
9
  export type { InteractiveControlsOpacityStoreState, InteractiveControlsOpacityStore, InteractiveControlsOpacityStoreActions, InteractiveControlsOpacityStoreDeps } from "./interactiveControlsOpacityStore";
10
10
  export { interactiveControlsOpacityModule, INTERACTIVE_CONTROLS_OPACITY_STORE_TOKEN } from "./interactiveControlsOpacityStore";
11
- export type { LanguageStoreState, LanguageStoreActions, LanguageStore, LanguageStoreDeps } from "./languageStore";
12
- export { languageModule, LANGUAGE_STORE_TOKEN } from "./languageStore";
13
11
  export type { NotificationsStoreState, NotificationsStore, NotificationsStoreActions, NotificationsStoreDeps } from "./notificationsStore";
14
12
  export { notificationsModule, NOTIFICATIONS_STORE_TOKEN } from "./notificationsStore";
15
13
  export type { PictureInPictureStoreState, PictureInPictureStore, PictureInPictureStoreDeps } from "./pictureInPictureStore";
@@ -18,9 +16,3 @@ export type { SeekToInteractiveDisabledTooltipStoreState, SeekToInteractiveDisab
18
16
  export { seekToInteractiveDisabledTooltipModule, SEEK_TO_INTERACTIVE_DISABLED_TOOLTIP_STORE_TOKEN } from "./seekToInteractiveDisabledTooltipStore";
19
17
  export type { ShowInteractiveTimeIndicatorTooltipStoreState, ShowInteractiveTimeIndicatorTooltipStore, ShowInteractiveTimeIndicatorTooltipStoreActions, ShowInteractiveTimeIndicatorTooltipStoreDeps } from "./showInteractiveTimeIndicatorTooltipStore";
20
18
  export { showInteractiveTimeIndicatorTooltipModule, SHOW_INTERACTIVE_TIME_INDICATOR_TOOLTIP_STORE_TOKEN } from "./showInteractiveTimeIndicatorTooltipStore";
21
- export type { SubtitlesStoreState, SubtitlesStoreInternalActions, SubtitlesStoreExternalActions, SubtitlesStore, SubtitlesStoreDeps } from "./subtitlesStore";
22
- export { subtitlesModule, SUBTITLES_STORE_TOKEN } from "./subtitlesStore";
23
- export type { QualityStoreDeps, QualityStoreState, QualityStore } from "./qualityStore";
24
- export { qualityModule, QUALITY_STORE_TOKEN } from "./qualityStore";
25
- export type { PlaybackRateStoreDeps, PlaybackRateStoreState, PlaybackRateStore } from "./playbackRateStore";
26
- export { playbackRateModule, PLAYBACK_RATE_STORE_TOKEN } from "./playbackRateStore";
@@ -1,3 +1,3 @@
1
- export { SUBSCRIPTION_TOKEN, PLAYER_TOKEN, LOGGER_TOKEN, UI_CONFIG_TOKEN, PLAYER_CONFIG_TOKEN, LEGACY_STORE_TOKEN, INTERACTIVE_CONTROLLER_TOKEN, TRACER_STORE_TOKEN, GET_STATISTICS_SERVICE_TOKEN, APP_TRACER_TOKEN } from "./infrastructure.token";
1
+ export { SUBSCRIPTION_TOKEN, PLAYER_TOKEN, LOGGER_TOKEN, UI_CONFIG_TOKEN, PLAYER_CONFIG_TOKEN, LEGACY_STORE_TOKEN, INTERACTIVE_CONTROLLER_TOKEN } from "./infrastructure.token";
2
2
  export { registerInfrastructure } from "./infrastructure.module";
3
3
  export type { InfrastructureParams } from "./infrastructure.module";
@@ -3,22 +3,17 @@
3
3
  *
4
4
  * Регистрация базовых зависимостей и store-модулей.
5
5
  */
6
- import type { IDIContainer, Subscription, AppTracer } from "@vkontakte/videoplayer-shared";
6
+ import type { IDIContainer, Subscription } from "@vkontakte/videoplayer-shared";
7
7
  import type { IUIConfig } from "../../../config";
8
8
  import type { IVKVideoPlayerConfig } from "../../../types";
9
9
  import type { IStore } from "../../index";
10
10
  import type { Interactives } from "@vkontakte/videoplayer-interactive";
11
- import type { IUIStatistics } from "../../../services/statistics";
12
- import type { ITracer } from "@vkontakte/videoplayer-shared";
13
11
  export interface InfrastructureParams {
14
12
  legacyStore: IStore;
15
13
  uiConfig: IUIConfig;
16
14
  config: IVKVideoPlayerConfig;
17
15
  interactiveController: Interactives | undefined;
18
16
  subscription: Subscription;
19
- tracer: ITracer;
20
- getStatisticsService: () => IUIStatistics | undefined;
21
- getAppTracer: () => AppTracer | undefined;
22
17
  }
23
18
  /**
24
19
  * Регистрирует базовые зависимости в DI контейнере
@@ -4,13 +4,12 @@
4
4
  * Core DI токены для базовых зависимостей.
5
5
  */
6
6
  import { InjectionToken } from "@vkontakte/videoplayer-shared";
7
- import type { Subscription, ILogger, ITracer, AppTracer } from "@vkontakte/videoplayer-shared";
7
+ import type { Subscription, ILogger } from "@vkontakte/videoplayer-shared";
8
8
  import type { IPlayer } from "@vkontakte/videoplayer-core";
9
9
  import type { Interactives } from "@vkontakte/videoplayer-interactive";
10
10
  import type { IUIConfig } from "../../../config";
11
11
  import type { IVKVideoPlayerConfig } from "../../../types";
12
12
  import type { IStore } from "../../index";
13
- import type { IUIStatistics } from "../../../services/statistics";
14
13
  /** Общий subscription для всех rxjs подписок */
15
14
  export declare const SUBSCRIPTION_TOKEN: InjectionToken<Subscription>;
16
15
  /** Инстанс плеера */
@@ -25,6 +24,3 @@ export declare const PLAYER_CONFIG_TOKEN: InjectionToken<IVKVideoPlayerConfig>;
25
24
  export declare const LEGACY_STORE_TOKEN: InjectionToken<IStore>;
26
25
  /** Интерактивный контроллер */
27
26
  export declare const INTERACTIVE_CONTROLLER_TOKEN: InjectionToken<Interactives | undefined>;
28
- export declare const TRACER_STORE_TOKEN: InjectionToken<ITracer>;
29
- export declare const GET_STATISTICS_SERVICE_TOKEN: InjectionToken<() => IUIStatistics | undefined>;
30
- export declare const APP_TRACER_TOKEN: InjectionToken<() => AppTracer | undefined>;
@@ -1,11 +1,11 @@
1
1
  import type { ChromecastState, IAudioStream, IConfig as ICoreInitVideoConfig, IExternalTextTrack, IOptionalTuningConfig, IPlayer, ISources, ITextTrack, IVideoStream, PlaybackRate, PlaybackState, VideoFormat } from "@vkontakte/videoplayer-core";
2
2
  import type { InteractiveRange } from "@vkontakte/videoplayer-interactive";
3
- import type { AppTracer, IError, ILogger, InterfaceLanguage, InternalsExposure, IRectangle, ISubject, IValueObservable, IValueSubject, QualityLimits, VideoQuality } from "@vkontakte/videoplayer-shared";
3
+ import type { AppTracer, IError, ILogger, InterfaceLanguage, InternalsExposure, IRectangle, IValueObservable, QualityLimits, VideoQuality } from "@vkontakte/videoplayer-shared";
4
4
  import type { SeekAction, ThinOneStat } from "@vkontakte/videoplayer-statistics";
5
5
  import type { Readable, Writable } from "svelte/store";
6
6
  import type { AdditionalButtonDeprecated, AdsPlaybackState, ControlBlocksRefs, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerControlsRef, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, PlaybackStateRealistic, Position, Size, VideoPlaybackRate, VideoPlayerView, VideoQualityForRender, VideoQualityUI, VideoSubtitle, VideoSubtitleParsed } from "../types";
7
7
  import type { AdmanWrapper } from "../components/Ads/admanWrapper";
8
- import type { Key } from "../translation/types";
8
+ import type { Key, LanguageConfig } from "../translation/types";
9
9
  import type { QualitySettingsAppliesTo } from "../utils/userSettings";
10
10
  import type { GridTypes, PlayPrevChapterDisabledTooltipKey } from "../constans";
11
11
  import type { AdditionalButton, AdditionalDesktopControlPanelButton } from "../components/Controls/types";
@@ -272,7 +272,8 @@ export interface IStoreInternalActions {
272
272
  holdCamera(): void;
273
273
  releaseCamera(): void;
274
274
  downloadVideo: () => void;
275
- setLanguage: (language: InterfaceLanguage | string) => Promise<void>;
275
+ addLanguage: (config: LanguageConfig) => void;
276
+ setLanguage: (language: InterfaceLanguage | string) => void;
276
277
  nextMovie: (movieId: number) => void;
277
278
  correctSeekTimeToInteractive: (time: number) => number;
278
279
  replayInteractive?: () => void;
@@ -333,25 +334,18 @@ export interface IStoreInitVideoConfig extends ICoreInitVideoConfig {
333
334
  canDownload?: boolean;
334
335
  previewThumbsData?: ITimelinePreviewThumbsData;
335
336
  subtitles?: Omit<IExternalTextTrack, "type">[];
337
+ subtitlesForcedLanguage?: string;
336
338
  unitedVideoId?: number;
337
339
  videoEpisodes?: IVideoEpisode[];
338
340
  }
339
- export interface IStoreEvents {
340
- actionRewind$: ISubject<void>;
341
- actionSeek$: IValueSubject<SeekAction | ThinOneStat.ActionSeekType>;
342
- actionQuality$: ISubject<ThinOneStat.ActionQualityType>;
343
- nextMovie$: ISubject<number>;
344
- }
345
341
  export interface IStore {
346
342
  initVideo: (config: IStoreInitVideoConfig) => void;
347
343
  videoId$: Writable<number | undefined>;
348
344
  playerPhase: IPlayerPhase;
349
345
  interfaceLanguage$: Readable<InterfaceLanguage | string>;
350
- interfaceLanguageUpdated$: ISubject<void>;
351
346
  isCyrillicRelatedInterface$: Readable<boolean>;
352
347
  interactiveData?: IInteractiveData;
353
- vsid$: Writable<string | undefined>;
354
- events: IStoreEvents;
348
+ vsid$: Readable<string | undefined>;
355
349
  state: IPlayerState;
356
350
  ui: IUIState;
357
351
  ads: IAdsState;
@@ -366,6 +360,7 @@ export interface IStore {
366
360
  initOnFinishedCallback: VoidFunction;
367
361
  resetAdsState: VoidFunction;
368
362
  updateAdmanWrapperSubscriptions: VoidFunction;
363
+ updateStatisticsSubscriptions: VoidFunction;
369
364
  updateAppTracerSubscriptions: VoidFunction;
370
365
  updateTracerSubscriptions: VoidFunction;
371
366
  getLogger: () => ILogger;
@@ -6,4 +6,3 @@ export type LanguageConfig = {
6
6
  fallback: InterfaceLanguage;
7
7
  pack: LanguagePack;
8
8
  };
9
- export type TSignature = (key: Key, params?: Record<string, string>) => string;
@@ -1,15 +0,0 @@
1
- import type { ISubject, IValueSubject } from "@vkontakte/videoplayer-shared";
2
- import type { SeekAction, ThinOneStat } from "@vkontakte/videoplayer-statistics";
3
- import type { EnrichedStore } from "../types";
4
- import type { IUIStatistics } from "../../services/statistics";
5
- export interface IConnectStatisticsParams {
6
- store: EnrichedStore;
7
- statistics: IUIStatistics;
8
- }
9
- export interface IStoreEvents {
10
- actionRewind$: ISubject<void>;
11
- actionSeek$: IValueSubject<SeekAction | ThinOneStat.ActionSeekType>;
12
- actionQuality$: ISubject<ThinOneStat.ActionQualityType>;
13
- nextMovie$: ISubject<number>;
14
- }
15
- export declare function connectStatisticsToStore(params: IConnectStatisticsParams): void;
@@ -1,9 +0,0 @@
1
- /**
2
- * Language Store Module
3
- *
4
- * Экспорты модуля языка интерфейса.
5
- */
6
- export type { LanguageStoreState, LanguageStoreActions, LanguageStore, Deps as LanguageStoreDeps } from "./languageStore.store";
7
- export { createLanguageStore } from "./languageStore.store";
8
- export { languageModule } from "./languageStore.module";
9
- export { LANGUAGE_STORE_TOKEN } from "./languageStore.token";
@@ -1,3 +0,0 @@
1
- import { type LanguageStore } from "./languageStore.store";
2
- import type { Module } from "../utils";
3
- export declare const languageModule: Module<LanguageStore>;
@@ -1,51 +0,0 @@
1
- /**
2
- * Language Store Module
3
- *
4
- * Управляет состоянием языка интерфейса: загрузка языковых пакетов, установка языка, функция перевода.
5
- */
6
- import type { Writable } from "svelte/store";
7
- import { InterfaceLanguage, Subject } from "@vkontakte/videoplayer-shared";
8
- import type { AppTracer } from "@vkontakte/videoplayer-shared";
9
- import type { IUIConfig } from "../../../config";
10
- import type { Key } from "../../../translation/types";
11
- /**
12
- * Зависимости модуля language
13
- */
14
- export interface Deps {
15
- /** UI конфиг */
16
- uiConfig: IUIConfig;
17
- /** Начальный язык интерфейса */
18
- initialInterfaceLanguage: InterfaceLanguage | string;
19
- /** Признак кириллического интерфейса */
20
- initialIsCyrillicRelatedInterface: boolean;
21
- /** Функция для получения сервиса статистики */
22
- getStatisticsService?: () => {
23
- oneStat?: {
24
- logError: (params: {
25
- errorType: string;
26
- fatal: boolean;
27
- }) => void;
28
- };
29
- } | undefined;
30
- /** Функция для получения AppTracer для error reporting */
31
- getAppTracer?: () => AppTracer | undefined;
32
- }
33
- export interface LanguageStoreState {
34
- /** Текущий язык интерфейса */
35
- interfaceLanguage$: Writable<InterfaceLanguage | string>;
36
- /** Событие обновления языка */
37
- interfaceLanguageUpdated$: Subject<void>;
38
- /** Признак кириллического интерфейса */
39
- isCyrillicRelatedInterface$: Writable<boolean>;
40
- }
41
- export interface LanguageStoreActions {
42
- /** Установить язык интерфейса */
43
- setLanguage: (language: InterfaceLanguage | string) => Promise<void>;
44
- /** Функция перевода */
45
- t: (key: Key, params?: Record<string, string>) => string;
46
- }
47
- export interface LanguageStore {
48
- state: LanguageStoreState;
49
- actions: LanguageStoreActions;
50
- }
51
- export declare const createLanguageStore: (deps: Deps) => LanguageStore;
@@ -1,6 +0,0 @@
1
- /**
2
- * Language Store Token
3
- */
4
- import { InjectionToken } from "@vkontakte/videoplayer-shared";
5
- import type { LanguageStore } from "./languageStore.store";
6
- export declare const LANGUAGE_STORE_TOKEN: InjectionToken<LanguageStore>;
@@ -1,6 +0,0 @@
1
- /**
2
- * Playback Rate Store Module
3
- */
4
- export { createPlaybackRateStore, type PlaybackRateStoreDeps, type PlaybackRateStoreState, type PlaybackRateStore } from "./playbackRateStore.store";
5
- export { playbackRateModule } from "./playbackRateStore.module";
6
- export { PLAYBACK_RATE_STORE_TOKEN } from "./playbackRateStore.token";
@@ -1,8 +0,0 @@
1
- /**
2
- * Playback Rate Store Module
3
- *
4
- * Композиция модуля через Dependency Injection.
5
- */
6
- import { type PlaybackRateStore } from "./playbackRateStore.store";
7
- import type { Module } from "../utils";
8
- export declare const playbackRateModule: Module<PlaybackRateStore>;
@@ -1,40 +0,0 @@
1
- /**
2
- * Playback Rate Store Module
3
- *
4
- * Управляет состоянием скорости воспроизведения: доступные скорости.
5
- */
6
- import type { Readable } from "svelte/store";
7
- import type { IPlayer } from "@vkontakte/videoplayer-core";
8
- import type { IUIConfig } from "../../../config";
9
- import type { Key } from "../../../translation/types";
10
- import type { VideoPlaybackRate } from "../../../types";
11
- /**
12
- * Зависимости модуля playback rate
13
- */
14
- export interface PlaybackRateStoreDeps {
15
- /** Плеер */
16
- player: IPlayer;
17
- /** UI конфиг */
18
- uiConfig: IUIConfig;
19
- /** Функция перевода */
20
- t: (key: Key, params?: Record<string, string>) => string;
21
- /** Признак интерактивного видео */
22
- isInteractive: boolean;
23
- }
24
- /**
25
- * Состояние модуля playback rate
26
- */
27
- export interface PlaybackRateStoreState {
28
- /** Доступные скорости воспроизведения */
29
- availablePlaybackRates$: Readable<VideoPlaybackRate[]>;
30
- }
31
- /**
32
- * Результат создания playback rate store
33
- */
34
- export interface PlaybackRateStore {
35
- state: PlaybackRateStoreState;
36
- }
37
- /**
38
- * Создаёт playback rate store
39
- */
40
- export declare const createPlaybackRateStore: (deps: PlaybackRateStoreDeps) => PlaybackRateStore;
@@ -1,6 +0,0 @@
1
- /**
2
- * Playback Rate Store Token
3
- */
4
- import { InjectionToken } from "@vkontakte/videoplayer-shared";
5
- import type { PlaybackRateStore } from "./playbackRateStore.store";
6
- export declare const PLAYBACK_RATE_STORE_TOKEN: InjectionToken<PlaybackRateStore>;
@@ -1,6 +0,0 @@
1
- /**
2
- * Quality Store Module
3
- */
4
- export { createQualityStore, type QualityStoreDeps, type QualityStoreState, type QualityStore } from "./qualityStore.store";
5
- export { qualityModule } from "./qualityStore.module";
6
- export { QUALITY_STORE_TOKEN } from "./qualityStore.token";
@@ -1,8 +0,0 @@
1
- /**
2
- * Quality Store Module
3
- *
4
- * Композиция модуля через Dependency Injection.
5
- */
6
- import { type QualityStore } from "./qualityStore.store";
7
- import type { Module } from "../utils";
8
- export declare const qualityModule: Module<QualityStore>;
@@ -1,37 +0,0 @@
1
- /**
2
- * Quality Store Module
3
- *
4
- * Управляет состоянием качества видео: доступные качества, авто-качество.
5
- */
6
- import type { Readable } from "svelte/store";
7
- import type { IPlayer } from "@vkontakte/videoplayer-core";
8
- import type { Key } from "../../../translation/types";
9
- import type { VideoQualityForRender } from "../../../types";
10
- /**
11
- * Зависимости модуля quality
12
- */
13
- export interface QualityStoreDeps {
14
- /** Плеер */
15
- player: IPlayer;
16
- /** Функция перевода */
17
- t: (key: Key, params?: Record<string, string>) => string;
18
- }
19
- /**
20
- * Состояние модуля quality
21
- */
22
- export interface QualityStoreState {
23
- /** Доступные качества для рендера */
24
- availableQualities$: Readable<VideoQualityForRender[]>;
25
- /** Признак доступности авто-качества */
26
- isAutoQualityAvailable$: Readable<boolean>;
27
- }
28
- /**
29
- * Результат создания quality store
30
- */
31
- export interface QualityStore {
32
- state: QualityStoreState;
33
- }
34
- /**
35
- * Создаёт quality store
36
- */
37
- export declare const createQualityStore: (deps: QualityStoreDeps) => QualityStore;
@@ -1,6 +0,0 @@
1
- /**
2
- * Quality Store Token
3
- */
4
- import { InjectionToken } from "@vkontakte/videoplayer-shared";
5
- import type { QualityStore } from "./qualityStore.store";
6
- export declare const QUALITY_STORE_TOKEN: InjectionToken<QualityStore>;
@@ -1,9 +0,0 @@
1
- /**
2
- * Subtitles Store Module
3
- *
4
- * Экспорты модуля субтитров.
5
- */
6
- export type { SubtitlesStoreState, SubtitlesStoreInternalActions, SubtitlesStoreExternalActions, SubtitlesStore, Deps as SubtitlesStoreDeps } from "./subtitlesStore.store";
7
- export { createSubtitlesStore } from "./subtitlesStore.store";
8
- export { subtitlesModule } from "./subtitlesStore.module";
9
- export { SUBTITLES_STORE_TOKEN } from "./subtitlesStore.token";
@@ -1,8 +0,0 @@
1
- /**
2
- * Subtitles Store Module
3
- *
4
- * Композиция модуля через Dependency Injection.
5
- */
6
- import { type SubtitlesStore } from "./subtitlesStore.store";
7
- import type { Module } from "../utils";
8
- export declare const subtitlesModule: Module<SubtitlesStore>;
@@ -1,130 +0,0 @@
1
- /**
2
- * Subtitles Store Module
3
- *
4
- * Управляет состоянием субтитров: выбор, отображение, скачивание и парсинг.
5
- */
6
- import type { Readable, Writable } from "svelte/store";
7
- import type { IPlayer, ITextTrack } from "@vkontakte/videoplayer-core";
8
- import type { ISubscription, ITracer } from "@vkontakte/videoplayer-shared";
9
- import type { AppTracer } from "@vkontakte/videoplayer-shared";
10
- import { Subject } from "@vkontakte/videoplayer-shared";
11
- import type { VideoSubtitle, VideoSubtitleParsed, AvailableVideoSubtitle } from "../../../types";
12
- import type { IUIConfig } from "../../../config";
13
- import type { TSignature } from "../../../translation/types";
14
- /**
15
- * Зависимости модуля subtitles
16
- */
17
- export interface Deps {
18
- /** Плеер */
19
- player: IPlayer;
20
- /** UI конфиг */
21
- uiConfig: IUIConfig;
22
- /** Подписки */
23
- subscription: ISubscription;
24
- /** Функция перевода */
25
- t: TSignature;
26
- /** Стор языка интерфейса */
27
- interfaceLanguage$: Readable<string>;
28
- /** Стор точной позиции */
29
- positionExact$: Readable<number>;
30
- /** Стор скорости воспроизведения */
31
- currentPlaybackRate$: Readable<number>;
32
- /** Стор playing состояния */
33
- isPlaying$: Readable<boolean>;
34
- /** Стор minimal view */
35
- isMinimalView$: Readable<boolean>;
36
- /** Стор video id */
37
- videoId$: Writable<number | undefined>;
38
- /** Видео элемент */
39
- getVideoElement: () => HTMLVideoElement | null;
40
- /** Колбэки */
41
- callbacks: {
42
- onSubtitleOn?: (lang: string, id: string) => void;
43
- onSubtitleOff?: () => void;
44
- onAvailableSubtitlesChanged?: (subtitles: AvailableVideoSubtitle[]) => void;
45
- };
46
- /** Функция для получения сервиса статистики */
47
- getStatisticsService?: () => {
48
- oneStat?: {
49
- logError: (params: {
50
- errorType: string;
51
- fatal: boolean;
52
- }) => void;
53
- };
54
- } | undefined;
55
- /** Функция для получения AppTracer для error reporting */
56
- getAppTracer?: () => AppTracer | undefined;
57
- /** Tracer для логирования */
58
- tracer: ITracer;
59
- }
60
- /**
61
- * Состояние модуля subtitles
62
- */
63
- export interface SubtitlesStoreState {
64
- /** Текущие выбранные субтитры */
65
- currentSubtitle$: Readable<Omit<VideoSubtitle, "selected">>;
66
- /** Доступные текстовые треки */
67
- availableTextTracks$: Readable<ITextTrack[]>;
68
- /** Список доступных субтитров для UI */
69
- availableSubtitlesList$: Readable<VideoSubtitle[]>;
70
- /** Текущие субтитры для отображения */
71
- currentSubtitleCaptions$: Readable<VideoSubtitleParsed["texts"]>;
72
- /** Видимость авто-субтитров */
73
- isAutoSubtitleCaptionVisible$: Writable<boolean>;
74
- }
75
- /**
76
- * Экшены модуля subtitles для внутреннего использования
77
- */
78
- export interface SubtitlesStoreInternalActions {
79
- /** Установить субтитры */
80
- setSubtitle: (subtitle: VideoSubtitle | undefined, external: boolean) => void;
81
- /** Переключить субтитры */
82
- toggleSubtitle: (external: boolean) => void;
83
- /** Включить субтитры */
84
- subtitleOn: (external: boolean, id?: string) => void;
85
- /** Выключить субтитры */
86
- subtitleOff: (external: boolean) => void;
87
- /** Установить форсированный язык субтитров */
88
- setForcedSubtitlesLanguage: (language: string) => void;
89
- /** Обновить доступные субтитры */
90
- updateAvailableSubtitles: () => void;
91
- }
92
- /**
93
- * Экшены модуля subtitles для внешнего использования
94
- */
95
- export interface SubtitlesStoreExternalActions {
96
- /** Установить субтитры */
97
- setSubtitle: (subtitle: VideoSubtitle | undefined) => void;
98
- /** Переключить субтитры */
99
- toggleSubtitle: () => void;
100
- /**
101
- * Изменить субтитры
102
- */
103
- changeSubtitle: (enabled: boolean, id?: string) => void;
104
- }
105
- /**
106
- * Результат создания subtitles store
107
- */
108
- export interface SubtitlesStore {
109
- /** Состояние */
110
- state: SubtitlesStoreState;
111
- /** Экшены для внутреннего использования */
112
- actions: SubtitlesStoreInternalActions;
113
- /** Экшены для внешнего использования */
114
- externalActions: SubtitlesStoreExternalActions;
115
- /** События для статистики */
116
- events: {
117
- actionSetSubtitle$: Subject<string>;
118
- actionSubtitlesSwitched$: Subject<{
119
- enabled: boolean;
120
- lang: string;
121
- auto: boolean;
122
- }>;
123
- };
124
- /** Очистка ресурсов */
125
- destroy(): void;
126
- }
127
- /**
128
- * Создаёт subtitles store
129
- */
130
- export declare const createSubtitlesStore: (deps: Deps) => SubtitlesStore;
@@ -1,6 +0,0 @@
1
- /**
2
- * Subtitles Store Token
3
- */
4
- import { InjectionToken } from "@vkontakte/videoplayer-shared";
5
- import type { SubtitlesStore } from "./subtitlesStore.store";
6
- export declare const SUBTITLES_STORE_TOKEN: InjectionToken<SubtitlesStore>;