@vkontakte/videoplayer 1.1.93-dev.cd80d9e13.0 → 1.1.93-dev.cd8858cd1.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 +9 -9
- package/es2015.esm.js +8 -8
- package/esnext.cjs +32 -32
- package/esnext.esm.js +12 -12
- package/evergreen.esm.js +12 -12
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.svelte.d.ts +1 -0
- package/types/config.d.ts +6 -0
- package/types/store/composition.d.ts +9 -1
- package/types/store/connectors/statisticsConnector.d.ts +15 -0
- package/types/store/index.d.ts +1 -1
- package/types/store/modules/index.d.ts +9 -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 +40 -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 -7
- package/types/translation/types.d.ts +1 -0
- package/types/types/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.93-dev.
|
|
3
|
+
"version": "1.1.93-dev.cd8858cd1.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.162-dev.
|
|
47
|
-
"@vkontakte/videoplayer-interactive": "1.0.68-dev.
|
|
48
|
-
"@vkontakte/videoplayer-shared": "1.0.91-dev.
|
|
49
|
-
"@vkontakte/videoplayer-statistics": "1.0.108-dev.
|
|
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"
|
|
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;
|
package/types/config.d.ts
CHANGED
|
@@ -231,8 +231,14 @@ export interface IUIConfig {
|
|
|
231
231
|
mobileSubMenuStretchHeight: boolean;
|
|
232
232
|
/** перенос кнопки с логотипом вк из верхнего-левого угла в контролы около кнопки звука */
|
|
233
233
|
mobileVkLogoViewOnBottomControls: boolean;
|
|
234
|
+
/** включить выбор аудиодорожки, по умолчанию, первую из списка в adaptation set. */
|
|
235
|
+
chooseFirstAudioStreamFromAdaptationSet: boolean;
|
|
234
236
|
/** показывает подписи с типом звуковой дорожки, например, "Объемный звук 5.1" */
|
|
235
237
|
audioChannelConfiguration: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Используем ли стратегию, что если callback слушатель RecoveryError не передан, то отключаем recovery флоу.
|
|
240
|
+
*/
|
|
241
|
+
canProviderHandleNetworkRecoverableError: boolean;
|
|
236
242
|
};
|
|
237
243
|
/**
|
|
238
244
|
* Отключает вызов колбэка uiInfo.onPlayerSizeChanged при ресайзе обычного pip
|
|
@@ -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, InteractiveControlsOpacityStore, NotificationsStore, PictureInPictureStore, SeekToInteractiveDisabledTooltipStore, ShowInteractiveTimeIndicatorTooltipStore } from "./modules";
|
|
5
|
+
import type { FakeIsPlayingStore, GraphIsOpenedStore, InteractiveControlsOpacityStore, LanguageStore, NotificationsStore, PictureInPictureStore, 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: {
|
|
@@ -18,6 +22,10 @@ export interface ICompositionResult {
|
|
|
18
22
|
showInteractiveTimeIndicatorTooltipStore: ShowInteractiveTimeIndicatorTooltipStore;
|
|
19
23
|
graphIsOpenedStore: GraphIsOpenedStore;
|
|
20
24
|
interactiveControlsOpacityStore: InteractiveControlsOpacityStore;
|
|
25
|
+
languageStore: LanguageStore;
|
|
26
|
+
subtitlesStore: SubtitlesStore;
|
|
27
|
+
qualityStore: QualityStore;
|
|
28
|
+
playbackRateStore: PlaybackRateStore;
|
|
21
29
|
};
|
|
22
30
|
/** Очистка ресурсов */
|
|
23
31
|
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, 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, 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";
|
|
@@ -16,3 +18,9 @@ export type { SeekToInteractiveDisabledTooltipStoreState, SeekToInteractiveDisab
|
|
|
16
18
|
export { seekToInteractiveDisabledTooltipModule, SEEK_TO_INTERACTIVE_DISABLED_TOOLTIP_STORE_TOKEN } from "./seekToInteractiveDisabledTooltipStore";
|
|
17
19
|
export type { ShowInteractiveTimeIndicatorTooltipStoreState, ShowInteractiveTimeIndicatorTooltipStore, ShowInteractiveTimeIndicatorTooltipStoreActions, ShowInteractiveTimeIndicatorTooltipStoreDeps } from "./showInteractiveTimeIndicatorTooltipStore";
|
|
18
20
|
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 } 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 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,40 @@
|
|
|
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;
|
|
@@ -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";
|
|
@@ -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;
|
package/types/store/types.d.ts
CHANGED
|
@@ -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, IValueObservable, QualityLimits, VideoQuality } from "@vkontakte/videoplayer-shared";
|
|
3
|
+
import type { AppTracer, IError, ILogger, InterfaceLanguage, InternalsExposure, IRectangle, ISubject, IValueObservable, IValueSubject, 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
|
|
8
|
+
import type { Key } 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,8 +272,7 @@ export interface IStoreInternalActions {
|
|
|
272
272
|
holdCamera(): void;
|
|
273
273
|
releaseCamera(): void;
|
|
274
274
|
downloadVideo: () => void;
|
|
275
|
-
|
|
276
|
-
setLanguage: (language: InterfaceLanguage | string) => void;
|
|
275
|
+
setLanguage: (language: InterfaceLanguage | string) => Promise<void>;
|
|
277
276
|
nextMovie: (movieId: number) => void;
|
|
278
277
|
correctSeekTimeToInteractive: (time: number) => number;
|
|
279
278
|
replayInteractive?: () => void;
|
|
@@ -334,18 +333,25 @@ export interface IStoreInitVideoConfig extends ICoreInitVideoConfig {
|
|
|
334
333
|
canDownload?: boolean;
|
|
335
334
|
previewThumbsData?: ITimelinePreviewThumbsData;
|
|
336
335
|
subtitles?: Omit<IExternalTextTrack, "type">[];
|
|
337
|
-
subtitlesForcedLanguage?: string;
|
|
338
336
|
unitedVideoId?: number;
|
|
339
337
|
videoEpisodes?: IVideoEpisode[];
|
|
340
338
|
}
|
|
339
|
+
export interface IStoreEvents {
|
|
340
|
+
actionRewind$: ISubject<void>;
|
|
341
|
+
actionSeek$: IValueSubject<SeekAction | ThinOneStat.ActionSeekType>;
|
|
342
|
+
actionQuality$: ISubject<ThinOneStat.ActionQualityType>;
|
|
343
|
+
nextMovie$: ISubject<number>;
|
|
344
|
+
}
|
|
341
345
|
export interface IStore {
|
|
342
346
|
initVideo: (config: IStoreInitVideoConfig) => void;
|
|
343
347
|
videoId$: Writable<number | undefined>;
|
|
344
348
|
playerPhase: IPlayerPhase;
|
|
345
349
|
interfaceLanguage$: Readable<InterfaceLanguage | string>;
|
|
350
|
+
interfaceLanguageUpdated$: ISubject<void>;
|
|
346
351
|
isCyrillicRelatedInterface$: Readable<boolean>;
|
|
347
352
|
interactiveData?: IInteractiveData;
|
|
348
|
-
vsid$:
|
|
353
|
+
vsid$: Writable<string | undefined>;
|
|
354
|
+
events: IStoreEvents;
|
|
349
355
|
state: IPlayerState;
|
|
350
356
|
ui: IUIState;
|
|
351
357
|
ads: IAdsState;
|
|
@@ -357,10 +363,11 @@ export interface IStore {
|
|
|
357
363
|
callbacks?: IVKVideoPlayerCallbacks;
|
|
358
364
|
setUiCallbacks: (uiCallbacks: IVKVideoPlayerUICallbacks) => void;
|
|
359
365
|
initAdmanWrapper: VoidFunction;
|
|
366
|
+
initOnFinishedCallback: VoidFunction;
|
|
360
367
|
resetAdsState: VoidFunction;
|
|
361
368
|
updateAdmanWrapperSubscriptions: VoidFunction;
|
|
362
|
-
updateStatisticsSubscriptions: VoidFunction;
|
|
363
369
|
updateAppTracerSubscriptions: VoidFunction;
|
|
370
|
+
updateTracerSubscriptions: VoidFunction;
|
|
364
371
|
getLogger: () => ILogger;
|
|
365
372
|
getPlayer: () => IPlayer;
|
|
366
373
|
destroy(): void;
|
|
@@ -413,4 +420,5 @@ export interface IStoreParams {
|
|
|
413
420
|
getAppTracer: () => AppTracer | undefined;
|
|
414
421
|
getAdmanWrapper: () => AdmanWrapper | undefined;
|
|
415
422
|
logger: ILogger;
|
|
423
|
+
adsEnabled: boolean;
|
|
416
424
|
}
|
package/types/types/index.d.ts
CHANGED