@vkontakte/videoplayer 1.1.86 → 1.1.87-dev.04ce2cd1.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 +423 -56
- package/es2015.esm.js +423 -56
- package/es2018.cjs +423 -56
- package/es2018.esm.js +423 -56
- package/es2024.cjs +423 -56
- package/es2024.esm.js +423 -56
- package/esnext.cjs +423 -56
- package/esnext.esm.js +423 -56
- package/evergreen.esm.js +423 -56
- package/package.json +5 -5
- package/types/VKVideoPlayer/HTMLElement.d.ts +1 -1
- package/types/VKVideoPlayer/index.svelte.d.ts +173 -173
- package/types/components/Ads/admanWrapper.d.ts +79 -75
- package/types/components/Ads/types.d.ts +27 -27
- package/types/components/Controls/contants/desktopButtonsLeftIds.d.ts +8 -8
- package/types/components/Controls/contants/desktopButtonsLeftWeights.d.ts +2 -4
- package/types/components/Controls/contants/desktopButtonsRightIds.d.ts +8 -8
- package/types/components/Controls/contants/desktopButtonsRightWeights.d.ts +2 -4
- package/types/components/Controls/types.d.ts +27 -27
- package/types/components/Controls/utils/isInnerButtonGuard.d.ts +1 -1
- package/types/components/Icons/constants.d.ts +5 -5
- package/types/components/Icons/utils.d.ts +1 -1
- package/types/components/Menus/constants/contextMenuItemIds.d.ts +10 -10
- package/types/components/Menus/constants/contextMenuItemWeights.d.ts +2 -4
- package/types/components/Menus/constants/index.d.ts +4 -4
- package/types/components/Menus/constants/openSubMenuItemsIds.d.ts +1 -1
- package/types/components/Menus/constants/settingsMenuItemIds.d.ts +10 -10
- package/types/components/Menus/constants/settingsMenuItemWeights.d.ts +2 -4
- package/types/components/Menus/constants/subMenuIds.d.ts +6 -6
- package/types/components/Menus/subMenuTabs/rootMenuItems.d.ts +26 -26
- package/types/components/Menus/subMenuTabs/sharedMenuItems.d.ts +7 -7
- package/types/components/Menus/subMenuTabs/subMenuItems.d.ts +4 -10
- package/types/components/Menus/subMenuTabs/types.d.ts +108 -108
- package/types/components/Menus/subMenuTabs/utils.d.ts +2 -2
- package/types/components/Menus/types.d.ts +64 -61
- package/types/components/Menus/utils/getCurrentQualityDisplayValue.d.ts +12 -12
- package/types/components/Menus/utils/getQualityIcon.d.ts +2 -2
- package/types/components/Menus/utils/getSubMenusStack.svelte.d.ts +7 -7
- package/types/components/Menus/utils/menuNavigation.d.ts +5 -5
- package/types/components/Root/types.d.ts +79 -79
- package/types/components/Root/utils.d.ts +2 -2
- package/types/components/Timeline/PreviewTrack/useTransitionToPreviewTrack.svelte.d.ts +15 -15
- package/types/components/Timeline/consts.d.ts +2 -2
- package/types/components/shared/interpolateUtils.d.ts +2 -2
- package/types/config.d.ts +270 -260
- package/types/constans/controls.d.ts +21 -21
- package/types/constans/grid.d.ts +9 -9
- package/types/constans/index.d.ts +8 -8
- package/types/constans/interactives.d.ts +4 -4
- package/types/constans/keyboard.d.ts +43 -48
- package/types/index.d.ts +16 -16
- package/types/services/statistics.d.ts +13 -13
- package/types/store/index.d.ts +391 -391
- package/types/store/micro/base.d.ts +6 -6
- package/types/store/micro/fakeIsPlaying.d.ts +8 -10
- package/types/store/micro/graphIsOpened.d.ts +11 -13
- package/types/store/micro/index.d.ts +1 -1
- package/types/store/micro/interactiveControlsOpacity.d.ts +8 -10
- package/types/store/micro/notifications.d.ts +7 -10
- package/types/store/micro/pictureInPicture.d.ts +6 -9
- package/types/store/micro/seekToInteractiveDisabledTooltip.d.ts +8 -7
- package/types/store/micro/showInteractiveTimeIndicatorTooltip.d.ts +13 -12
- package/types/store/utils.d.ts +36 -36
- package/types/translation/index.d.ts +2 -2
- package/types/translation/labels.d.ts +1 -1
- package/types/translation/packs/en.d.ts +1 -1
- package/types/translation/packs/ru.d.ts +1 -1
- package/types/translation/types.d.ts +5 -5
- package/types/types/index.d.ts +534 -516
- package/types/types/svg.d.d.ts +5 -0
- package/types/utils/CaptionsPrepared.d.ts +15 -15
- package/types/utils/WebVttParser.d.ts +11 -11
- package/types/utils/attachments/defferedDisableByCondition.d.ts +3 -3
- package/types/utils/changeVolume.d.ts +6 -6
- package/types/utils/elementHelpers.d.ts +2 -2
- package/types/utils/findCurrentSubtltlePhrase.d.ts +1 -1
- package/types/utils/fullscreen.d.ts +14 -14
- package/types/utils/getActualEpisode.d.ts +7 -7
- package/types/utils/getControlInfo.d.ts +5 -7
- package/types/utils/getHotKeyMapData.d.ts +1 -1
- package/types/utils/grid.d.ts +1 -1
- package/types/utils/hooks/useIosSafariFullscreen.d.ts +2 -2
- package/types/utils/hooks/useIosSafariFullscreenSubtitles.d.ts +3 -3
- package/types/utils/keyboardHandleCases.d.ts +1 -1
- package/types/utils/notificationShowManager.d.ts +7 -6
- package/types/utils/roundFps.d.ts +1 -1
- package/types/utils/sanitizeHtml.d.ts +3 -3
- package/types/utils/sorts.d.ts +2 -2
- package/types/utils/stack/index.d.ts +7 -7
- package/types/utils/stack/node.d.ts +3 -3
- package/types/utils/subtitles.d.ts +8 -8
- package/types/utils/timeout.d.ts +2 -2
- package/types/utils/updatePlayerControlBlocks.d.ts +2 -2
- package/types/utils/updatePlayerControlsInfo.d.ts +2 -2
- package/types/utils/userSettings.d.ts +26 -21
- package/types/utils/videoConfig.d.ts +6 -2
- package/types/utils/volumeChange.d.ts +1 -1
- package/types/utils/webAPI/annotationsApi/annotationsApi.d.ts +31 -31
- package/types/utils/webAPI/annotationsApi/errors.d.ts +1 -1
- package/types/utils/webAPI/focusLock.d.ts +30 -30
- package/types/utils/webAPI/focusManager.d.ts +15 -15
- package/types/utils/webAPI/language.d.ts +1 -1
- package/types/utils/webAPI/mediaSessionApi.d.ts +14 -14
- package/types/utils/webAPI/pictureInPictureApi/documentPictureInPictureApi.svelte.d.ts +41 -41
- package/types/utils/webAPI/pictureInPictureApi/factory.d.ts +2 -2
- package/types/utils/webAPI/pictureInPictureApi/index.d.ts +4 -4
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApi.d.ts +46 -46
- package/types/utils/webAPI/pictureInPictureApi/types.d.ts +4 -4
- package/types/utils/webAPI/pictureInPictureApi/utils.d.ts +3 -3
- package/types/utils/webAPI/slotsApi.d.ts +41 -41
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare enum DesktopButtonsRightIds {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
LOGO = "vkLogo",
|
|
3
|
+
AUTOPLAY_NEXT = "autoplayNext",
|
|
4
|
+
VOLUME = "volume",
|
|
5
|
+
SUBTITLES = "subtitles",
|
|
6
|
+
SETTINGS = "settings",
|
|
7
|
+
CONTEXT = "context",
|
|
8
|
+
FULLSCREEN = "fullscreen",
|
|
9
|
+
CHROMECAST = "chromecast"
|
|
10
10
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { DesktopButtonsRightIds } from
|
|
2
|
-
export declare const desktopButtonsRightWeights: {
|
|
3
|
-
[key in DesktopButtonsRightIds]: number;
|
|
4
|
-
};
|
|
1
|
+
import { DesktopButtonsRightIds } from "./desktopButtonsRightIds";
|
|
2
|
+
export declare const desktopButtonsRightWeights: { [key in DesktopButtonsRightIds] : number };
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { GridTypes } from
|
|
2
|
-
import type { TmpComponentType } from
|
|
1
|
+
import type { GridTypes } from "../../constans";
|
|
2
|
+
import type { TmpComponentType } from "../../types/tmp";
|
|
3
3
|
export declare enum ControlButtonType {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
DESKTOP_CONTROL_PANEL_LEFT = "desktop-control-panel-left",
|
|
5
|
+
DESKTOP_CONTROL_PANEL_RIGHT = "desktop-control-panel-right"
|
|
6
6
|
}
|
|
7
7
|
interface BaseButton {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
id: string;
|
|
9
|
+
weight: number;
|
|
10
|
+
disabled?: boolean;
|
|
11
11
|
}
|
|
12
12
|
interface BaseInnerButton extends BaseButton {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
buttonComponent: TmpComponentType;
|
|
14
|
+
buttonComponentProps?: Record<string, unknown>;
|
|
15
|
+
ariaKeyShortCut?: string;
|
|
16
|
+
ariaExpanded?: boolean;
|
|
17
17
|
}
|
|
18
18
|
interface BaseAdditionalButton extends BaseButton {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
icon: string;
|
|
20
|
+
testId?: string;
|
|
21
|
+
onClick?: () => void;
|
|
22
|
+
ariaLabel: string;
|
|
23
23
|
}
|
|
24
24
|
export interface DesktopControlPanelButton extends BaseInnerButton {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
type: ControlButtonType.DESKTOP_CONTROL_PANEL_LEFT | ControlButtonType.DESKTOP_CONTROL_PANEL_RIGHT;
|
|
26
|
+
tooltipEnabled?: boolean;
|
|
27
|
+
mouseEnter?: () => void;
|
|
28
|
+
mouseLeave?: () => void;
|
|
29
|
+
tooltipText?: string;
|
|
30
|
+
disabledTooltipContent?: string;
|
|
31
|
+
className?: string;
|
|
32
32
|
}
|
|
33
33
|
export interface AdditionalDesktopControlPanelButton extends BaseAdditionalButton {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
type: ControlButtonType.DESKTOP_CONTROL_PANEL_RIGHT;
|
|
35
|
+
tooltipText?: string;
|
|
36
|
+
disabledTooltipContent?: string;
|
|
37
|
+
hideOnDesktopGridTypes?: GridTypes[];
|
|
38
|
+
disableMouseupTooltipShow?: boolean;
|
|
39
39
|
}
|
|
40
40
|
export type AdditionalButton = AdditionalDesktopControlPanelButton;
|
|
41
41
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AdditionalDesktopControlPanelButton, DesktopControlPanelButton } from
|
|
1
|
+
import type { AdditionalDesktopControlPanelButton, DesktopControlPanelButton } from "../types";
|
|
2
2
|
export declare const isInnerButtonGuard: (btn: DesktopControlPanelButton | AdditionalDesktopControlPanelButton) => btn is DesktopControlPanelButton;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { IconSize } from
|
|
1
|
+
import type { IconSize } from "./constants";
|
|
2
2
|
export declare const getSizeStyle: (size: IconSize) => string;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare enum ContextMenuItemIds {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
12
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { ContextMenuItemIds } from
|
|
2
|
-
export declare const contextMenuItemWeights: {
|
|
3
|
-
[key in ContextMenuItemIds]: number;
|
|
4
|
-
};
|
|
1
|
+
import { ContextMenuItemIds } from "./contextMenuItemIds";
|
|
2
|
+
export declare const contextMenuItemWeights: { [key in ContextMenuItemIds] : number };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
1
|
+
export * from "./settingsMenuItemWeights";
|
|
2
|
+
export * from "./settingsMenuItemIds";
|
|
3
|
+
export * from "./defaultSubMenuMinWidth";
|
|
4
|
+
export * from "./topOffset";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare enum SettingsMenuItemIds {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
QUALITY = "quality-settings",
|
|
3
|
+
AUDIO_TRACKS = "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
12
|
}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
import { SettingsMenuItemIds } from
|
|
2
|
-
export declare const settingsMenuItemWeights: {
|
|
3
|
-
[key in SettingsMenuItemIds]: number;
|
|
4
|
-
};
|
|
1
|
+
import { SettingsMenuItemIds } from "./settingsMenuItemIds";
|
|
2
|
+
export declare const settingsMenuItemWeights: { [key in SettingsMenuItemIds] : number };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare enum SubMenuIds {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
QUALITY = "quality-sub",
|
|
3
|
+
QUALITY_DETAIL = "quality-detail-sub",
|
|
4
|
+
DEFAULT_QUALITY_APPLIANCE = "default_quality_applies_to_sub",
|
|
5
|
+
AUDIO_TRACKS = "audio-language-sub",
|
|
6
|
+
PLAYBACK_RATE = "playback-rate-sub",
|
|
7
|
+
SUBTITLES = "subtitles-sub"
|
|
8
8
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { RootMenuId, type SettingsMenuItem } from
|
|
2
|
-
import { type VideoPlaybackRate, type VideoSubtitle } from
|
|
3
|
-
import type { IAudioStream, PlaybackRate, VideoQuality } from
|
|
4
|
-
import type { QualitySettingsAppliesTo } from
|
|
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
5
|
export type Context = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
23
|
};
|
|
24
24
|
/**
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
* Мапа элементов меню, которые показываются на первом уровне.
|
|
26
|
+
*/
|
|
27
27
|
export declare const RootMenuItemMap: Record<RootMenuId, (context: Context) => SettingsMenuItem>;
|
|
28
28
|
type Params = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
items: RootMenuId[];
|
|
30
|
+
context: Context;
|
|
31
|
+
additionalSettingsMenuItems: SettingsMenuItem[];
|
|
32
32
|
};
|
|
33
33
|
export declare const getRootMenuItems: ({ items, context, additionalSettingsMenuItems }: Params) => SettingsMenuItem[];
|
|
34
34
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { type Context, type SubMenuItem } from
|
|
2
|
-
import type { QualitySettingsAppliesTo } from
|
|
1
|
+
import { type Context, type SubMenuItem } from "./types";
|
|
2
|
+
import type { QualitySettingsAppliesTo } from "../../../utils/userSettings";
|
|
3
3
|
export type QualityHandler = (params: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
labelWithQuality: boolean;
|
|
5
|
+
appliesTo: QualitySettingsAppliesTo;
|
|
6
|
+
selected: boolean;
|
|
7
7
|
}, context: Context) => SubMenuItem;
|
|
8
8
|
type DefaultHandler = (context: Context) => SubMenuItem;
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* В данном файле определяем элементы меню, которые могут использоваться в разных подменю.
|
|
11
|
+
*/
|
|
12
12
|
export declare const getMenuItemForAnotherQuality: DefaultHandler;
|
|
13
13
|
export declare const getMenuItemForAutoQuality: QualityHandler;
|
|
14
14
|
export declare const getMenuItemForQualityApplience: DefaultHandler;
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import { SubMenuId, type Context } from
|
|
1
|
+
import { SubMenuId, type Context, type SubMenuData } from "./types";
|
|
2
2
|
type Params = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
subMenuId: SubMenuId | null;
|
|
4
|
+
context: Context;
|
|
5
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
|
-
}[];
|
|
6
|
+
export declare const getSubMenuData: ({ subMenuId, context }: Params) => ReturnType<SubMenuData>[];
|
|
13
7
|
export {};
|
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
import type { UIType, VideoPlaybackRate, VideoQualityForRender, VideoQualityUI, VideoSubtitle } from
|
|
2
|
-
import type { IAudioStream, PlaybackRate, VideoQuality } from
|
|
3
|
-
import type { QualitySettingsAppliesTo } from
|
|
4
|
-
import type { TmpComponentType } from
|
|
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 "../../../types/tmp";
|
|
5
5
|
export declare enum SharedSubMenuItemId {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
QUALITY_OTHER = "quality-other-settings",
|
|
7
|
+
QUALITY_AUTO = "quality-auto",
|
|
8
|
+
QUALITY_APPLIANCE = "quality-appliance-settings",
|
|
9
|
+
QUALITY_HIGH = "quality-high",
|
|
10
|
+
QUALITY_TRAFFIC_SAVING = "quality-traffic-saving"
|
|
11
11
|
}
|
|
12
12
|
export declare enum SubMenuId {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
PLAYBACK_RATE = "playback-rate",
|
|
14
|
+
QUALITY_SETTINGS = "quality-settings",
|
|
15
|
+
QUALITY_OTHER_SETTINGS = "quality-other-settings",
|
|
16
|
+
QUALITY_APPLIANCE = "quality-appliance",
|
|
17
|
+
AUDIO_TRACKS = "audio-tracks",
|
|
18
|
+
SUBTITLES = "subtitles"
|
|
19
19
|
}
|
|
20
20
|
export declare enum RootMenuId {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
QUALITY_SETTINGS = "quality-settings",
|
|
22
|
+
TRAFFIC_SAVING_SWITCH = "traffic-saving-switch",
|
|
23
|
+
AUDIO_TRACKS = "audio-tracks-settings",
|
|
24
|
+
PLAYBACK_RATE = "playback-rate-settings",
|
|
25
|
+
SUBTITLES = "subtitles-settings",
|
|
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
31
|
}
|
|
32
32
|
export type Context = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
63
|
};
|
|
64
64
|
export type SubMenuData = (context: Context) => {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
title: string;
|
|
66
|
+
closeSettingsMenu?: () => void;
|
|
67
|
+
items: SubMenuItem[];
|
|
68
|
+
id: SubMenuId;
|
|
69
|
+
minWidth?: number;
|
|
70
70
|
};
|
|
71
71
|
export type SubMenuItem = SubMenuItemOpenSubMenu | SubMenuItemSelect;
|
|
72
72
|
type BaseSubMenuItem<U = any> = {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
+
dataTestid?: string;
|
|
83
83
|
};
|
|
84
84
|
export type SubMenuItemOpenSubMenu = {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
type: SubMenuItemType.OPEN_SUB_MENU;
|
|
86
|
+
children: SubMenuId;
|
|
87
|
+
id: SharedSubMenuItemId;
|
|
88
88
|
} & BaseSubMenuItem;
|
|
89
89
|
export type SubMenuItemSelect<T = any> = {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
type: SubMenuItemType.SELECT_VALUE;
|
|
91
|
+
value: T;
|
|
92
|
+
dataValue?: T | keyof T;
|
|
93
|
+
selectItem: (value: T) => void;
|
|
94
94
|
} & BaseSubMenuItem;
|
|
95
95
|
interface BaseMenuItem<Id> {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
96
|
+
id: Id;
|
|
97
|
+
weight: number;
|
|
98
|
+
ariaLabel?: string;
|
|
99
|
+
label: string;
|
|
100
100
|
}
|
|
101
101
|
export type IconPropsType = {
|
|
102
|
-
|
|
102
|
+
[key: string]: any;
|
|
103
103
|
};
|
|
104
104
|
interface BaseSettingsMenuItem extends BaseMenuItem<RootMenuId> {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
105
|
+
icon: TmpComponentType;
|
|
106
|
+
iconProps?: IconPropsType;
|
|
107
|
+
isHiddenFor?: UIType[];
|
|
108
108
|
}
|
|
109
109
|
export declare enum MenuItemType {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
OPEN_SUB_MENU = "OPEN_SUB_MENU",
|
|
111
|
+
CLICK = "CLICK",
|
|
112
|
+
SWITCH = "SWITCH"
|
|
113
113
|
}
|
|
114
114
|
export declare enum SubMenuItemType {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
OPEN_SUB_MENU = "OPEN_SUB_MENU",
|
|
116
|
+
SELECT_VALUE = "SELECT_VALUE"
|
|
117
117
|
}
|
|
118
118
|
export interface OpenSubMenuSettingsMenuItem extends BaseSettingsMenuItem {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
type: MenuItemType.OPEN_SUB_MENU;
|
|
120
|
+
value: string;
|
|
121
|
+
valueComponent?: TmpComponentType;
|
|
122
|
+
children: SubMenuId;
|
|
123
123
|
}
|
|
124
124
|
export interface ClickSettingsMenuItem extends BaseSettingsMenuItem {
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
type: MenuItemType.CLICK;
|
|
126
|
+
onClick: () => void;
|
|
127
127
|
}
|
|
128
128
|
export interface SwitchSettingsMenuItem extends BaseSettingsMenuItem {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
129
|
+
type: MenuItemType.SWITCH;
|
|
130
|
+
onClick: (enabled: boolean) => void;
|
|
131
|
+
enabled: boolean;
|
|
132
|
+
tooltipText?: string;
|
|
133
|
+
maxTooltipWidth?: number;
|
|
134
134
|
}
|
|
135
|
-
export type AdditionalSwitchSettingsMenuItem = Omit<SwitchSettingsMenuItem,
|
|
136
|
-
|
|
137
|
-
|
|
135
|
+
export type AdditionalSwitchSettingsMenuItem = Omit<SwitchSettingsMenuItem, "icon" | "onClick"> & {
|
|
136
|
+
icon: string;
|
|
137
|
+
onChangeEnabled: (enabled: boolean) => void;
|
|
138
138
|
};
|
|
139
|
-
export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem,
|
|
140
|
-
|
|
139
|
+
export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem, "icon"> & {
|
|
140
|
+
icon: string;
|
|
141
141
|
};
|
|
142
142
|
export type SettingsMenuItem = OpenSubMenuSettingsMenuItem | ClickSettingsMenuItem | SwitchSettingsMenuItem;
|
|
143
143
|
export type AdditionalSettingsMenuItem = AdditionalSwitchSettingsMenuItem | AdditionalClickSettingsMenuItem;
|
|
144
144
|
export interface ContextMenuItem extends BaseMenuItem<string> {
|
|
145
|
-
|
|
145
|
+
onClick: () => void;
|
|
146
146
|
}
|
|
147
147
|
export type AdditionalContextMenuItem = ContextMenuItem;
|
|
148
148
|
export type MenuRefs = {
|
|
149
|
-
|
|
149
|
+
[key: string]: HTMLUListElement;
|
|
150
150
|
};
|
|
151
151
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type QualitySettingsAppliesTo } from
|
|
2
|
-
export declare const getEnrichWithQualityAppliesTo: (appliesTo: QualitySettingsAppliesTo) => <T>(fn: (value: T, appliesTo: QualitySettingsAppliesTo) => void) => (value: T) => void;
|
|
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
3
|
export declare function isDefined<T>(x: T | undefined): x is T;
|