@vkontakte/videoplayer 1.1.96-dev.cd28586c7.0 → 1.1.96

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 (37) hide show
  1. package/es2015.cjs +9 -9
  2. package/es2015.esm.js +10 -10
  3. package/esnext.cjs +9 -9
  4. package/esnext.esm.js +10 -10
  5. package/evergreen.esm.js +10 -10
  6. package/package.json +5 -5
  7. package/types/VKVideoPlayer/index.svelte.d.ts +1 -0
  8. package/types/components/Ads/admanWrapper.d.ts +2 -1
  9. package/types/components/Ads/types.d.ts +1 -1
  10. package/types/config.d.ts +14 -3
  11. package/types/index.d.ts +2 -2
  12. package/types/store/composition.d.ts +9 -1
  13. package/types/store/connectors/statisticsConnector.d.ts +15 -0
  14. package/types/store/index.d.ts +1 -1
  15. package/types/store/modules/index.d.ts +10 -3
  16. package/types/store/modules/infrastructure/index.d.ts +1 -1
  17. package/types/store/modules/infrastructure/infrastructure.module.d.ts +6 -1
  18. package/types/store/modules/infrastructure/infrastructure.token.d.ts +5 -1
  19. package/types/store/modules/languageStore/index.d.ts +9 -0
  20. package/types/store/modules/languageStore/languageStore.module.d.ts +3 -0
  21. package/types/store/modules/languageStore/languageStore.store.d.ts +51 -0
  22. package/types/store/modules/languageStore/languageStore.token.d.ts +6 -0
  23. package/types/store/modules/playbackRateStore/index.d.ts +6 -0
  24. package/types/store/modules/playbackRateStore/playbackRateStore.module.d.ts +8 -0
  25. package/types/store/modules/playbackRateStore/playbackRateStore.store.d.ts +61 -0
  26. package/types/store/modules/playbackRateStore/playbackRateStore.token.d.ts +6 -0
  27. package/types/store/modules/qualityStore/index.d.ts +6 -0
  28. package/types/store/modules/qualityStore/qualityStore.module.d.ts +8 -0
  29. package/types/store/modules/qualityStore/qualityStore.store.d.ts +37 -0
  30. package/types/store/modules/qualityStore/qualityStore.token.d.ts +6 -0
  31. package/types/store/modules/subtitlesStore/index.d.ts +9 -0
  32. package/types/store/modules/subtitlesStore/subtitlesStore.module.d.ts +8 -0
  33. package/types/store/modules/subtitlesStore/subtitlesStore.store.d.ts +130 -0
  34. package/types/store/modules/subtitlesStore/subtitlesStore.token.d.ts +6 -0
  35. package/types/store/types.d.ts +15 -9
  36. package/types/translation/types.d.ts +1 -0
  37. package/types/types/index.d.ts +1 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer",
3
- "version": "1.1.96-dev.cd28586c7.0",
3
+ "version": "1.1.96",
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.165-dev.cd28586c7.0",
47
- "@vkontakte/videoplayer-interactive": "1.0.71-dev.cd28586c7.0",
48
- "@vkontakte/videoplayer-shared": "1.0.94-dev.cd28586c7.0",
49
- "@vkontakte/videoplayer-statistics": "1.0.111-dev.cd28586c7.0"
46
+ "@vkontakte/videoplayer-core": "2.0.165",
47
+ "@vkontakte/videoplayer-interactive": "1.0.71",
48
+ "@vkontakte/videoplayer-shared": "1.0.94",
49
+ "@vkontakte/videoplayer-statistics": "1.0.111"
50
50
  }
51
51
  }
