@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer",
3
- "version": "1.1.81",
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.150",
59
- "@vkontakte/videoplayer-interactive": "1.0.56",
60
- "@vkontakte/videoplayer-shared": "1.0.79",
61
- "@vkontakte/videoplayer-statistics": "1.0.96"
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
  }
@@ -23,6 +23,7 @@ export type AdmanInitParams = {
23
23
  adsVideoElement: HTMLVideoElement;
24
24
  paramsOverride?: AdsParams;
25
25
  externalApi?: IAdmanInitParamsExternalApi;
26
+ json?: Record<string, unknown>;
26
27
  };
27
28
  export type IPlayerState = {
28
29
  vsid: Readable<string | undefined>;
@@ -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;
@@ -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: () => boolean;
461
- isActive: () => boolean;
462
- setContext: (svelteContext: Map<unknown, unknown>) => void;
463
- request: () => Promise<void>;
464
- exit: () => Promise<void>;
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: (enabled: boolean) => void;
467
- dispose: () => Promise<void>;
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;