@vkontakte/videoplayer 1.1.82-dev.ba996fd4.0 → 1.1.82-dev.ccc376e8.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.82-dev.ba996fd4.0",
3
+ "version": "1.1.82-dev.ccc376e8.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.151-dev.ba996fd4.0",
59
- "@vkontakte/videoplayer-interactive": "1.0.57-dev.ba996fd4.0",
60
- "@vkontakte/videoplayer-shared": "1.0.80-dev.ba996fd4.0",
61
- "@vkontakte/videoplayer-statistics": "1.0.97-dev.ba996fd4.0"
58
+ "@vkontakte/videoplayer-core": "2.0.151-dev.ccc376e8.0",
59
+ "@vkontakte/videoplayer-interactive": "1.0.57-dev.ccc376e8.0",
60
+ "@vkontakte/videoplayer-shared": "1.0.80-dev.ccc376e8.0",
61
+ "@vkontakte/videoplayer-statistics": "1.0.97-dev.ccc376e8.0"
62
62
  }
63
63
  }
@@ -2,12 +2,12 @@ import type { IAudioStream, IConfig, IExternalTextTrack, IOptionalTuningConfig,
2
2
  import { ChromecastState, PlaybackState, VideoFormat } from '@vkontakte/videoplayer-core';
3
3
  import { type IError, type ILogger, InterfaceLanguage, type IRectangle, type IValueObservable, type QualityLimits, VideoQuality, type InternalsExposure } from '@vkontakte/videoplayer-shared';
4
4
  import type { ISDKConfig, IUIConfig } from '../config';
5
- import { SeekAction } from '@vkontakte/videoplayer-statistics';
5
+ import { SeekAction, ThinOneStat } from '@vkontakte/videoplayer-statistics';
6
6
  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, type ControlBlocksRefs, type ControlsKeys, type HotKeyMapData, type IAnnotationsApi, type IControlInfo, type IDisabledControls, type IInteractiveData, type IPictureInPictureApi, type IPlayerControlsRef, type IPlayerPhase, type ITimelinePreviewThumbsData, type IVideoEpisode, type IVKVideoPlayerCallbacks, type IVKVideoPlayerUICallbacks, type PlaybackStateRealistic, type Position, type VideoPlaybackRate, type VideoPlayerView, type VideoQualityForRender, type VideoQualityUI, type VideoSubtitle, type VideoSubtitleParsed } from '../types';
10
+ import { type AdditionalButtonDeprecated, type ControlBlocksRefs, type ControlsKeys, type HotKeyMapData, type IAnnotationsApi, type IControlInfo, type IDisabledControls, type IInteractiveData, type IPictureInPictureApi, type IPlayerControlsRef, type IPlayerPhase, type ITimelinePreviewThumbsData, type IVideoEpisode, type IVKVideoPlayerCallbacks, type IVKVideoPlayerUICallbacks, type PlaybackStateRealistic, type Position, type Size, type VideoPlaybackRate, type VideoPlayerView, type VideoQualityForRender, type VideoQualityUI, type VideoSubtitle, type VideoSubtitleParsed } from '../types';
11
11
  import { AdsPlaybackState } from '../types';
12
12
  import { type QualitySettingsAppliesTo } from '../utils/userSettings';
13
13
  import type { DebugData } from './utils';
