@vkontakte/videoplayer 1.0.7-dev.cab43a2.0 → 1.0.9
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/VKVideoPlayer/index.d.ts +38 -0
- package/components/Ads/admanWrapper.d.ts +71 -0
- package/components/Ads/utils.d.ts +1 -0
- package/constans.d.ts +31 -0
- package/env.d.ts +3 -0
- package/es2015.cjs.js +6 -0
- package/es2015.esm.js +6 -0
- package/es2018.cjs.js +6 -0
- package/es2018.esm.js +6 -0
- package/esnext.cjs.js +6 -0
- package/esnext.esm.js +6 -0
- package/index.d.ts +6 -81
- package/package.json +8 -8
- package/store/index.d.ts +110 -0
- package/store/initStatistics.d.ts +5 -0
- package/store/utils.d.ts +27 -0
- package/types/index.d.ts +68 -0
- package/utils/clipboard.d.ts +1 -0
- package/utils/dom.d.ts +2 -0
- package/utils/formatSeconds.d.ts +1 -0
- package/utils/fullscreen.d.ts +20 -0
- package/utils/isios.d.ts +1 -0
- package/utils/roundFps.d.ts +1 -0
- package/utils/stack/index.d.ts +9 -0
- package/utils/stack/node.d.ts +5 -0
- package/utils/storage.d.ts +5 -0
- package/utils/volume.d.ts +4 -0
- package/index.cjs.js +0 -5
- package/index.esm.js +0 -5
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IVideoData, IVKVideoPlayerConfig } from '../types';
|
|
2
|
+
export declare class VKVideoPlayer extends HTMLElement {
|
|
3
|
+
private svelteStubComponent?;
|
|
4
|
+
private svelteRootComponent?;
|
|
5
|
+
private readonly _shadowRoot;
|
|
6
|
+
private readonly playerContainer;
|
|
7
|
+
private currentPlayingVideoIndex;
|
|
8
|
+
private needToRepeatPlaylist;
|
|
9
|
+
private config;
|
|
10
|
+
private readonly logger;
|
|
11
|
+
private readonly log;
|
|
12
|
+
private readonly subscription;
|
|
13
|
+
constructor();
|
|
14
|
+
connectedCallback(): void;
|
|
15
|
+
private disconnectedCallback;
|
|
16
|
+
private needToShowNextPrevButtons;
|
|
17
|
+
private isNextButtonActive;
|
|
18
|
+
private isPrevButtonActive;
|
|
19
|
+
private getNextVideoInfo;
|
|
20
|
+
private createPlayer;
|
|
21
|
+
private playNextVideo;
|
|
22
|
+
private playPrevVideo;
|
|
23
|
+
private repeatPlaylist;
|
|
24
|
+
private createPlayerWithCurrentVideo;
|
|
25
|
+
initPlayer(config: IVKVideoPlayerConfig): void;
|
|
26
|
+
private isOneVideoPlaylist;
|
|
27
|
+
/**
|
|
28
|
+
* Обновление плейлиста. Будут перезаписаны все видео после текущего
|
|
29
|
+
*/
|
|
30
|
+
updateNextVideos(videos: IVideoData[]): void;
|
|
31
|
+
play(): void;
|
|
32
|
+
pause(): void;
|
|
33
|
+
stop(): void;
|
|
34
|
+
setMuted(muted: boolean): void;
|
|
35
|
+
setVolume(volume: number): void;
|
|
36
|
+
setRepeat(repeat: boolean): void;
|
|
37
|
+
seekTime(time: number): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { AdsSection } from '../../types';
|
|
2
|
+
import type { AdsParams } from '../../types';
|
|
3
|
+
import type { ILogger, ISubject } from '@vkontakte/videoplayer-shared';
|
|
4
|
+
import type { IAdsState, IUIState } from '../../store';
|
|
5
|
+
declare type ExternalActions = {
|
|
6
|
+
switchFromAdsToVideo: (callPlay?: boolean) => void;
|
|
7
|
+
switchFromVideoToAds: () => void;
|
|
8
|
+
setMuted: (muted: boolean) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare type AdmanInitParams = {
|
|
11
|
+
width: number;
|
|
12
|
+
height: number;
|
|
13
|
+
isFullscreen: boolean;
|
|
14
|
+
isAutoplay: boolean;
|
|
15
|
+
slotId: number;
|
|
16
|
+
params?: AdsParams;
|
|
17
|
+
duration: number;
|
|
18
|
+
previewParam?: number;
|
|
19
|
+
adsContainer: HTMLElement;
|
|
20
|
+
adsVideoElement: HTMLVideoElement;
|
|
21
|
+
};
|
|
22
|
+
export interface IAdEvents {
|
|
23
|
+
slotRequested$: ISubject<void>;
|
|
24
|
+
started$: ISubject<AdsSection>;
|
|
25
|
+
paused$: ISubject<void>;
|
|
26
|
+
resumed$: ISubject<void>;
|
|
27
|
+
ended$: ISubject<void>;
|
|
28
|
+
skipped$: ISubject<void>;
|
|
29
|
+
clicked$: ISubject<void>;
|
|
30
|
+
}
|
|
31
|
+
declare type PartialUIState = Pick<IUIState, 'isMobile' | 'mobileUnmuteButtonVisible'>;
|
|
32
|
+
export declare class AdmanWrapper {
|
|
33
|
+
private adman;
|
|
34
|
+
private initialVolume;
|
|
35
|
+
private videoElement;
|
|
36
|
+
private currentAdSection;
|
|
37
|
+
private actions;
|
|
38
|
+
private adsState;
|
|
39
|
+
private uiState;
|
|
40
|
+
private readonly log;
|
|
41
|
+
events: IAdEvents;
|
|
42
|
+
constructor(logger: ILogger);
|
|
43
|
+
init(actions: ExternalActions, adsState: IAdsState, uiState: PartialUIState): void;
|
|
44
|
+
loadAdman: (abortSignal: AbortSignal) => Promise<void>;
|
|
45
|
+
onAdmanLoadingError(): void;
|
|
46
|
+
initAdman(initParams: AdmanInitParams): void;
|
|
47
|
+
private switchToVideo;
|
|
48
|
+
togglePlay(): void;
|
|
49
|
+
setInitialVolume(volume: number): void;
|
|
50
|
+
setVolume(volume: number): void;
|
|
51
|
+
setFullscreen(isFullscreen: boolean): void;
|
|
52
|
+
startPreroll(): void;
|
|
53
|
+
startPostroll(): void;
|
|
54
|
+
private onAdsReady;
|
|
55
|
+
private onAdStarted;
|
|
56
|
+
private onAdTimeRemained;
|
|
57
|
+
private onAdPaused;
|
|
58
|
+
private onAdPlayed;
|
|
59
|
+
private onAdMidrollPoint;
|
|
60
|
+
private onAdSkipped;
|
|
61
|
+
private onAdClosed;
|
|
62
|
+
private onAdCompleted;
|
|
63
|
+
private onAdClicked;
|
|
64
|
+
private onAdError;
|
|
65
|
+
play(): void;
|
|
66
|
+
pause(): void;
|
|
67
|
+
skip(): void;
|
|
68
|
+
setPosition(position: number, duration: number): void;
|
|
69
|
+
destroy(): void;
|
|
70
|
+
}
|
|
71
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getPuid10Val: (width: number, height: number) => number;
|
package/constans.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const UI_CONTROLS_HIDE_TIMEOUT = 500;
|
|
2
|
+
export declare const UI_CONTROLS_HIDE_TIMEOUT_MOBILE = 3000;
|
|
3
|
+
export declare const UI_CONTROLS_HIDE_TIMEOUT_ON_START = 2000;
|
|
4
|
+
export declare const UI_CONTROLS_HIDE_TIMEOUT_IN_FULLSCREEN = 3000;
|
|
5
|
+
export declare const UI_MOBILE_UNMUTE_BUTTON_COLLAPSE_TIMEOUT = 6000;
|
|
6
|
+
export declare const VERTICAL_VOLUME_BAR_HIDE_TIMEOUT = 300;
|
|
7
|
+
export declare const AUTO_QUALITY_NAME = "\u0410\u0432\u0442\u043E";
|
|
8
|
+
export declare const PREFERRED_VOLUME_STORAGE_KEY = "vk_player_preferred_volume";
|
|
9
|
+
export declare const PREFER_MUTE_STORAGE_KEY = "vk_player_prefer_volume_mute";
|
|
10
|
+
export declare const DEBUG_PANEL_OPENED_STORAGE_KEY = "vk_player_debug_panel_opened";
|
|
11
|
+
export declare const DEFAULT_VOLUME = 1;
|
|
12
|
+
export declare const MIN_PREFERRED_VOLUME = 0.05;
|
|
13
|
+
export declare const MAX_VOLUME = 1;
|
|
14
|
+
export declare const KEYBOARD_VOLUME_CHANGE_STEP = 0.05;
|
|
15
|
+
export declare const KEYBOARD_SEEK_STEP = 10;
|
|
16
|
+
export declare const PLAYER_RESIZE_DEBOUNCE_TIME = 300;
|
|
17
|
+
export declare const ACTIVE_LIVE_VALID_DELAY = 5;
|
|
18
|
+
export declare const DEFAULT_SUPPORT_LINK = "https://vk.com/support?act=new&from=v";
|
|
19
|
+
export declare const LOADER_DISPLAY_DELAY = 500;
|
|
20
|
+
export declare const enum ProcessedKeysCodes {
|
|
21
|
+
ArrowLeft = "ArrowLeft",
|
|
22
|
+
ArrowUp = "ArrowUp",
|
|
23
|
+
ArrowRight = "ArrowRight",
|
|
24
|
+
ArrowDown = "ArrowDown",
|
|
25
|
+
Space = "Space",
|
|
26
|
+
KeyM = "KeyM",
|
|
27
|
+
KeyF = "KeyF",
|
|
28
|
+
KeyK = "KeyK",
|
|
29
|
+
KeyL = "KeyL",
|
|
30
|
+
KeyJ = "KeyJ"
|
|
31
|
+
}
|
package/env.d.ts
ADDED