@vkontakte/videoplayer 1.1.95 → 1.1.96-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs +10 -10
- package/es2015.esm.js +11 -11
- package/esnext.cjs +10 -10
- package/esnext.esm.js +11 -11
- package/evergreen.esm.js +11 -11
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.svelte.d.ts +8 -1
- package/types/components/Ads/admanWrapper.d.ts +2 -1
- package/types/components/Ads/types.d.ts +1 -1
- package/types/components/Menus/subMenuTabs/types.d.ts +7 -0
- package/types/components/Menus/utils/getSubMenusStack.svelte.d.ts +1 -0
- package/types/config.d.ts +4 -3
- package/types/index.d.ts +3 -3
- package/types/store/composition.d.ts +10 -1
- package/types/store/connectors/statisticsConnector.d.ts +15 -0
- package/types/store/index.d.ts +1 -1
- package/types/store/modules/highlightedMenuItemsStore/highlightedMenuItems.module.d.ts +3 -0
- package/types/store/modules/highlightedMenuItemsStore/highlightedMenuItems.store.d.ts +21 -0
- package/types/store/modules/highlightedMenuItemsStore/highlightedMenuItems.token.d.ts +5 -0
- package/types/store/modules/highlightedMenuItemsStore/index.d.ts +3 -0
- package/types/store/modules/index.d.ts +10 -1
- package/types/store/modules/infrastructure/index.d.ts +1 -1
- package/types/store/modules/infrastructure/infrastructure.module.d.ts +6 -1
- package/types/store/modules/infrastructure/infrastructure.token.d.ts +5 -1
- package/types/store/modules/languageStore/index.d.ts +9 -0
- package/types/store/modules/languageStore/languageStore.module.d.ts +3 -0
- package/types/store/modules/languageStore/languageStore.store.d.ts +51 -0
- package/types/store/modules/languageStore/languageStore.token.d.ts +6 -0
- package/types/store/modules/playbackRateStore/index.d.ts +6 -0
- package/types/store/modules/playbackRateStore/playbackRateStore.module.d.ts +8 -0
- package/types/store/modules/playbackRateStore/playbackRateStore.store.d.ts +61 -0
- package/types/store/modules/playbackRateStore/playbackRateStore.token.d.ts +6 -0
- package/types/store/modules/qualityStore/index.d.ts +6 -0
- package/types/store/modules/qualityStore/qualityStore.module.d.ts +8 -0
- package/types/store/modules/qualityStore/qualityStore.store.d.ts +37 -0
- package/types/store/modules/qualityStore/qualityStore.token.d.ts +6 -0
- package/types/store/modules/subtitlesStore/index.d.ts +9 -0
- package/types/store/modules/subtitlesStore/subtitlesStore.module.d.ts +8 -0
- package/types/store/modules/subtitlesStore/subtitlesStore.store.d.ts +130 -0
- package/types/store/modules/subtitlesStore/subtitlesStore.token.d.ts +6 -0
- package/types/store/types.d.ts +15 -9
- package/types/translation/types.d.ts +1 -0
- package/types/types/index.d.ts +1 -4
- package/types/utils/sanitizeSvg.d.ts +5 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.96-beta.0",
|
|
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.
|
|
47
|
-
"@vkontakte/videoplayer-interactive": "1.0.
|
|
48
|
-
"@vkontakte/videoplayer-shared": "1.0.
|
|
49
|
-
"@vkontakte/videoplayer-statistics": "1.0.
|
|
46
|
+
"@vkontakte/videoplayer-core": "2.0.165-beta.0",
|
|
47
|
+
"@vkontakte/videoplayer-interactive": "1.0.71-beta.0",
|
|
48
|
+
"@vkontakte/videoplayer-shared": "1.0.94-beta.0",
|
|
49
|
+
"@vkontakte/videoplayer-statistics": "1.0.111-beta.0"
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -7,7 +7,7 @@ import type { PlaybackRate } from "@vkontakte/videoplayer-core";
|
|
|
7
7
|
import { type IStatContext } from "@vkontakte/videoplayer-statistics";
|
|
8
8
|
import { ThinOneStat } from "@vkontakte/videoplayer-statistics";
|
|
9
9
|
import { AnnotationsApi } from "../utils/webAPI/annotationsApi/annotationsApi";
|
|
10
|
-
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from "../components/Menus/subMenuTabs/types";
|
|
10
|
+
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem, MenuItemHighlight, RootMenuId } from "../components/Menus/subMenuTabs/types";
|
|
11
11
|
import type { AdditionalButton } from "../components/Controls/types";
|
|
12
12
|
import { SlotsApi } from "../utils/webAPI/slotsApi";
|
|
13
13
|
import { HTMLElement } from "./HTMLElement";
|
|
@@ -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;
|
|
@@ -158,6 +159,7 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
158
159
|
*/
|
|
159
160
|
toggleHighQuality(value: boolean): void;
|
|
160
161
|
changeAudioStream(id: string): void;
|
|
162
|
+
setHighlightedMenuItems(items: Partial<Record<RootMenuId, MenuItemHighlight>> | undefined): void;
|
|
161
163
|
addLanguage(config: LanguageConfig): void;
|
|
162
164
|
setLanguage(language: InterfaceLanguage | string): Promise<void>;
|
|
163
165
|
private replaceVideoDataInConfig;
|
|
@@ -193,6 +195,11 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
193
195
|
updateStatContext(statContext: Partial<IStatContext | ThinOneStat.IStatContext>): void;
|
|
194
196
|
handleTimerNextVideo(state: boolean): void;
|
|
195
197
|
togglePictureInPicture(): void;
|
|
198
|
+
/**
|
|
199
|
+
* Переключает видимость меню настроек.
|
|
200
|
+
* @param force Если true — открыть, если false — закрыть, если не указано — toggle.
|
|
201
|
+
*/
|
|
202
|
+
toggleSettingsMenu(force?: boolean): void;
|
|
196
203
|
focus(): void;
|
|
197
204
|
/**
|
|
198
205
|
* Восстанавливает фокус на последнем сфокусированном элементе в плеере.
|
|
@@ -24,7 +24,7 @@ export declare class AdmanWrapper {
|
|
|
24
24
|
private isVsidOriginal;
|
|
25
25
|
private preserveMutedState;
|
|
26
26
|
private stopAdmanOnSwitch;
|
|
27
|
-
private
|
|
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;
|
|
@@ -28,6 +28,7 @@ export declare enum RootMenuId {
|
|
|
28
28
|
COPY_DATA = "copy-data",
|
|
29
29
|
DEBUG_INFO = "debug-info"
|
|
30
30
|
}
|
|
31
|
+
export declare const SETTINGS_MENU_ID: "settings";
|
|
31
32
|
export type Context = {
|
|
32
33
|
closeSettingsMenu: () => void;
|
|
33
34
|
isMobile: boolean;
|
|
@@ -111,6 +112,12 @@ export declare enum MenuItemType {
|
|
|
111
112
|
CLICK = "CLICK",
|
|
112
113
|
SWITCH = "SWITCH"
|
|
113
114
|
}
|
|
115
|
+
export interface MenuItemHighlight {
|
|
116
|
+
/** SVG как строка или URL на SVG-файл */
|
|
117
|
+
svg: string;
|
|
118
|
+
/** CSS стили для контейнера с SVG */
|
|
119
|
+
styleSvgContainer?: string;
|
|
120
|
+
}
|
|
114
121
|
export declare enum SubMenuItemType {
|
|
115
122
|
OPEN_SUB_MENU = "OPEN_SUB_MENU",
|
|
116
123
|
SELECT_VALUE = "SELECT_VALUE"
|
package/types/config.d.ts
CHANGED
|
@@ -53,10 +53,11 @@ export interface IAdsConfig {
|
|
|
53
53
|
preserveMutedState: boolean;
|
|
54
54
|
stopAdmanOnSwitch: boolean;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
57
|
-
* Если true —
|
|
56
|
+
* Валидировать данные баннера перед стартом рекламы.
|
|
57
|
+
* Если true — проверяется validateBannerData (сейчас: duration > 0).
|
|
58
|
+
* При невалидных данных started$ не стреляется, видео сразу продолжает воспроизведение.
|
|
58
59
|
*/
|
|
59
|
-
|
|
60
|
+
validateAdBannerData: boolean;
|
|
60
61
|
}
|
|
61
62
|
export interface IUIConfig {
|
|
62
63
|
isMobile: ForceOrRelay;
|
package/types/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
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";
|
|
6
6
|
import type { Milliseconds, QualityLimits } from "@vkontakte/videoplayer-shared";
|
|
7
7
|
export { VERSION } from "./env";
|
|
8
8
|
export declare const registerPlayerWebComponent: () => void;
|
|
9
|
-
export { type AdditionalSettingsMenuItem, MenuItemType, type AdditionalClickSettingsMenuItem, type AdditionalSwitchSettingsMenuItem, type AdditionalContextMenuItem } from "./components/Menus/subMenuTabs/types";
|
|
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,24 +1,33 @@
|
|
|
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, 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: {
|
|
14
18
|
fakeIsPlayingStore: FakeIsPlayingStore;
|
|
15
19
|
graphIsOpenedStore: GraphIsOpenedStore;
|
|
16
20
|
interactiveControlsOpacityStore: InteractiveControlsOpacityStore;
|
|
21
|
+
highlightedMenuItemsStore: HighlightedMenuItemsStore;
|
|
17
22
|
notificationsStore: NotificationsStore;
|
|
18
23
|
pictureInPictureStore: PictureInPictureStore;
|
|
19
24
|
qoeStore: IQoeStore;
|
|
20
25
|
seekToInteractiveDisabledTooltipStore: SeekToInteractiveDisabledTooltipStore;
|
|
21
26
|
showInteractiveTimeIndicatorTooltipStore: ShowInteractiveTimeIndicatorTooltipStore;
|
|
27
|
+
languageStore: LanguageStore;
|
|
28
|
+
subtitlesStore: SubtitlesStore;
|
|
29
|
+
qualityStore: QualityStore;
|
|
30
|
+
playbackRateStore: PlaybackRateStore;
|
|
22
31
|
};
|
|
23
32
|
/** Очистка ресурсов */
|
|
24
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;
|
package/types/store/index.d.ts
CHANGED
|
@@ -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,
|
|
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;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HighlightedMenuItems Store
|
|
3
|
+
*
|
|
4
|
+
* Управляет подсветкой пунктов меню настроек.
|
|
5
|
+
*/
|
|
6
|
+
import type { Writable } from "svelte/store";
|
|
7
|
+
import type { MenuItemHighlight, RootMenuId } from "../../../components/Menus/subMenuTabs/types";
|
|
8
|
+
export interface HighlightedMenuItemsStoreState {
|
|
9
|
+
items$: Writable<Partial<Record<RootMenuId, MenuItemHighlight>> | undefined>;
|
|
10
|
+
}
|
|
11
|
+
export interface HighlightedMenuItemsStoreActions {
|
|
12
|
+
/** Установить подсвеченные пункты меню */
|
|
13
|
+
setHighlightedMenuItems(items: Partial<Record<RootMenuId, MenuItemHighlight>> | undefined): void;
|
|
14
|
+
/** Очистить подсветку */
|
|
15
|
+
clear(): void;
|
|
16
|
+
}
|
|
17
|
+
export interface HighlightedMenuItemsStore {
|
|
18
|
+
state: HighlightedMenuItemsStoreState;
|
|
19
|
+
actions: HighlightedMenuItemsStoreActions;
|
|
20
|
+
}
|
|
21
|
+
export declare const createHighlightedMenuItemsStore: () => HighlightedMenuItemsStore;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { InjectionToken } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
export declare const HIGHLIGHTED_MENU_ITEMS_STORE_TOKEN: InjectionToken<HIGHLIGHTED_MENU_ITEMS_STORE_STORE>;
|
|
3
|
+
import type { HighlightedMenuItemsStore } from "./highlightedMenuItems.store";
|
|
4
|
+
type HIGHLIGHTED_MENU_ITEMS_STORE_STORE = HighlightedMenuItemsStore;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { HighlightedMenuItemsStoreState, HighlightedMenuItemsStore, HighlightedMenuItemsStoreActions } from "./highlightedMenuItems.store";
|
|
2
|
+
export { highlightedMenuItemsModule } from "./highlightedMenuItems.module";
|
|
3
|
+
export { HIGHLIGHTED_MENU_ITEMS_STORE_TOKEN } from "./highlightedMenuItems.token";
|
|
@@ -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,3 +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";
|
|
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,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
|
+
* 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
|
+
* 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,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,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";
|