@vkontakte/videoplayer 1.1.37-dev.aaebf6d2.0 → 1.1.38-dev.02602b16.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 +17 -17
- package/es2015.esm.js +17 -17
- package/es2018.cjs.js +17 -17
- package/es2018.esm.js +17 -17
- package/esnext.cjs.js +17 -17
- package/esnext.esm.js +17 -17
- package/evergreen.esm.js +17 -17
- package/package.json +10 -10
- package/types/VKVideoPlayer/index.d.ts +85 -0
- package/types/components/Ads/admanWrapper.d.ts +82 -0
- package/types/components/Ads/utils.d.ts +1 -0
- package/types/config.d.ts +117 -0
- package/types/constans/controls.d.ts +27 -0
- package/types/constans/debounce-timers.d.ts +1 -0
- package/types/constans/grid.d.ts +14 -0
- package/types/constans/index.d.ts +8 -0
- package/types/constans/interactives.d.ts +7 -0
- package/types/constans/keyboard.d.ts +51 -0
- package/types/constans/lang.d.ts +2 -0
- package/types/constans/storage-keys.d.ts +1 -0
- package/types/constans/throttle-timers.d.ts +1 -0
- package/types/env.d.ts +2 -0
- package/types/index.d.ts +12 -0
- package/types/services/sentry.d.ts +28 -0
- package/types/services/statistics.d.ts +13 -0
- package/types/store/index.d.ts +276 -0
- package/types/store/micro/base.d.ts +8 -0
- package/types/store/micro/fakeIsPlaying.d.ts +13 -0
- package/types/store/micro/index.d.ts +2 -0
- package/types/store/micro/interactiveControlsOpacity.d.ts +13 -0
- package/types/store/micro/seekToInteractiveDisabledTooltip.d.ts +9 -0
- package/types/store/micro/showInteractiveTimeIndicatorTooltip.d.ts +15 -0
- package/types/store/utils.d.ts +30 -0
- package/types/translation/index.d.ts +6 -0
- package/types/translation/packs/en.d.ts +3 -0
- package/types/translation/packs/ru.d.ts +3 -0
- package/types/translation/types.d.ts +8 -0
- package/types/types/index.d.ts +461 -0
- package/types/utils/WebVttParser.d.ts +19 -0
- package/types/utils/changeVolume.d.ts +6 -0
- package/types/utils/clipboard.d.ts +1 -0
- package/types/utils/dom.d.ts +2 -0
- package/types/utils/fetchFile.d.ts +1 -0
- package/types/utils/findCurrentSubtltlePhrase.d.ts +2 -0
- package/types/utils/formatSeconds.d.ts +1 -0
- package/types/utils/fullscreen.d.ts +24 -0
- package/types/utils/getActualEpisode.d.ts +10 -0
- package/types/utils/getHotKeyMapData.d.ts +2 -0
- package/types/utils/getQualityLabel.d.ts +2 -0
- package/types/utils/grid.d.ts +6 -0
- package/types/utils/isIphoneOrOldIpad.d.ts +2 -0
- package/types/utils/keyboardHandleCases.d.ts +2 -0
- package/types/utils/menuNavigation.d.ts +13 -0
- package/types/utils/roundFps.d.ts +1 -0
- package/types/utils/sanitizeHtml.d.ts +5 -0
- package/types/utils/stack/index.d.ts +9 -0
- package/types/utils/stack/node.d.ts +5 -0
- package/types/utils/subtitleLanguages.d.ts +1 -0
- package/types/utils/updatePlayerControlsInfo.d.ts +3 -0
- package/types/utils/userSettings.d.ts +10 -0
- package/types/utils/videoConfig.d.ts +2 -0
- package/types/utils/volumeChange.d.ts +5 -0
- package/types/utils/webAPI/annotationsApi/annotationsApi.d.ts +29 -0
- package/types/utils/webAPI/annotationsApi/errors.d.ts +7 -0
- package/types/utils/webAPI/language.d.ts +2 -0
- package/types/utils/webAPI/mediaSessionApi.d.ts +8 -0
- package/types/utils/webAPI/pictureInPictureApi/documentPictureInPictureApi.d.ts +23 -0
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApi.d.ts +38 -0
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApiFactory.d.ts +4 -0
- package/index.d.ts +0 -477
package/package.json
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.38-dev.02602b16.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
7
7
|
"license": "GPL-3.0",
|
|
8
8
|
"main": "./esnext.cjs.js",
|
|
9
9
|
"module": "./esnext.esm.js",
|
|
10
|
-
"types": "./index.d.ts",
|
|
10
|
+
"types": "./types/index.d.ts",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
14
|
"import": "./esnext.esm.js",
|
|
15
15
|
"require": "./esnext.cjs.js",
|
|
16
|
-
"types": "./index.d.ts"
|
|
16
|
+
"types": "./types/index.d.ts"
|
|
17
17
|
},
|
|
18
18
|
"./evergreen": {
|
|
19
19
|
"import": "./evergreen.esm.js",
|
|
20
20
|
"require": "./evergreen.cjs.js",
|
|
21
|
-
"types": "./index.d.ts"
|
|
21
|
+
"types": "./types/index.d.ts"
|
|
22
22
|
},
|
|
23
23
|
"./esnext": {
|
|
24
24
|
"import": "./esnext.esm.js",
|
|
25
25
|
"require": "./esnext.cjs.js",
|
|
26
|
-
"types": "./index.d.ts"
|
|
26
|
+
"types": "./types/index.d.ts"
|
|
27
27
|
},
|
|
28
28
|
"./es2018": {
|
|
29
29
|
"import": "./es2018.esm.js",
|
|
30
30
|
"require": "./es2018.cjs.js",
|
|
31
|
-
"types": "./index.d.ts"
|
|
31
|
+
"types": "./types/index.d.ts"
|
|
32
32
|
},
|
|
33
33
|
"./es2015": {
|
|
34
34
|
"import": "./es2015.esm.js",
|
|
35
35
|
"require": "./es2015.cjs.js",
|
|
36
|
-
"types": "./index.d.ts"
|
|
36
|
+
"types": "./types/index.d.ts"
|
|
37
37
|
},
|
|
38
38
|
"./evergreen.esm.js": "./evergeen.esm.js",
|
|
39
39
|
"./esnext.esm.js": "./esnext.esm.js",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"**/*.d.ts"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@vkontakte/videoplayer-core": "
|
|
53
|
-
"@vkontakte/videoplayer-interactive": "1.0.
|
|
52
|
+
"@vkontakte/videoplayer-core": "2.0.105-dev.3573a175.0",
|
|
53
|
+
"@vkontakte/videoplayer-interactive": "1.0.13-dev.437468aa.0",
|
|
54
54
|
"@vkontakte/videoplayer-shared": "^1.0.36",
|
|
55
|
-
"@vkontakte/videoplayer-statistics": "
|
|
55
|
+
"@vkontakte/videoplayer-statistics": "1.0.51-dev.eca6afa6.0"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { ISDKConfig } from '../config';
|
|
2
|
+
import type { LanguageConfig } from '../translation/types';
|
|
3
|
+
import type { IVideoData, IVKVideoPlayerConfig } from '../types';
|
|
4
|
+
import { InterfaceLanguage, type QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
5
|
+
import type { ISources } from '@vkontakte/videoplayer-core';
|
|
6
|
+
import { type PlaybackRate } from '@vkontakte/videoplayer-core';
|
|
7
|
+
import { AnnotationsApi } from '../utils/webAPI/annotationsApi/annotationsApi';
|
|
8
|
+
export declare class VKVideoPlayer extends HTMLElement {
|
|
9
|
+
private svelteStubComponent?;
|
|
10
|
+
private svelteRootComponent?;
|
|
11
|
+
private store?;
|
|
12
|
+
private microStoresRoot?;
|
|
13
|
+
private statistics;
|
|
14
|
+
private sentry;
|
|
15
|
+
private _shadowRoot;
|
|
16
|
+
private playerContainer;
|
|
17
|
+
private rootContainer;
|
|
18
|
+
private uiConfig;
|
|
19
|
+
private coreConfig;
|
|
20
|
+
private statisticsConfig;
|
|
21
|
+
private interactiveController;
|
|
22
|
+
private interactiveContainer;
|
|
23
|
+
private graphMadePause;
|
|
24
|
+
private currentPlayingVideoIndex;
|
|
25
|
+
private needToRepeatPlaylist;
|
|
26
|
+
private videoConfig;
|
|
27
|
+
private pictureInPictureApi;
|
|
28
|
+
private mediaSessionApi;
|
|
29
|
+
private unsubscribePlayerPhaseSubscription;
|
|
30
|
+
private readonly logger;
|
|
31
|
+
private readonly log;
|
|
32
|
+
private readonly subscription;
|
|
33
|
+
annotationsApi: AnnotationsApi | undefined;
|
|
34
|
+
private createPlayerTimeout;
|
|
35
|
+
private prevIsid;
|
|
36
|
+
private isInited;
|
|
37
|
+
constructor();
|
|
38
|
+
private connectedCallback;
|
|
39
|
+
private disconnectedCallback;
|
|
40
|
+
private initPlayerRootContainers;
|
|
41
|
+
private needToShowNextPrevButtons;
|
|
42
|
+
private isNextButtonActive;
|
|
43
|
+
private isPrevButtonActive;
|
|
44
|
+
private isControlDisabled;
|
|
45
|
+
private getNextVideoInfo;
|
|
46
|
+
private createPlayer;
|
|
47
|
+
private addPlayerInfoSubscriptions;
|
|
48
|
+
private playNextVideo;
|
|
49
|
+
private playPrevVideo;
|
|
50
|
+
private repeatPlaylist;
|
|
51
|
+
private createPlayerWithCurrentVideo;
|
|
52
|
+
private playPrevChapter;
|
|
53
|
+
private seekToInteractive;
|
|
54
|
+
private toggleGraph;
|
|
55
|
+
private initInteractives;
|
|
56
|
+
private initInteractivesStatistics;
|
|
57
|
+
initPlayer(videoConfig: IVKVideoPlayerConfig, sdkConfig?: Partial<ISDKConfig>): void;
|
|
58
|
+
private isOneVideoPlaylist;
|
|
59
|
+
/**
|
|
60
|
+
* Обновление плейлиста. Будут перезаписаны все видео после текущего
|
|
61
|
+
*/
|
|
62
|
+
updateNextVideos(videos: IVideoData[]): void;
|
|
63
|
+
private initMediaSession;
|
|
64
|
+
private setupMediaSessionForVideo;
|
|
65
|
+
private setupMediaSessionForAds;
|
|
66
|
+
play(): void;
|
|
67
|
+
pause(): void;
|
|
68
|
+
stop(): void;
|
|
69
|
+
setMuted(muted: boolean): void;
|
|
70
|
+
setVolume(volume: number): void;
|
|
71
|
+
setRepeat(repeat: boolean): void;
|
|
72
|
+
seekTime(time: number): void;
|
|
73
|
+
seekEpisodeStartTime(time: number): void;
|
|
74
|
+
returnFocusToEpisodes(): void;
|
|
75
|
+
setPlaybackRate(playbackRate: PlaybackRate): void;
|
|
76
|
+
setAutoQualityLimits(limits: QualityLimits): void;
|
|
77
|
+
addLanguage(config: LanguageConfig): void;
|
|
78
|
+
setLanguage(language: InterfaceLanguage | string): Promise<void>;
|
|
79
|
+
setLiveStart(sources: ISources): void;
|
|
80
|
+
setWaitRecord(): void;
|
|
81
|
+
setLiveEnd(videoData: IVideoData): void;
|
|
82
|
+
getDeviceId(): string | undefined;
|
|
83
|
+
replayInteractiveVideo(): void;
|
|
84
|
+
showInteractiveIndicatorTooltip(newValue: boolean, useTimeout?: boolean): void;
|
|
85
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Writable, Readable } from 'svelte/store';
|
|
2
|
+
import { AdsSection } from '../../types';
|
|
3
|
+
import type { AdsParams } from '../../types';
|
|
4
|
+
import type { ILogger, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
5
|
+
import { Subject } from '@vkontakte/videoplayer-shared';
|
|
6
|
+
import type { IAdsState } from '../../store';
|
|
7
|
+
type ExternalActions = {
|
|
8
|
+
switchFromAdsToVideo: (callPlay?: boolean) => void;
|
|
9
|
+
switchFromVideoToAds: () => void;
|
|
10
|
+
setMuted: (muted: boolean) => void;
|
|
11
|
+
};
|
|
12
|
+
export type AdmanInitParams = {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
isFullscreen: boolean;
|
|
16
|
+
isAutoplay: boolean;
|
|
17
|
+
slotId: number;
|
|
18
|
+
params?: AdsParams;
|
|
19
|
+
duration: number;
|
|
20
|
+
previewParam?: number;
|
|
21
|
+
adsContainer: HTMLElement;
|
|
22
|
+
adsVideoElement: HTMLVideoElement;
|
|
23
|
+
};
|
|
24
|
+
type IPlayerState = {
|
|
25
|
+
isMobile: Readable<boolean>;
|
|
26
|
+
mobileUnmuteButtonVisible: Writable<boolean>;
|
|
27
|
+
vsid: Readable<string | undefined>;
|
|
28
|
+
};
|
|
29
|
+
interface IConfig {
|
|
30
|
+
loadTimeout: Milliseconds;
|
|
31
|
+
initTimeout: Milliseconds;
|
|
32
|
+
}
|
|
33
|
+
export declare class AdmanWrapper {
|
|
34
|
+
private adman;
|
|
35
|
+
private initialVolume;
|
|
36
|
+
private videoElement;
|
|
37
|
+
private currentAdSection;
|
|
38
|
+
private actions;
|
|
39
|
+
private adsState;
|
|
40
|
+
private playerState;
|
|
41
|
+
private readonly log;
|
|
42
|
+
private loadTimeout;
|
|
43
|
+
private initTimeout;
|
|
44
|
+
events: {
|
|
45
|
+
slotRequested$: Subject<void>;
|
|
46
|
+
started$: Subject<AdsSection>;
|
|
47
|
+
paused$: Subject<void>;
|
|
48
|
+
resumed$: Subject<void>;
|
|
49
|
+
ended$: Subject<void>;
|
|
50
|
+
skipped$: Subject<void>;
|
|
51
|
+
clicked$: Subject<void>;
|
|
52
|
+
};
|
|
53
|
+
constructor(logger: ILogger, config: IConfig);
|
|
54
|
+
init(actions: ExternalActions, adsState: IAdsState, playerState: IPlayerState): void;
|
|
55
|
+
loadAdman: (abortSignal: AbortSignal) => Promise<void>;
|
|
56
|
+
onAdmanLoadingError(): void;
|
|
57
|
+
initAdman(initParams: AdmanInitParams): void;
|
|
58
|
+
private switchToVideo;
|
|
59
|
+
togglePlay(): void;
|
|
60
|
+
setInitialVolume(volume: number): void;
|
|
61
|
+
setVolume(volume: number): void;
|
|
62
|
+
setFullscreen(isFullscreen: boolean): void;
|
|
63
|
+
startPreroll(): void;
|
|
64
|
+
startPostroll(): void;
|
|
65
|
+
private onAdsReady;
|
|
66
|
+
private onAdStarted;
|
|
67
|
+
private onAdTimeRemained;
|
|
68
|
+
private onAdPaused;
|
|
69
|
+
private onAdPlayed;
|
|
70
|
+
private onAdMidrollPoint;
|
|
71
|
+
private onAdSkipped;
|
|
72
|
+
private onAdClosed;
|
|
73
|
+
private onAdCompleted;
|
|
74
|
+
private onAdClicked;
|
|
75
|
+
private onAdError;
|
|
76
|
+
play(): void;
|
|
77
|
+
pause(): void;
|
|
78
|
+
skip(): void;
|
|
79
|
+
setPosition(position: number, duration: number): void;
|
|
80
|
+
destroy(): void;
|
|
81
|
+
}
|
|
82
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getPuid10Val: (width: number, height: number) => number;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { ExactVideoQuality } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { IOptionalTuningConfig as ICoreConfig } from '@vkontakte/videoplayer-core';
|
|
3
|
+
import { InterfaceLanguage, ErrorCategory } from '@vkontakte/videoplayer-shared';
|
|
4
|
+
import type { RecursivePartial } from '@vkontakte/videoplayer-shared';
|
|
5
|
+
import type { IOptionalConfig as IStatisticsConfig } from '@vkontakte/videoplayer-statistics';
|
|
6
|
+
import type { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
7
|
+
type ForceOrRelay = boolean | undefined;
|
|
8
|
+
export declare enum LogoType {
|
|
9
|
+
VK = "vk",
|
|
10
|
+
VK_VIDEO = "vk_video",
|
|
11
|
+
VK_VIDEO_MOBILE = "vk_video_mobile"
|
|
12
|
+
}
|
|
13
|
+
export interface IUIConfig {
|
|
14
|
+
isMobile: ForceOrRelay;
|
|
15
|
+
isSmoothVideoRotate: boolean;
|
|
16
|
+
showSupport: boolean;
|
|
17
|
+
supportLink: string;
|
|
18
|
+
showLogo: ForceOrRelay;
|
|
19
|
+
logoLink: string;
|
|
20
|
+
logoType: LogoType;
|
|
21
|
+
defaultLanguage: InterfaceLanguage;
|
|
22
|
+
downloadVKLanguages: boolean;
|
|
23
|
+
updateBuiltinLanguages: boolean;
|
|
24
|
+
ads: {
|
|
25
|
+
enable: ForceOrRelay;
|
|
26
|
+
loadTimeout: Milliseconds;
|
|
27
|
+
initTimeout: Milliseconds;
|
|
28
|
+
slot?: number;
|
|
29
|
+
preview?: number;
|
|
30
|
+
};
|
|
31
|
+
volumeDefault: number;
|
|
32
|
+
volumeMinRestore: number;
|
|
33
|
+
loaderDelay: Milliseconds;
|
|
34
|
+
allowChangingFullscreenTarget: boolean;
|
|
35
|
+
minSubtitlesFontSize: number;
|
|
36
|
+
autoSubtitlesTimeout: Milliseconds;
|
|
37
|
+
trafficSavingLimit: ExactVideoQuality;
|
|
38
|
+
episodeMinWidthPc: number;
|
|
39
|
+
controls: {
|
|
40
|
+
hideTimeout: Milliseconds;
|
|
41
|
+
hideTimeoutMobile: Milliseconds;
|
|
42
|
+
hideTimeoutInitial: Milliseconds;
|
|
43
|
+
hideTimeoutFullscreen: Milliseconds;
|
|
44
|
+
hideTimeoutCursor: Milliseconds;
|
|
45
|
+
hideTimeoutTooltips: Milliseconds;
|
|
46
|
+
collapseMobileUnmute: Milliseconds;
|
|
47
|
+
hide360IconTimeout: Milliseconds;
|
|
48
|
+
volumeBarTimeout: Milliseconds;
|
|
49
|
+
hideHotKeyHelpers: Milliseconds;
|
|
50
|
+
playbackRateMin: number;
|
|
51
|
+
playbackRateMax: number;
|
|
52
|
+
playbackRateStep: number;
|
|
53
|
+
seekStepKeyboard: Milliseconds;
|
|
54
|
+
seekStepMobile: Milliseconds;
|
|
55
|
+
seekStepFrame: Milliseconds;
|
|
56
|
+
volumeStepKeyboard: number;
|
|
57
|
+
volumeStepWheel: number;
|
|
58
|
+
};
|
|
59
|
+
hideThumbTimerAfterTouch: boolean;
|
|
60
|
+
sentry: {
|
|
61
|
+
dsn: string;
|
|
62
|
+
sampleRate: number;
|
|
63
|
+
whiteErrorCategoryList: ErrorCategory[];
|
|
64
|
+
blackErrorCategoryList: ErrorCategory[];
|
|
65
|
+
whiteErrorIdList: string[];
|
|
66
|
+
blackErrorIdList: string[];
|
|
67
|
+
};
|
|
68
|
+
features: {
|
|
69
|
+
autoplay: boolean;
|
|
70
|
+
statistics: boolean;
|
|
71
|
+
sentry: boolean;
|
|
72
|
+
preload: boolean;
|
|
73
|
+
subtitles: boolean;
|
|
74
|
+
timelinePreview: boolean;
|
|
75
|
+
episodes: boolean;
|
|
76
|
+
fullscreen: boolean;
|
|
77
|
+
mediaSession: boolean;
|
|
78
|
+
annotations: boolean;
|
|
79
|
+
download: boolean;
|
|
80
|
+
pip: boolean;
|
|
81
|
+
dpip: boolean;
|
|
82
|
+
liveRewind: boolean;
|
|
83
|
+
playbackRate: boolean;
|
|
84
|
+
trafficSaving: boolean;
|
|
85
|
+
episodesClustering: boolean;
|
|
86
|
+
copyVideoLink: boolean;
|
|
87
|
+
videoRotate: boolean;
|
|
88
|
+
interactiveGraph: boolean;
|
|
89
|
+
seekToInteractive: boolean;
|
|
90
|
+
interactiveLastFrame: boolean;
|
|
91
|
+
interactiveTextPermanent: boolean;
|
|
92
|
+
interactiveHideTime: boolean;
|
|
93
|
+
interactivePlayPrevChapter: boolean;
|
|
94
|
+
interactiveTimeIndicator: boolean;
|
|
95
|
+
thumbTimer: boolean;
|
|
96
|
+
hotKeyMapModal: boolean;
|
|
97
|
+
hotKeyHelpers: boolean;
|
|
98
|
+
saveDebugInfoToFile: boolean;
|
|
99
|
+
additionalButtons: boolean;
|
|
100
|
+
contextMenuButton: boolean;
|
|
101
|
+
};
|
|
102
|
+
interactive: {
|
|
103
|
+
historyMaxLength: number;
|
|
104
|
+
noInteractionEventTimeout: number;
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export declare const defaultConfig: IUIConfig;
|
|
108
|
+
export type IOptionalUIConfig = RecursivePartial<IUIConfig>;
|
|
109
|
+
export declare const fillDefault: (partial: IOptionalUIConfig) => IUIConfig;
|
|
110
|
+
export interface ISDKConfig {
|
|
111
|
+
ui: RecursivePartial<IUIConfig>;
|
|
112
|
+
core: ICoreConfig;
|
|
113
|
+
statistics: IStatisticsConfig;
|
|
114
|
+
}
|
|
115
|
+
export declare const setConfig: (config: IUIConfig) => IUIConfig;
|
|
116
|
+
export declare const getConfig: () => IUIConfig;
|
|
117
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum Controls {
|
|
2
|
+
PLAY_BUTTON = "PLAY_BUTTON",
|
|
3
|
+
REPLAY_BUTTON = "REPLAY_BUTTON",
|
|
4
|
+
NEXT_BUTTON = "NEXT_BUTTON",
|
|
5
|
+
PREV_BUTTON = "PREV_BUTTON",
|
|
6
|
+
PICTURE_IN_PICTURE = "PICTURE_IN_PICTURE",
|
|
7
|
+
FULLSCREEN_BUTTON = "FULLSCREEN_BUTTON",
|
|
8
|
+
SETTINGS_BUTTON = "SETTINGS_BUTTON",
|
|
9
|
+
LIVE_BUTTON = "LIVE_BUTTON",
|
|
10
|
+
GRAPH_BUTTON = "GRAPH_BUTTON",
|
|
11
|
+
PLAY_PREV_CHAPTER_BUTTON = "PLAY_PREV_CHAPTER_BUTTON",
|
|
12
|
+
SEEK_TO_INTERACTIVE_BUTTON = "SEEK_TO_INTERACTIVE_BUTTON",
|
|
13
|
+
TIMELINE = "TIMELINE",
|
|
14
|
+
VOLUME_BAR = "VOLUME_BAR",
|
|
15
|
+
MUTE_BUTTON = "MUTE_BUTTON",
|
|
16
|
+
SUBTITLES_BUTTON = "SUBTITLES_BUTTON",
|
|
17
|
+
CHROMECAST_BUTTON = "CHROMECAST_BUTTON",
|
|
18
|
+
VK_BUTTON = "VK_BUTTON",
|
|
19
|
+
EPISODE_BUTTON = "EPISODE_BUTTON",
|
|
20
|
+
INCREMENT_PLAYBACK_RATE = "INCREMENT_PLAYBACK_RATE",
|
|
21
|
+
DECREMENT_PLAYBACK_RATE = "DECREMENT_PLAYBACK_RATE"
|
|
22
|
+
}
|
|
23
|
+
export declare const PLAYER_CONTROLS_HEIGHT = 40;
|
|
24
|
+
export declare const PLAYER_CONTROLS_DESKTOP_MARGIN_LEFT_ELEMENTS = 4;
|
|
25
|
+
export declare const PLAYER_CONTROLS_TRANSITION_TIMEOUT_MS = 260;
|
|
26
|
+
export declare const PLAYER_CONTROLS_DESKTOP_EPISODES_COUNT_WIDTH = 60;
|
|
27
|
+
export declare const PLAYER_WRAPPER_PADDING = 8;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PLAYER_MENU_RENDER_TIMEOUT = 100;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Controls } from './controls';
|
|
2
|
+
import type { Key } from '../translation/types';
|
|
3
|
+
export declare const InteractiveActionDisabledControls: Controls[];
|
|
4
|
+
export declare const OpenedGraphDisabledControls: Controls[];
|
|
5
|
+
export declare const ActionChoiceDisabledControls: Controls[];
|
|
6
|
+
export type PlayPrevChapterDisabledTooltipKey = Extract<Key, 'tooltip_interactive_go_back_disabled' | 'tooltip_interactive_go_back_disabled_first' | 'tooltip_interactive_go_back_disabled_limit'>;
|
|
7
|
+
export type SeekToInteractiveDisabledTooltipKey = Extract<Key, 'tooltip_chapter_without_interactive' | 'tooltip_interactive_of_chapter_completed' | 'tooltip_disabled_when_interactive'>;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const enum ProcessedKeysCodes {
|
|
2
|
+
ArrowLeft = "ArrowLeft",
|
|
3
|
+
ArrowUp = "ArrowUp",
|
|
4
|
+
ArrowRight = "ArrowRight",
|
|
5
|
+
ArrowDown = "ArrowDown",
|
|
6
|
+
Comma = "Comma",
|
|
7
|
+
Period = "Period",
|
|
8
|
+
Space = "Space",
|
|
9
|
+
KeyM = "KeyM",
|
|
10
|
+
KeyF = "KeyF",
|
|
11
|
+
KeyK = "KeyK",
|
|
12
|
+
KeyL = "KeyL",
|
|
13
|
+
KeyJ = "KeyJ",
|
|
14
|
+
KeyC = "KeyC",
|
|
15
|
+
KeyI = "KeyI",
|
|
16
|
+
Digit1 = "Digit1",
|
|
17
|
+
Digit2 = "Digit2",
|
|
18
|
+
Digit3 = "Digit3",
|
|
19
|
+
Digit4 = "Digit4",
|
|
20
|
+
Digit5 = "Digit5",
|
|
21
|
+
Digit6 = "Digit6",
|
|
22
|
+
Digit7 = "Digit7",
|
|
23
|
+
Digit8 = "Digit8",
|
|
24
|
+
Digit9 = "Digit9",
|
|
25
|
+
Digit0 = "Digit0",
|
|
26
|
+
Numpad1 = "Numpad1",
|
|
27
|
+
Numpad2 = "Numpad2",
|
|
28
|
+
Numpad3 = "Numpad3",
|
|
29
|
+
Numpad4 = "Numpad4",
|
|
30
|
+
Numpad5 = "Numpad5",
|
|
31
|
+
Numpad6 = "Numpad6",
|
|
32
|
+
Numpad7 = "Numpad7",
|
|
33
|
+
Numpad8 = "Numpad8",
|
|
34
|
+
Numpad9 = "Numpad9",
|
|
35
|
+
Numpad0 = "Numpad0",
|
|
36
|
+
ShiftLeft = "ShiftLeft",
|
|
37
|
+
ShiftRight = "ShiftRight",
|
|
38
|
+
Slash = "Slash",
|
|
39
|
+
Tab = "Tab",
|
|
40
|
+
Escape = "Escape",
|
|
41
|
+
Enter = "Enter"
|
|
42
|
+
}
|
|
43
|
+
export declare const processedKeysCodesToKeyLabelMap: {
|
|
44
|
+
KeyF: string;
|
|
45
|
+
KeyK: string;
|
|
46
|
+
KeyC: string;
|
|
47
|
+
KeyM: string;
|
|
48
|
+
};
|
|
49
|
+
export declare const seekKeys: Set<ProcessedKeysCodes>;
|
|
50
|
+
export declare const menuNavigationKeys: Set<ProcessedKeysCodes>;
|
|
51
|
+
export declare const doNotCloseMenuKeys: Set<ProcessedKeysCodes>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEBUG_PANEL_OPENED_STORAGE_KEY = "vk_player_debug_panel_opened";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PLAYER_RESIZE_THROTTLE_TIME = 300;
|
package/types/env.d.ts
ADDED
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { VKVideoPlayer } from './VKVideoPlayer';
|
|
2
|
+
import type { IVKVideoPlayerConfig, IControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, IVideoLive, IInteractiveData, AdditionalButton } from './types';
|
|
3
|
+
import { GridTypes } from './constans';
|
|
4
|
+
import type { LanguagePack, LanguageConfig } from './translation/types';
|
|
5
|
+
import type { ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek } from '@vkontakte/videoplayer-core';
|
|
6
|
+
import type { Milliseconds, QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
7
|
+
export { VERSION } from './env';
|
|
8
|
+
export declare const registerPlayerWebComponent: () => void;
|
|
9
|
+
export type { VKVideoPlayer, IVKVideoPlayerConfig, IControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButton, QualityLimits, };
|
|
10
|
+
export { GridTypes, };
|
|
11
|
+
export { InterfaceLanguage, VKNumericLanguage, loadVKLangPack, } from '@vkontakte/videoplayer-shared';
|
|
12
|
+
export { VideoQuality, VideoFormat, } from '@vkontakte/videoplayer-core';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ErrorCategory } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { IError } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import type { ISubscription } from '@vkontakte/videoplayer-shared';
|
|
4
|
+
import type { IUIConfig } from '../config';
|
|
5
|
+
export type UiSentryContext = Partial<{
|
|
6
|
+
[key: string]: string | number | boolean;
|
|
7
|
+
}>;
|
|
8
|
+
export type UiSentryTags = Partial<{
|
|
9
|
+
errorType: string;
|
|
10
|
+
category: ErrorCategory;
|
|
11
|
+
[key: string]: string | number | boolean;
|
|
12
|
+
}>;
|
|
13
|
+
export type UiSentryEnvParams = {
|
|
14
|
+
version: string;
|
|
15
|
+
env: string;
|
|
16
|
+
};
|
|
17
|
+
export declare class UISentry {
|
|
18
|
+
sentrySubscription: ISubscription;
|
|
19
|
+
private options;
|
|
20
|
+
private version;
|
|
21
|
+
private context;
|
|
22
|
+
private sentryClient;
|
|
23
|
+
constructor(options: IUIConfig['sentry'], envParams: UiSentryEnvParams, context?: UiSentryContext);
|
|
24
|
+
destroy(): void;
|
|
25
|
+
logIError(error: IError, fatal?: boolean): void;
|
|
26
|
+
report(error: Error, tags?: UiSentryTags, extras?: UiSentryContext): void;
|
|
27
|
+
static getInstance(): Readonly<UISentry> | null;
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ISubscription } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { type IConstructorParams, type IOneStat, type IStatContext } from '@vkontakte/videoplayer-statistics';
|
|
3
|
+
export interface IUIStatistics {
|
|
4
|
+
statSubscription: ISubscription;
|
|
5
|
+
oneStat: IOneStat;
|
|
6
|
+
destroy: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare class UIOneStat implements IUIStatistics {
|
|
9
|
+
oneStat: IOneStat;
|
|
10
|
+
statSubscription: ISubscription;
|
|
11
|
+
constructor(statContext: IStatContext, params: IConstructorParams);
|
|
12
|
+
destroy(): void;
|
|
13
|
+
}
|