@vkontakte/videoplayer 1.1.74-dev.2444f53a.0 → 1.1.74-dev.d2cefd48.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 +71 -68
- package/es2015.esm.js +71 -68
- package/es2018.cjs.js +71 -68
- package/es2018.esm.js +71 -68
- package/es2024.cjs.js +70 -67
- package/es2024.esm.js +70 -67
- package/esnext.cjs.js +70 -67
- package/esnext.esm.js +70 -67
- package/evergreen.esm.js +70 -67
- package/package.json +5 -5
- 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 +4 -2
- package/types/config.d.ts +3 -1
- package/types/index.d.ts +4 -3
- package/types/store/utils.d.ts +1 -1
- package/types/types/index.d.ts +5 -4
- package/types/utils/dom.d.ts +1 -0
- 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.74-dev.
|
|
3
|
+
"version": "1.1.74-dev.d2cefd48.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.143-dev.
|
|
59
|
-
"@vkontakte/videoplayer-interactive": "1.0.49-dev.
|
|
60
|
-
"@vkontakte/videoplayer-shared": "1.0.71-dev.
|
|
61
|
-
"@vkontakte/videoplayer-statistics": "1.0.89-dev.
|
|
58
|
+
"@vkontakte/videoplayer-core": "2.0.143-dev.d2cefd48.0",
|
|
59
|
+
"@vkontakte/videoplayer-interactive": "1.0.49-dev.d2cefd48.0",
|
|
60
|
+
"@vkontakte/videoplayer-shared": "1.0.71-dev.d2cefd48.0",
|
|
61
|
+
"@vkontakte/videoplayer-statistics": "1.0.89-dev.d2cefd48.0"
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -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
|
-
paramsOverride?: AdsParams;
|
|
21
|
-
duration: 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;
|
|
@@ -26,8 +27,9 @@ export interface RootProps {
|
|
|
26
27
|
canRewindLive: boolean;
|
|
27
28
|
showAds: boolean;
|
|
28
29
|
adsSlotId?: number | undefined;
|
|
29
|
-
adsParams?:
|
|
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;
|
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 {
|
|
@@ -40,7 +42,6 @@ export interface IUIConfig {
|
|
|
40
42
|
useAdmanFromNPM: boolean;
|
|
41
43
|
volumeMultiplier: number;
|
|
42
44
|
isVsidOriginal: boolean;
|
|
43
|
-
usePuid: boolean;
|
|
44
45
|
};
|
|
45
46
|
/**
|
|
46
47
|
* Если нет ранее сохранённого значения громкости будет использовано это
|
|
@@ -77,6 +78,7 @@ export interface IUIConfig {
|
|
|
77
78
|
};
|
|
78
79
|
hideThumbTimerAfterTouch: boolean;
|
|
79
80
|
preventPauseOnVideoClick: boolean;
|
|
81
|
+
returnFocusOnControlsHide: boolean;
|
|
80
82
|
sentry: {
|
|
81
83
|
dsn: string;
|
|
82
84
|
sampleRate: number;
|
package/types/index.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { VKVideoPlayer } from './VKVideoPlayer/index.svelte';
|
|
2
|
-
import type { IVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, 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, ITimelinePreviewThumbsData, 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/utils.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare const getMicroStores: () => IMicroStores;
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const storeFromObservable: <T>(observable$: IValueObservable<T>, onNewValueEmitted?: (value: T) => void) => Readable<T>;
|
|
14
14
|
export declare const storeFromObservableWithInitValue: <T>(observable$: IObservable<T>, initValue: T, onNewValueEmitted?: (value: T) => void) => Readable<T>;
|
|
15
|
-
export declare const constructDebugTextData: (player: IPlayer, config: IConfig
|
|
15
|
+
export declare const constructDebugTextData: (player: IPlayer, config: IConfig, store: IStore, traceId: string) => string;
|
|
16
16
|
export type DebugData = {
|
|
17
17
|
version: string;
|
|
18
18
|
viewport: string;
|
package/types/types/index.d.ts
CHANGED
|
@@ -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"
|
|
@@ -165,7 +166,6 @@ export interface IVKVideoPlayerStatistics extends Partial<IUIStatistics> {
|
|
|
165
166
|
export interface IVKVideoPlayerSentry extends Partial<UISentry> {
|
|
166
167
|
config: ISDKConfig['ui']['sentry'];
|
|
167
168
|
}
|
|
168
|
-
export type AdsParams = Record<string, unknown>;
|
|
169
169
|
export interface IVideoEpisodesNormalizedTimeline {
|
|
170
170
|
from: number;
|
|
171
171
|
width: number;
|
|
@@ -202,8 +202,9 @@ export interface IVideoDataBase {
|
|
|
202
202
|
/**
|
|
203
203
|
* duration используется только для инициализации адмана.
|
|
204
204
|
*/
|
|
205
|
-
duration?:
|
|
206
|
-
adsParams?:
|
|
205
|
+
duration?: AdmanInitParams['duration'];
|
|
206
|
+
adsParams?: AdmanInitParams['params'];
|
|
207
|
+
adsExternalApi?: AdmanInitParams['externalApi'];
|
|
207
208
|
videoEpisodes?: IVideoEpisode[];
|
|
208
209
|
previewThumbsData?: ITimelinePreviewThumbsData;
|
|
209
210
|
isClip?: boolean;
|
|
@@ -268,7 +269,7 @@ export interface IVKVideoPlayerConfig {
|
|
|
268
269
|
supportLink?: string;
|
|
269
270
|
showAds?: boolean;
|
|
270
271
|
adsSlotId?: number;
|
|
271
|
-
adsParams?:
|
|
272
|
+
adsParams?: AdmanInitParams['params'];
|
|
272
273
|
/** @deprecated */
|
|
273
274
|
adsPreviewParam?: number;
|
|
274
275
|
adsAutoplayParam?: boolean;
|
package/types/utils/dom.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getPuid10Val: (width: number, height: number) => number;
|