@vkontakte/videoplayer 1.1.81 → 1.1.82-dev.bc3c59e8.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 +46 -46
- package/es2015.esm.js +46 -46
- package/es2018.cjs +34 -34
- package/es2018.esm.js +34 -34
- package/es2024.cjs +36 -36
- package/es2024.esm.js +36 -36
- package/esnext.cjs +36 -36
- package/esnext.esm.js +36 -36
- package/evergreen.esm.js +36 -36
- package/package.json +5 -5
- package/types/components/Ads/types.d.ts +1 -0
- package/types/components/Root/types.d.ts +1 -0
- package/types/types/index.d.ts +20 -8
- package/types/utils/webAPI/pictureInPictureApi/documentPictureInPictureApi.svelte.d.ts +9 -1
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApi.d.ts +7 -1
- package/types/utils/webAPI/pictureInPictureApi/utils.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.82-dev.bc3c59e8.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.
|
|
59
|
-
"@vkontakte/videoplayer-interactive": "1.0.
|
|
60
|
-
"@vkontakte/videoplayer-shared": "1.0.
|
|
61
|
-
"@vkontakte/videoplayer-statistics": "1.0.
|
|
58
|
+
"@vkontakte/videoplayer-core": "2.0.151-dev.bc3c59e8.0",
|
|
59
|
+
"@vkontakte/videoplayer-interactive": "1.0.57-dev.bc3c59e8.0",
|
|
60
|
+
"@vkontakte/videoplayer-shared": "1.0.80-dev.bc3c59e8.0",
|
|
61
|
+
"@vkontakte/videoplayer-statistics": "1.0.97-dev.bc3c59e8.0"
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -30,6 +30,7 @@ export interface RootProps {
|
|
|
30
30
|
adsParams?: AdmanInitParams['params'];
|
|
31
31
|
adsAutoplayParam?: boolean;
|
|
32
32
|
adsExternalApi?: AdmanInitParams['externalApi'];
|
|
33
|
+
adsJson?: AdmanInitParams['json'];
|
|
33
34
|
duration?: number | undefined;
|
|
34
35
|
logoClickable: boolean;
|
|
35
36
|
logoHidden: boolean;
|
package/types/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VideoQuality, VideoFormat, ISources, IExternalTextTrack, IAudioStream } from '@vkontakte/videoplayer-core';
|
|
2
|
-
import type { IValueObservable, InterfaceLanguage, Subscription, IRectangle, DevNullEntry } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { IValueObservable, InterfaceLanguage, Subscription, IRectangle, DebouncedFn, DevNullEntry } from '@vkontakte/videoplayer-shared';
|
|
3
3
|
import type { Chapter, Manifest, ManifestVideo, VideoInfo, Interactives, IInteractiveOptions } from '@vkontakte/videoplayer-interactive';
|
|
4
4
|
import { PlaybackState } from '@vkontakte/videoplayer-core';
|
|
5
5
|
import type { MediascopePixelTypes } from '@vkontakte/videoplayer-statistics';
|
|
@@ -207,6 +207,7 @@ export interface IVideoDataBase {
|
|
|
207
207
|
duration?: AdmanInitParams['duration'];
|
|
208
208
|
adsParams?: AdmanInitParams['params'];
|
|
209
209
|
adsExternalApi?: AdmanInitParams['externalApi'];
|
|
210
|
+
adsJson?: AdmanInitParams['json'];
|
|
210
211
|
videoEpisodes?: IVideoEpisode[];
|
|
211
212
|
previewThumbsData?: ITimelinePreviewThumbsData;
|
|
212
213
|
isClip?: boolean;
|
|
@@ -456,15 +457,26 @@ export interface IPictureInPictureApiInfo {
|
|
|
456
457
|
export type PictureInPictureSettings = {
|
|
457
458
|
enabled?: boolean;
|
|
458
459
|
};
|
|
460
|
+
export interface PictureInPictureEventHandlers {
|
|
461
|
+
enterpictureinpicture: (event: Event) => void;
|
|
462
|
+
leavepictureinpicture: (event: Event) => void;
|
|
463
|
+
resize: DebouncedFn<(event: Event) => void>;
|
|
464
|
+
}
|
|
465
|
+
export interface ExternalPictureInPictureEventHandlers extends Omit<PictureInPictureEventHandlers, 'resize'> {
|
|
466
|
+
resize: (event: Event) => void;
|
|
467
|
+
}
|
|
459
468
|
export interface IPictureInPictureApi {
|
|
460
|
-
isSupported
|
|
461
|
-
isActive
|
|
462
|
-
setContext
|
|
463
|
-
request
|
|
464
|
-
exit
|
|
469
|
+
isSupported(): boolean;
|
|
470
|
+
isActive(): boolean;
|
|
471
|
+
setContext(svelteContext: Map<unknown, unknown>): void;
|
|
472
|
+
request(): Promise<void>;
|
|
473
|
+
exit(): Promise<void>;
|
|
465
474
|
info: IPictureInPictureApiInfo;
|
|
466
|
-
setEnabled
|
|
467
|
-
dispose
|
|
475
|
+
setEnabled(enabled: boolean): void;
|
|
476
|
+
dispose(): Promise<void>;
|
|
477
|
+
assignPlayerContainer(playerContainer: HTMLElement): void;
|
|
478
|
+
updateVideoElement(): void;
|
|
479
|
+
setExternalEventHandlers(externalEventHandlers: Partial<ExternalPictureInPictureEventHandlers>): void;
|
|
468
480
|
}
|
|
469
481
|
export interface IAnnotationsApi {
|
|
470
482
|
/** @deprecated Больше не используется. Контейнер теперь определяется самостоятельно */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { IPictureInPictureApi, PictureInPictureSettings } from '../../../types';
|
|
2
1
|
import { ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { ExternalPictureInPictureEventHandlers, IPictureInPictureApi, PictureInPictureSettings } from '../../../types';
|
|
3
3
|
import { PictureInPictureType } from '../../../types';
|
|
4
4
|
export declare class DocumentPictureInPictureApiSvelte implements IPictureInPictureApi {
|
|
5
5
|
private playerDomElement;
|
|
@@ -12,6 +12,11 @@ export declare class DocumentPictureInPictureApiSvelte implements IPictureInPict
|
|
|
12
12
|
isEnabled$: ValueSubject<boolean>;
|
|
13
13
|
type: PictureInPictureType;
|
|
14
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Обычный pip может быть открыт браузером через медиа-сессию
|
|
17
|
+
*/
|
|
18
|
+
private pipActive;
|
|
19
|
+
private readonly pipApi;
|
|
15
20
|
constructor({ enabled }?: PictureInPictureSettings);
|
|
16
21
|
/**
|
|
17
22
|
* Флаг показывает, есть ли в целом возможность использовать dpip в данном браузере, поддерживается ли это.
|
|
@@ -30,6 +35,9 @@ export declare class DocumentPictureInPictureApiSvelte implements IPictureInPict
|
|
|
30
35
|
* Флаг определяет может ли пользователь переходить в dpip на уровне бизнес логике.
|
|
31
36
|
*/
|
|
32
37
|
setEnabled(enabled: boolean): void;
|
|
38
|
+
assignPlayerContainer(playerContainer: HTMLElement): void;
|
|
39
|
+
updateVideoElement(): void;
|
|
40
|
+
setExternalEventHandlers(externalEventHandlers: Partial<ExternalPictureInPictureEventHandlers>): void;
|
|
33
41
|
private createStretchedContainer;
|
|
34
42
|
}
|
|
35
43
|
export declare function isInstanceOfDocumentPictureInPictureApi(pictureInPictureApi?: IPictureInPictureApi): pictureInPictureApi is DocumentPictureInPictureApiSvelte;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ValueSubject, type DebouncedFn } from '@vkontakte/videoplayer-shared';
|
|
1
2
|
import type { IPictureInPictureApi, PictureInPictureSettings } from '../../../types';
|
|
2
3
|
import { PictureInPictureType } from '../../../types';
|
|
3
|
-
import { ValueSubject, type DebouncedFn } from '@vkontakte/videoplayer-shared';
|
|
4
4
|
interface PictureInPictureEventHandlers {
|
|
5
5
|
enterpictureinpicture: (event: Event) => void;
|
|
6
6
|
leavepictureinpicture: (event: Event) => void;
|
|
@@ -47,6 +47,12 @@ export declare class PictureInPictureApi implements IPictureInPictureApi {
|
|
|
47
47
|
* Флаг определяет может ли пользователь переходить в pip на уровне бизнес логике.
|
|
48
48
|
*/
|
|
49
49
|
setEnabled(enabled: boolean): void;
|
|
50
|
+
/**
|
|
51
|
+
* для сафари нужно корректно обновить состояние пипа, потому что если мы попали сюда
|
|
52
|
+
* из за креша провайдера + клика на выход из пип-а, то сафари может не успеть прислать
|
|
53
|
+
* leavepictureinpicture на старый элемент из за чего UI застрянет в неправильном состоянии
|
|
54
|
+
*/
|
|
55
|
+
private waitForSafariLeavePictureInPicture;
|
|
50
56
|
}
|
|
51
57
|
export declare function isInstanceOfPictureInPictureApi(pictureInPictureApi?: IPictureInPictureApi): pictureInPictureApi is PictureInPictureApi;
|
|
52
58
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isPiPSupported: () => boolean;
|