@@ -69,6 +69,7 @@ export declare class VKVideoPlayer extends HTMLElement {
69
69
  private readonly createOneStat;
70
70
  private createThinOneStat;
71
71
  private createStatisticsForVideo;
72
+ private attachStatistics;
72
73
  private createAppTracerForVideo;
73
74
  private createAdsParamsForVideo;
74
75
  private createPlayer;
@@ -24,7 +24,7 @@ export declare class AdmanWrapper {
24
24
  private isVsidOriginal;
25
25
  private preserveMutedState;
26
26
  private stopAdmanOnSwitch;
27
- private skipNoFillAds;
27
+ private validateAdBannerData;
28
28
  private watchDogTimeout;
29
29
  private externalApi?;
30
30
  events: {
@@ -64,6 +64,7 @@ export declare class AdmanWrapper {
64
64
  startPreroll(): void;
65
65
  startPostroll(): void;
66
66
  private onAdsReady;
67
+ private validateBannerData;
67
68
  private onAdStarted;
68
69
  private onAdTimeRemained;
69
70
  private onAdPaused;
@@ -17,5 +17,5 @@ export interface IConfig {
17
17
  isVsidOriginal: boolean;
18
18
  preserveMutedState: boolean;
19
19
  stopAdmanOnSwitch: boolean;
20
- skipNoFillAds: boolean;
20
+ validateAdBannerData: boolean;
21
21
  }
package/types/config.d.ts CHANGED
@@ -53,14 +53,25 @@ export interface IAdsConfig {
53
53
  preserveMutedState: boolean;
54
54
  stopAdmanOnSwitch: boolean;
55
55
  /**
56
- * Пропускать no-fill рекламу (баннер с нулевой длительностью).
57
- * Если true — started$ не стреляется, видео сразу продолжает воспроизведение.
56
+ * Валидировать данные баннера перед стартом рекламы.
57
+ * Если true — проверяется validateBannerData (сейчас: duration > 0).
58
+ * При невалидных данных started$ не стреляется, видео сразу продолжает воспроизведение.
58
59
  */
59
- skipNoFillAds: boolean;
60
+ validateAdBannerData: boolean;
60
61
  }
61
62
  export interface IUIConfig {
62
63
  isMobile: ForceOrRelay;
63
64
  keepPlayerElement: boolean;
65
+ /**
66
+ * не будет использовано если keepPlayerElement: false
67
+ * @default true
68
+ */
69
+ keepPlayerElementOnMobile: boolean;
70
+ /**
71
+ * не будет использовано если keepPlayerElement: false
72
+ * @default true
73
+ */
74
+ keepPlayerElementOnSafari: boolean;
64
75
  disableInvisibleComponentsTimeout: Milliseconds;
65
76
  debugLog: boolean | {
66
77
  tag?: string;
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VKVideoPlayer } from "./VKVideoPlayer/index.svelte";
2
- import type { AdsParams, IAdmanInitParamsExternalApi, IVKVideoPlayerConfig, IUpdatableVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, IVideoEpisode, IQoeConfig, IQoePoll, IQoeResult, IQoeQuestion, IQoeCallbacks, QoePollTranslations, VideoPlayerView } from "./types";
2
+ import type { AdsParams, IAdmanInitParamsExternalApi, IVKVideoPlayerConfig, IUpdatableVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, IVideoEpisode, IQoeConfig, IQoeButtonOnlyConfig, IQoePoll, IQoeResult, IQoeQuestion, IQoeCallbacks, QoePollTranslations, VideoPlayerView } from "./types";
3
3
  import type { LanguagePack, LanguageConfig } from "./translation/types";
4
4
  import type { LogoType as VKLogoType, IAdsConfig, ISDKConfig, IDpipConfig } from "./config";
5
5
  import type { ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek } from "@vkontakte/videoplayer-core";
@@ -8,7 +8,7 @@ export { VERSION } from "./env";
8
8
  export declare const registerPlayerWebComponent: () => void;
9
9
  export { type AdditionalSettingsMenuItem, MenuItemType, type AdditionalClickSettingsMenuItem, type AdditionalSwitchSettingsMenuItem, type AdditionalContextMenuItem, RootMenuId, SubMenuId, SETTINGS_MENU_ID } from "./components/Menus/subMenuTabs/types";
10
10
  export { type AdditionalButton, ControlButtonType } from "./components/Controls/types";
11
- export type { VKVideoPlayer, IVKVideoPlayerConfig, IUpdatableVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, QualityLimits, IAdsConfig, IVideoEpisode, IDpipConfig, IQoeConfig, IQoePoll, IQoeResult, IQoeQuestion, IQoeCallbacks, QoePollTranslations, ISDKConfig, VideoPlayerView, IAdmanInitParamsExternalApi, VKLogoType };
11
+ export type { VKVideoPlayer, IVKVideoPlayerConfig, IUpdatableVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, QualityLimits, IAdsConfig, IVideoEpisode, IDpipConfig, IQoeConfig, IQoeButtonOnlyConfig, IQoePoll, IQoeResult, IQoeQuestion, IQoeCallbacks, QoePollTranslations, ISDKConfig, VideoPlayerView, IAdmanInitParamsExternalApi, VKLogoType };
12
12
  export { GridTypes } from "./constans";
13
13
  export { PlayerPhase } from "./types";
14
14
  export { isPiPSupported, isDpipSupported } from "./utils/webAPI/pictureInPictureApi";
@@ -1,13 +1,17 @@
1
1
  import type { IUIConfig } from "../config";
2
2
  import type { IVKVideoPlayerConfig } from "../types";
3
+ import type { IUIStatistics } from "../services/statistics";
3
4
  import type { IStore } from "./index";
4
- import type { FakeIsPlayingStore, GraphIsOpenedStore, HighlightedMenuItemsStore, InteractiveControlsOpacityStore, NotificationsStore, PictureInPictureStore, IQoeStore, SeekToInteractiveDisabledTooltipStore, ShowInteractiveTimeIndicatorTooltipStore } from "./modules";
5
+ import type { FakeIsPlayingStore, GraphIsOpenedStore, HighlightedMenuItemsStore, InteractiveControlsOpacityStore, LanguageStore, NotificationsStore, PictureInPictureStore, IQoeStore, SeekToInteractiveDisabledTooltipStore, ShowInteractiveTimeIndicatorTooltipStore, SubtitlesStore, QualityStore, PlaybackRateStore } from "./modules";
6
+ import type { AppTracer } from "@vkontakte/videoplayer-shared";
5
7
  import type { Interactives } from "@vkontakte/videoplayer-interactive";
6
8
  export interface ICompositionParams {
7
9
  legacyStore: IStore;
8
10
  uiConfig: IUIConfig;
9
11
  config: IVKVideoPlayerConfig;
10
12
  interactiveController: Interactives | undefined;
13
+ getStatisticsService: () => IUIStatistics | undefined;
14
+ getAppTracer: () => AppTracer | undefined;
11
15
  }
12
16
  export interface ICompositionResult {
13
17
  stores: {
@@ -20,6 +24,10 @@ export interface ICompositionResult {
20
24
  qoeStore: IQoeStore;
21
25
  seekToInteractiveDisabledTooltipStore: SeekToInteractiveDisabledTooltipStore;
22
26
  showInteractiveTimeIndicatorTooltipStore: ShowInteractiveTimeIndicatorTooltipStore;
27
+ languageStore: LanguageStore;
28
+ subtitlesStore: SubtitlesStore;
29
+ qualityStore: QualityStore;
30
+ playbackRateStore: PlaybackRateStore;
23
31
  };
24
32
  /** Очистка ресурсов */
25
33
  destroy(): void;
@@ -0,0 +1,15 @@
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;
@@ -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, 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;
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, 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, registerInfrastructure } from "./infrastructure";
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";
2
2
  export type { InfrastructureParams } from "./infrastructure";
3
3
  export { registerModules } from "./utils";
4
4
  export type { Module } from "./utils";
@@ -8,6 +8,8 @@ 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";
11
13
  export type { NotificationsStoreState, NotificationsStore, NotificationsStoreActions, NotificationsStoreDeps } from "./notificationsStore";
12
14
  export { notificationsModule, NOTIFICATIONS_STORE_TOKEN } from "./notificationsStore";
13
15
  export type { PictureInPictureStoreState, PictureInPictureStore, PictureInPictureStoreDeps } from "./pictureInPictureStore";
@@ -18,5 +20,10 @@ export type { SeekToInteractiveDisabledTooltipStoreState, SeekToInteractiveDisab
18
20
  export { seekToInteractiveDisabledTooltipModule, SEEK_TO_INTERACTIVE_DISABLED_TOOLTIP_STORE_TOKEN } from "./seekToInteractiveDisabledTooltipStore";
19
21
  export type { ShowInteractiveTimeIndicatorTooltipStoreState, ShowInteractiveTimeIndicatorTooltipStore, ShowInteractiveTimeIndicatorTooltipStoreActions, ShowInteractiveTimeIndicatorTooltipStoreDeps } from "./showInteractiveTimeIndicatorTooltipStore";
20
22
  export { showInteractiveTimeIndicatorTooltipModule, SHOW_INTERACTIVE_TIME_INDICATOR_TOOLTIP_STORE_TOKEN } from "./showInteractiveTimeIndicatorTooltipStore";
21
- export type { HighlightedMenuItemsStoreState, HighlightedMenuItemsStore, HighlightedMenuItemsStoreActions } from "./highlightedMenuItemsStore";
22
- export { highlightedMenuItemsModule, HIGHLIGHTED_MENU_ITEMS_STORE_TOKEN } from "./highlightedMenuItemsStore";
23
+ export { type HighlightedMenuItemsStoreState, type HighlightedMenuItemsStore, type HighlightedMenuItemsStoreActions, highlightedMenuItemsModule, HIGHLIGHTED_MENU_ITEMS_STORE_TOKEN } from "./highlightedMenuItemsStore";
24
+ export type { SubtitlesStoreState, SubtitlesStoreInternalActions, SubtitlesStoreExternalActions, SubtitlesStore, SubtitlesStoreDeps } from "./subtitlesStore";
25
+ export { subtitlesModule, SUBTITLES_STORE_TOKEN } from "./subtitlesStore";
26
+ export type { QualityStoreDeps, QualityStoreState, QualityStore } from "./qualityStore";
27
+ export { qualityModule, QUALITY_STORE_TOKEN } from "./qualityStore";
28
+ export type { PlaybackRateStoreDeps, PlaybackRateStoreState, PlaybackRateStoreActions, PlaybackRateStore } from "./playbackRateStore";
29
+ 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 } from "./infrastructure.token";
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";
2
2
  export { registerInfrastructure } from "./infrastructure.module";
3
3
  export type { InfrastructureParams } from "./infrastructure.module";
@@ -3,17 +3,22 @@
3
3
  *
4
4
  * Регистрация базовых зависимостей и store-модулей.
5
5
  */
6
- import type { IDIContainer, Subscription } from "@vkontakte/videoplayer-shared";
6
+ import type { IDIContainer, Subscription, AppTracer } 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";
11
13
  export interface InfrastructureParams {
12
14
  legacyStore: IStore;
13
15
  uiConfig: IUIConfig;
14
16
  config: IVKVideoPlayerConfig;
15
17
  interactiveController: Interactives | undefined;
16
18
  subscription: Subscription;
19
+ tracer: ITracer;
20
+ getStatisticsService: () => IUIStatistics | undefined;
21
+ getAppTracer: () => AppTracer | undefined;
17
22
  }
18
23
  /**
19
24
  * Регистрирует базовые зависимости в DI контейнере
@@ -4,12 +4,13 @@
4
4
  * Core DI токены для базовых зависимостей.
5
5
  */
6
6
  import { InjectionToken } from "@vkontakte/videoplayer-shared";
7
- import type { Subscription, ILogger } from "@vkontakte/videoplayer-shared";
7
+ import type { Subscription, ILogger, ITracer, AppTracer } 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";
13
14
  /** Общий subscription для всех rxjs подписок */
14
15
  export declare const SUBSCRIPTION_TOKEN: InjectionToken<Subscription>;
15
16
  /** Инстанс плеера */
@@ -24,3 +25,6 @@ export declare const PLAYER_CONFIG_TOKEN: InjectionToken<IVKVideoPlayerConfig>;
24
25
  export declare const LEGACY_STORE_TOKEN: InjectionToken<IStore>;
25
26
  /** Интерактивный контроллер */
26
27
  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>;
@@ -0,0 +1,9 @@
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";
@@ -0,0 +1,3 @@
1
+ import { type LanguageStore } from "./languageStore.store";
2
+ import type { Module } from "../utils";
3
+ export declare const languageModule: Module<LanguageStore>;
@@ -0,0 +1,51 @@
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;
@@ -0,0 +1,6 @@
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>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Playback Rate Store Module
3
+ */
4
+ export { createPlaybackRateStore, type PlaybackRateStoreDeps, type PlaybackRateStoreState, type PlaybackRateStoreActions, type PlaybackRateStore } from "./playbackRateStore.store";
5
+ export { playbackRateModule } from "./playbackRateStore.module";
6
+ export { PLAYBACK_RATE_STORE_TOKEN } from "./playbackRateStore.token";
@@ -0,0 +1,8 @@
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>;
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Playback Rate Store Module
3
+ *
4
+ * Управляет состоянием скорости воспроизведения: доступные скорости.
5
+ */
6
+ import type { Readable, Writable } from "svelte/store";
7
+ import type { IPlayer, PlaybackRate } from "@vkontakte/videoplayer-core";
8
+ import type { ITracer } from "@vkontakte/videoplayer-shared";
9
+ import type { IUIConfig } from "../../../config";
10
+ import type { Key } from "../../../translation/types";
11
+ import type { PlayerPhase, VideoPlaybackRate } from "../../../types";
12
+ /**
13
+ * Зависимости модуля playback rate
14
+ */
15
+ export interface PlaybackRateStoreDeps {
16
+ /** Плеер */
17
+ player: IPlayer;
18
+ /** UI конфиг */
19
+ uiConfig: IUIConfig;
20
+ /** Функция перевода */
21
+ t: (key: Key, params?: Record<string, string>) => string;
22
+ /** Признак интерактивного видео */
23
+ isInteractive: boolean;
24
+ /** Tracer для логирования */
25
+ tracer: ITracer;
26
+ /** Флаг сохранения скорости в localStorage */
27
+ saveRate: boolean;
28
+ /** Функция сохранения предпочитаемой скорости */
29
+ savePreferredRate: (rate: PlaybackRate) => void;
30
+ /** Признак воспроизведения */
31
+ isPlaying$: Readable<boolean>;
32
+ /** Фаза плеера */
33
+ playerPhase$: Readable<PlayerPhase>;
34
+ }
35
+ /**
36
+ * Состояние модуля playback rate
37
+ */
38
+ export interface PlaybackRateStoreState {
39
+ /** Доступные скорости воспроизведения */
40
+ availablePlaybackRates$: Readable<VideoPlaybackRate[]>;
41
+ /** Флаг доступности смены скорости */
42
+ canChangePlaybackSpeed$: Readable<boolean | undefined>;
43
+ /** Признак активации двойной перемотки вперёд */
44
+ doubleForwardOn$: Writable<boolean>;
45
+ /** Признак доступности двойной перемотки вперёд */
46
+ doubleForwardAvailable$: Readable<boolean>;
47
+ }
48
+ export interface PlaybackRateStoreActions {
49
+ setPlaybackRate: (playbackRate: PlaybackRate, saveToLocalStorage?: boolean) => void;
50
+ incrementPlaybackRate: () => VideoPlaybackRate;
51
+ decrementPlaybackRate: () => VideoPlaybackRate;
52
+ changeDoubleForwardOn: (enabled: boolean) => void;
53
+ }
54
+ export interface PlaybackRateStore {
55
+ state: PlaybackRateStoreState;
56
+ actions: PlaybackRateStoreActions;
57
+ }
58
+ /**
59
+ * Создаёт playback rate store
60
+ */
61
+ export declare const createPlaybackRateStore: (deps: PlaybackRateStoreDeps) => PlaybackRateStore;
@@ -0,0 +1,6 @@
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>;
@@ -0,0 +1,6 @@
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";
@@ -0,0 +1,8 @@
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>;
@@ -0,0 +1,37 @@
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;
@@ -0,0 +1,6 @@
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>;
@@ -0,0 +1,9 @@
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";
@@ -0,0 +1,8 @@
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>;
@@ -0,0 +1,130 @@
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;
@@ -0,0 +1,6 @@
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>;