@vkontakte/videoplayer 1.1.82-dev.a57718f4.0 → 1.1.82-dev.af06eecf.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.a57718f4.0",
3
+ "version": "1.1.82-dev.af06eecf.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.a57718f4.0",
59
- "@vkontakte/videoplayer-interactive": "1.0.57-dev.a57718f4.0",
60
- "@vkontakte/videoplayer-shared": "1.0.80-dev.a57718f4.0",
61
- "@vkontakte/videoplayer-statistics": "1.0.97-dev.a57718f4.0"
58
+ "@vkontakte/videoplayer-core": "2.0.151-dev.af06eecf.0",
59
+ "@vkontakte/videoplayer-interactive": "1.0.57-dev.af06eecf.0",
60
+ "@vkontakte/videoplayer-shared": "1.0.80-dev.af06eecf.0",
61
+ "@vkontakte/videoplayer-statistics": "1.0.97-dev.af06eecf.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;
@@ -396,10 +393,11 @@ interface IStoreParams {
396
393
  internalsExposure: InternalsExposure | null;
397
394
  playerView?: VideoPlayerView;
398
395
  playerId: string;
396
+ videoElement?: HTMLVideoElement;
399
397
  }
400
398
  /**
401
399
  * Store приложения.
402
400
  * Если будет слишком большим - можно разделить его на модули
403
401
  */
404
- export declare const createStore: ({ interfaceLanguage, isCyrillicRelatedInterface, videoId, isClip, isLiveCatchUpMode, statAuthToken, isAudioDisabled, canDownload, callbacks, webApi, videoEpisodes, previewThumbsData, uiConfig, coreConfig, player: playerInstance, disabledControls, isInteractive, interactiveRanges$, isInteractiveTime$, replayInteractive, stopPlayer, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalSettingsMenuItems, additionalContextMenuItems, playPrevVideo, playNextVideo, onVideoChanged, looped, statistics: uiStatistics, saveRate, internalsExposure, playerView, playerId, metaConfig, }: IStoreParams) => IStore;
402
+ export declare const createStore: ({ interfaceLanguage, isCyrillicRelatedInterface, videoId, isClip, isLiveCatchUpMode, statAuthToken, isAudioDisabled, canDownload, callbacks, webApi, videoEpisodes, previewThumbsData, uiConfig, coreConfig, player: playerInstance, disabledControls, isInteractive, interactiveRanges$, isInteractiveTime$, replayInteractive, stopPlayer, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalSettingsMenuItems, additionalContextMenuItems, playPrevVideo, playNextVideo, onVideoChanged, looped, statistics: uiStatistics, saveRate, internalsExposure, playerView, playerId, metaConfig, videoElement: externalVideoElement, }: IStoreParams) => IStore;
405
403
  export {};
@@ -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;
@@ -93,6 +93,7 @@ export interface IVKVideoPlayerCallbacks {
93
93
  onDevNullLog?: (entry: DevNullEntry) => void;
94
94
  onTitleClicked?: () => void;
95
95
  onRichSeekActiveChanged?: (active: boolean) => void;
96
+ onVideoElementCreated?: (videoElement: HTMLVideoElement) => void;
96
97
  uiInfo?: {
97
98
  onUpcomingLiveViewStateChanged?: (value: IUpcomingLiveViewControlInfo) => void;
98
99
  onControlsVisibleChanged?: (value?: boolean) => void;
@@ -117,6 +118,7 @@ export interface IVKVideoPlayerCallbacks {
117
118
  onFullscreenChanged?: (value?: IControlInfo) => void;
118
119
  onChromecastChanged?: (value?: IControlInfo) => void;
119
120
  onPipChanged?: (value?: IControlInfo) => void;
121
+ onTheaterModeChanged?: (value?: IControlInfo) => void;
120
122
  onVkLogoChanged?: (value?: IControlInfo) => void;
121
123
  onTimelineChanged?: (value?: IControlInfo) => void;
122
124
  onTimelineMouseEnter?: () => void;
@@ -310,6 +312,7 @@ export interface IVKVideoPlayerConfig {
310
312
  playerView?: VideoPlayerView;
311
313
  mediascopePixels?: MediascopePixelTypes.Pixel[];
312
314
  getVideoDeeplink?: (timestamp: number) => string;
315
+ videoElement?: HTMLVideoElement;
313
316
  }
314
317
  export interface IControlInfo {
315
318
  left: number;
@@ -345,6 +348,7 @@ export interface IPlayerControlsRef {
345
348
  fullscreen?: HTMLElement;
346
349
  chromecast?: HTMLButtonElement;
347
350
  pip?: HTMLButtonElement;
351
+ 'theater-mode-button'?: HTMLButtonElement;
348
352
  vkLogo?: HTMLButtonElement;
349
353
  interactiveTimeIndicator?: HTMLElement;
350
354
  timeline?: HTMLElement;
@@ -457,15 +461,27 @@ export interface IPictureInPictureApiInfo {
457
461
  export type PictureInPictureSettings = {
458
462
  enabled?: boolean;
459
463
  };
464
+ export interface Size {
465
+ width: number;
466
+ height: number;
467
+ }
468
+ export interface ExternalPictureInPictureEventHandlers {
469
+ enterpictureinpicture?: VoidFunction;
470
+ leavepictureinpicture?: VoidFunction;
471
+ resize?: (size: Size) => void;
472
+ }
460
473
  export interface IPictureInPictureApi {
461
- isSupported: () => boolean;
462
- isActive: () => boolean;
463
- setContext: (svelteContext: Map<unknown, unknown>) => void;
464
- request: () => Promise<void>;
465
- exit: () => Promise<void>;
474
+ isSupported(): boolean;
475
+ isActive(): boolean;
476
+ setContext(svelteContext: Map<unknown, unknown>): void;
477
+ request(): Promise<void>;
478
+ exit(): Promise<void>;
466
479
  info: IPictureInPictureApiInfo;
467
- setEnabled: (enabled: boolean) => void;
468
- dispose: () => Promise<void>;
480
+ setEnabled(enabled: boolean): void;
481
+ dispose(): Promise<void>;
482
+ assignPlayerContainer(playerContainer: HTMLElement): void;
483
+ updateVideoElement(): void;
484
+ setExternalEventHandlers(externalEventHandlers: ExternalPictureInPictureEventHandlers): void;
469
485
  }
470
486
  export interface IAnnotationsApi {
471
487
  /** @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;