@vkontakte/videoplayer 1.1.92-dev.524dbd943.0 → 1.1.92-dev.55a45bc45.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.92-dev.524dbd943.0",
3
+ "version": "1.1.92-dev.55a45bc45.0",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -43,9 +43,9 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "@adtech/rbadman": "2.2.57",
46
- "@vkontakte/videoplayer-core": "2.0.161-dev.524dbd943.0",
47
- "@vkontakte/videoplayer-interactive": "1.0.67-dev.524dbd943.0",
48
- "@vkontakte/videoplayer-shared": "1.0.90-dev.524dbd943.0",
49
- "@vkontakte/videoplayer-statistics": "1.0.107-dev.524dbd943.0"
46
+ "@vkontakte/videoplayer-core": "2.0.161-dev.55a45bc45.0",
47
+ "@vkontakte/videoplayer-interactive": "1.0.67-dev.55a45bc45.0",
48
+ "@vkontakte/videoplayer-shared": "1.0.90-dev.55a45bc45.0",
49
+ "@vkontakte/videoplayer-statistics": "1.0.107-dev.55a45bc45.0"
50
50
  }
51
51
  }
package/types/config.d.ts CHANGED
@@ -20,10 +20,12 @@ export declare enum LogoType {
20
20
  * never - не показывать
21
21
  * always - показыватьв всегда
22
22
  */
23
- export type TitleShowBehaviour = "fullscreen" | "with-controls" | "never" | "always";
23
+ export type TitleShowBehaviour = "fullscreen" | "fullscreen-and-dpip" | "with-controls" | "never" | "always";
24
24
  export interface IDpipConfig {
25
- minimalView?: boolean;
26
25
  initialSize?: Size;
26
+ minimalView?: boolean;
27
+ showPrevNextButtons?: boolean;
28
+ showAutoplayToggle?: boolean;
27
29
  }
28
30
  export interface IAdsConfig {
29
31
  enable: ForceOrRelay;
@@ -229,6 +231,8 @@ export interface IUIConfig {
229
231
  mobileSubMenuStretchHeight: boolean;
230
232
  /** перенос кнопки с логотипом вк из верхнего-левого угла в контролы около кнопки звука */
231
233
  mobileVkLogoViewOnBottomControls: boolean;
234
+ /** включить выбор аудиодорожки, по умолчанию, первую из списка в adaptation set. */
235
+ chooseFirstAudioStreamFromAdaptationSet: boolean;
232
236
  };
233
237
  /**
234
238
  * Отключает вызов колбэка uiInfo.onPlayerSizeChanged при ресайзе обычного pip
@@ -1,9 +1,11 @@
1
1
  export declare const enum ProcessedKeysCodes {
2
+ Alt = "Alt",
2
3
  ArrowLeft = "ArrowLeft",
3
4
  ArrowUp = "ArrowUp",
4
5
  ArrowRight = "ArrowRight",
5
6
  ArrowDown = "ArrowDown",
6
7
  Comma = "Comma",
8
+ Control = "Control",
7
9
  Period = "Period",
8
10
  Space = "Space",
9
11
  KeyC = "KeyC",
@@ -4,7 +4,7 @@
4
4
  * Управляет состоянием Picture-in-Picture режима.
5
5
  */
6
6
  import type { Readable } from "svelte/store";
7
- import type { IPictureInPictureApi, PictureInPictureType } from "../../../types";
7
+ import { type IPictureInPictureApi, PictureInPictureType } from "../../../types";
8
8
  /**
9
9
  * Зависимости модуля pictureInPicture
10
10
  */
@@ -12,13 +12,19 @@ export interface Deps {
12
12
  /** API Picture-in-Picture */
13
13
  pictureInPictureApi?: IPictureInPictureApi;
14
14
  }
15
+ export interface DpipHiddenFeatures {
16
+ autoplayToggle?: boolean;
17
+ prevNext?: boolean;
18
+ }
15
19
  /**
16
20
  * Состояние модуля pictureInPicture
17
21
  */
18
22
  export interface PictureInPictureStoreState {
19
23
  isActive$: Readable<boolean>;
24
+ isDpipActive$: Readable<boolean>;
20
25
  isEnabled$: Readable<boolean>;
21
26
  type$: Readable<PictureInPictureType | undefined>;
27
+ hiddenFeatures$: Readable<DpipHiddenFeatures | undefined>;
22
28
  }
23
29
  /**
24
30
  * Результат создания pictureInPicture store
@@ -21,14 +21,15 @@ export interface SetQualityInfo {
21
21
  changeReason?: "default" | "limit-changed";
22
22
  byUser?: boolean;
23
23
  }
24
- export interface IAdsState {
25
- position: Writable<number>;
26
- duration: Writable<number>;
27
- playbackState: Writable<AdsPlaybackState>;
28
- canSkip: Writable<boolean>;
29
- secondsToWatchBeforeSkip: Writable<number>;
30
- postrollPassed: Writable<boolean>;
24
+ export interface IAdsStateValues {
25
+ position: number;
26
+ duration: number;
27
+ playbackState: AdsPlaybackState;
28
+ canSkip: boolean;
29
+ secondsToWatchBeforeSkip: number;
30
+ postrollPassed: boolean;
31
31
  }
32
+ export type IAdsState = { [K in keyof IAdsStateValues] : Writable<IAdsStateValues[K]> };
32
33
  export interface IUIState {
33
34
  t: (key: Key, params?: Record<string, string>) => string;
34
35
  isMinimalView$: Writable<boolean>;
@@ -356,10 +357,10 @@ export interface IStore {
356
357
  callbacks?: IVKVideoPlayerCallbacks;
357
358
  setUiCallbacks: (uiCallbacks: IVKVideoPlayerUICallbacks) => void;
358
359
  initAdmanWrapper: VoidFunction;
360
+ resetAdsState: VoidFunction;
359
361
  updateAdmanWrapperSubscriptions: VoidFunction;
360
362
  updateStatisticsSubscriptions: VoidFunction;
361
363
  updateAppTracerSubscriptions: VoidFunction;
362
- updateTracerSubscriptions: VoidFunction;
363
364
  getLogger: () => ILogger;
364
365
  getPlayer: () => IPlayer;
365
366
  destroy(): void;
@@ -1,8 +1,8 @@
1
1
  import type { Readable } from "svelte/store";
2
2
  import type { IValueObservable } from "@vkontakte/videoplayer-shared";
3
3
  import type { IPlayer, IConfig, IObservable } from "@vkontakte/videoplayer-core";
4
- import type { EnrichedStore, IStore } from ".";
5
- import type { AdditionalButtonDeprecated } from "../types";
4
+ import type { EnrichedStore, IAdsStateValues, IStore } from "./types";
5
+ import { type AdditionalButtonDeprecated } from "../types";
6
6
  import type { AdditionalDesktopControlPanelButton } from "../components/Controls/types";
7
7
  import type { ISDKConfig } from "../config";
8
8
  export declare const setStores: (store: EnrichedStore) => void;
@@ -50,3 +50,4 @@ export declare class SubtitlesDownloader {
50
50
  destroy(): void;
51
51
  isDestroyed(): boolean;
52
52
  }
53
+ export declare const getAdsDefaultStateValues: () => IAdsStateValues;
@@ -39,6 +39,7 @@ export interface IVKVideoPlayerCallbacks {
39
39
  onPlay?: () => void;
40
40
  onLooped?: () => void;
41
41
  onPause?: () => void;
42
+ onFinished?: () => void;
42
43
  onVolumeChange?: (volume: number) => void;
43
44
  onFullscreenEnter?: () => void;
44
45
  onFullscreenExit?: () => void;
@@ -492,12 +493,13 @@ export interface ExternalPictureInPictureEventHandlers {
492
493
  resize?: (size: Size) => void;
493
494
  }
494
495
  export interface IPictureInPictureApi {
496
+ info: IPictureInPictureApiInfo;
497
+ dpipConfig?: IDpipConfig;
495
498
  isSupported(): boolean;
496
499
  isActive(): boolean;
497
500
  setContext(svelteContext: Map<unknown, unknown>): void;
498
501
  request(): Promise<void>;
499
502
  exit(): Promise<void>;
500
- info: IPictureInPictureApiInfo;
501
503
  setEnabled(enabled: boolean): void;
502
504
  dispose(): Promise<void>;
503
505
  assignPlayerContainer(playerContainer: HTMLElement): void;
@@ -1,8 +1,9 @@
1
1
  import { ValueSubject } from "@vkontakte/videoplayer-shared";
2
+ import type { IDpipConfig } from "../../../config";
2
3
  import type { ExternalPictureInPictureEventHandlers, IPictureInPictureApi, PictureInPictureSettings } from "../../../types";
3
4
  import { PictureInPictureType } from "../../../types";
4
5
  export declare class DocumentPictureInPictureApiSvelte implements IPictureInPictureApi {
5
- private readonly initialSize;
6
+ readonly settings: PictureInPictureSettings;
6
7
  private playerDomElement;
7
8
  private playerParentShadowRoot;
8
9
  private playerDummyElement;
@@ -18,7 +19,8 @@ export declare class DocumentPictureInPictureApiSvelte implements IPictureInPict
18
19
  */
19
20
  private pipActive;
20
21
  private readonly pipApi;
21
- constructor({ enabled, initialSize }: PictureInPictureSettings);
22
+ constructor(settings: PictureInPictureSettings);
23
+ get dpipConfig(): IDpipConfig;
22
24
  /**
23
25
  * Флаг показывает, есть ли в целом возможность использовать dpip в данном браузере, поддерживается ли это.
24
26
  */
@@ -39,6 +41,7 @@ export declare class DocumentPictureInPictureApiSvelte implements IPictureInPict
39
41
  assignPlayerContainer(playerContainer: HTMLElement): void;
40
42
  updateVideoElement(): void;
41
43
  setExternalEventHandlers(externalEventHandlers: ExternalPictureInPictureEventHandlers): void;
44
+ private get initialSize();
42
45
  private createStretchedContainer;
43
46
  }
44
47
  export declare function isInstanceOfDocumentPictureInPictureApi(pictureInPictureApi?: IPictureInPictureApi): pictureInPictureApi is DocumentPictureInPictureApiSvelte;