@vkontakte/videoplayer 1.1.54-dev.11a53745.0 → 1.1.54-dev.2b69b64d.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 +16 -16
- package/es2015.esm.js +17 -17
- package/es2018.cjs.js +16 -16
- package/es2018.esm.js +17 -17
- package/esnext.cjs.js +12 -12
- package/esnext.esm.js +12 -12
- package/evergreen.esm.js +12 -12
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.d.ts +2 -0
- package/types/store/index.d.ts +1 -3
- package/types/store/micro/pictureInPicture.d.ts +11 -0
- package/types/types/index.d.ts +12 -0
- package/types/utils/webAPI/pictureInPictureApi/documentPictureInPictureApi.d.ts +13 -1
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApi.d.ts +13 -1
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApiFactory.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.54-dev.
|
|
3
|
+
"version": "1.1.54-dev.2b69b64d.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@adtech/rbadman": "^2.2.57",
|
|
53
|
-
"@vkontakte/videoplayer-core": "2.0.123-dev.
|
|
54
|
-
"@vkontakte/videoplayer-interactive": "1.0.29-dev.
|
|
55
|
-
"@vkontakte/videoplayer-shared": "1.0.52-dev.
|
|
56
|
-
"@vkontakte/videoplayer-statistics": "1.0.69-dev.
|
|
53
|
+
"@vkontakte/videoplayer-core": "2.0.123-dev.967b5dac.0",
|
|
54
|
+
"@vkontakte/videoplayer-interactive": "1.0.29-dev.e70294db.0",
|
|
55
|
+
"@vkontakte/videoplayer-shared": "1.0.52-dev.c7d232fe.0",
|
|
56
|
+
"@vkontakte/videoplayer-statistics": "1.0.69-dev.df4dea56.0"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -34,6 +34,7 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
34
34
|
private readonly logger;
|
|
35
35
|
private readonly log;
|
|
36
36
|
private readonly subscription;
|
|
37
|
+
private readonly interactiveSubscription;
|
|
37
38
|
annotationsApi: AnnotationsApi | undefined;
|
|
38
39
|
private createPlayerTimeout;
|
|
39
40
|
private prevIsid;
|
|
@@ -70,6 +71,7 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
70
71
|
pause(): void;
|
|
71
72
|
stop(): void;
|
|
72
73
|
setMuted(muted: boolean): void;
|
|
74
|
+
setPiPEnabled(enabled: boolean): void;
|
|
73
75
|
setVolume(volume: number): void;
|
|
74
76
|
setRepeat(repeat: boolean): void;
|
|
75
77
|
seekTime(time: number): void;
|
package/types/store/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import type { Readable, Writable } from 'svelte/store';
|
|
|
8
8
|
import { AdmanWrapper } from '../components/Ads/admanWrapper';
|
|
9
9
|
import type { LanguageConfig } from '../translation/types';
|
|
10
10
|
import type { AdditionalButtonDeprecated, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, Position, VideoPlaybackRate, VideoQualityForRender, VideoQualityUI, VideoSubtitle, VideoSubtitleParsed } from '../types';
|
|
11
|
-
import { AdsPlaybackState
|
|
11
|
+
import { AdsPlaybackState } from '../types';
|
|
12
12
|
import type { DebugData } from './utils';
|
|
13
13
|
import { GridTypes, type PlayPrevChapterDisabledTooltipKey } from '../constans';
|
|
14
14
|
import { UIOneStat } from '../services/statistics';
|
|
@@ -84,8 +84,6 @@ export interface IUIState {
|
|
|
84
84
|
icon3DVideoVisible: Writable<boolean>;
|
|
85
85
|
scrubbingInProgress: Writable<boolean>;
|
|
86
86
|
is3DVideo: Writable<boolean>;
|
|
87
|
-
isPictureInPictureActive$: Readable<boolean>;
|
|
88
|
-
pictureInPictureType$: Readable<PictureInPictureType>;
|
|
89
87
|
currentGridType$: Readable<GridTypes>;
|
|
90
88
|
interactiveHideMobileControls: Writable<boolean>;
|
|
91
89
|
additionalButtonsDeprecated$: Readable<AdditionalButtonDeprecated[]>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseMicroStore } from './base';
|
|
2
|
+
import type { InitMicroStoreParams, PictureInPictureType } from '../../types';
|
|
3
|
+
export default class PictureInPicture extends BaseMicroStore {
|
|
4
|
+
readonly stateName = "pictureInPicture$";
|
|
5
|
+
state$: {
|
|
6
|
+
isActive$: import("svelte/store").Writable<boolean>;
|
|
7
|
+
isEnabled$: import("svelte/store").Writable<boolean>;
|
|
8
|
+
type$: import("svelte/store").Writable<PictureInPictureType | undefined>;
|
|
9
|
+
};
|
|
10
|
+
init(initStoreParams: InitMicroStoreParams): import("@vkontakte/videoplayer-shared").Subscription;
|
|
11
|
+
}
|
package/types/types/index.d.ts
CHANGED
|
@@ -260,6 +260,7 @@ export interface IVKVideoPlayerConfig {
|
|
|
260
260
|
showEndScreen?: boolean;
|
|
261
261
|
showAutoplayNext?: boolean;
|
|
262
262
|
showNextPrevButtons?: boolean;
|
|
263
|
+
pipEnabled?: boolean;
|
|
263
264
|
}
|
|
264
265
|
export interface IControlInfo {
|
|
265
266
|
/** @deprecated Используйте новое поле left */
|
|
@@ -376,8 +377,12 @@ export declare enum PictureInPictureType {
|
|
|
376
377
|
}
|
|
377
378
|
export interface IPictureInPictureApiInfo {
|
|
378
379
|
isActive$: IValueObservable<boolean>;
|
|
380
|
+
isEnabled$: IValueObservable<boolean>;
|
|
379
381
|
type: PictureInPictureType;
|
|
380
382
|
}
|
|
383
|
+
export type PictureInPictureSettings = {
|
|
384
|
+
enabled?: boolean;
|
|
385
|
+
};
|
|
381
386
|
export interface IPictureInPictureApi {
|
|
382
387
|
isSupported: () => boolean;
|
|
383
388
|
isActive: () => boolean;
|
|
@@ -385,6 +390,7 @@ export interface IPictureInPictureApi {
|
|
|
385
390
|
request: () => Promise<void>;
|
|
386
391
|
remove: () => Promise<void>;
|
|
387
392
|
info: IPictureInPictureApiInfo;
|
|
393
|
+
setEnabled: (enabled: boolean) => void;
|
|
388
394
|
dispose: () => Promise<void>;
|
|
389
395
|
}
|
|
390
396
|
export interface IAnnotationsApi {
|
|
@@ -490,6 +496,11 @@ export type IToggleable<T> = T & {
|
|
|
490
496
|
};
|
|
491
497
|
type MicroStoreWritableBase<T = unknown> = Writable<T>;
|
|
492
498
|
type ToggleableMicroStore = IToggleable<MicroStoreWritableBase<boolean | null>>;
|
|
499
|
+
export type PictureInPictureMicroStore = {
|
|
500
|
+
isActive$: Writable<boolean>;
|
|
501
|
+
isEnabled$: Writable<boolean>;
|
|
502
|
+
type$: Writable<PictureInPictureType | undefined>;
|
|
503
|
+
};
|
|
493
504
|
export interface IMicroStores {
|
|
494
505
|
fakeIsPlaying$: ToggleableMicroStore;
|
|
495
506
|
interactiveControlsOpacity$: ToggleableMicroStore;
|
|
@@ -499,6 +510,7 @@ export interface IMicroStores {
|
|
|
499
510
|
clearTimeout: () => void;
|
|
500
511
|
};
|
|
501
512
|
graphIsOpened$: ToggleableMicroStore;
|
|
513
|
+
pictureInPicture$: PictureInPictureMicroStore;
|
|
502
514
|
}
|
|
503
515
|
export interface InitMicroStoreParams {
|
|
504
516
|
store: IStore;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IPictureInPictureApi } from '../../../types';
|
|
1
|
+
import type { IPictureInPictureApi, PictureInPictureSettings } from '../../../types';
|
|
2
2
|
import { ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
3
3
|
import { PictureInPictureType } from '../../../types';
|
|
4
4
|
export declare class DocumentPictureInPictureApi implements IPictureInPictureApi {
|
|
@@ -9,15 +9,27 @@ export declare class DocumentPictureInPictureApi implements IPictureInPictureApi
|
|
|
9
9
|
private pipWindow;
|
|
10
10
|
info: {
|
|
11
11
|
isActive$: ValueSubject<boolean>;
|
|
12
|
+
isEnabled$: ValueSubject<boolean>;
|
|
12
13
|
type: PictureInPictureType;
|
|
13
14
|
};
|
|
15
|
+
constructor({ enabled }?: PictureInPictureSettings);
|
|
16
|
+
/**
|
|
17
|
+
* Флаг показывает, есть ли в целом возможность использовать dpip в данном браузере, поддерживается ли это.
|
|
18
|
+
*/
|
|
14
19
|
isSupported(): boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Флаг показывает, находится ли пользователь в режиме dpip.
|
|
22
|
+
*/
|
|
15
23
|
isActive(): boolean;
|
|
16
24
|
setPlayerDomElement(playerDomElement: HTMLElement, playerParentShadowRoot: ShadowRoot): void;
|
|
17
25
|
setContext(svelteContext: Map<unknown, unknown>): void;
|
|
18
26
|
request(): Promise<void>;
|
|
19
27
|
remove(): Promise<void>;
|
|
20
28
|
dispose(): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Флаг определяет может ли пользователь переходить в dpip на уровне бизнес логике.
|
|
31
|
+
*/
|
|
32
|
+
setEnabled(enabled: boolean): void;
|
|
21
33
|
private createStretchedContainer;
|
|
22
34
|
}
|
|
23
35
|
export declare function isInstanceOfDocumentPictureInPictureApi(pictureInPictureApi?: IPictureInPictureApi): pictureInPictureApi is DocumentPictureInPictureApi;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IPictureInPictureApi } from '../../../types';
|
|
1
|
+
import type { IPictureInPictureApi, PictureInPictureSettings } from '../../../types';
|
|
2
2
|
import { PictureInPictureType } from '../../../types';
|
|
3
3
|
import { ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
4
4
|
declare const PICTURE_IN_PICTURE_EVENTS: readonly ["enterpictureinpicture", "leavepictureinpicture", "resize"];
|
|
@@ -16,9 +16,17 @@ export declare class PictureInPictureApi implements IPictureInPictureApi {
|
|
|
16
16
|
private readonly eventHandlers;
|
|
17
17
|
info: {
|
|
18
18
|
isActive$: ValueSubject<boolean>;
|
|
19
|
+
isEnabled$: ValueSubject<boolean>;
|
|
19
20
|
type: PictureInPictureType;
|
|
20
21
|
};
|
|
22
|
+
constructor({ enabled }?: PictureInPictureSettings);
|
|
23
|
+
/**
|
|
24
|
+
* Флаг показывает, есть ли в целом возможность использовать pip в данном браузере, поддерживается ли это.
|
|
25
|
+
*/
|
|
21
26
|
isSupported(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Флаг показывает, находится ли пользователь в режиме pip.
|
|
29
|
+
*/
|
|
22
30
|
isActive(): boolean;
|
|
23
31
|
setContext(svelteContext: Map<unknown, unknown>): void;
|
|
24
32
|
revealPictureInPicture(): Promise<void>;
|
|
@@ -33,6 +41,10 @@ export declare class PictureInPictureApi implements IPictureInPictureApi {
|
|
|
33
41
|
private onEnterPictureInPicture;
|
|
34
42
|
private onLeavePictureInPicture;
|
|
35
43
|
private onResize;
|
|
44
|
+
/**
|
|
45
|
+
* Флаг определяет может ли пользователь переходить в pip на уровне бизнес логике.
|
|
46
|
+
*/
|
|
47
|
+
setEnabled(enabled: boolean): void;
|
|
36
48
|
}
|
|
37
49
|
export declare function isInstanceOfPictureInPictureApi(pictureInPictureApi?: IPictureInPictureApi): pictureInPictureApi is PictureInPictureApi;
|
|
38
50
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IPictureInPictureApi } from '../../../types';
|
|
1
|
+
import type { IPictureInPictureApi, PictureInPictureSettings } from '../../../types';
|
|
2
2
|
export declare class PictureInPictureApiFactory {
|
|
3
|
-
static getLatestSupportedVersion(): IPictureInPictureApi | undefined;
|
|
3
|
+
static getLatestSupportedVersion(settings: PictureInPictureSettings): IPictureInPictureApi | undefined;
|
|
4
4
|
}
|