@vkontakte/videoplayer 1.1.73-dev.ecbcbb4c.0 → 1.1.74-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.js +87 -79
- package/es2015.esm.js +87 -79
- package/es2018.cjs.js +87 -79
- package/es2018.esm.js +87 -79
- package/es2024.cjs.js +87 -79
- package/es2024.esm.js +87 -79
- package/esnext.cjs.js +87 -79
- package/esnext.esm.js +87 -79
- package/evergreen.esm.js +87 -79
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.svelte.d.ts +8 -1
- package/types/components/Ads/admanWrapper.d.ts +5 -35
- package/types/components/Ads/types.d.ts +37 -0
- package/types/components/Root/types.d.ts +9 -3
- package/types/config.d.ts +19 -9
- package/types/index.d.ts +4 -3
- package/types/store/index.d.ts +17 -2
- package/types/translation/types.d.ts +1 -1
- package/types/types/index.d.ts +13 -6
- package/types/utils/dom.d.ts +1 -0
- package/types/utils/fullscreen.d.ts +1 -6
- package/types/components/Ads/utils.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.74-beta.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
57
|
"@adtech/rbadman": "2.2.57",
|
|
58
|
-
"@vkontakte/videoplayer-core": "2.0.
|
|
59
|
-
"@vkontakte/videoplayer-interactive": "1.0.
|
|
60
|
-
"@vkontakte/videoplayer-shared": "1.0.
|
|
61
|
-
"@vkontakte/videoplayer-statistics": "1.0.
|
|
58
|
+
"@vkontakte/videoplayer-core": "2.0.143-beta.0",
|
|
59
|
+
"@vkontakte/videoplayer-interactive": "1.0.49-beta.0",
|
|
60
|
+
"@vkontakte/videoplayer-shared": "1.0.71-beta.0",
|
|
61
|
+
"@vkontakte/videoplayer-statistics": "1.0.89-beta.0"
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ISDKConfig } from '../config';
|
|
2
2
|
import type { LanguageConfig } from '../translation/types';
|
|
3
3
|
import type { IVideoData, IVKVideoPlayerConfig } from '../types';
|
|
4
|
-
import { type QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
4
|
+
import { type QualityLimits, type Seconds } from '@vkontakte/videoplayer-shared';
|
|
5
5
|
import { InterfaceLanguage } from '@vkontakte/videoplayer-shared';
|
|
6
6
|
import { type PlaybackRate } from '@vkontakte/videoplayer-core';
|
|
7
7
|
import type { IStatContext } from '@vkontakte/videoplayer-statistics';
|
|
@@ -13,6 +13,10 @@ import { SlotsApi } from '../utils/webAPI/slotsApi';
|
|
|
13
13
|
export declare class VKVideoPlayer extends HTMLElement {
|
|
14
14
|
private svelteStubComponent?;
|
|
15
15
|
private svelteRootComponent?;
|
|
16
|
+
/**
|
|
17
|
+
* Слой, который живет на протяжении жизни плеера, не уничтожается между переключениями видео.
|
|
18
|
+
*/
|
|
19
|
+
private sveltePersistentLayerComponent?;
|
|
16
20
|
private svelteErrorComponent?;
|
|
17
21
|
private store?;
|
|
18
22
|
private microStoresRoot?;
|
|
@@ -49,6 +53,7 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
49
53
|
private readonly fatalError$;
|
|
50
54
|
constructor();
|
|
51
55
|
private connectedCallback;
|
|
56
|
+
private updatePersistentLayerProps;
|
|
52
57
|
private disconnectedCallback;
|
|
53
58
|
private initPlayerRootContainers;
|
|
54
59
|
private needToShowNextPrevButtons;
|
|
@@ -113,6 +118,7 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
113
118
|
* (если был выключен, например, ручным выбором качества пользователем)
|
|
114
119
|
*/
|
|
115
120
|
toggleHighQuality(value: boolean): void;
|
|
121
|
+
changeAudioStream(id: string): void;
|
|
116
122
|
addLanguage(config: LanguageConfig): void;
|
|
117
123
|
setLanguage(language: InterfaceLanguage | string): Promise<void>;
|
|
118
124
|
setLiveStart(videoData: IVideoData): void;
|
|
@@ -160,5 +166,6 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
160
166
|
*/
|
|
161
167
|
handleExternalKeyboardEvent(event: KeyboardEvent): boolean;
|
|
162
168
|
setAutoplayNext(autoplayNext: boolean): void;
|
|
169
|
+
getTotalViewTime(): Seconds | undefined;
|
|
163
170
|
private unmountComponent;
|
|
164
171
|
}
|
|
@@ -1,39 +1,9 @@
|
|
|
1
|
-
import type { Readable } from 'svelte/store';
|
|
2
1
|
import type { AdsTimeRemained } from '../../types';
|
|
3
2
|
import { AdsSection } from '../../types';
|
|
4
|
-
import type
|
|
5
|
-
import { type ILogger, type Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import { type ILogger } from '@vkontakte/videoplayer-shared';
|
|
6
4
|
import { Subject } from '@vkontakte/videoplayer-shared';
|
|
7
5
|
import type { IAdsState } from '../../store';
|
|
8
|
-
type ExternalActions
|
|
9
|
-
switchFromAdsToVideo: (callPlay?: boolean) => void;
|
|
10
|
-
switchFromVideoToAds: () => void;
|
|
11
|
-
setMuted: (muted: boolean) => void;
|
|
12
|
-
};
|
|
13
|
-
export type AdmanInitParams = {
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
isFullscreen: boolean;
|
|
17
|
-
isAutoplay: boolean;
|
|
18
|
-
slotId: number;
|
|
19
|
-
params?: AdsParams;
|
|
20
|
-
duration: number;
|
|
21
|
-
previewParam?: number;
|
|
22
|
-
adsContainer: HTMLElement;
|
|
23
|
-
adsVideoElement: HTMLVideoElement;
|
|
24
|
-
};
|
|
25
|
-
type IPlayerState = {
|
|
26
|
-
vsid: Readable<string | undefined>;
|
|
27
|
-
};
|
|
28
|
-
interface IConfig {
|
|
29
|
-
loadTimeout: Milliseconds;
|
|
30
|
-
initTimeout: Milliseconds;
|
|
31
|
-
runtimeTimeout: Milliseconds;
|
|
32
|
-
useAdmanFromNPM: boolean;
|
|
33
|
-
volumeMultiplier: number;
|
|
34
|
-
isVsidOriginal: boolean;
|
|
35
|
-
usePuid: boolean;
|
|
36
|
-
}
|
|
6
|
+
import type { AdmanInitParams, ExternalActions, IConfig, IPlayerState } from './types';
|
|
37
7
|
export declare class AdmanWrapper {
|
|
38
8
|
private adman;
|
|
39
9
|
private initialVolume;
|
|
@@ -50,8 +20,8 @@ export declare class AdmanWrapper {
|
|
|
50
20
|
private runtimeTimeout;
|
|
51
21
|
private useAdmanFromNPM;
|
|
52
22
|
private isVsidOriginal;
|
|
53
|
-
private usePuid;
|
|
54
23
|
private watchDogTimeout;
|
|
24
|
+
private externalApi?;
|
|
55
25
|
events: {
|
|
56
26
|
init$: Subject<number>;
|
|
57
27
|
loadStarted$: Subject<void>;
|
|
@@ -76,7 +46,7 @@ export declare class AdmanWrapper {
|
|
|
76
46
|
loadAdmanMailRu: (abortSignal: AbortSignal) => Promise<void>;
|
|
77
47
|
private loadAdmanNPM;
|
|
78
48
|
onAdmanLoadingError(): void;
|
|
79
|
-
initAdman(initParams: AdmanInitParams): void
|
|
49
|
+
initAdman(initParams: AdmanInitParams): Promise<void>;
|
|
80
50
|
private switchToVideo;
|
|
81
51
|
private setPostrollPassed;
|
|
82
52
|
togglePlay(): void;
|
|
@@ -103,5 +73,5 @@ export declare class AdmanWrapper {
|
|
|
103
73
|
skip(): void;
|
|
104
74
|
setPosition(position: number, duration: number): void;
|
|
105
75
|
destroy(): void;
|
|
76
|
+
private safeExternalCall;
|
|
106
77
|
}
|
|
107
|
-
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { Readable } from 'svelte/store';
|
|
3
|
+
export type ExternalActions = {
|
|
4
|
+
switchFromAdsToVideo: (callPlay?: boolean) => void;
|
|
5
|
+
switchFromVideoToAds: () => void;
|
|
6
|
+
setMuted: (muted: boolean) => void;
|
|
7
|
+
};
|
|
8
|
+
export type AdsParams = Record<string, unknown>;
|
|
9
|
+
export interface IAdmanInitParamsExternalApi {
|
|
10
|
+
videoGetAds?: (p: AdsParams) => Promise<Record<string, unknown> | null>;
|
|
11
|
+
videoTrackAdEvent?: (sectionKey: string, bannerId: string) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export type AdmanInitParams = {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
isFullscreen: boolean;
|
|
17
|
+
isAutoplay: boolean;
|
|
18
|
+
slotId: number;
|
|
19
|
+
params?: AdsParams;
|
|
20
|
+
duration: number;
|
|
21
|
+
previewParam?: number;
|
|
22
|
+
adsContainer: HTMLElement;
|
|
23
|
+
adsVideoElement: HTMLVideoElement;
|
|
24
|
+
paramsOverride?: AdsParams;
|
|
25
|
+
externalApi?: IAdmanInitParamsExternalApi;
|
|
26
|
+
};
|
|
27
|
+
export type IPlayerState = {
|
|
28
|
+
vsid: Readable<string | undefined>;
|
|
29
|
+
};
|
|
30
|
+
export interface IConfig {
|
|
31
|
+
loadTimeout: Milliseconds;
|
|
32
|
+
initTimeout: Milliseconds;
|
|
33
|
+
runtimeTimeout: Milliseconds;
|
|
34
|
+
useAdmanFromNPM: boolean;
|
|
35
|
+
volumeMultiplier: number;
|
|
36
|
+
isVsidOriginal: boolean;
|
|
37
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { IExternalTextTrack, ISources, PlaybackRate } from '@vkontakte/videoplayer-core';
|
|
2
2
|
import type { IStore } from '../../store';
|
|
3
|
-
import type {
|
|
3
|
+
import type { IMicroStoresRoot, IVideoLive, IVKVideoPlayerConfig } from '../../types';
|
|
4
4
|
import type { IUIConfig } from '../../config';
|
|
5
5
|
import type { Interactives } from '@vkontakte/videoplayer-interactive';
|
|
6
6
|
import KeyboardControls from '../KeyboardControls.svelte';
|
|
7
7
|
import type { QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
8
|
+
import type { AdmanInitParams } from '../Ads/types';
|
|
8
9
|
export interface RootProps {
|
|
9
10
|
sources: ISources | undefined;
|
|
10
11
|
store: IStore;
|
|
@@ -16,6 +17,7 @@ export interface RootProps {
|
|
|
16
17
|
interactiveContainer: HTMLElement | undefined;
|
|
17
18
|
interactiveController: Interactives | undefined;
|
|
18
19
|
subtitles: Omit<IExternalTextTrack, 'type'>[] | undefined;
|
|
20
|
+
subtitlesForcedLanguage?: string;
|
|
19
21
|
live: IVideoLive | undefined;
|
|
20
22
|
preload: boolean;
|
|
21
23
|
autoplay: boolean;
|
|
@@ -25,9 +27,9 @@ export interface RootProps {
|
|
|
25
27
|
canRewindLive: boolean;
|
|
26
28
|
showAds: boolean;
|
|
27
29
|
adsSlotId?: number | undefined;
|
|
28
|
-
adsParams?:
|
|
29
|
-
adsPreviewParam?: number | undefined;
|
|
30
|
+
adsParams?: AdmanInitParams['params'];
|
|
30
31
|
adsAutoplayParam?: boolean;
|
|
32
|
+
adsExternalApi?: AdmanInitParams['externalApi'];
|
|
31
33
|
duration?: number | undefined;
|
|
32
34
|
logoClickable: boolean;
|
|
33
35
|
logoHidden: boolean;
|
|
@@ -59,6 +61,7 @@ export interface RootExports {
|
|
|
59
61
|
setMuted: (muted: boolean) => void;
|
|
60
62
|
toggleSubtitle: () => void;
|
|
61
63
|
changeSubtitle: (enabled: boolean, id?: string) => void;
|
|
64
|
+
changeAudioStream: (id: string) => void;
|
|
62
65
|
hideControls: () => void;
|
|
63
66
|
showControls: () => void;
|
|
64
67
|
setVolume: (volume: number) => void;
|
|
@@ -75,3 +78,6 @@ export interface RootExports {
|
|
|
75
78
|
toggleTrafficSaving: (value: boolean) => void;
|
|
76
79
|
toggleHighQuality: (value: boolean) => void;
|
|
77
80
|
}
|
|
81
|
+
export interface PersistentLayerExports {
|
|
82
|
+
startVideoChangedAnimation: (prev: boolean) => void;
|
|
83
|
+
}
|
package/types/config.d.ts
CHANGED
|
@@ -8,6 +8,8 @@ type ForceOrRelay = boolean | undefined;
|
|
|
8
8
|
export declare enum LogoType {
|
|
9
9
|
VK = "vk",
|
|
10
10
|
VK_VIDEO = "vk_video",
|
|
11
|
+
APP_STORE = "app_store",
|
|
12
|
+
PLAY_MARKET = "play_market",
|
|
11
13
|
VK_VIDEO_MOBILE = "vk_video_mobile"
|
|
12
14
|
}
|
|
13
15
|
export interface IUIConfig {
|
|
@@ -33,12 +35,13 @@ export interface IUIConfig {
|
|
|
33
35
|
initTimeout: Milliseconds;
|
|
34
36
|
runtimeTimeout: Milliseconds;
|
|
35
37
|
slot?: number;
|
|
38
|
+
/** @deprecated, Вместо этого используйте paramsOverride: { preview } */
|
|
36
39
|
preview?: number;
|
|
40
|
+
paramsOverride?: Record<string, unknown>;
|
|
37
41
|
isMobileGoToSiteButton: boolean;
|
|
38
42
|
useAdmanFromNPM: boolean;
|
|
39
43
|
volumeMultiplier: number;
|
|
40
44
|
isVsidOriginal: boolean;
|
|
41
|
-
usePuid: boolean;
|
|
42
45
|
};
|
|
43
46
|
/**
|
|
44
47
|
* Если нет ранее сохранённого значения громкости будет использовано это
|
|
@@ -75,6 +78,7 @@ export interface IUIConfig {
|
|
|
75
78
|
};
|
|
76
79
|
hideThumbTimerAfterTouch: boolean;
|
|
77
80
|
preventPauseOnVideoClick: boolean;
|
|
81
|
+
returnFocusOnControlsHide: boolean;
|
|
78
82
|
sentry: {
|
|
79
83
|
dsn: string;
|
|
80
84
|
sampleRate: number;
|
|
@@ -156,18 +160,10 @@ export interface IUIConfig {
|
|
|
156
160
|
* Отображать ли анимацию смены статуса проигрывания.
|
|
157
161
|
*/
|
|
158
162
|
playbackStatusShow: boolean;
|
|
159
|
-
/**
|
|
160
|
-
* Продолжительность анимации.
|
|
161
|
-
*/
|
|
162
|
-
playbackStatusAnimationDuration: number;
|
|
163
163
|
/**
|
|
164
164
|
* Отображать ли анимацию при переключении видео на следующее или предыдущее.
|
|
165
165
|
*/
|
|
166
166
|
playbackStatusNextVideoShow: boolean;
|
|
167
|
-
/**
|
|
168
|
-
* Продолжительность анимации для переключения видео.
|
|
169
|
-
*/
|
|
170
|
-
playbackStatusNextVideoAnimationDuration: number;
|
|
171
167
|
/**
|
|
172
168
|
* Включает ранее выбранный язык субтитров при запуске видео
|
|
173
169
|
*/
|
|
@@ -190,6 +186,11 @@ export interface IUIConfig {
|
|
|
190
186
|
* сохраняет выбранные состояния плеера в localStorage только от user actions
|
|
191
187
|
*/
|
|
192
188
|
savePreferredStatesOnUserActionOnly: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Если включен то за зацикливание одного видео будет отвечать флаг loop
|
|
191
|
+
*/
|
|
192
|
+
useLoopSetting: boolean;
|
|
193
|
+
doubleForwardAvailable: boolean;
|
|
193
194
|
};
|
|
194
195
|
interactive: {
|
|
195
196
|
historyMaxLength: number;
|
|
@@ -220,6 +221,15 @@ export interface IUIConfig {
|
|
|
220
221
|
};
|
|
221
222
|
/** уникальный идентификатор пользователя для сохранения настроек */
|
|
222
223
|
userSalt: string;
|
|
224
|
+
/**
|
|
225
|
+
* Время, которое нужно зажимать горячую клавишу, чтобы включилось х2 ускорение.
|
|
226
|
+
*/
|
|
227
|
+
doubleForwardActivationTime: number;
|
|
228
|
+
playbackStatusAnimationDuration: number;
|
|
229
|
+
/**
|
|
230
|
+
* Продолжительность анимации для переключения видео.
|
|
231
|
+
*/
|
|
232
|
+
playbackStatusNextVideoAnimationDuration: number;
|
|
223
233
|
}
|
|
224
234
|
export declare const defaultConfig: IUIConfig;
|
|
225
235
|
export type IOptionalUIConfig = RecursivePartial<IUIConfig>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { VKVideoPlayer } from './VKVideoPlayer/index.svelte';
|
|
2
|
-
import type { IVKVideoPlayerConfig, IControlInfo, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData,
|
|
2
|
+
import type { IVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, IVideoEpisode, VideoPlayerView } from './types';
|
|
3
3
|
import type { LanguagePack, LanguageConfig } from './translation/types';
|
|
4
|
-
import type { ISDKConfig } from './config';
|
|
4
|
+
import type { LogoType as VKLogoType, ISDKConfig } from './config';
|
|
5
|
+
import type { AdsParams, IAdmanInitParamsExternalApi } from './components/Ads/types';
|
|
5
6
|
import type { ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek } from '@vkontakte/videoplayer-core';
|
|
6
7
|
import type { Milliseconds, QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
7
8
|
export { VERSION } from './env';
|
|
8
9
|
export declare const registerPlayerWebComponent: () => void;
|
|
9
10
|
export { type AdditionalSettingsMenuItem, MenuItemType, type AdditionalClickSettingsMenuItem, type AdditionalSwitchSettingsMenuItem, type AdditionalContextMenuItem, } from './components/Menus/subMenuTabs/types';
|
|
10
11
|
export { type AdditionalButton, ControlButtonType, } from './components/Controls/types';
|
|
11
|
-
export type { VKVideoPlayer, IVKVideoPlayerConfig, IControlInfo, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, QualityLimits, IVideoEpisode, ISDKConfig, VideoPlayerView, };
|
|
12
|
+
export type { VKVideoPlayer, IVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, QualityLimits, IVideoEpisode, ISDKConfig, VideoPlayerView, IAdmanInitParamsExternalApi, VKLogoType, };
|
|
12
13
|
export { GridTypes, } from './constans';
|
|
13
14
|
export { PlayerPhase, } from './types';
|
|
14
15
|
export { InterfaceLanguage, VKNumericLanguage, loadVKLangPack, } from '@vkontakte/videoplayer-shared';
|
package/types/store/index.d.ts
CHANGED
|
@@ -122,7 +122,6 @@ export interface IUIState {
|
|
|
122
122
|
ref$: Writable<HTMLElement | undefined>;
|
|
123
123
|
name$: Writable<string | undefined>;
|
|
124
124
|
};
|
|
125
|
-
aboutToGoNextVideo: Writable<'next' | 'prev' | undefined>;
|
|
126
125
|
/**
|
|
127
126
|
* Отключаем любое действие пользователя.
|
|
128
127
|
*/
|
|
@@ -131,6 +130,14 @@ export interface IUIState {
|
|
|
131
130
|
* Положение заголовка названия видео.
|
|
132
131
|
*/
|
|
133
132
|
videoTitleInfo: Writable<IControlInfo | undefined>;
|
|
133
|
+
/**
|
|
134
|
+
* Ускорение видео х2.
|
|
135
|
+
*/
|
|
136
|
+
doubleForwardOn$: Writable<boolean>;
|
|
137
|
+
/**
|
|
138
|
+
* Определяет, что двойное ускорение видео доступно.
|
|
139
|
+
*/
|
|
140
|
+
doubleForwardAvailable$: Readable<false>;
|
|
134
141
|
}
|
|
135
142
|
export interface IWebApi {
|
|
136
143
|
pictureInPictureApi?: IPictureInPictureApi;
|
|
@@ -140,6 +147,7 @@ export interface IWebApi {
|
|
|
140
147
|
export interface IStore {
|
|
141
148
|
initVideo: (config: IConfig & {
|
|
142
149
|
subtitles?: Omit<IExternalTextTrack, 'type'>[];
|
|
150
|
+
subtitlesForcedLanguage?: string;
|
|
143
151
|
}) => void;
|
|
144
152
|
videoId?: number;
|
|
145
153
|
isClip: boolean;
|
|
@@ -293,6 +301,7 @@ export interface IStore {
|
|
|
293
301
|
nextVideoAnnouncementAuto: () => void;
|
|
294
302
|
nextVideoAnnouncementCancel: () => void;
|
|
295
303
|
checkFullscreenSupport: () => boolean;
|
|
304
|
+
changeDoubleForwardOn: (enabled: boolean) => void;
|
|
296
305
|
};
|
|
297
306
|
external: {
|
|
298
307
|
firstStart: (showAds: boolean) => void;
|
|
@@ -323,6 +332,7 @@ export interface IStore {
|
|
|
323
332
|
setQuality: (quality: VideoQualityUI) => void;
|
|
324
333
|
setTrafficSavingEnabled: (trafficSavingEnabled: boolean) => void;
|
|
325
334
|
setHighQualityEnabled: (highQualityEnabled: boolean) => void;
|
|
335
|
+
changeAudioStream: (id: string) => void;
|
|
326
336
|
};
|
|
327
337
|
};
|
|
328
338
|
callbacks?: IVKVideoPlayerCallbacks;
|
|
@@ -361,6 +371,11 @@ interface IStoreParams {
|
|
|
361
371
|
additionalContextMenuItems: AdditionalContextMenuItem[];
|
|
362
372
|
playPrevVideo: () => void;
|
|
363
373
|
playNextVideo: () => void;
|
|
374
|
+
/**
|
|
375
|
+
* playPrevVideo или playNextVideo могут не вызваться, если обработка следующего видео находится на стороне интегарции,
|
|
376
|
+
* поэтому используем данный колбэк.
|
|
377
|
+
*/
|
|
378
|
+
onVideoChanged: (prev: boolean) => void;
|
|
364
379
|
looped?: boolean;
|
|
365
380
|
statistics?: UIOneStat;
|
|
366
381
|
saveRate: boolean;
|
|
@@ -372,5 +387,5 @@ interface IStoreParams {
|
|
|
372
387
|
* Store приложения.
|
|
373
388
|
* Если будет слишком большим - можно разделить его на модули
|
|
374
389
|
*/
|
|
375
|
-
export declare const createStore: ({ interfaceLanguage, isCyrillicRelatedInterface, videoId, isClip, isLiveCatchUpMode, statAuthToken, isAudioDisabled, canDownload, callbacks, webApi, videoEpisodes, previewThumbsData, uiConfig, coreConfig, player: playerInstance, disabledControls, isInteractive, interactiveRanges$, isInteractiveTime$, replayInteractive, stopPlayer, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalSettingsMenuItems, additionalContextMenuItems, playPrevVideo, playNextVideo, looped, statistics: uiStatistics, saveRate, internalsExposure, playerView, playerId, }: IStoreParams) => IStore;
|
|
390
|
+
export declare const createStore: ({ interfaceLanguage, isCyrillicRelatedInterface, videoId, isClip, isLiveCatchUpMode, statAuthToken, isAudioDisabled, canDownload, callbacks, webApi, videoEpisodes, previewThumbsData, uiConfig, coreConfig, player: playerInstance, disabledControls, isInteractive, interactiveRanges$, isInteractiveTime$, replayInteractive, stopPlayer, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalSettingsMenuItems, additionalContextMenuItems, playPrevVideo, playNextVideo, onVideoChanged, looped, statistics: uiStatistics, saveRate, internalsExposure, playerView, playerId, }: IStoreParams) => IStore;
|
|
376
391
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InterfaceLanguage } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
export type Key = 'auto_quality_invariant' | 'auto_quality' | 'menu_quality' | 'menu_playback_rate' | 'menu_traffic_saving' | 'menu_report' | 'menu_pip' | 'menu_pip_close' | 'menu_copy_video_link' | 'menu_copy_video_link_with_timestamp' | 'menu_video_rotate' | 'menu_video_loop_on' | 'menu_video_loop_off' | 'menu_chromecast' | 'menu_copy_debug' | 'menu_save_debug' | 'menu_debug_overlay' | 'menu_copy_embed_code' | 'pip_dummy_title' | 'submenu_traffic_saving' | 'submenu_quality' | 'submenu_playback_rate' | 'submenu_settings' | 'submenu_audio_languages' | 'auto_quality_option' | 'playing_ads' | 'skip_ads_now' | 'skip_ads_after' | 'visit_advertiser' | 'aria_timeline' | 'aria_timeline_value' | 'doubletap_seek_step' | 'playback_rate_1' | 'playback_rate' | 'video360' | 'subtitles_caption' | 'subtitles_auto' | 'subtitles_off' | 'subtitles_auto_caption' | 'subtitles_turn_on' | 'subtitles_turn_off' | 'traffic_saving_off' | 'traffic_saving_on' | 'traffic_saving_helper_text' | 'tooltip_previous' | 'tooltip_restart' | 'tooltip_play' | 'tooltip_pause' | 'tooltip_next' | 'tooltip_button_disabled' | 'tooltip_interactive_go_back' | 'tooltip_interactive_go_back_disabled' | 'tooltip_interactive_go_back_disabled_first' | 'tooltip_interactive_go_back_disabled_limit' | 'tooltip_chapter_without_interactive' | 'tooltip_interactive_of_chapter_completed' | 'tooltip_interactive_seek' | 'tooltip_interactive_graph_off' | 'tooltip_interactive_graph_on' | 'tooltip_live' | 'tooltip_episodes' | 'tooltip_volume' | 'tooltip_volume_muted' | 'tooltip_sound_unavailable' | 'tooltip_settings_on' | 'tooltip_subtitles_off' | 'tooltip_settings_off' | 'tooltip_subtitles_on' | 'tooltip_fullscreen_off' | 'tooltip_fullscreen_on' | 'tooltip_chromecast_off' | 'tooltip_chromecast_on' | 'tooltip_episode_finished' | 'tooltip_episode_unfinished' | 'tooltip_disabled_when_interactive' | 'tooltip_disabled_when_graph_on' | 'tooltip_interactive_interaction_time_indicator' | 'tooltip_vk_logo' | 'tooltip_vk_video_logo' | 'tooltip_autoplay_off' | 'tooltip_autoplay_on' | 'tooltip_context_menu_open' | 'tooltip_context_menu_close' | 'download_video_caption' | 'hotkey_helper_current_volume' | 'hotkey_map_modal_title' | 'hotkey_map_modal_close_btn_text' | 'hotkey_map_group_title_common' | 'hotkey_map_group_title_playback' | 'hotkey_map_group_title_subtitles' | 'hotkey_map_group_title_episodes' | 'hotkey_map_item_mute_description' | 'hotkey_map_item_mute_value' | 'hotkey_map_item_volume_down_description' | 'hotkey_map_item_volume_down_value' | 'hotkey_map_item_volume_up_description' | 'hotkey_map_item_volume_up_value' | 'hotkey_map_item_pip_description' | 'hotkey_map_item_pip_value' | 'hotkey_map_item_full_screen_description' | 'hotkey_map_item_full_screen_value' | 'hotkey_map_item_show_context_menu_description' | 'hotkey_map_item_show_context_menu_value' | 'hotkey_map_item_show_hotkey_map_description' | 'hotkey_map_item_show_hotkey_map_value' | 'hotkey_map_item_play_toggle_description' | 'hotkey_map_item_play_toggle_value' | 'hotkey_map_item_seek_backward_description' | 'hotkey_map_item_seek_backward_value' | 'hotkey_map_item_seek_forward_description' | 'hotkey_map_item_seek_forward_value' | 'hotkey_map_item_fast_seek_backward_description' | 'hotkey_map_item_fast_seek_backward_value' | 'hotkey_map_item_fast_seek_forward_description' | 'hotkey_map_item_fast_seek_forward_value' | 'hotkey_map_item_rate_down_description' | 'hotkey_map_item_rate_down_value' | 'hotkey_map_item_rate_up_description' | 'hotkey_map_item_rate_up_value' | 'hotkey_map_item_prev_frame_description' | 'hotkey_map_item_prev_frame_value' | 'hotkey_map_item_next_frame_description' | 'hotkey_map_item_next_frame_value' | 'hotkey_map_item_jump_seek_description' | 'hotkey_map_item_jump_seek_value' | 'hotkey_map_item_subtitles_toggle_description' | 'hotkey_map_item_subtitles_toggle_value' | 'hotkey_map_item_prev_episode_description' | 'hotkey_map_item_prev_episode_pc_value' | 'hotkey_map_item_prev_episode_mac_value' | 'hotkey_map_item_next_episode_description' | 'hotkey_map_item_next_episode_pc_value' | 'hotkey_map_item_next_episode_mac_value' | 'hotkey_map_item_next_video_description' | 'hotkey_map_item_next_video_value' | 'hotkey_map_item_prev_video_description' | 'hotkey_map_item_prev_video_value' | 'waiting_live_day_value' | 'waiting_live_hour_value' | 'waiting_live_minute_value' | 'waiting_live_second_value' | 'waiting_live_colon' | 'waiting_live_upcoming_title' | 'waiting_live_timer_title' | 'waiting_live_recover_title' | 'waiting_record_title' | 'aria_label_submenu_traffic_saving' | 'aria_label_submenu_back' | 'aria_label_menu_quality' | 'aria_label_menu_rate' | 'aria_label_menu_subtitle' | 'aria_label_menu_download' | 'aria_label_new_tab_alert' | 'aria_label_menu_debug_overlay' | 'aria_label_menu_rotate' | 'aria_label_menu_loop' | 'aria_label_debug_panel' | 'aria_label_context_menu' | 'aria_label_video_player' | 'aria_label_spherical_control' | 'aria_label_menu_audio_languages' | 'aria_label_settings' | 'aria_label_autoplay' | 'menu_audio_languages' | 'audio_stream_display_language_label' | 'audio_stream_display_language_label_index' | 'audio_stream_display_label_index' | 'audio_stream_display_language_index' | 'audio_stream_display_unknown' | 'end_screen_next_video' | 'end_screen_recommended_video' | 'other_quality' | 'high_quality' | 'high_quality_description' | 'auto_quality_limit' | 'traffic_saving_quality' | 'traffic_saving_quality_description' | 'quality_applience' | 'quality_applience_action' | 'default_quality_for_any_video' | 'slow_video_notification_button' | 'slow_video_notification_force_description' | 'slow_video_notification_suggest_description';
|
|
2
|
+
export type Key = 'auto_quality_invariant' | 'auto_quality' | 'menu_quality' | 'menu_playback_rate' | 'menu_traffic_saving' | 'menu_report' | 'menu_pip' | 'menu_pip_close' | 'menu_copy_video_link' | 'menu_copy_video_link_with_timestamp' | 'menu_video_rotate' | 'menu_video_loop_on' | 'menu_video_loop_off' | 'menu_chromecast' | 'menu_copy_debug' | 'menu_save_debug' | 'menu_debug_overlay' | 'menu_copy_embed_code' | 'pip_dummy_title' | 'submenu_traffic_saving' | 'submenu_quality' | 'submenu_playback_rate' | 'submenu_settings' | 'submenu_audio_languages' | 'auto_quality_option' | 'playing_ads' | 'skip_ads_now' | 'skip_ads_after' | 'visit_advertiser' | 'aria_timeline' | 'aria_timeline_value' | 'doubletap_seek_step' | 'playback_rate_1' | 'playback_rate' | 'video360' | 'subtitles_caption' | 'subtitles_auto' | 'subtitles_off' | 'subtitles_auto_caption' | 'subtitles_turn_on' | 'subtitles_turn_off' | 'traffic_saving_off' | 'traffic_saving_on' | 'traffic_saving_helper_text' | 'tooltip_previous' | 'tooltip_restart' | 'tooltip_play' | 'tooltip_pause' | 'tooltip_next' | 'tooltip_button_disabled' | 'tooltip_interactive_go_back' | 'tooltip_interactive_go_back_disabled' | 'tooltip_interactive_go_back_disabled_first' | 'tooltip_interactive_go_back_disabled_limit' | 'tooltip_chapter_without_interactive' | 'tooltip_interactive_of_chapter_completed' | 'tooltip_interactive_seek' | 'tooltip_interactive_graph_off' | 'tooltip_interactive_graph_on' | 'tooltip_live' | 'tooltip_episodes' | 'tooltip_volume' | 'tooltip_volume_muted' | 'tooltip_sound_unavailable' | 'tooltip_settings_on' | 'tooltip_subtitles_off' | 'tooltip_settings_off' | 'tooltip_subtitles_on' | 'tooltip_fullscreen_off' | 'tooltip_fullscreen_on' | 'tooltip_chromecast_off' | 'tooltip_chromecast_on' | 'tooltip_episode_finished' | 'tooltip_episode_unfinished' | 'tooltip_disabled_when_interactive' | 'tooltip_disabled_when_graph_on' | 'tooltip_interactive_interaction_time_indicator' | 'tooltip_vk_logo' | 'tooltip_vk_video_logo' | 'tooltip_autoplay_off' | 'tooltip_autoplay_on' | 'tooltip_context_menu_open' | 'tooltip_context_menu_close' | 'download_video_caption' | 'hotkey_helper_current_volume' | 'hotkey_map_modal_title' | 'hotkey_map_modal_close_btn_text' | 'hotkey_map_group_title_common' | 'hotkey_map_group_title_playback' | 'hotkey_map_group_title_subtitles' | 'hotkey_map_group_title_episodes' | 'hotkey_map_item_mute_description' | 'hotkey_map_item_mute_value' | 'hotkey_map_item_volume_down_description' | 'hotkey_map_item_volume_down_value' | 'hotkey_map_item_volume_up_description' | 'hotkey_map_item_volume_up_value' | 'hotkey_map_item_pip_description' | 'hotkey_map_item_pip_value' | 'hotkey_map_item_full_screen_description' | 'hotkey_map_item_full_screen_value' | 'hotkey_map_item_show_context_menu_description' | 'hotkey_map_item_show_context_menu_value' | 'hotkey_map_item_show_hotkey_map_description' | 'hotkey_map_item_show_hotkey_map_value' | 'hotkey_map_item_play_toggle_description' | 'hotkey_map_item_play_toggle_value' | 'hotkey_map_item_seek_backward_description' | 'hotkey_map_item_seek_backward_value' | 'hotkey_map_item_seek_forward_description' | 'hotkey_map_item_seek_forward_value' | 'hotkey_map_item_fast_seek_backward_description' | 'hotkey_map_item_fast_seek_backward_value' | 'hotkey_map_item_fast_seek_forward_description' | 'hotkey_map_item_fast_seek_forward_value' | 'hotkey_map_item_rate_down_description' | 'hotkey_map_item_rate_down_value' | 'hotkey_map_item_rate_up_description' | 'hotkey_map_item_rate_up_value' | 'hotkey_map_item_prev_frame_description' | 'hotkey_map_item_prev_frame_value' | 'hotkey_map_item_next_frame_description' | 'hotkey_map_item_next_frame_value' | 'hotkey_map_item_jump_seek_description' | 'hotkey_map_item_jump_seek_value' | 'hotkey_map_item_subtitles_toggle_description' | 'hotkey_map_item_subtitles_toggle_value' | 'hotkey_map_item_prev_episode_description' | 'hotkey_map_item_prev_episode_pc_value' | 'hotkey_map_item_prev_episode_mac_value' | 'hotkey_map_item_next_episode_description' | 'hotkey_map_item_next_episode_pc_value' | 'hotkey_map_item_next_episode_mac_value' | 'hotkey_map_item_next_video_description' | 'hotkey_map_item_next_video_value' | 'hotkey_map_item_prev_video_description' | 'hotkey_map_item_prev_video_value' | 'waiting_live_day_value' | 'waiting_live_hour_value' | 'waiting_live_minute_value' | 'waiting_live_second_value' | 'waiting_live_colon' | 'waiting_live_upcoming_title' | 'waiting_live_timer_title' | 'waiting_live_recover_title' | 'waiting_record_title' | 'aria_label_submenu_traffic_saving' | 'aria_label_submenu_back' | 'aria_label_menu_quality' | 'aria_label_menu_rate' | 'aria_label_menu_subtitle' | 'aria_label_menu_download' | 'aria_label_new_tab_alert' | 'aria_label_menu_debug_overlay' | 'aria_label_menu_rotate' | 'aria_label_menu_loop' | 'aria_label_debug_panel' | 'aria_label_context_menu' | 'aria_label_video_player' | 'aria_label_spherical_control' | 'aria_label_menu_audio_languages' | 'aria_label_settings' | 'aria_label_autoplay' | 'menu_audio_languages' | 'audio_stream_display_language_label' | 'audio_stream_display_language_label_index' | 'audio_stream_display_label_index' | 'audio_stream_display_language_index' | 'audio_stream_display_unknown' | 'end_screen_next_video' | 'end_screen_recommended_video' | 'other_quality' | 'high_quality' | 'high_quality_description' | 'auto_quality_limit' | 'traffic_saving_quality' | 'traffic_saving_quality_description' | 'quality_applience' | 'quality_applience_action' | 'default_quality_for_any_video' | 'slow_video_notification_button' | 'slow_video_notification_force_description' | 'slow_video_notification_suggest_description' | 'double_forward_label';
|
|
3
3
|
export type LanguagePack = Record<Key, string>;
|
|
4
4
|
export type LanguageConfig = {
|
|
5
5
|
language: string;
|
package/types/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { VideoQuality, VideoFormat, ISources, IExternalTextTrack } from '@vkontakte/videoplayer-core';
|
|
1
|
+
import type { VideoQuality, VideoFormat, ISources, IExternalTextTrack, IAudioStream } from '@vkontakte/videoplayer-core';
|
|
2
2
|
import type { IValueObservable, InterfaceLanguage, Subscription, IRectangle, DevNullEntry } from '@vkontakte/videoplayer-shared';
|
|
3
3
|
import type { Chapter, Manifest, ManifestVideo, VideoInfo, Interactives, IInteractiveOptions } from '@vkontakte/videoplayer-interactive';
|
|
4
4
|
import { PlaybackState } from '@vkontakte/videoplayer-core';
|
|
@@ -12,6 +12,7 @@ import type { IUIStatistics } from '../services/statistics';
|
|
|
12
12
|
import { UISentry } from '../services/sentry';
|
|
13
13
|
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from '../components/Menus/subMenuTabs/types';
|
|
14
14
|
import type { AdditionalDesktopControlPanelButton } from '../components/Controls/types';
|
|
15
|
+
import type { AdmanInitParams } from '../components/Ads/types';
|
|
15
16
|
export declare const enum UIType {
|
|
16
17
|
DESKTOP = "desktop",
|
|
17
18
|
MOBILE = "mobile"
|
|
@@ -36,6 +37,8 @@ export interface IVKVideoPlayerCallbacks {
|
|
|
36
37
|
onSubtitleOff?: () => void;
|
|
37
38
|
onSubtitleOn?: (lang: string, id: string) => void;
|
|
38
39
|
onAvailableSubtitlesChanged?: (subtitles: AvailableVideoSubtitle[]) => void;
|
|
40
|
+
onAvailableAudioStreamsChanged?: (audioStreams: AvailableAudioStream[]) => void;
|
|
41
|
+
onAudioStreamChanged?: (id: string) => void;
|
|
39
42
|
onAudioDisabledHint?: () => void;
|
|
40
43
|
onAudioDoesNotExistHint?: () => void;
|
|
41
44
|
onEpisodeClicked?: (byKeyboard: boolean) => void;
|
|
@@ -163,7 +166,6 @@ export interface IVKVideoPlayerStatistics extends Partial<IUIStatistics> {
|
|
|
163
166
|
export interface IVKVideoPlayerSentry extends Partial<UISentry> {
|
|
164
167
|
config: ISDKConfig['ui']['sentry'];
|
|
165
168
|
}
|
|
166
|
-
export type AdsParams = Record<string, unknown>;
|
|
167
169
|
export interface IVideoEpisodesNormalizedTimeline {
|
|
168
170
|
from: number;
|
|
169
171
|
width: number;
|
|
@@ -188,7 +190,7 @@ export interface ITimelinePreviewThumbsData {
|
|
|
188
190
|
isUV: boolean;
|
|
189
191
|
links: string[];
|
|
190
192
|
}
|
|
191
|
-
export type VideoLiveStatus = '
|
|
193
|
+
export type VideoLiveStatus = 'no_video' | 'deleted' | 'waiting' | 'started' | 'finished' | 'upcoming' | 'failed' | 'postlive';
|
|
192
194
|
export interface IVideoLive {
|
|
193
195
|
status: VideoLiveStatus;
|
|
194
196
|
startTime?: number;
|
|
@@ -200,12 +202,14 @@ export interface IVideoDataBase {
|
|
|
200
202
|
/**
|
|
201
203
|
* duration используется только для инициализации адмана.
|
|
202
204
|
*/
|
|
203
|
-
duration?:
|
|
204
|
-
adsParams?:
|
|
205
|
+
duration?: AdmanInitParams['duration'];
|
|
206
|
+
adsParams?: AdmanInitParams['params'];
|
|
207
|
+
adsExternalApi?: AdmanInitParams['externalApi'];
|
|
205
208
|
videoEpisodes?: IVideoEpisode[];
|
|
206
209
|
previewThumbsData?: ITimelinePreviewThumbsData;
|
|
207
210
|
isClip?: boolean;
|
|
208
211
|
subtitles?: Array<Omit<IExternalTextTrack, 'type'>>;
|
|
212
|
+
subtitlesForcedLanguage?: string;
|
|
209
213
|
sources?: ISources;
|
|
210
214
|
live?: IVideoLive;
|
|
211
215
|
}
|
|
@@ -257,6 +261,7 @@ export interface IVKVideoPlayerConfig {
|
|
|
257
261
|
preload?: boolean;
|
|
258
262
|
autoplay?: boolean;
|
|
259
263
|
repeat?: boolean;
|
|
264
|
+
loop?: boolean;
|
|
260
265
|
volume?: number;
|
|
261
266
|
muted?: boolean;
|
|
262
267
|
fromTime?: number;
|
|
@@ -264,7 +269,8 @@ export interface IVKVideoPlayerConfig {
|
|
|
264
269
|
supportLink?: string;
|
|
265
270
|
showAds?: boolean;
|
|
266
271
|
adsSlotId?: number;
|
|
267
|
-
adsParams?:
|
|
272
|
+
adsParams?: AdmanInitParams['params'];
|
|
273
|
+
/** @deprecated */
|
|
268
274
|
adsPreviewParam?: number;
|
|
269
275
|
adsAutoplayParam?: boolean;
|
|
270
276
|
interfaceLanguage?: InterfaceLanguage | string;
|
|
@@ -485,6 +491,7 @@ export type AvailableVideoSubtitle = {
|
|
|
485
491
|
language: string;
|
|
486
492
|
title: string;
|
|
487
493
|
};
|
|
494
|
+
export type AvailableAudioStream = Required<Pick<IAudioStream, 'id' | 'language' | 'label'>>;
|
|
488
495
|
export type VideoSubtitle = {
|
|
489
496
|
value: string;
|
|
490
497
|
displayValue: string;
|
package/types/utils/dom.d.ts
CHANGED
|
@@ -14,14 +14,9 @@ interface DocumentElementWithFullscreen extends HTMLElement {
|
|
|
14
14
|
mozRequestFullScreen?: () => Promise<void>;
|
|
15
15
|
webkitRequestFullscreen?: () => Promise<void>;
|
|
16
16
|
}
|
|
17
|
-
interface IosSafariVideoElementWithFullscreen extends HTMLVideoElement {
|
|
18
|
-
webkitSupportsFullscreen?: boolean;
|
|
19
|
-
webkitEnterFullscreen?: () => void;
|
|
20
|
-
webkitExitFullscreen?: () => void;
|
|
21
|
-
}
|
|
22
17
|
export declare const requestFullscreen: (element: DocumentElementWithFullscreen) => Promise<void>;
|
|
23
18
|
export declare const exitFullscreen: (doc: DocumentWithFullscreen) => Promise<void>;
|
|
24
|
-
export declare const isSupported: (doc: DocumentWithFullscreen,
|
|
19
|
+
export declare const isSupported: (doc: DocumentWithFullscreen, isIOS?: boolean) => boolean;
|
|
25
20
|
export declare const exitIosSafariVideoElementFullscreen: (videoElement: HTMLVideoElement) => void;
|
|
26
21
|
export declare const getDocumentFullscreenElement: () => Element | undefined;
|
|
27
22
|
export declare const checkIsFullscreen: () => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getPuid10Val: (width: number, height: number) => number;
|