@vkontakte/videoplayer 1.1.56-dev.d9cc5791.0 → 1.1.56
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 +77 -62
- package/es2015.esm.js +77 -62
- package/es2018.cjs.js +76 -61
- package/es2018.esm.js +76 -61
- package/esnext.cjs.js +79 -64
- package/esnext.esm.js +79 -64
- package/evergreen.esm.js +79 -64
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.d.ts +6 -1
- package/types/components/Ads/admanWrapper.d.ts +3 -1
- package/types/components/Menus/constants/subMenuIds.d.ts +1 -0
- package/types/components/Menus/subMenuTabs/rootMenuItems.d.ts +35 -0
- package/types/components/Menus/subMenuTabs/sharedMenuItems.d.ts +17 -0
- package/types/components/Menus/subMenuTabs/subMenuItems.d.ts +13 -0
- package/types/components/Menus/subMenuTabs/types.d.ts +145 -0
- package/types/components/Menus/subMenuTabs/utils.d.ts +3 -0
- package/types/components/Menus/types.d.ts +19 -12
- package/types/components/Menus/utils/getCurrentQualityDisplayValue.d.ts +20 -2
- package/types/components/Menus/utils/getSubMenusStack.svelte.d.ts +10 -0
- package/types/components/Menus/utils/menuNavigation.d.ts +2 -5
- package/types/components/shared/interpolateUtils.d.ts +7 -0
- package/types/config.d.ts +4 -0
- package/types/index.d.ts +1 -1
- package/types/store/index.d.ts +16 -3
- package/types/translation/types.d.ts +1 -1
- package/types/types/index.d.ts +1 -1
- package/types/utils/userSettings.d.ts +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.56
|
|
3
|
+
"version": "1.1.56",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -50,9 +50,9 @@
|
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@adtech/rbadman": "^2.2.57",
|
|
53
|
-
"@vkontakte/videoplayer-core": "2.0.126
|
|
54
|
-
"@vkontakte/videoplayer-interactive": "1.0.31
|
|
55
|
-
"@vkontakte/videoplayer-shared": "1.0.54
|
|
56
|
-
"@vkontakte/videoplayer-statistics": "1.0.71
|
|
53
|
+
"@vkontakte/videoplayer-core": "^2.0.126",
|
|
54
|
+
"@vkontakte/videoplayer-interactive": "^1.0.31",
|
|
55
|
+
"@vkontakte/videoplayer-shared": "^1.0.54",
|
|
56
|
+
"@vkontakte/videoplayer-statistics": "^1.0.71"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -6,7 +6,7 @@ import { InterfaceLanguage } from '@vkontakte/videoplayer-shared';
|
|
|
6
6
|
import { type PlaybackRate } from '@vkontakte/videoplayer-core';
|
|
7
7
|
import type { IStatContext } from '@vkontakte/videoplayer-statistics';
|
|
8
8
|
import { AnnotationsApi } from '../utils/webAPI/annotationsApi/annotationsApi';
|
|
9
|
-
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from '../components/Menus/types';
|
|
9
|
+
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from '../components/Menus/subMenuTabs/types';
|
|
10
10
|
import type { AdditionalButton } from '../components/Controls/types';
|
|
11
11
|
export declare class VKVideoPlayer extends HTMLElement {
|
|
12
12
|
private svelteStubComponent?;
|
|
@@ -60,6 +60,11 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
60
60
|
private initInteractives;
|
|
61
61
|
initPlayer(videoConfig: IVKVideoPlayerConfig, sdkConfig?: Partial<ISDKConfig>): void;
|
|
62
62
|
private isOneVideoPlaylist;
|
|
63
|
+
private updateVideos;
|
|
64
|
+
/**
|
|
65
|
+
* Обновление плейлиста. Будут перезаписаны все видео до текущего
|
|
66
|
+
*/
|
|
67
|
+
updatePrevVideos(videos: IVideoData[]): void;
|
|
63
68
|
/**
|
|
64
69
|
* Обновление плейлиста. Будут перезаписаны все видео после текущего
|
|
65
70
|
*/
|
|
@@ -2,7 +2,7 @@ import type { Writable, Readable } from 'svelte/store';
|
|
|
2
2
|
import type { AdsTimeRemained } from '../../types';
|
|
3
3
|
import { AdsSection } from '../../types';
|
|
4
4
|
import type { AdsParams } from '../../types';
|
|
5
|
-
import type
|
|
5
|
+
import { type ILogger, type Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
6
6
|
import { Subject } from '@vkontakte/videoplayer-shared';
|
|
7
7
|
import type { IAdsState } from '../../store';
|
|
8
8
|
type ExternalActions = {
|
|
@@ -32,10 +32,12 @@ interface IConfig {
|
|
|
32
32
|
initTimeout: Milliseconds;
|
|
33
33
|
runtimeTimeout: Milliseconds;
|
|
34
34
|
useAdmanFromNPM: boolean;
|
|
35
|
+
volumeMultiplier: number;
|
|
35
36
|
}
|
|
36
37
|
export declare class AdmanWrapper {
|
|
37
38
|
private adman;
|
|
38
39
|
private initialVolume;
|
|
40
|
+
private readonly volumeMultiplier;
|
|
39
41
|
private videoElement;
|
|
40
42
|
private currentAdSection;
|
|
41
43
|
private actions;
|
|
@@ -1,6 +1,7 @@
|
|
|
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",
|
|
4
5
|
AUDIO_LANGUAGES = "audio-language-sub",
|
|
5
6
|
PLAYBACK_RATE = "playback-rate-sub",
|
|
6
7
|
SUBTITLES = "subtitles-sub"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RootMenuId, type SettingsMenuItem } from './types';
|
|
2
|
+
import { type VideoPlaybackRate, type VideoSubtitle } from '../../../types';
|
|
3
|
+
import type { IAudioStream, PlaybackRate, VideoQuality } from '@vkontakte/videoplayer-core';
|
|
4
|
+
import type { QualitySettingsAppliesTo } from '../../../utils/userSettings';
|
|
5
|
+
export type Context = {
|
|
6
|
+
currentPlaybackRate: number;
|
|
7
|
+
availablePlaybackRates: VideoPlaybackRate[];
|
|
8
|
+
selectPlaybackRate: (playbackRate: PlaybackRate) => void;
|
|
9
|
+
trafficSavingEnabled: boolean;
|
|
10
|
+
toggleTrafficSaving: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
|
|
11
|
+
currentQuality: VideoQuality;
|
|
12
|
+
isAutoQualityEnabled: boolean;
|
|
13
|
+
isMobile: boolean;
|
|
14
|
+
currentAudioStream: IAudioStream | undefined;
|
|
15
|
+
availableAudioStreams: IAudioStream[];
|
|
16
|
+
qualityDetailsSubMenuEnabled: boolean;
|
|
17
|
+
currentSubtitle: Omit<VideoSubtitle, 'selected'>;
|
|
18
|
+
onDownloadClick: () => void;
|
|
19
|
+
onReportProblemClick: () => void;
|
|
20
|
+
onCopyDataClick: () => void;
|
|
21
|
+
onSaveTraceDataClick: () => void;
|
|
22
|
+
toggleShowDebugInfo: () => void;
|
|
23
|
+
debugPanelVisible: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Мапа элементов меню, которые показываются на первом уровне.
|
|
27
|
+
*/
|
|
28
|
+
export declare const RootMenuItemMap: Record<RootMenuId, (context: Context) => SettingsMenuItem>;
|
|
29
|
+
type Params = {
|
|
30
|
+
items: RootMenuId[];
|
|
31
|
+
context: Context;
|
|
32
|
+
additionalSettingsMenuItems: SettingsMenuItem[];
|
|
33
|
+
};
|
|
34
|
+
export declare const getRootMenuItems: ({ items, context, additionalSettingsMenuItems }: Params) => SettingsMenuItem[];
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Context, type SubMenuItem } from './types';
|
|
2
|
+
import type { QualitySettingsAppliesTo } from 'packages/ui/src/utils/userSettings';
|
|
3
|
+
export type QualityHandler = (params: {
|
|
4
|
+
labelWithQuality: boolean;
|
|
5
|
+
appliesTo: QualitySettingsAppliesTo;
|
|
6
|
+
selected: boolean;
|
|
7
|
+
}, context: Context) => SubMenuItem;
|
|
8
|
+
type DefaultHandler = (context: Context) => SubMenuItem;
|
|
9
|
+
/**
|
|
10
|
+
* В данном файле определяем элементы меню, которые могут использоваться в разных подменю.
|
|
11
|
+
*/
|
|
12
|
+
export declare const getMenuItemForAnotherQuality: DefaultHandler;
|
|
13
|
+
export declare const getMenuItemForAutoQuality: QualityHandler;
|
|
14
|
+
export declare const getMenuItemForQualityApplience: DefaultHandler;
|
|
15
|
+
export declare const getMenuItemForHighQuality: QualityHandler;
|
|
16
|
+
export declare const getMenuItemForTrafficSaving: QualityHandler;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SubMenuId, type Context } from './types';
|
|
2
|
+
type Params = {
|
|
3
|
+
subMenuId: SubMenuId | null;
|
|
4
|
+
context: Context;
|
|
5
|
+
};
|
|
6
|
+
export declare const getSubMenuData: ({ subMenuId, context }: Params) => {
|
|
7
|
+
title: string;
|
|
8
|
+
closeSettingsMenu?: () => void;
|
|
9
|
+
items: import("./types").SubMenuItem[];
|
|
10
|
+
id: SubMenuId;
|
|
11
|
+
minWidth?: number;
|
|
12
|
+
}[];
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { UIType, VideoPlaybackRate, VideoQualityForRender, VideoQualityUI, VideoSubtitle } from '../../../types';
|
|
2
|
+
import type { IAudioStream, PlaybackRate, VideoQuality } from '@vkontakte/videoplayer-core';
|
|
3
|
+
import type { QualitySettingsAppliesTo } from '../../../utils/userSettings';
|
|
4
|
+
import type { TmpComponentType } from 'packages/ui/src/types/tmp';
|
|
5
|
+
export declare enum SharedSubMenuItemId {
|
|
6
|
+
QUALITY_OTHER = "QUALITY_OTHER",
|
|
7
|
+
QUALITY_AUTO = "QUALITY_AUTO",
|
|
8
|
+
QUALITY_APPLIENCE = "QUALITY_APPLIENCE",
|
|
9
|
+
QUALITY_HIGH = "QUALITY_HIGH",
|
|
10
|
+
QUALITY_TRAFFIC_SAVING = "QUALITY_TRAFFIC_SAVING"
|
|
11
|
+
}
|
|
12
|
+
export declare enum SubMenuId {
|
|
13
|
+
PLAYBACK_RATE_SUB_MENU = "PLAYBACK_RATE_SUB_MENU",
|
|
14
|
+
QUALITY_DETAILS = "QUALITY_DETAILS",
|
|
15
|
+
QUALITY = "QUALITY",
|
|
16
|
+
QUALITY_APPLIENCE = "QUALITY_APPLIENCE",
|
|
17
|
+
AUDIO_LANGUAGES = "AUDIO_LANGUAGES",
|
|
18
|
+
SUBTITLES = "SUBTITLES"
|
|
19
|
+
}
|
|
20
|
+
export declare enum RootMenuId {
|
|
21
|
+
QUALITY_SETTINGS = "QUALITY_SETTINGS",
|
|
22
|
+
TRAFFIC_SAVING_SWITCH = "TRAFFIC_SAVING_SWITCH",
|
|
23
|
+
AUDIO_LANGUAGES = "AUDIO_LANGUAGES",
|
|
24
|
+
PLAYBACK_RATE = "PLAYBACK_RATE",
|
|
25
|
+
SUBTITLES = "SUBTITLES",
|
|
26
|
+
DOWNLOAD = "DOWNLOAD",
|
|
27
|
+
SHOW_SUPPORT = "SHOW_SUPPORT",
|
|
28
|
+
COPY_DATA = "COPY_DATA",
|
|
29
|
+
SAVE_TRACE_INFO = "SAVE_TRACE_INFO",
|
|
30
|
+
DEBUG_INFO = "DEBUG_INFO"
|
|
31
|
+
}
|
|
32
|
+
export type Context = {
|
|
33
|
+
closeSettingsMenu: () => void;
|
|
34
|
+
isMobile: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Скорость.
|
|
37
|
+
*/
|
|
38
|
+
availablePlaybackRates: VideoPlaybackRate[];
|
|
39
|
+
selectPlaybackRate: (playbackRate: PlaybackRate) => void;
|
|
40
|
+
/**
|
|
41
|
+
* Качество.
|
|
42
|
+
*/
|
|
43
|
+
selectQuality: (quality: VideoQualityUI, appliesTo: QualitySettingsAppliesTo) => void;
|
|
44
|
+
isAutoQualityEnabled: boolean;
|
|
45
|
+
isAutoQualityAvailable: boolean;
|
|
46
|
+
highQualityEnabled: boolean;
|
|
47
|
+
toggleHighQuality: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
|
|
48
|
+
trafficSavingEnabled: boolean;
|
|
49
|
+
toggleTrafficSaving: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
|
|
50
|
+
currentQuality: VideoQuality;
|
|
51
|
+
availableQualities: VideoQualityForRender[];
|
|
52
|
+
/**
|
|
53
|
+
* Звуковые дорожки.
|
|
54
|
+
*/
|
|
55
|
+
availableAudioStreams: IAudioStream[];
|
|
56
|
+
selectAudioLanguage: (stream: IAudioStream) => void;
|
|
57
|
+
currentAudioStream: IAudioStream | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Субтитры
|
|
60
|
+
*/
|
|
61
|
+
availableSubtitlesList: VideoSubtitle[];
|
|
62
|
+
selectSubtitle: (subtitle: VideoSubtitle) => void;
|
|
63
|
+
};
|
|
64
|
+
export type SubMenuData = (context: Context) => {
|
|
65
|
+
title: string;
|
|
66
|
+
closeSettingsMenu?: () => void;
|
|
67
|
+
items: SubMenuItem[];
|
|
68
|
+
id: SubMenuId;
|
|
69
|
+
minWidth?: number;
|
|
70
|
+
};
|
|
71
|
+
export type SubMenuItem = SubMenuItemOpenSubMenu | SubMenuItemSelect;
|
|
72
|
+
type BaseSubMenuItem<U = any> = {
|
|
73
|
+
selected?: boolean;
|
|
74
|
+
valueComponent?: TmpComponentType;
|
|
75
|
+
valueComponentParams?: {
|
|
76
|
+
[key: string]: U;
|
|
77
|
+
};
|
|
78
|
+
bottomBordered?: boolean;
|
|
79
|
+
label?: string;
|
|
80
|
+
sublabel?: string;
|
|
81
|
+
ariaLabel?: string;
|
|
82
|
+
};
|
|
83
|
+
export type SubMenuItemOpenSubMenu = {
|
|
84
|
+
type: SubMenuItemType.OPEN_SUB_MENU;
|
|
85
|
+
children: SubMenuId;
|
|
86
|
+
id: SharedSubMenuItemId;
|
|
87
|
+
} & BaseSubMenuItem;
|
|
88
|
+
export type SubMenuItemSelect<T = any> = {
|
|
89
|
+
type: SubMenuItemType.SELECT_VALUE;
|
|
90
|
+
value: T;
|
|
91
|
+
selectItem: (value: T) => void;
|
|
92
|
+
} & BaseSubMenuItem;
|
|
93
|
+
interface BaseMenuItem<Id> {
|
|
94
|
+
id: Id;
|
|
95
|
+
weight: number;
|
|
96
|
+
ariaLabel?: string;
|
|
97
|
+
label: string;
|
|
98
|
+
}
|
|
99
|
+
interface BaseSettingsMenuItem extends BaseMenuItem<RootMenuId> {
|
|
100
|
+
icon: TmpComponentType;
|
|
101
|
+
isHiddenFor?: UIType[];
|
|
102
|
+
}
|
|
103
|
+
export declare enum MenuItemType {
|
|
104
|
+
OPEN_SUB_MENU = "OPEN_SUB_MENU",
|
|
105
|
+
CLICK = "CLICK",
|
|
106
|
+
SWITCH = "SWITCH"
|
|
107
|
+
}
|
|
108
|
+
export declare enum SubMenuItemType {
|
|
109
|
+
OPEN_SUB_MENU = "OPEN_SUB_MENU",
|
|
110
|
+
SELECT_VALUE = "SELECT_VALUE"
|
|
111
|
+
}
|
|
112
|
+
export interface OpenSubMenuSettingsMenuItem extends BaseSettingsMenuItem {
|
|
113
|
+
type: MenuItemType.OPEN_SUB_MENU;
|
|
114
|
+
value: string;
|
|
115
|
+
valueComponent?: TmpComponentType;
|
|
116
|
+
children: SubMenuId;
|
|
117
|
+
}
|
|
118
|
+
export interface ClickSettingsMenuItem extends BaseSettingsMenuItem {
|
|
119
|
+
type: MenuItemType.CLICK;
|
|
120
|
+
onClick: () => void;
|
|
121
|
+
}
|
|
122
|
+
export interface SwitchSettingsMenuItem extends BaseSettingsMenuItem {
|
|
123
|
+
type: MenuItemType.SWITCH;
|
|
124
|
+
onClick: (enabled: boolean) => void;
|
|
125
|
+
enabled: boolean;
|
|
126
|
+
tooltipText?: string;
|
|
127
|
+
maxTooltipWidth?: number;
|
|
128
|
+
}
|
|
129
|
+
export type AdditionalSwitchSettingsMenuItem = Omit<SwitchSettingsMenuItem, 'icon' | 'onClick'> & {
|
|
130
|
+
icon: string;
|
|
131
|
+
onChangeEnabled: (enabled: boolean) => void;
|
|
132
|
+
};
|
|
133
|
+
export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem, 'icon'> & {
|
|
134
|
+
icon: string;
|
|
135
|
+
};
|
|
136
|
+
export type SettingsMenuItem = OpenSubMenuSettingsMenuItem | ClickSettingsMenuItem | SwitchSettingsMenuItem;
|
|
137
|
+
export type AdditionalSettingsMenuItem = AdditionalSwitchSettingsMenuItem | AdditionalClickSettingsMenuItem;
|
|
138
|
+
export interface ContextMenuItem extends BaseMenuItem<string> {
|
|
139
|
+
onClick: () => void;
|
|
140
|
+
}
|
|
141
|
+
export type AdditionalContextMenuItem = ContextMenuItem;
|
|
142
|
+
export type MenuRefs = {
|
|
143
|
+
[key: string]: HTMLUListElement;
|
|
144
|
+
};
|
|
145
|
+
export {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type QualitySettingsAppliesTo } from '../../../utils/userSettings';
|
|
2
|
+
export declare const getEnrichWithQualityAppliesTo: (appliesTo: QualitySettingsAppliesTo) => <T>(fn: (value: T, appliesTo: QualitySettingsAppliesTo) => void) => (value: T) => void;
|
|
3
|
+
export declare function isDefined<T>(x: T | undefined): x is T;
|
|
@@ -47,40 +47,47 @@ export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem, 'icon
|
|
|
47
47
|
};
|
|
48
48
|
export type SettingsMenuItem = OpenSubMenuSettingsMenuItem | ClickSettingsMenuItem | SwitchSettingsMenuItem;
|
|
49
49
|
export type AdditionalSettingsMenuItem = AdditionalSwitchSettingsMenuItem | AdditionalClickSettingsMenuItem;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
dataValue?: T | keyof T;
|
|
54
|
-
valueComponent?: any;
|
|
50
|
+
interface SubMenuItemBase<U = any> {
|
|
51
|
+
selected?: boolean;
|
|
52
|
+
valueComponent?: TmpComponentType;
|
|
55
53
|
valueComponentParams?: {
|
|
56
54
|
[key: string]: U;
|
|
57
55
|
};
|
|
58
|
-
|
|
56
|
+
bottomBordered?: boolean;
|
|
59
57
|
label?: string;
|
|
60
|
-
|
|
58
|
+
sublabel?: string;
|
|
59
|
+
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;
|
|
61
66
|
selectItem: (value: T) => void;
|
|
62
67
|
}
|
|
63
|
-
export interface OpenSubMenuSubMenuItem {
|
|
68
|
+
export interface OpenSubMenuSubMenuItem extends SubMenuItemBase {
|
|
64
69
|
type: SubMenuItemType.OPEN_SUB_MENU;
|
|
65
|
-
ariaLabel?: string;
|
|
66
|
-
label: string;
|
|
67
70
|
id: string;
|
|
68
71
|
subMenuId: SubMenuIds;
|
|
69
|
-
getSubItemForFocus
|
|
72
|
+
getSubItemForFocus?: () => HTMLLIElement;
|
|
70
73
|
}
|
|
71
74
|
export type SubMenuItem = SelectValueSubMenuItem | OpenSubMenuSubMenuItem;
|
|
72
75
|
export interface SubMenuList {
|
|
73
76
|
id: SubMenuIds;
|
|
74
|
-
parentItemId
|
|
77
|
+
parentItemId?: string;
|
|
75
78
|
items: SubMenuItem[];
|
|
76
79
|
returnFromSubMenu?: () => void;
|
|
77
80
|
ariaLabelReturnFromSubMenu?: string;
|
|
78
81
|
title: string;
|
|
79
82
|
closeSettingsMenu: () => void;
|
|
80
83
|
minWidth?: number;
|
|
84
|
+
onMount?: () => void;
|
|
81
85
|
}
|
|
82
86
|
export interface ContextMenuItem extends BaseMenuItem {
|
|
83
87
|
onClick: () => void;
|
|
84
88
|
}
|
|
85
89
|
export type AdditionalContextMenuItem = ContextMenuItem;
|
|
90
|
+
export type MenuRefs = {
|
|
91
|
+
[key: string]: HTMLUListElement;
|
|
92
|
+
};
|
|
86
93
|
export {};
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
import { VideoQuality } from '@vkontakte/videoplayer-core';
|
|
2
|
-
import type
|
|
3
|
-
|
|
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 {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SubMenuId } from '../subMenuTabs/types';
|
|
2
|
+
/**
|
|
3
|
+
* Представляем цепочку открытия подменюшек стеком, таким образом можем открывать хоть сколько.
|
|
4
|
+
*/
|
|
5
|
+
export declare const getSubMenusStack: () => {
|
|
6
|
+
readonly current: SubMenuId | null;
|
|
7
|
+
pushSubMenu: (subMenuId: SubMenuId) => void;
|
|
8
|
+
popSubMenu: () => void;
|
|
9
|
+
popAllSubMenus: () => void;
|
|
10
|
+
};
|
|
@@ -11,11 +11,8 @@ 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
|
|
15
|
-
export declare const handleKeyDownSubMenu: (event: KeyboardEvent, returnFromSubMenu: () => void,
|
|
16
|
-
itemIdReturnCase: Writable<string | undefined>;
|
|
17
|
-
id: string;
|
|
18
|
-
}, closeSettingsMenuFn: () => void) => Promise<void>;
|
|
14
|
+
export declare const handleKeyDownOpenSubMenuItem: (event: KeyboardEvent, openSubmenuFn: () => void) => Promise<void>;
|
|
15
|
+
export declare const handleKeyDownSubMenu: (event: KeyboardEvent, returnFromSubMenu: () => void, closeSettingsMenuFn: () => void) => Promise<void>;
|
|
19
16
|
export declare const handleChoseMenuItem: (event: KeyboardEvent, selectFn: () => void) => void;
|
|
20
17
|
export declare const handleSwitchMenuItem: (event: KeyboardEvent, enabled: boolean, selectFn: (value: boolean) => void) => void;
|
|
21
18
|
export declare const getContextMenuPositionByButton: (btnRef: HTMLButtonElement) => Position;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type AllowedHTML = Record<string, boolean>;
|
|
2
|
+
/**
|
|
3
|
+
* В дальнейшем можно по надобности указывать возможные атрибуты.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_ALLOWED_HTML: AllowedHTML;
|
|
6
|
+
export declare const interpolateMessage: (message?: string, customAllowedHTML?: AllowedHTML) => string | undefined;
|
|
7
|
+
export {};
|
package/types/config.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export interface IUIConfig {
|
|
|
30
30
|
preview?: number;
|
|
31
31
|
isMobileGoToSiteButton: boolean;
|
|
32
32
|
useAdmanFromNPM: boolean;
|
|
33
|
+
volumeMultiplier: number;
|
|
33
34
|
};
|
|
34
35
|
volumeDefault: number;
|
|
35
36
|
volumeMinRestore: number;
|
|
@@ -38,6 +39,7 @@ export interface IUIConfig {
|
|
|
38
39
|
minSubtitlesFontSize: number;
|
|
39
40
|
autoSubtitlesTimeout: Milliseconds;
|
|
40
41
|
trafficSavingLimit: ExactVideoQuality;
|
|
42
|
+
highQualityLimit: ExactVideoQuality;
|
|
41
43
|
episodeMinWidthPc: number;
|
|
42
44
|
controls: {
|
|
43
45
|
showOnStartupAtAutoplay: boolean;
|
|
@@ -61,6 +63,7 @@ export interface IUIConfig {
|
|
|
61
63
|
volumeStepWheel: number;
|
|
62
64
|
};
|
|
63
65
|
hideThumbTimerAfterTouch: boolean;
|
|
66
|
+
preventPauseOnVideoClick: boolean;
|
|
64
67
|
sentry: {
|
|
65
68
|
dsn: string;
|
|
66
69
|
sampleRate: number;
|
|
@@ -118,6 +121,7 @@ export interface IUIConfig {
|
|
|
118
121
|
exposeInternalsToGlobal: boolean;
|
|
119
122
|
skipInitialPlaybackStateValue: boolean;
|
|
120
123
|
skipInitialPlaybackRateValue: boolean;
|
|
124
|
+
qualityDetailsSubMenuEnabled: boolean;
|
|
121
125
|
};
|
|
122
126
|
interactive: {
|
|
123
127
|
historyMaxLength: number;
|
package/types/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek } f
|
|
|
7
7
|
import type { Milliseconds, QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
8
8
|
export { VERSION } from './env';
|
|
9
9
|
export declare const registerPlayerWebComponent: () => void;
|
|
10
|
-
export { type AdditionalSettingsMenuItem, MenuItemType, type AdditionalClickSettingsMenuItem, type AdditionalSwitchSettingsMenuItem, type AdditionalContextMenuItem, } from './components/Menus/types';
|
|
10
|
+
export { type AdditionalSettingsMenuItem, MenuItemType, type AdditionalClickSettingsMenuItem, type AdditionalSwitchSettingsMenuItem, type AdditionalContextMenuItem, } from './components/Menus/subMenuTabs/types';
|
|
11
11
|
export { type AdditionalButton, ControlButtonType, } from './components/Controls/types';
|
|
12
12
|
export type { VKVideoPlayer, IVKVideoPlayerConfig, IControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, QualityLimits, IVideoEpisode, ISDKConfig, };
|
|
13
13
|
export { GridTypes, };
|
package/types/store/index.d.ts
CHANGED
|
@@ -9,11 +9,16 @@ import { AdmanWrapper } from '../components/Ads/admanWrapper';
|
|
|
9
9
|
import type { Key, 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 } from '../types';
|
|
12
|
+
import { type QualitySettingsAppliesTo } from '../utils/userSettings';
|
|
12
13
|
import type { DebugData } from './utils';
|
|
13
14
|
import { GridTypes, type PlayPrevChapterDisabledTooltipKey } from '../constans';
|
|
14
15
|
import { UIOneStat } from '../services/statistics';
|
|
15
|
-
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem, ContextMenuItem, SettingsMenuItem } from '../components/Menus/types';
|
|
16
|
+
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem, ContextMenuItem, SettingsMenuItem } from '../components/Menus/subMenuTabs/types';
|
|
16
17
|
import type { AdditionalButton, AdditionalDesktopControlPanelButton } from '../components/Controls/types';
|
|
18
|
+
type Info = {
|
|
19
|
+
appliesTo?: QualitySettingsAppliesTo;
|
|
20
|
+
changeReason?: 'default' | 'limit-changed';
|
|
21
|
+
};
|
|
17
22
|
export interface IAdsState {
|
|
18
23
|
position: Writable<number>;
|
|
19
24
|
duration: Writable<number>;
|
|
@@ -58,6 +63,7 @@ export interface IUIState {
|
|
|
58
63
|
};
|
|
59
64
|
};
|
|
60
65
|
isFullscreen: Writable<boolean>;
|
|
66
|
+
isFullscreenOpenedByKeyboard: Writable<boolean>;
|
|
61
67
|
rotateAlpha: Writable<number>;
|
|
62
68
|
isAutoplay: Writable<boolean>;
|
|
63
69
|
debugPanelVisible: Writable<boolean>;
|
|
@@ -138,6 +144,7 @@ export interface IStore {
|
|
|
138
144
|
volume$: Readable<number>;
|
|
139
145
|
muted$: Readable<boolean>;
|
|
140
146
|
trafficSavingEnabled$: Readable<boolean>;
|
|
147
|
+
highQualityEnabled$: Readable<boolean>;
|
|
141
148
|
availableVideoStreams$: Readable<IVideoStream[]>;
|
|
142
149
|
availableAudioStreams$: Readable<IAudioStream[]>;
|
|
143
150
|
videoStream$: Readable<IVideoStream | undefined>;
|
|
@@ -180,6 +187,10 @@ export interface IStore {
|
|
|
180
187
|
playPrevChapterDisabledTooltip: PlayPrevChapterDisabledTooltipKey;
|
|
181
188
|
looped$: Writable<boolean>;
|
|
182
189
|
loadedMetadata$: Writable<boolean>;
|
|
190
|
+
/**
|
|
191
|
+
* Определяет, можно ли в целом увидеть/выбрать Авто режим выбора качества.
|
|
192
|
+
*/
|
|
193
|
+
isAutoQualityAvailable$: Readable<boolean>;
|
|
183
194
|
};
|
|
184
195
|
ui: IUIState;
|
|
185
196
|
ads: IAdsState;
|
|
@@ -196,11 +207,12 @@ export interface IStore {
|
|
|
196
207
|
closeSettingsMenu: (fromSubMenu?: boolean) => void;
|
|
197
208
|
openSettingsSubMenu: (name: string, ref: HTMLElement) => void;
|
|
198
209
|
closeSettingsSubMenu: (ref: HTMLElement, isClosing?: boolean) => void;
|
|
199
|
-
setTrafficSavingEnabled: (trafficSavingEnabled: boolean) => void;
|
|
210
|
+
setTrafficSavingEnabled: (trafficSavingEnabled: boolean, appliesTo?: QualitySettingsAppliesTo) => void;
|
|
211
|
+
setHighQualityEnabled: (highQualityEnabled: boolean, appliesTo?: QualitySettingsAppliesTo) => void;
|
|
200
212
|
setVolume: (volume: number, preferredVolume?: number) => void;
|
|
201
213
|
setAudioStream: (stream: IAudioStream) => void;
|
|
202
214
|
setVideoStream: (stream: IVideoStream) => void;
|
|
203
|
-
setQuality: (quality: VideoQualityUI) => void;
|
|
215
|
+
setQuality: (quality: VideoQualityUI, info?: Info) => void;
|
|
204
216
|
setPlaybackRate: (playbackRate: PlaybackRate) => void;
|
|
205
217
|
incrementPlaybackRate: () => void;
|
|
206
218
|
decrementPlaybackRate: () => void;
|
|
@@ -286,6 +298,7 @@ export interface IStore {
|
|
|
286
298
|
setUiCallbacks: (uiCallbacks: IVKVideoPlayerUICallbacks) => void;
|
|
287
299
|
getAdmanWrapper: () => AdmanWrapper;
|
|
288
300
|
getLogger: () => ILogger;
|
|
301
|
+
getPlayer: () => IPlayer;
|
|
289
302
|
destroy(): void;
|
|
290
303
|
}
|
|
291
304
|
interface IStoreParams {
|
|
@@ -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' | 'hotkey_map_item_next_video_description' | 'hotkey_map_item_next_video_value' | 'hotkey_map_item_prev_video_description' | 'hotkey_map_item_prev_video_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' | 'end_screen_next_video' | 'end_screen_recommended_video';
|
|
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' | 'tooltip_autoplay_off' | 'tooltip_autoplay_on' | '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' | 'hotkey_map_item_next_video_description' | 'hotkey_map_item_next_video_value' | 'hotkey_map_item_prev_video_description' | 'hotkey_map_item_prev_video_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' | 'end_screen_next_video' | 'end_screen_recommended_video' | 'other_quality' | 'high_quality' | 'high_quality_description' | 'auto_quality_limit' | 'traffic_saving_quality' | 'traffic_saving_quality_description' | 'quality_applience' | 'quality_applience_action' | 'default_quality_for_any_video';
|
|
3
3
|
export type LanguagePack = Record<Key, string>;
|
|
4
4
|
export type LanguageConfig = {
|
|
5
5
|
language: string;
|
package/types/types/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ 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';
|
|
12
|
+
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from '../components/Menus/subMenuTabs/types';
|
|
13
13
|
export declare const enum UIType {
|
|
14
14
|
DESKTOP = "desktop",
|
|
15
15
|
MOBILE = "mobile"
|
|
@@ -15,3 +15,20 @@ 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
|
+
export type PreferredQualitySettingsType = 'traffic_saving' | 'high_quality' | 'auto_quality' | 'exact_video';
|
|
19
|
+
export 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 & {
|
|
32
|
+
appliesTo: QualitySettingsAppliesTo;
|
|
33
|
+
}) | null, migrateSettingsToLegacyWay: (videoId?: number) => void, savePreferredQualitySettings: (value: PreferredQualitySettingsValue, appliesTo?: QualitySettingsAppliesTo) => void, savePreferredDefaultQualitySettings: (value: DefaultPreferredQualitySettingsValue) => void, removePreferredQualitySettingsByVideo: () => void, getPreferredDefaultQualitySettings: () => DefaultPreferredQualitySettingsValue | null;
|
|
34
|
+
export {};
|