@vkontakte/videoplayer 1.1.52-dev.d7d08e6d.0 → 1.1.52-dev.f5d6dcc9.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.52-dev.d7d08e6d.0",
3
+ "version": "1.1.52-dev.f5d6dcc9.0",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -49,9 +49,9 @@
49
49
  "**/*.d.ts"
50
50
  ],
51
51
  "dependencies": {
52
- "@vkontakte/videoplayer-core": "2.0.119-dev.df6b2fd8.0",
53
- "@vkontakte/videoplayer-interactive": "1.0.27-dev.fb9d0f4c.0",
54
- "@vkontakte/videoplayer-shared": "1.0.51-dev.5628c766.0",
55
- "@vkontakte/videoplayer-statistics": "1.0.66-dev.7901d9e7.0"
52
+ "@vkontakte/videoplayer-core": "2.0.119-dev.c81726f6.0",
53
+ "@vkontakte/videoplayer-interactive": "1.0.27-dev.13f3531e.0",
54
+ "@vkontakte/videoplayer-shared": "1.0.51-dev.b5aa895a.0",
55
+ "@vkontakte/videoplayer-statistics": "1.0.66-dev.8a6011fa.0"
56
56
  }
57
57
  }
@@ -1,7 +1,6 @@
1
1
  export declare enum SubMenuIds {
2
2
  QUALITY = "quality-sub",
3
3
  QUALITY_DETAIL = "quality-detail-sub",
4
- DEFAULT_QUALITY_APPLIENCE = "default_quality_applies_to_sub",
5
4
  AUDIO_LANGUAGES = "audio-language-sub",
6
5
  PLAYBACK_RATE = "playback-rate-sub",
7
6
  SUBTITLES = "subtitles-sub"
@@ -47,47 +47,40 @@ export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem, 'icon
47
47
  };
48
48
  export type SettingsMenuItem = OpenSubMenuSettingsMenuItem | ClickSettingsMenuItem | SwitchSettingsMenuItem;
49
49
  export type AdditionalSettingsMenuItem = AdditionalSwitchSettingsMenuItem | AdditionalClickSettingsMenuItem;
