@vkontakte/videoplayer 1.1.64-dev.e0c286d1.0 → 1.1.64
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 +66 -66
- package/es2015.esm.js +66 -66
- package/es2018.cjs.js +68 -68
- package/es2018.esm.js +68 -68
- package/es2024.cjs.js +70 -70
- package/es2024.esm.js +70 -70
- package/esnext.cjs.js +70 -70
- package/esnext.esm.js +70 -70
- package/evergreen.esm.js +70 -70
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.svelte.d.ts +2 -0
- package/types/components/Root/types.d.ts +2 -0
- package/types/config.d.ts +2 -0
- package/types/store/index.d.ts +13 -1
- package/types/store/utils.d.ts +1 -1
- package/types/utils/webAPI/slotsApi.d.ts +26 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.64
|
|
3
|
+
"version": "1.1.64",
|
|
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.134
|
|
59
|
-
"@vkontakte/videoplayer-interactive": "1.0.39
|
|
60
|
-
"@vkontakte/videoplayer-shared": "1.0.62
|
|
61
|
-
"@vkontakte/videoplayer-statistics": "1.0.80
|
|
58
|
+
"@vkontakte/videoplayer-core": "2.0.134",
|
|
59
|
+
"@vkontakte/videoplayer-interactive": "1.0.39",
|
|
60
|
+
"@vkontakte/videoplayer-shared": "1.0.62",
|
|
61
|
+
"@vkontakte/videoplayer-statistics": "1.0.80"
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -80,6 +80,8 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
80
80
|
stop(): void;
|
|
81
81
|
setMuted(muted: boolean): void;
|
|
82
82
|
toggleSubtitle(): void;
|
|
83
|
+
hideControls(): void;
|
|
84
|
+
showControls(): void;
|
|
83
85
|
setPiPEnabled(enabled: boolean): void;
|
|
84
86
|
setVolume(volume: number): void;
|
|
85
87
|
setRepeat(repeat: boolean): void;
|
|
@@ -58,6 +58,8 @@ export interface RootExports {
|
|
|
58
58
|
pause: () => void;
|
|
59
59
|
setMuted: (muted: boolean) => void;
|
|
60
60
|
toggleSubtitle: () => void;
|
|
61
|
+
hideControls: () => void;
|
|
62
|
+
showControls: () => void;
|
|
61
63
|
setVolume: (volume: number) => void;
|
|
62
64
|
seekTime: (time: number) => void;
|
|
63
65
|
seekEpisodeStartTime: (time: number) => void;
|
package/types/config.d.ts
CHANGED
|
@@ -109,6 +109,7 @@ export interface IUIConfig {
|
|
|
109
109
|
episodesClustering: boolean;
|
|
110
110
|
copyVideoLink: boolean;
|
|
111
111
|
videoRotate: boolean;
|
|
112
|
+
tracer: boolean;
|
|
112
113
|
interactiveGraph: boolean;
|
|
113
114
|
interactiveResponsiveUi?: boolean;
|
|
114
115
|
seekToInteractive: boolean;
|
|
@@ -122,6 +123,7 @@ export interface IUIConfig {
|
|
|
122
123
|
interactiveControlsExpectTimeBlinkAnimation: boolean;
|
|
123
124
|
interactiveControlsTapPlace: boolean;
|
|
124
125
|
interactiveControlsFillAnimation: boolean;
|
|
126
|
+
interactiveControlsHideAnimation: boolean;
|
|
125
127
|
thumbTimer: boolean;
|
|
126
128
|
hotKeyMapModal: boolean;
|
|
127
129
|
hotKeyHelpers: boolean;
|
package/types/store/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { InteractiveRange } from '@vkontakte/videoplayer-interactive';
|
|
|
7
7
|
import type { Readable, Writable } from 'svelte/store';
|
|
8
8
|
import { AdmanWrapper } from '../components/Ads/admanWrapper';
|
|
9
9
|
import type { Key, LanguageConfig } from '../translation/types';
|
|
10
|
-
import type { AdditionalButtonDeprecated, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, Position, VideoPlaybackRate, VideoPlayerView, VideoQualityForRender, VideoQualityUI, VideoSubtitle, VideoSubtitleParsed } from '../types';
|
|
10
|
+
import type { AdditionalButtonDeprecated, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerControlsRef, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, Position, VideoPlaybackRate, VideoPlayerView, VideoQualityForRender, VideoQualityUI, VideoSubtitle, VideoSubtitleParsed } from '../types';
|
|
11
11
|
import { AdsPlaybackState } from '../types';
|
|
12
12
|
import { type QualitySettingsAppliesTo } from '../utils/userSettings';
|
|
13
13
|
import type { DebugData } from './utils';
|
|
@@ -15,6 +15,7 @@ import { GridTypes, type PlayPrevChapterDisabledTooltipKey } from '../constans';
|
|
|
15
15
|
import { UIOneStat } from '../services/statistics';
|
|
16
16
|
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem, ContextMenuItem, SettingsMenuItem } from '../components/Menus/subMenuTabs/types';
|
|
17
17
|
import type { AdditionalButton, AdditionalDesktopControlPanelButton } from '../components/Controls/types';
|
|
18
|
+
import type { SlotsApi } from '../utils/webAPI/slotsApi';
|
|
18
19
|
type Info = {
|
|
19
20
|
appliesTo?: QualitySettingsAppliesTo;
|
|
20
21
|
changeReason?: 'default' | 'limit-changed';
|
|
@@ -30,6 +31,14 @@ export interface IAdsState {
|
|
|
30
31
|
export interface IUIState {
|
|
31
32
|
t: (key: Key, params?: Record<string, string>) => string;
|
|
32
33
|
controlsVisible: Writable<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Точечно скрываем контролы.
|
|
36
|
+
*/
|
|
37
|
+
hiddenControls: Partial<Record<keyof IPlayerControlsRef, Writable<boolean>>>;
|
|
38
|
+
/**
|
|
39
|
+
* Определяет, могут ли вообще контролы быть показаны.
|
|
40
|
+
*/
|
|
41
|
+
isControlsAvailable: Writable<boolean>;
|
|
33
42
|
touched: Writable<boolean>;
|
|
34
43
|
controls: {
|
|
35
44
|
prevButton: Writable<IControlInfo | undefined>;
|
|
@@ -121,6 +130,7 @@ export interface IUIState {
|
|
|
121
130
|
export interface IWebApi {
|
|
122
131
|
pictureInPictureApi?: IPictureInPictureApi;
|
|
123
132
|
annotationsApi?: IAnnotationsApi;
|
|
133
|
+
slotsApi?: SlotsApi;
|
|
124
134
|
}
|
|
125
135
|
export interface IStore {
|
|
126
136
|
initVideo: (config: IConfig & {
|
|
@@ -300,6 +310,8 @@ export interface IStore {
|
|
|
300
310
|
addAdditionalButton: (newButton: AdditionalButton) => void;
|
|
301
311
|
removeAdditionalButton: (itemId: string) => void;
|
|
302
312
|
setLiveLowLatency: (isLowLatency: boolean) => void;
|
|
313
|
+
hideControls: () => void;
|
|
314
|
+
showControls: () => void;
|
|
303
315
|
};
|
|
304
316
|
};
|
|
305
317
|
callbacks?: IVKVideoPlayerCallbacks;
|
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, store: IStore) => string;
|
|
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;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { IStore } from '../../store';
|
|
2
|
+
import type { IPlayerControlsRef } from '../../types';
|
|
1
3
|
/**
|
|
2
4
|
* Если смотреть по порядку расположения типов, то чем дальше тип, тем выше у него zIndex.
|
|
3
5
|
*
|
|
@@ -6,17 +8,39 @@
|
|
|
6
8
|
*/
|
|
7
9
|
export type SlotOverlay = 'over_video' | 'over_controls';
|
|
8
10
|
export declare const SLOT_NAME = "annotation";
|
|
11
|
+
export type HideControlsWhenIntersectedOptions = {
|
|
12
|
+
observedSlotElementId: string;
|
|
13
|
+
controlsToObserve: (keyof IPlayerControlsRef)[];
|
|
14
|
+
};
|
|
9
15
|
type AddOptions = {
|
|
10
16
|
id: string;
|
|
11
17
|
overlay: SlotOverlay;
|
|
18
|
+
hideAllControls?: boolean;
|
|
19
|
+
controlsBehaviour?: HideControlsWhenIntersectedOptions;
|
|
12
20
|
};
|
|
13
21
|
export declare class SlotsApi {
|
|
14
22
|
private shadowRootContainer;
|
|
15
23
|
private slots;
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
private store;
|
|
25
|
+
constructor();
|
|
26
|
+
init(shadowRootContainer: HTMLElement, store: IStore | undefined): void;
|
|
27
|
+
add(element: HTMLElement, options: AddOptions): void;
|
|
18
28
|
private setupSlotStyles;
|
|
29
|
+
/**
|
|
30
|
+
* Запускаем отслеживание пересечения между переданным элементом внутри слота и контролами.
|
|
31
|
+
*/
|
|
32
|
+
private runHidingControlsWhenIntersected;
|
|
33
|
+
/**
|
|
34
|
+
* Ищем внутри рутового элемента слота элемент, с которым хотим отслеживать пересечение контролов.
|
|
35
|
+
* Приходится делать через mutationObserver, так как данный элемент в силу асинхронной работы внешнего
|
|
36
|
+
* фреймворка может появиться позже.
|
|
37
|
+
* @param slotRootElement Рутовый элемент слота.
|
|
38
|
+
* @param slotElementId Идентификатор элемента внутри слота, с которым хотим отслеживать пересечение контролов.
|
|
39
|
+
* @param slotId Идентификатор слота.
|
|
40
|
+
*/
|
|
41
|
+
private findSlotElement;
|
|
19
42
|
remove(id: string): void;
|
|
20
43
|
destroy(): void;
|
|
44
|
+
haveSlots(): boolean;
|
|
21
45
|
}
|
|
22
46
|
export {};
|