@@ -63,6 +63,7 @@ export interface IUIState {
63
63
  fullscreen: Writable<IControlInfo | undefined>;
64
64
  chromecast: Writable<IControlInfo | undefined>;
65
65
  pip: Writable<IControlInfo | undefined>;
66
+ 'theater-mode-button': Writable<IControlInfo | undefined>;
66
67
  vkLogo: Writable<IControlInfo | undefined>;
67
68
  interactiveTimeIndicator: Writable<IControlInfo | undefined>;
68
69
  timeline: Writable<IControlInfo | undefined>;
@@ -94,10 +95,7 @@ export interface IUIState {
94
95
  showContextMenuBtn$: Writable<boolean>;
95
96
  position$: Writable<Position>;
96
97
  };
97
- playerSize: Writable<{
98
- width: number;
99
- height: number;
100
- }>;
98
+ playerSize: Writable<Size>;
101
99
  isMobile: Writable<boolean>;
102
100
  mobileNotReportControlHidden$: Readable<boolean>;
103
101
  icon3DVideoVisible: Writable<boolean>;
@@ -140,7 +138,6 @@ export interface IUIState {
140
138
  * Определяет, что двойное ускорение видео доступно.
141
139
  */
142
140
  doubleForwardAvailable$: Readable<false>;
143
- previewTrackNotificationVisible: Writable<boolean>;
144
141
  previewTrackActive: Writable<boolean>;
145
142
  previewTrackDragInProgress: Writable<boolean>;
146
143
  previewTrackAvailable: Readable<boolean>;
@@ -261,7 +258,7 @@ export interface IStore {
261
258
  togglePictureInPicture: () => void;
262
259
  startScrubbing: (progress: number) => void;
263
260
  progressScrubbing: (progress: number) => void;
264
- completeScrubbing: (progress: number, forcePrecise?: boolean) => void;
261
+ completeScrubbing: (progress: number, forcePrecise?: boolean, action?: ThinOneStat.ActionSeekType | SeekAction) => void;
265
262
  toggleChromecast: () => void;
266
263
  seekTime: (time: number, action: SeekAction, forcePrecise?: boolean) => void;
267
264
  seekEpisodeStartTime: (time: number) => void;
@@ -2,7 +2,7 @@ import type { VideoQuality, VideoFormat, ISources, IExternalTextTrack, IAudioStr
2
2
  import type { IValueObservable, InterfaceLanguage, Subscription, IRectangle, 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
- import type { MediascopePixelTypes } from '@vkontakte/videoplayer-statistics';
5
+ import type { MediascopePixelTypes, SeekAction, ThinOneStat } from '@vkontakte/videoplayer-statistics';
6
6
  import type { Writable, Readable } from 'svelte/store';
7
7
  import type { ISDKConfig, IUIConfig } from '../config';
8
8
  import type { IStore } from '../store';
@@ -44,7 +44,7 @@ export interface IVKVideoPlayerCallbacks {
44
44
  onEpisodeClicked?: (byKeyboard: boolean) => void;
45
45
  onEpisodeChanged?: (episode: IVideoEpisode) => void;
46
46
  onTimeupdate?: (duration: number, position: number) => void;
47
- onSeek?: (from: number, to: number) => void;
47
+ onSeek?: (from: number, to: number, type: ThinOneStat.ActionSeekType | SeekAction) => void;
48
48
  onCrashed?: (reason?: string) => void;
49
49
  onRecoverableError?: (reason?: string) => void;
50
50
  onCurrentFormatChanged?: (currentFormat: VideoFormat | undefined) => void;
@@ -117,6 +117,7 @@ export interface IVKVideoPlayerCallbacks {
117
117
  onFullscreenChanged?: (value?: IControlInfo) => void;
118
118
  onChromecastChanged?: (value?: IControlInfo) => void;
119
119
  onPipChanged?: (value?: IControlInfo) => void;
120
+ onTheaterModeChanged?: (value?: IControlInfo) => void;
120
121
  onVkLogoChanged?: (value?: IControlInfo) => void;
121
122
  onTimelineChanged?: (value?: IControlInfo) => void;
122
123
  onTimelineMouseEnter?: () => void;
@@ -345,6 +346,7 @@ export interface IPlayerControlsRef {
345
346
  fullscreen?: HTMLElement;
346
347
  chromecast?: HTMLButtonElement;
347
348
  pip?: HTMLButtonElement;
349
+ 'theater-mode-button'?: HTMLButtonElement;
348
350
  vkLogo?: HTMLButtonElement;
349
351
  interactiveTimeIndicator?: HTMLElement;
350
352
  timeline?: HTMLElement;
@@ -457,15 +459,27 @@ export interface IPictureInPictureApiInfo {
457
459
  export type PictureInPictureSettings = {
458
460
  enabled?: boolean;
459
461
  };
462
+ export interface Size {
463
+ width: number;
464
+ height: number;
465
+ }
466
+ export interface ExternalPictureInPictureEventHandlers {
467
+ enterpictureinpicture?: VoidFunction;
468
+ leavepictureinpicture?: VoidFunction;
469
+ resize?: (size: Size) => void;
470
+ }
460
471
  export interface IPictureInPictureApi {
461
- isSupported: () => boolean;
462
- isActive: () => boolean;
463
- setContext: (svelteContext: Map<unknown, unknown>) => void;
464
- request: () => Promise<void>;
465
- exit: () => Promise<void>;
472
+ isSupported(): boolean;
473
+ isActive(): boolean;
474
+ setContext(svelteContext: Map<unknown, unknown>): void;
475
+ request(): Promise<void>;
476
+ exit(): Promise<void>;
466
477
  info: IPictureInPictureApiInfo;
467
- setEnabled: (enabled: boolean) => void;
468
- dispose: () => Promise<void>;
478
+ setEnabled(enabled: boolean): void;
479
+ dispose(): Promise<void>;
480
+ assignPlayerContainer(playerContainer: HTMLElement): void;
481
+ updateVideoElement(): void;
482
+ setExternalEventHandlers(externalEventHandlers: ExternalPictureInPictureEventHandlers): void;
469
483
  }
470
484
  export interface IAnnotationsApi {
471
485
  /** @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: ExternalPictureInPictureEventHandlers): void;
33
41
  private createStretchedContainer;
34
42
  }
35
43
  export declare function isInstanceOfDocumentPictureInPictureApi(pictureInPictureApi?: IPictureInPictureApi): pictureInPictureApi is DocumentPictureInPictureApiSvelte;
@@ -1,14 +1,6 @@
1
- import type { IPictureInPictureApi, PictureInPictureSettings } from '../../../types';
1
+ import { ValueSubject } from '@vkontakte/videoplayer-shared';
2
+ import type { ExternalPictureInPictureEventHandlers, IPictureInPictureApi, PictureInPictureSettings } from '../../../types';
2
3
  import { PictureInPictureType } from '../../../types';
3
- import { ValueSubject, type DebouncedFn } from '@vkontakte/videoplayer-shared';
4
- interface PictureInPictureEventHandlers {
5
- enterpictureinpicture: (event: Event) => void;
6
- leavepictureinpicture: (event: Event) => void;
7
- resize: DebouncedFn<(event: Event) => void>;
8
- }
9
- interface ExternalPictureInPictureEventHandlers extends Omit<PictureInPictureEventHandlers, 'resize'> {
10
- resize: (event: Event) => void;
11
- }
12
4
  export declare class PictureInPictureApi implements IPictureInPictureApi {
13
5
  private isRequested;
14
6
  private videoElement;
@@ -37,7 +29,7 @@ export declare class PictureInPictureApi implements IPictureInPictureApi {
37
29
  assignPlayerContainer(playerContainer: HTMLElement): void;
38
30
  updateVideoElement(): void;
39
31
  private addEventHandlers;
40
- setExternalEventHandlers(externalEventHandlers: Partial<ExternalPictureInPictureEventHandlers>): void;
32
+ setExternalEventHandlers(externalEventHandlers: ExternalPictureInPictureEventHandlers): void;
41
33
  private removeEventHandlers;
42
34
  dispose(): Promise<void>;
43
35
  private onEnterPictureInPicture;
@@ -55,4 +47,3 @@ export declare class PictureInPictureApi implements IPictureInPictureApi {
55
47
  private waitForSafariLeavePictureInPicture;
56
48
  }
57
49
  export declare function isInstanceOfPictureInPictureApi(pictureInPictureApi?: IPictureInPictureApi): pictureInPictureApi is PictureInPictureApi;
58
- export {};
@@ -0,0 +1,6 @@
1
+ import type { DebouncedFn } from '@vkontakte/videoplayer-shared';
2
+ export interface PictureInPictureEventHandlers {
3
+ enterpictureinpicture: (event: Event) => void;
4
+ leavepictureinpicture: (event?: Event) => void;
5
+ resize: DebouncedFn<(event: Event) => void>;
6
+ }
@@ -0,0 +1,5 @@
1
+ import { type SafeAny } from '@vkontakte/videoplayer-shared';
2
+ import type { PictureInPictureResizeEvent } from '../../../types';
3
+ export declare const isPiPSupported: () => boolean;
4
+ export declare const isPiPEvent: (e: SafeAny) => e is PictureInPictureEvent;
5
+ export declare const isPiPResizeEvent: (e: Event) => e is PictureInPictureResizeEvent;