@vkontakte/videoplayer 1.1.44-dev.871d1572.0 → 1.1.44-dev.9f8a3e1d.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/es2015.cjs.js +17 -17
- package/es2015.esm.js +17 -17
- package/es2018.cjs.js +17 -17
- package/es2018.esm.js +17 -17
- package/esnext.cjs.js +17 -17
- package/esnext.esm.js +17 -17
- package/evergreen.esm.js +17 -17
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.d.ts +7 -0
- package/types/components/Menus/constants/contextMenuItemIds.d.ts +12 -0
- package/types/components/Menus/constants/contextMenuItemWeights.d.ts +4 -0
- package/types/components/Menus/constants/defaultSubMenuMinWidth.d.ts +1 -0
- package/types/components/Menus/constants/index.d.ts +4 -0
- package/types/components/Menus/constants/settingsMenuItemIds.d.ts +12 -0
- package/types/components/Menus/constants/settingsMenuItemWeights.d.ts +4 -0
- package/types/components/Menus/constants/topOffset.d.ts +1 -0
- package/types/components/Menus/types.d.ts +72 -0
- package/types/components/Menus/utils/getCurrentQualityDisplayValue.d.ts +3 -0
- package/types/components/Menus/utils/getQualityIcon.d.ts +3 -0
- package/types/{utils → components/Menus/utils}/menuNavigation.d.ts +7 -3
- package/types/config.d.ts +2 -0
- package/types/index.d.ts +1 -0
- package/types/store/index.d.ts +16 -6
- package/types/translation/types.d.ts +1 -1
- package/types/types/index.d.ts +11 -7
- package/types/utils/getQualityLabel.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.44-dev.
|
|
3
|
+
"version": "1.1.44-dev.9f8a3e1d.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": "
|
|
53
|
-
"@vkontakte/videoplayer-interactive": "1.0.19-dev.
|
|
54
|
-
"@vkontakte/videoplayer-shared": "
|
|
55
|
-
"@vkontakte/videoplayer-statistics": "
|
|
52
|
+
"@vkontakte/videoplayer-core": "2.0.111-dev.fe148f6b.0",
|
|
53
|
+
"@vkontakte/videoplayer-interactive": "1.0.19-dev.1ff354f7.0",
|
|
54
|
+
"@vkontakte/videoplayer-shared": "1.0.43-dev.0d161ca2.0",
|
|
55
|
+
"@vkontakte/videoplayer-statistics": "1.0.58-dev.c156527f.0"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -5,6 +5,7 @@ import { InterfaceLanguage, type QualityLimits } from '@vkontakte/videoplayer-sh
|
|
|
5
5
|
import { type PlaybackRate } from '@vkontakte/videoplayer-core';
|
|
6
6
|
import type { IStatContext } from '@vkontakte/videoplayer-statistics';
|
|
7
7
|
import { AnnotationsApi } from '../utils/webAPI/annotationsApi/annotationsApi';
|
|
8
|
+
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from '../components/Menus/types';
|
|
8
9
|
export declare class VKVideoPlayer extends HTMLElement {
|
|
9
10
|
private svelteStubComponent?;
|
|
10
11
|
private svelteRootComponent?;
|
|
@@ -86,5 +87,11 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
86
87
|
replayInteractiveChapter(callback?: () => void): Promise<void>;
|
|
87
88
|
showInteractiveIndicatorTooltip(newValue: boolean, useTimeout?: boolean): void;
|
|
88
89
|
switchToActiveLive(): void;
|
|
90
|
+
updateAdditionalSettingsItem(itemId: string, fields: Partial<Omit<AdditionalSettingsMenuItem, 'id' | 'type'>>): void;
|
|
91
|
+
addAdditionalSettingsItem(newItem: AdditionalSettingsMenuItem): void;
|
|
92
|
+
removeAdditionalSettingsItem(itemId: string): void;
|
|
93
|
+
updateAdditionalContextItem(itemId: string, fields: Partial<Omit<AdditionalContextMenuItem, 'id'>>): void;
|
|
94
|
+
addAdditionalContextItem(newItem: AdditionalContextMenuItem): void;
|
|
95
|
+
removeAdditionalContextItem(itemId: string): void;
|
|
89
96
|
updateStatContext(statContext: Partial<IStatContext>): void;
|
|
90
97
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum ContextMenuItemIds {
|
|
2
|
+
COPY_LINK = "copy-link",
|
|
3
|
+
COPY_LINK_TIMESTAMP = "copy-link-timestamp",
|
|
4
|
+
COPY_EMBED_CODE = "copy-embed-code",
|
|
5
|
+
PIP = "pip",
|
|
6
|
+
VIDEO_LOOP = "video-loop",
|
|
7
|
+
ROTATE = "rotate",
|
|
8
|
+
REPORT = "report",
|
|
9
|
+
SAVE_DEBUG = "save-debug",
|
|
10
|
+
SAVE_TRACE = "save-trace",
|
|
11
|
+
DEBUG_INFO = "debug-info"
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const defaultSubMenuMinWidth = 137;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum SettingsMenuItemIds {
|
|
2
|
+
QUALITY = "quality-settings",
|
|
3
|
+
AUDIO_LANGUAGES = "audio-language-settings",
|
|
4
|
+
PLAYBACK_RATE = "playback-rate-settings",
|
|
5
|
+
SUBTITLES = "subtitles-settings",
|
|
6
|
+
TRAFFIC_SAVING = "traffic-saving-settings",
|
|
7
|
+
DOWNLOAD = "download",
|
|
8
|
+
REPORT = "report",
|
|
9
|
+
COPY_DATA = "copy-data",
|
|
10
|
+
SAVE_TRACE_INFO = "save-trace-info",
|
|
11
|
+
DEBUG_INFO = "debug-info"
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const topOffset: number;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { ComponentType } from 'svelte';
|
|
2
|
+
import type { Writable } from 'svelte/store';
|
|
3
|
+
import { UIType } from '../../types';
|
|
4
|
+
interface BaseMenuItem {
|
|
5
|
+
id: string;
|
|
6
|
+
weight: number;
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}
|
|
10
|
+
interface BaseSettingsMenuItem extends BaseMenuItem {
|
|
11
|
+
icon: ComponentType | string;
|
|
12
|
+
isHiddenFor?: UIType[];
|
|
13
|
+
}
|
|
14
|
+
export declare enum MenuItemType {
|
|
15
|
+
OPEN_SUB_MENU = "OPEN_SUB_MENU",
|
|
16
|
+
CLICK = "CLICK",
|
|
17
|
+
SWITCH = "SWITCH"
|
|
18
|
+
}
|
|
19
|
+
export interface OpenSubMenuSettingsMenuItem extends BaseSettingsMenuItem {
|
|
20
|
+
type: MenuItemType.OPEN_SUB_MENU;
|
|
21
|
+
value: string;
|
|
22
|
+
valueComponent?: ComponentType;
|
|
23
|
+
getSubItemForFocus: () => HTMLLIElement;
|
|
24
|
+
subMenu: {
|
|
25
|
+
show: boolean;
|
|
26
|
+
items: SubMenuItem[];
|
|
27
|
+
returnFromSubMenu?: () => void;
|
|
28
|
+
ariaLabelReturnFromSubMenu?: string;
|
|
29
|
+
title: string;
|
|
30
|
+
closeSettingsMenu: () => void;
|
|
31
|
+
backToMainSettings: () => void;
|
|
32
|
+
itemIdReturnCase: Writable<string | undefined>;
|
|
33
|
+
selectItem: (value: SubMenuItem['value']) => void;
|
|
34
|
+
minWidth?: number;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export interface ClickSettingsMenuItem extends BaseSettingsMenuItem {
|
|
38
|
+
type: MenuItemType.CLICK;
|
|
39
|
+
onClick: () => void;
|
|
40
|
+
}
|
|
41
|
+
export interface SwitchSettingsMenuItem extends BaseSettingsMenuItem {
|
|
42
|
+
type: MenuItemType.SWITCH;
|
|
43
|
+
onClick: (enabled: boolean) => void;
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
tooltipText?: string;
|
|
46
|
+
maxTooltipWidth?: number;
|
|
47
|
+
}
|
|
48
|
+
export type AdditionalSwitchSettingsMenuItem = Omit<SwitchSettingsMenuItem, 'icon' | 'onClick'> & {
|
|
49
|
+
icon: string;
|
|
50
|
+
onChangeEnabled: (enabled: boolean) => void;
|
|
51
|
+
};
|
|
52
|
+
export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem, 'icon'> & {
|
|
53
|
+
icon: string;
|
|
54
|
+
};
|
|
55
|
+
export type SettingsMenuItem = OpenSubMenuSettingsMenuItem | ClickSettingsMenuItem | SwitchSettingsMenuItem;
|
|
56
|
+
export type AdditionalSettingsMenuItem = AdditionalSwitchSettingsMenuItem | AdditionalClickSettingsMenuItem;
|
|
57
|
+
export interface SubMenuItem<T = any, U = any> {
|
|
58
|
+
value: T;
|
|
59
|
+
dataValue?: T | keyof T;
|
|
60
|
+
valueComponent?: ComponentType;
|
|
61
|
+
valueComponentParams?: {
|
|
62
|
+
[key: string]: U;
|
|
63
|
+
};
|
|
64
|
+
ariaLabel?: string;
|
|
65
|
+
label?: string;
|
|
66
|
+
selected?: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface ContextMenuItem extends BaseMenuItem {
|
|
69
|
+
onClick: () => void;
|
|
70
|
+
}
|
|
71
|
+
export type AdditionalContextMenuItem = ContextMenuItem;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { VideoQuality } from '@vkontakte/videoplayer-core';
|
|
2
|
+
import type { VideoQualityForRender } from '../../../types';
|
|
3
|
+
export declare const getCurrentQualityDisplayValue: (currentQuality: VideoQuality | undefined, availableQualities: VideoQualityForRender[], isAutoQualityEnabled: boolean | undefined) => string;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { type Writable } from 'svelte/store';
|
|
2
|
-
import type { Position } from '
|
|
2
|
+
import type { Position } from '../../../types';
|
|
3
3
|
export declare const isKeyboardHandleCase: (event?: MouseEvent) => boolean;
|
|
4
4
|
export declare const handleFocusReturnToBtn: (ref: HTMLButtonElement, menuVisible: boolean, openedByKeyboard$: Writable<boolean>) => Promise<void>;
|
|
5
5
|
export declare const handleFocusReturnToElem: (ref: HTMLButtonElement, menuVisible: boolean, openedByKeyboard$: Writable<boolean>) => Promise<void>;
|
|
6
6
|
export declare const handleFocusOnMenu: (ref: HTMLUListElement, menuVisible: boolean, isOpenedByKeyboard: boolean) => Promise<void>;
|
|
7
|
-
export declare const returnFocusToMenuItem: (ref: HTMLLIElement
|
|
7
|
+
export declare const returnFocusToMenuItem: (ref: HTMLLIElement) => Promise<void>;
|
|
8
8
|
export declare const handleKeyDownMainMenu: (event: KeyboardEvent, closeCallback: () => void) => void;
|
|
9
9
|
export declare const handleKeyDownOpenSubMenuItem: (event: KeyboardEvent, openSubmenuFn: () => void, getSubItemFn: () => HTMLLIElement) => Promise<void>;
|
|
10
|
-
export declare const handleKeyDownSubMenu: (event: KeyboardEvent, backToMainSettingsFn: () => void,
|
|
10
|
+
export declare const handleKeyDownSubMenu: (event: KeyboardEvent, backToMainSettingsFn: () => void, { itemIdReturnCase, id }: {
|
|
11
|
+
itemIdReturnCase: Writable<string | undefined>;
|
|
12
|
+
id: string;
|
|
13
|
+
}, closeSettingsMenuFn: () => void) => Promise<void>;
|
|
11
14
|
export declare const handleChoseMenuItem: (event: KeyboardEvent, selectFn: () => void) => void;
|
|
15
|
+
export declare const handleSwitchMenuItem: (event: KeyboardEvent, enabled: boolean, selectFn: (value: boolean) => void) => void;
|
|
12
16
|
export declare const getContextMenuPositionByButton: (btnRef: HTMLButtonElement) => Position;
|
|
13
17
|
export declare const getContextMenuPositionByHotKey: (overlayRef: HTMLDivElement | undefined) => Position;
|
package/types/config.d.ts
CHANGED
|
@@ -101,6 +101,8 @@ export interface IUIConfig {
|
|
|
101
101
|
saveDebugInfoToFile: boolean;
|
|
102
102
|
saveTraceInfoToFile: boolean;
|
|
103
103
|
additionalButtons: boolean;
|
|
104
|
+
additionalSettingsMenuItems: boolean;
|
|
105
|
+
additionalContextMenuItems: boolean;
|
|
104
106
|
contextMenuButton: boolean;
|
|
105
107
|
audioLanguages: boolean;
|
|
106
108
|
saveRate: boolean;
|
package/types/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek } f
|
|
|
6
6
|
import type { Milliseconds, QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
7
7
|
export { VERSION } from './env';
|
|
8
8
|
export declare const registerPlayerWebComponent: () => void;
|
|
9
|
+
export { type AdditionalSettingsMenuItem, MenuItemType, type AdditionalClickSettingsMenuItem, type AdditionalSwitchSettingsMenuItem, type AdditionalContextMenuItem, } from './components/Menus/types';
|
|
9
10
|
export type { VKVideoPlayer, IVKVideoPlayerConfig, IControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButton, QualityLimits, };
|
|
10
11
|
export { GridTypes, };
|
|
11
12
|
export { InterfaceLanguage, VKNumericLanguage, loadVKLangPack, } from '@vkontakte/videoplayer-shared';
|
package/types/store/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { IConfig, IExternalTextTrack, IOptionalTuningConfig, IPlayer, ISources,
|
|
1
|
+
import type { IAudioStream, IConfig, IExternalTextTrack, IOptionalTuningConfig, IPlayer, ISources, IVideoStream, PlaybackRate } from '@vkontakte/videoplayer-core';
|
|
2
2
|
import { ChromecastState, PlaybackState, VideoFormat } from '@vkontakte/videoplayer-core';
|
|
3
|
-
import { type IError, type ILogger, type IRectangle, type IValueObservable, type QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
4
|
-
import { InterfaceLanguage, VideoQuality } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import { type IError, type ILogger, InterfaceLanguage, type IRectangle, type IValueObservable, type QualityLimits, VideoQuality } from '@vkontakte/videoplayer-shared';
|
|
5
4
|
import type { IUIConfig } from '../config';
|
|
6
5
|
import { SeekAction } from '@vkontakte/videoplayer-statistics';
|
|
7
6
|
import { type InteractiveRange } from '@vkontakte/videoplayer-interactive';
|
|
@@ -11,9 +10,9 @@ import type { LanguageConfig } from '../translation/types';
|
|
|
11
10
|
import type { AdditionalButton, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, Position, VideoPlaybackRate, VideoQualityForRender, VideoQualityUI, VideoSubtitle, VideoSubtitleParsed } from '../types';
|
|
12
11
|
import { AdsPlaybackState, PictureInPictureType } from '../types';
|
|
13
12
|
import type { DebugData } from './utils';
|
|
14
|
-
import { type PlayPrevChapterDisabledTooltipKey } from '../constans';
|
|
15
|
-
import { GridTypes } from '../constans';
|
|
13
|
+
import { GridTypes, type PlayPrevChapterDisabledTooltipKey } from '../constans';
|
|
16
14
|
import { UIOneStat } from '../services/statistics';
|
|
15
|
+
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem, ContextMenuItem, SettingsMenuItem } from '../components/Menus/types';
|
|
17
16
|
export interface IAdsState {
|
|
18
17
|
position: Writable<number>;
|
|
19
18
|
duration: Writable<number>;
|
|
@@ -90,6 +89,8 @@ export interface IUIState {
|
|
|
90
89
|
currentGridType$: Readable<GridTypes>;
|
|
91
90
|
interactiveHideMobileControls: Writable<boolean>;
|
|
92
91
|
additionalButtons$: Readable<AdditionalButton[]>;
|
|
92
|
+
additionalSettingsMenuItems$: Readable<SettingsMenuItem[]>;
|
|
93
|
+
additionalContextMenuItems$: Readable<ContextMenuItem[]>;
|
|
93
94
|
overlayContainer$: Writable<HTMLDivElement | undefined>;
|
|
94
95
|
startedByKeyboard$: Writable<boolean>;
|
|
95
96
|
}
|
|
@@ -231,6 +232,7 @@ export interface IStore {
|
|
|
231
232
|
correctSeekTimeToInteractive: (time: number) => number;
|
|
232
233
|
replayInteractive?: () => void;
|
|
233
234
|
setLooped: (isLooped: boolean) => void;
|
|
235
|
+
reportProblem: () => void;
|
|
234
236
|
};
|
|
235
237
|
external: {
|
|
236
238
|
firstStart: (showAds: boolean) => void;
|
|
@@ -243,6 +245,12 @@ export interface IStore {
|
|
|
243
245
|
setMuted: (muted: boolean) => void;
|
|
244
246
|
setVolume: (volume: number) => void;
|
|
245
247
|
returnFocusToEpisodes: () => void;
|
|
248
|
+
updateAdditionalSettingsItem: (itemId: string, fields: Partial<Omit<AdditionalSettingsMenuItem, 'id' | 'type'>>) => void;
|
|
249
|
+
addAdditionalSettingsItem: (newItem: AdditionalSettingsMenuItem) => void;
|
|
250
|
+
removeAdditionalSettingsItem: (itemId: string) => void;
|
|
251
|
+
updateAdditionalContextItem: (itemId: string, fields: Partial<Omit<AdditionalContextMenuItem, 'id'>>) => void;
|
|
252
|
+
addAdditionalContextItem: (newItem: AdditionalContextMenuItem) => void;
|
|
253
|
+
removeAdditionalContextItem: (itemId: string) => void;
|
|
246
254
|
};
|
|
247
255
|
};
|
|
248
256
|
callbacks?: IVKVideoPlayerCallbacks;
|
|
@@ -275,6 +283,8 @@ interface IStoreParams {
|
|
|
275
283
|
disabledControls: ControlsKeys;
|
|
276
284
|
playPrevChapterDisabledTooltip: PlayPrevChapterDisabledTooltipKey;
|
|
277
285
|
additionalButtons: AdditionalButton[];
|
|
286
|
+
additionalSettingsMenuItems: AdditionalSettingsMenuItem[];
|
|
287
|
+
additionalContextMenuItems: AdditionalContextMenuItem[];
|
|
278
288
|
looped?: boolean;
|
|
279
289
|
statistics?: UIOneStat;
|
|
280
290
|
saveRate: boolean;
|
|
@@ -283,5 +293,5 @@ interface IStoreParams {
|
|
|
283
293
|
* Store приложения.
|
|
284
294
|
* Если будет слишком большим - можно разделить его на модули
|
|
285
295
|
*/
|
|
286
|
-
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, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, looped, statistics: uiStatistics, saveRate, }: IStoreParams) => IStore;
|
|
296
|
+
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, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalSettingsMenuItems, additionalContextMenuItems, looped, statistics: uiStatistics, saveRate, }: IStoreParams) => IStore;
|
|
287
297
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InterfaceLanguage } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
export type Key = 'auto_quality_invariant' | 'auto_quality' | 'menu_quality' | 'menu_playback_rate' | 'menu_traffic_saving' | 'menu_report' | 'menu_pip' | 'menu_copy_video_link' | 'menu_copy_video_link_with_timestamp' | 'menu_video_rotate' | 'menu_video_loop_on' | 'menu_video_loop_off' | 'menu_chromecast' | 'menu_copy_debug' | 'menu_save_debug' | 'menu_debug_overlay' | 'menu_copy_embed_code' | 'pip_dummy_title' | 'submenu_traffic_saving' | 'submenu_quality' | 'submenu_playback_rate' | 'submenu_settings' | 'submenu_audio_languages' | 'auto_quality_option' | 'mobile_unmute' | 'playing_ads' | 'skip_ads_now' | 'skip_ads_after' | 'visit_advertiser' | 'aria_timeline' | 'aria_open_settings' | 'aria_timeline_value' | 'doubletap_seek_step' | 'playback_rate_1' | 'playback_rate' | 'video360' | 'subtitles_caption' | 'subtitles_auto' | 'subtitles_off' | 'subtitles_auto_caption' | 'subtitles_turn_on' | 'subtitles_turn_off' | 'traffic_saving_off' | 'traffic_saving_on' | 'traffic_saving_disable' | 'traffic_saving_enable' | 'traffic_saving_helper_text' | 'tooltip_previous' | 'tooltip_restart' | 'tooltip_play' | 'tooltip_pause' | 'tooltip_next' | 'tooltip_button_disabled' | 'tooltip_interactive_go_back' | 'tooltip_interactive_go_back_disabled' | 'tooltip_interactive_go_back_disabled_first' | 'tooltip_interactive_go_back_disabled_limit' | 'tooltip_chapter_without_interactive' | 'tooltip_interactive_of_chapter_completed' | 'tooltip_interactive_seek' | 'tooltip_interactive_graph_off' | 'tooltip_interactive_graph_on' | 'tooltip_live' | 'tooltip_episodes' | 'tooltip_volume' | 'tooltip_volume_muted' | 'tooltip_settings_on' | 'tooltip_subtitles_off' | 'tooltip_settings_off' | 'tooltip_subtitles_on' | 'tooltip_fullscreen_off' | 'tooltip_fullscreen_on' | 'tooltip_chromecast_off' | 'tooltip_chromecast_on' | 'tooltip_episode_finished' | 'tooltip_episode_unfinished' | 'tooltip_disabled_when_interactive' | 'tooltip_disabled_when_graph_on' | 'tooltip_interactive_interaction_time_indicator' | 'tooltip_vk_logo' | 'tooltip_vk_video_logo' | 'download_video_caption' | 'hotkey_helper_current_volume' | 'hotkey_map_modal_title' | 'hotkey_map_modal_close_btn_text' | 'hotkey_map_group_title_common' | 'hotkey_map_group_title_playback' | 'hotkey_map_group_title_subtitles' | 'hotkey_map_group_title_episodes' | 'hotkey_map_item_mute_description' | 'hotkey_map_item_mute_value' | 'hotkey_map_item_volume_down_description' | 'hotkey_map_item_volume_down_value' | 'hotkey_map_item_volume_up_description' | 'hotkey_map_item_volume_up_value' | 'hotkey_map_item_pip_description' | 'hotkey_map_item_pip_value' | 'hotkey_map_item_full_screen_description' | 'hotkey_map_item_full_screen_value' | 'hotkey_map_item_show_context_menu_description' | 'hotkey_map_item_show_context_menu_value' | 'hotkey_map_item_show_hotkey_map_description' | 'hotkey_map_item_show_hotkey_map_value' | 'hotkey_map_item_play_toggle_description' | 'hotkey_map_item_play_toggle_value' | 'hotkey_map_item_seek_backward_description' | 'hotkey_map_item_seek_backward_value' | 'hotkey_map_item_seek_forward_description' | 'hotkey_map_item_seek_forward_value' | 'hotkey_map_item_fast_seek_backward_description' | 'hotkey_map_item_fast_seek_backward_value' | 'hotkey_map_item_fast_seek_forward_description' | 'hotkey_map_item_fast_seek_forward_value' | 'hotkey_map_item_rate_down_description' | 'hotkey_map_item_rate_down_value' | 'hotkey_map_item_rate_up_description' | 'hotkey_map_item_rate_up_value' | 'hotkey_map_item_prev_frame_description' | 'hotkey_map_item_prev_frame_value' | 'hotkey_map_item_next_frame_description' | 'hotkey_map_item_next_frame_value' | 'hotkey_map_item_jump_seek_description' | 'hotkey_map_item_jump_seek_value' | 'hotkey_map_item_subtitles_toggle_description' | 'hotkey_map_item_subtitles_toggle_value' | 'hotkey_map_item_prev_episode_description' | 'hotkey_map_item_prev_episode_pc_value' | 'hotkey_map_item_prev_episode_mac_value' | 'hotkey_map_item_next_episode_description' | 'hotkey_map_item_next_episode_pc_value' | 'hotkey_map_item_next_episode_mac_value' | 'waiting_live_day_value' | 'waiting_live_hour_value' | 'waiting_live_minute_value' | 'waiting_live_second_value' | 'waiting_live_colon' | 'waiting_live_upcoming_title' | 'waiting_live_timer_title' | 'waiting_live_recover_title' | 'waiting_record_title' | '
|
|
2
|
+
export type Key = 'auto_quality_invariant' | 'auto_quality' | 'menu_quality' | 'menu_playback_rate' | 'menu_traffic_saving' | 'menu_report' | 'menu_pip' | 'menu_copy_video_link' | 'menu_copy_video_link_with_timestamp' | 'menu_video_rotate' | 'menu_video_loop_on' | 'menu_video_loop_off' | 'menu_chromecast' | 'menu_copy_debug' | 'menu_save_debug' | 'menu_debug_overlay' | 'menu_copy_embed_code' | 'pip_dummy_title' | 'submenu_traffic_saving' | 'submenu_quality' | 'submenu_playback_rate' | 'submenu_settings' | 'submenu_audio_languages' | 'auto_quality_option' | 'mobile_unmute' | 'playing_ads' | 'skip_ads_now' | 'skip_ads_after' | 'visit_advertiser' | 'aria_timeline' | 'aria_open_settings' | 'aria_timeline_value' | 'doubletap_seek_step' | 'playback_rate_1' | 'playback_rate' | 'video360' | 'subtitles_caption' | 'subtitles_auto' | 'subtitles_off' | 'subtitles_auto_caption' | 'subtitles_turn_on' | 'subtitles_turn_off' | 'traffic_saving_off' | 'traffic_saving_on' | 'traffic_saving_disable' | 'traffic_saving_enable' | 'traffic_saving_helper_text' | 'tooltip_previous' | 'tooltip_restart' | 'tooltip_play' | 'tooltip_pause' | 'tooltip_next' | 'tooltip_button_disabled' | 'tooltip_interactive_go_back' | 'tooltip_interactive_go_back_disabled' | 'tooltip_interactive_go_back_disabled_first' | 'tooltip_interactive_go_back_disabled_limit' | 'tooltip_chapter_without_interactive' | 'tooltip_interactive_of_chapter_completed' | 'tooltip_interactive_seek' | 'tooltip_interactive_graph_off' | 'tooltip_interactive_graph_on' | 'tooltip_live' | 'tooltip_episodes' | 'tooltip_volume' | 'tooltip_volume_muted' | 'tooltip_settings_on' | 'tooltip_subtitles_off' | 'tooltip_settings_off' | 'tooltip_subtitles_on' | 'tooltip_fullscreen_off' | 'tooltip_fullscreen_on' | 'tooltip_chromecast_off' | 'tooltip_chromecast_on' | 'tooltip_episode_finished' | 'tooltip_episode_unfinished' | 'tooltip_disabled_when_interactive' | 'tooltip_disabled_when_graph_on' | 'tooltip_interactive_interaction_time_indicator' | 'tooltip_vk_logo' | 'tooltip_vk_video_logo' | 'download_video_caption' | 'hotkey_helper_current_volume' | 'hotkey_map_modal_title' | 'hotkey_map_modal_close_btn_text' | 'hotkey_map_group_title_common' | 'hotkey_map_group_title_playback' | 'hotkey_map_group_title_subtitles' | 'hotkey_map_group_title_episodes' | 'hotkey_map_item_mute_description' | 'hotkey_map_item_mute_value' | 'hotkey_map_item_volume_down_description' | 'hotkey_map_item_volume_down_value' | 'hotkey_map_item_volume_up_description' | 'hotkey_map_item_volume_up_value' | 'hotkey_map_item_pip_description' | 'hotkey_map_item_pip_value' | 'hotkey_map_item_full_screen_description' | 'hotkey_map_item_full_screen_value' | 'hotkey_map_item_show_context_menu_description' | 'hotkey_map_item_show_context_menu_value' | 'hotkey_map_item_show_hotkey_map_description' | 'hotkey_map_item_show_hotkey_map_value' | 'hotkey_map_item_play_toggle_description' | 'hotkey_map_item_play_toggle_value' | 'hotkey_map_item_seek_backward_description' | 'hotkey_map_item_seek_backward_value' | 'hotkey_map_item_seek_forward_description' | 'hotkey_map_item_seek_forward_value' | 'hotkey_map_item_fast_seek_backward_description' | 'hotkey_map_item_fast_seek_backward_value' | 'hotkey_map_item_fast_seek_forward_description' | 'hotkey_map_item_fast_seek_forward_value' | 'hotkey_map_item_rate_down_description' | 'hotkey_map_item_rate_down_value' | 'hotkey_map_item_rate_up_description' | 'hotkey_map_item_rate_up_value' | 'hotkey_map_item_prev_frame_description' | 'hotkey_map_item_prev_frame_value' | 'hotkey_map_item_next_frame_description' | 'hotkey_map_item_next_frame_value' | 'hotkey_map_item_jump_seek_description' | 'hotkey_map_item_jump_seek_value' | 'hotkey_map_item_subtitles_toggle_description' | 'hotkey_map_item_subtitles_toggle_value' | 'hotkey_map_item_prev_episode_description' | 'hotkey_map_item_prev_episode_pc_value' | 'hotkey_map_item_prev_episode_mac_value' | 'hotkey_map_item_next_episode_description' | 'hotkey_map_item_next_episode_pc_value' | 'hotkey_map_item_next_episode_mac_value' | 'waiting_live_day_value' | 'waiting_live_hour_value' | 'waiting_live_minute_value' | 'waiting_live_second_value' | 'waiting_live_colon' | 'waiting_live_upcoming_title' | 'waiting_live_timer_title' | 'waiting_live_recover_title' | 'waiting_record_title' | 'aria_label_submenu_traffic_saving_off' | 'aria_label_submenu_traffic_saving_on' | 'aria_label_submenu_back' | 'aria_label_menu_quality' | 'aria_label_menu_rate' | 'aria_label_menu_subtitle' | 'aria_label_menu_download' | 'aria_label_new_tab_alert' | 'aria_label_menu_debug_overlay_enable' | 'aria_label_menu_debug_overlay_disable' | 'aria_label_menu_rotate' | 'aria_label_menu_loop' | 'aria_label_debug_panel' | 'aria_label_context_menu_open' | 'aria_label_context_menu_close' | 'aria_label_video_player' | 'aria_label_spherical_control' | 'aria_label_menu_audio_languages' | 'menu_audio_languages' | 'audio_stream_display_language_label' | 'audio_stream_display_language_label_index' | 'audio_stream_display_label_index' | 'audio_stream_display_language_index' | 'audio_stream_display_unknown';
|
|
3
3
|
export type LanguagePack = Record<Key, string>;
|
|
4
4
|
export type LanguageConfig = {
|
|
5
5
|
language: string;
|
package/types/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VideoQuality, VideoFormat, ISources, IExternalTextTrack } from '@vkontakte/videoplayer-core';
|
|
2
2
|
import type { IValueObservable, InterfaceLanguage, Subscription } from '@vkontakte/videoplayer-shared';
|
|
3
|
-
import type { Manifest, VideoInfo } from '@vkontakte/videoplayer-interactive';
|
|
3
|
+
import type { Manifest, VideoInfo, InteractiveProjectInfo } from '@vkontakte/videoplayer-interactive';
|
|
4
4
|
import { PlaybackState } from '@vkontakte/videoplayer-core';
|
|
5
5
|
import type { Writable, Readable } from 'svelte/store';
|
|
6
6
|
import type { ISDKConfig } from '../config';
|
|
@@ -9,6 +9,11 @@ import { Controls, GridTypes, type SeekToInteractiveDisabledTooltipKey } from '.
|
|
|
9
9
|
import type { Key } from '../translation/types';
|
|
10
10
|
import type { IUIStatistics } from '../services/statistics';
|
|
11
11
|
import { UISentry } from '../services/sentry';
|
|
12
|
+
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from '../components/Menus/types';
|
|
13
|
+
export declare const enum UIType {
|
|
14
|
+
DESKTOP = "desktop",
|
|
15
|
+
MOBILE = "mobile"
|
|
16
|
+
}
|
|
12
17
|
export declare const enum AdditionalVideoQuality {
|
|
13
18
|
AUTO = "auto"
|
|
14
19
|
}
|
|
@@ -90,6 +95,7 @@ export interface IVKVideoPlayerCallbacks {
|
|
|
90
95
|
width: number;
|
|
91
96
|
height: number;
|
|
92
97
|
}) => void;
|
|
98
|
+
onReportProblem?: () => void;
|
|
93
99
|
};
|
|
94
100
|
adsInfo?: {
|
|
95
101
|
onStarted?: () => void;
|
|
@@ -164,12 +170,7 @@ export interface IInteractiveData {
|
|
|
164
170
|
get: (videoId: string) => Promise<number[]>;
|
|
165
171
|
save: (videoId: string, videoIds: number[]) => Promise<void>;
|
|
166
172
|
};
|
|
167
|
-
projectInfo?:
|
|
168
|
-
pid: string;
|
|
169
|
-
title: string;
|
|
170
|
-
videoId: string;
|
|
171
|
-
variantPayloadType: string;
|
|
172
|
-
};
|
|
173
|
+
projectInfo?: InteractiveProjectInfo;
|
|
173
174
|
tooltipHelpHintActive?: boolean;
|
|
174
175
|
}
|
|
175
176
|
export interface AdditionalButton {
|
|
@@ -220,10 +221,13 @@ export interface IVKVideoPlayerConfig {
|
|
|
220
221
|
is3DVideo?: boolean;
|
|
221
222
|
callbacks?: IVKVideoPlayerCallbacks;
|
|
222
223
|
additionalButtons?: AdditionalButton[];
|
|
224
|
+
additionalSettingsMenuItems?: AdditionalSettingsMenuItem[];
|
|
225
|
+
additionalContextMenuItems?: AdditionalContextMenuItem[];
|
|
223
226
|
refDomain?: string;
|
|
224
227
|
volumeMultiplier?: number;
|
|
225
228
|
saveRate?: boolean;
|
|
226
229
|
deviceId?: string;
|
|
230
|
+
showEndScreen?: boolean;
|
|
227
231
|
}
|
|
228
232
|
export interface IControlInfo {
|
|
229
233
|
/** @deprecated Используйте новое поле left */
|