50
- interface SubMenuItemBase<U = any> {
51
- selected?: boolean;
50
+ export interface SelectValueSubMenuItem<T = any, U = any> {
51
+ type: SubMenuItemType.SELECT_VALUE;
52
+ value: T;
53
+ dataValue?: T | keyof T;
52
54
  valueComponent?: ComponentType;
53
55
  valueComponentParams?: {
54
56
  [key: string]: U;
55
57
  };
56
- bottomBordered?: boolean;
57
- label?: string;
58
- sublabel?: string;
59
58
  ariaLabel?: string;
60
- onClick?: () => void;
61
- }
62
- export interface SelectValueSubMenuItem<T = any, U = any> extends SubMenuItemBase<U> {
63
- type: SubMenuItemType.SELECT_VALUE;
64
- value: T;
65
- dataValue?: T | keyof T;
59
+ label?: string;
60
+ selected?: boolean;
66
61
  selectItem: (value: T) => void;
67
62
  }
68
- export interface OpenSubMenuSubMenuItem extends SubMenuItemBase {
63
+ export interface OpenSubMenuSubMenuItem {
69
64
  type: SubMenuItemType.OPEN_SUB_MENU;
65
+ ariaLabel?: string;
66
+ label: string;
70
67
  id: string;
71
68
  subMenuId: SubMenuIds;
72
- getSubItemForFocus?: () => HTMLLIElement;
69
+ getSubItemForFocus: () => HTMLLIElement;
73
70
  }
74
71
  export type SubMenuItem = SelectValueSubMenuItem | OpenSubMenuSubMenuItem;
75
72
  export interface SubMenuList {
76
73
  id: SubMenuIds;
77
- parentItemId?: string;
74
+ parentItemId: string;
78
75
  items: SubMenuItem[];
79
76
  returnFromSubMenu?: () => void;
80
77
  ariaLabelReturnFromSubMenu?: string;
81
78
  title: string;
82
79
  closeSettingsMenu: () => void;
83
80
  minWidth?: number;
84
- onMount?: () => void;
85
81
  }
86
82
  export interface ContextMenuItem extends BaseMenuItem {
87
83
  onClick: () => void;
88
84
  }
89
85
  export type AdditionalContextMenuItem = ContextMenuItem;
90
- export type MenuRefs = {
91
- [key: string]: HTMLUListElement;
92
- };
93
86
  export {};
@@ -1,21 +1,3 @@
1
1
  import { VideoQuality } from '@vkontakte/videoplayer-core';
2
- import { type VideoQualityForRender } from '../../../types';
3
- type Params = {
4
- quality: VideoQuality;
5
- availableQualities: VideoQualityForRender[];
6
- };
7
- export declare const getQualityDisplayValue: ({ quality, availableQualities }: Params) => string;
8
- type CurrentQualityParams = {
9
- isAutoQualityEnabled: boolean | undefined;
10
- quality: VideoQuality | undefined;
11
- availableQualities: VideoQualityForRender[];
12
- };
13
- export declare const getCurrentQualityDisplayValue: ({ quality, availableQualities, isAutoQualityEnabled, }: CurrentQualityParams) => string;
14
- type QualityWithPrefixParams = {
15
- quality: VideoQuality | undefined;
16
- availableQualities: VideoQualityForRender[];
17
- prefix: string;
18
- onlyPrefix: boolean;
19
- };
20
- export declare const getQualityWithPrefix: ({ quality, availableQualities, prefix, onlyPrefix }: QualityWithPrefixParams) => string;
21
- export {};
2
+ import type { VideoQualityForRender } from '../../../types';
3
+ export declare const getCurrentQualityDisplayValue: (currentQuality: VideoQuality | undefined, availableQualities: VideoQualityForRender[], isAutoQualityEnabled: boolean | undefined) => string;
@@ -11,8 +11,11 @@ export declare const returnFocusToMenuItem: (refMenuItems: {
11
11
  [key: string]: HTMLLIElement;
12
12
  }, id: string) => Promise<void>;
13
13
  export declare const handleKeyDownMainMenu: (event: KeyboardEvent, closeCallback: () => void) => void;
14
- export declare const handleKeyDownOpenSubMenuItem: (event: KeyboardEvent, openSubmenuFn: () => void, getSubItemFn?: () => HTMLLIElement) => Promise<void>;
15
- export declare const handleKeyDownSubMenu: (event: KeyboardEvent, returnFromSubMenu: () => void, closeSettingsMenuFn: () => void) => Promise<void>;
14
+ export declare const handleKeyDownOpenSubMenuItem: (event: KeyboardEvent, openSubmenuFn: () => void, getSubItemFn: () => HTMLLIElement) => Promise<void>;
15
+ export declare const handleKeyDownSubMenu: (event: KeyboardEvent, returnFromSubMenu: () => void, { itemIdReturnCase, id }: {
16
+ itemIdReturnCase: Writable<string | undefined>;
17
+ id: string;
18
+ }, closeSettingsMenuFn: () => void) => Promise<void>;
16
19
  export declare const handleChoseMenuItem: (event: KeyboardEvent, selectFn: () => void) => void;
17
20
  export declare const handleSwitchMenuItem: (event: KeyboardEvent, enabled: boolean, selectFn: (value: boolean) => void) => void;
18
21
  export declare const getContextMenuPositionByButton: (btnRef: HTMLButtonElement) => Position;
package/types/config.d.ts CHANGED
@@ -37,7 +37,6 @@ export interface IUIConfig {
37
37
  minSubtitlesFontSize: number;
38
38
  autoSubtitlesTimeout: Milliseconds;
39
39
  trafficSavingLimit: ExactVideoQuality;
40
- highQualityLimit: ExactVideoQuality;
41
40
  episodeMinWidthPc: number;
42
41
  controls: {
43
42
  showOnStartupAtAutoplay: boolean;
@@ -116,7 +115,6 @@ export interface IUIConfig {
116
115
  nextPrevButtons: boolean;
117
116
  previewNoEmptySpace: boolean;
118
117
  exposeInternalsToGlobal: boolean;
119
- qualityDetailsSubMenuEnabled: boolean;
120
118
  };
121
119
  interactive: {
122
120
  historyMaxLength: number;
@@ -1,4 +1,4 @@
1
- import type { IAudioStream, IConfig, IExternalTextTrack, IOptionalTuningConfig, IPlayer, ISources, IVideoStream, PlaybackRate } from '@vkontakte/videoplayer-core';
1
+ import type { IAudioStream, IConfig, IExternalTextTrack, IOptionalTuningConfig, IPlayer, ISources, ITextTrack, IVideoStream, PlaybackRate } from '@vkontakte/videoplayer-core';
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 { IUIConfig } from '../config';
@@ -9,16 +9,11 @@ import { AdmanWrapper } from '../components/Ads/admanWrapper';
9
9
  import type { LanguageConfig } from '../translation/types';
10
10
  import type { AdditionalButtonDeprecated, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, Position, VideoPlaybackRate, VideoQualityForRender, VideoQualityUI, VideoSubtitle, VideoSubtitleParsed } from '../types';
11
11
  import { AdsPlaybackState, PictureInPictureType } from '../types';
12
- import { type QualitySettingsAppliesTo } from '../utils/userSettings';
13
12
  import type { DebugData } from './utils';
14
13
  import { GridTypes, type PlayPrevChapterDisabledTooltipKey } from '../constans';
15
14
  import { UIOneStat } from '../services/statistics';
16
15
  import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem, ContextMenuItem, SettingsMenuItem } from '../components/Menus/types';
17
16
  import type { AdditionalButton, AdditionalDesktopControlPanelButton } from '../components/Controls/types';
18
- type Info = {
19
- appliesTo?: QualitySettingsAppliesTo;
20
- changeReason?: 'default' | 'limit-changed';
21
- };
22
17
  export interface IAdsState {
23
18
  position: Writable<number>;
24
19
  duration: Writable<number>;
@@ -144,7 +139,6 @@ export interface IStore {
144
139
  volume$: Readable<number>;
145
140
  muted$: Readable<boolean>;
146
141
  trafficSavingEnabled$: Readable<boolean>;
147
- highQualityEnabled$: Readable<boolean>;
148
142
  availableVideoStreams$: Readable<IVideoStream[]>;
149
143
  availableAudioStreams$: Readable<IAudioStream[]>;
150
144
  videoStream$: Readable<IVideoStream | undefined>;
@@ -156,6 +150,7 @@ export interface IStore {
156
150
  currentPlaybackRate$: Readable<number>;
157
151
  availablePlaybackRates$: Readable<VideoPlaybackRate[]>;
158
152
  currentSubtitle$: Writable<Omit<VideoSubtitle, 'selected'>>;
153
+ availableTextTracks$: Readable<ITextTrack[]>;
159
154
  availableSubtitlesList$: Readable<VideoSubtitle[]>;
160
155
  currentSubtitleCaptions$: Readable<VideoSubtitleParsed['texts']>;
161
156
  isAutoSubtitleCaptionVisible$: Writable<boolean>;
@@ -202,17 +197,15 @@ export interface IStore {
202
197
  closeSettingsMenu: (fromSubMenu?: boolean) => void;
203
198
  openSettingsSubMenu: (name: string, ref: HTMLElement) => void;
204
199
  closeSettingsSubMenu: (ref: HTMLElement, isClosing?: boolean) => void;
205
- setTrafficSavingEnabled: (trafficSavingEnabled: boolean, appliesTo?: QualitySettingsAppliesTo) => void;
206
- setHighQualityEnabled: (highQualityEnabled: boolean, appliesTo?: QualitySettingsAppliesTo) => void;
207
- initQualitySettings: () => void;
200
+ setTrafficSavingEnabled: (trafficSavingEnabled: boolean) => void;
208
201
  setVolume: (volume: number, preferredVolume?: number) => void;
209
202
  setAudioStream: (stream: IAudioStream) => void;
210
203
  setVideoStream: (stream: IVideoStream) => void;
211
- setQuality: (quality: VideoQualityUI, info?: Info) => void;
204
+ setQuality: (quality: VideoQualityUI) => void;
212
205
  setPlaybackRate: (playbackRate: PlaybackRate) => void;
213
206
  incrementPlaybackRate: () => void;
214
207
  decrementPlaybackRate: () => void;
215
- setSubtitle: (subtitle: VideoSubtitle) => void;
208
+ setSubtitle: (subtitle?: VideoSubtitle) => void;
216
209
  toggleSubtitle: () => void;
217
210
  togglePictureInPicture: () => void;
218
211
  startScrubbing: (progress: number) => void;
@@ -293,7 +286,6 @@ export interface IStore {
293
286
  setUiCallbacks: (uiCallbacks: IVKVideoPlayerUICallbacks) => void;
294
287
  getAdmanWrapper: () => AdmanWrapper;
295
288
  getLogger: () => ILogger;
296
- getPlayer: () => IPlayer;
297
289
  destroy(): void;
298
290
  }
299
291
  interface IStoreParams {
@@ -0,0 +1,6 @@
1
+ interface Params {
2
+ getFullscreenTarget: () => HTMLElement;
3
+ fullScreenChangeHandler: (forced?: boolean) => void;
4
+ }
5
+ export declare const useIosSafariFullscreen: ({ getFullscreenTarget, fullScreenChangeHandler }: Params) => void;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { IStore } from '../../store';
2
+ interface Params {
3
+ store: IStore;
4
+ getFullscreenTarget: () => HTMLElement;
5
+ }
6
+ export declare const useIosSafariFullscreenSubtitles: ({ store, getFullscreenTarget }: Params) => void;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { ITextTrack } from '@vkontakte/videoplayer-core';
2
+ export declare class NativeSubtitles {
3
+ private readonly video;
4
+ constructor(video: HTMLVideoElement);
5
+ private getTracksArray;
6
+ attach(track: ITextTrack, showing?: boolean): void;
7
+ detachAll(): void;
8
+ updateSrc(track: ITextTrack): void;
9
+ getCurrentShowingId(): string | null;
10
+ }
@@ -15,18 +15,3 @@ export declare const savePreferredRate: (rate: PlaybackRate) => void;
15
15
  export declare const getPreferredRate: () => PlaybackRate | undefined;
16
16
  export declare const savePreferredAutoplayNext: (autoplayNext: boolean) => void;
17
17
  export declare const getPreferredAutoplayNext: () => boolean;
18
- type PreferredQualitySettingsType = 'traffic_saving' | 'high_quality' | 'auto_quality' | 'exact_video';
19
- type PreferredQualitySettingsValue = {
20
- type: Exclude<PreferredQualitySettingsType, 'exact_video'>;
21
- videoId?: number;
22
- } | {
23
- type: 'exact_quality';
24
- quality: VideoQuality;
25
- videoId?: number;
26
- };
27
- type DefaultPreferredQualitySettingsValue = Exclude<PreferredQualitySettingsValue, {
28
- type: 'exact_quality';
29
- }>;
30
- export type QualitySettingsAppliesTo = 'as-default' | 'to-video';
31
- export declare const getPreferredQualitySettings: (videoId: number | undefined) => PreferredQualitySettingsValue | null, migrateSettingsToLegacyWay: (videoId?: number) => void, savePreferredQualitySettings: (value: PreferredQualitySettingsValue, appliesTo?: QualitySettingsAppliesTo) => void, savePreferredDefaultQualitySettings: (value: DefaultPreferredQualitySettingsValue) => void, removePreferredQualitySettingsByVideo: () => void;
32
- export {};
@@ -1,15 +0,0 @@
1
- import { type MenuRefs, type SubMenuList } from '../types';
2
- import type { VideoQualityForRender, VideoQualityUI } from '../../../types';
3
- import { type QualitySettingsAppliesTo } from '../../../utils/userSettings';
4
- type Params = {
5
- menuRefs: MenuRefs;
6
- autoQualityItem: VideoQualityForRender | undefined;
7
- trafficSavingEnabled: boolean;
8
- highQualityEnabled: boolean;
9
- closeSettingsMenu: () => void;
10
- selectQuality: (quality: VideoQualityUI, appliesTo: QualitySettingsAppliesTo) => void;
11
- toggleTrafficSaving: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
12
- toggleHighQuality: (valiue: boolean, appliesTo: QualitySettingsAppliesTo) => void;
13
- };
14
- export declare const getQualityDetailsSubMenuList: ({ closeSettingsMenu, menuRefs, trafficSavingEnabled, autoQualityItem, highQualityEnabled, toggleHighQuality, selectQuality, toggleTrafficSaving, }: Params) => SubMenuList;
15
- export {};
@@ -1,12 +0,0 @@
1
- import { type SubMenuItem } from '../types';
2
- import type { VideoQualityForRender, VideoQualityUI } from '../../../types';
3
- type Params = {
4
- trafficSavingEnabled: boolean;
5
- toggleTrafficSaving: (value: boolean) => void;
6
- autoQualityItem: VideoQualityForRender | undefined;
7
- selectQuality: (quality: VideoQualityUI) => void;
8
- highQualityEnabled: boolean;
9
- toggleHighQuality: (valiue: boolean) => void;
10
- };
11
- export declare const getQualityLimitsForSubMenu: ({ trafficSavingEnabled, autoQualityItem, highQualityEnabled, toggleHighQuality, selectQuality, toggleTrafficSaving, }: Params) => SubMenuItem[];
12
- export {};
@@ -1,11 +0,0 @@
1
- import { type MenuRefs, type SubMenuList } from '../types';
2
- import type { VideoQualityForRender, VideoQualityUI } from '../../../types';
3
- type Params = {
4
- availableQualities: VideoQualityForRender[];
5
- isMobile: boolean;
6
- menuRefs: MenuRefs;
7
- closeSettingsMenu: () => void;
8
- selectQuality: (quality: VideoQualityUI) => void;
9
- };
10
- export declare const getQualitySubMenuList: ({ closeSettingsMenu, availableQualities, isMobile, menuRefs, selectQuality, }: Params) => SubMenuList;
11
- export {};
@@ -1,23 +0,0 @@
1
- import { SubMenuIds } from '../constants/subMenuIds';
2
- import { type SubMenuList } from '../types';
3
- import { getQualitySubMenuList } from './getQualitySubMenuList';
4
- import type { IAudioStream, PlaybackRate } from '@vkontakte/videoplayer-core';
5
- import { type VideoPlaybackRate, type VideoQualityUI, type VideoSubtitle } from '../../../types';
6
- import type { QualitySettingsAppliesTo } from 'packages/ui/src/utils/userSettings';
7
- type Params = {
8
- currentSubMenuList: SubMenuIds | null;
9
- availableAudioStreams: IAudioStream[];
10
- currentAudioStream: IAudioStream | undefined;
11
- selectAudioLanguage: (stream: IAudioStream) => void;
12
- availablePlaybackRates: VideoPlaybackRate[];
13
- selectPlaybackRate: (playbackRate: PlaybackRate) => void;
14
- availableSubtitlesList: VideoSubtitle[];
15
- selectSubtitle: (subtitle: VideoSubtitle) => void;
16
- trafficSavingEnabled: boolean;
17
- toggleTrafficSaving: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
18
- highQualityEnabled: boolean;
19
- toggleHighQuality: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
20
- selectQuality: (quality: VideoQualityUI, appliesTo: QualitySettingsAppliesTo) => void;
21
- } & Omit<Parameters<typeof getQualitySubMenuList>[0], 'selectQuality'>;
22
- export declare const getSubMenuList: ({ currentSubMenuList, availableQualities, closeSettingsMenu, isMobile, menuRefs, availableAudioStreams, currentAudioStream, availablePlaybackRates, availableSubtitlesList, trafficSavingEnabled, highQualityEnabled, toggleHighQuality, toggleTrafficSaving, selectPlaybackRate, selectAudioLanguage, selectQuality, selectSubtitle, }: Params) => SubMenuList[];
23
- export {};
@@ -1,2 +0,0 @@
1
- import { type QualitySettingsAppliesTo } from '../../../utils/userSettings';
2
- export declare const getEnrichWithQualityAppliesTo: (appliesTo: QualitySettingsAppliesTo) => <T>(fn: (value: T, appliesTo: QualitySettingsAppliesTo) => void) => (value: T) => void;
@@ -1,12 +0,0 @@
1
- import type { SettingsMenuItemIds } from '../constants';
2
- import type { SubMenuIds } from '../constants/subMenuIds';
3
- export declare const useSubMenuListsManager: () => {
4
- parentMenuId: {
5
- subscribe: (this: void, run: import("svelte/store").Subscriber<SettingsMenuItemIds | null | undefined>, invalidate?: import("svelte/store").Invalidator<SettingsMenuItemIds | null | undefined> | undefined) => import("svelte/store").Unsubscriber;
6
- };
7
- currentSubMenuList: import("svelte/store").Readable<SubMenuIds | null>;
8
- pushNextSubList: (nextList: SubMenuIds) => void;
9
- setParent: (parentId: SettingsMenuItemIds | null) => void;
10
- popCurrentSubList: () => void;
11
- popWholeSubMenu: () => void;
12
- };