@vkontakte/videoplayer 1.1.48-dev.fc0d146e.0 → 1.1.49-dev.4a45e527.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 +18 -18
- package/es2015.esm.js +18 -18
- package/es2018.cjs.js +18 -18
- package/es2018.esm.js +18 -18
- package/esnext.cjs.js +18 -18
- package/esnext.esm.js +18 -18
- package/evergreen.esm.js +18 -18
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.d.ts +4 -2
- package/types/components/Menus/constants/openSubMenuItemsIds.d.ts +3 -0
- package/types/components/Menus/constants/subMenuIds.d.ts +7 -0
- package/types/components/Menus/types.d.ts +28 -14
- package/types/components/Menus/utils/menuNavigation.d.ts +7 -2
- package/types/config.d.ts +1 -0
- package/types/store/index.d.ts +19 -5
- package/types/translation/types.d.ts +1 -1
- package/types/types/index.d.ts +11 -1
- package/types/utils/elementHelpers.d.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.49-dev.4a45e527.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"**/*.d.ts"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@vkontakte/videoplayer-core": "2.0.
|
|
53
|
-
"@vkontakte/videoplayer-interactive": "1.0.
|
|
54
|
-
"@vkontakte/videoplayer-shared": "1.0.
|
|
55
|
-
"@vkontakte/videoplayer-statistics": "1.0.
|
|
52
|
+
"@vkontakte/videoplayer-core": "2.0.116-dev.48c29cc5.0",
|
|
53
|
+
"@vkontakte/videoplayer-interactive": "1.0.24-dev.9cf42020.0",
|
|
54
|
+
"@vkontakte/videoplayer-shared": "1.0.48-dev.b486f817.0",
|
|
55
|
+
"@vkontakte/videoplayer-statistics": "1.0.63-dev.1de81b84.0"
|
|
56
56
|
}
|
|
57
57
|
}
|
|
@@ -49,8 +49,8 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
49
49
|
private createOneStat;
|
|
50
50
|
private createPlayer;
|
|
51
51
|
private addPlayerInfoSubscriptions;
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
playNextVideo(): void;
|
|
53
|
+
playPrevVideo(): void;
|
|
54
54
|
private repeatPlaylist;
|
|
55
55
|
private createPlayerWithCurrentVideo;
|
|
56
56
|
private playPrevChapter;
|
|
@@ -97,4 +97,6 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
97
97
|
addAdditionalButton(newButton: AdditionalButton): void;
|
|
98
98
|
removeAdditionalButton(itemId: string): void;
|
|
99
99
|
updateStatContext(statContext: Partial<IStatContext>): void;
|
|
100
|
+
focus(): void;
|
|
101
|
+
handleTimerNextVideo(state: boolean): void;
|
|
100
102
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ComponentType } from 'svelte';
|
|
2
|
-
import type { Writable } from 'svelte/store';
|
|
3
2
|
import { UIType } from '../../types';
|
|
3
|
+
import { SubMenuIds } from './constants/subMenuIds';
|
|
4
4
|
interface BaseMenuItem {
|
|
5
5
|
id: string;
|
|
6
6
|
weight: number;
|
|
@@ -16,23 +16,16 @@ export declare enum MenuItemType {
|
|
|
16
16
|
CLICK = "CLICK",
|
|
17
17
|
SWITCH = "SWITCH"
|
|
18
18
|
}
|
|
19
|
+
export declare enum SubMenuItemType {
|
|
20
|
+
OPEN_SUB_MENU = "OPEN_SUB_MENU",
|
|
21
|
+
SELECT_VALUE = "SELECT_VALUE"
|
|
22
|
+
}
|
|
19
23
|
export interface OpenSubMenuSettingsMenuItem extends BaseSettingsMenuItem {
|
|
20
24
|
type: MenuItemType.OPEN_SUB_MENU;
|
|
25
|
+
subMenuId: SubMenuIds;
|
|
21
26
|
value: string;
|
|
22
27
|
valueComponent?: ComponentType;
|
|
23
28
|
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
29
|
}
|
|
37
30
|
export interface ClickSettingsMenuItem extends BaseSettingsMenuItem {
|
|
38
31
|
type: MenuItemType.CLICK;
|
|
@@ -54,7 +47,8 @@ export type AdditionalClickSettingsMenuItem = Omit<SwitchSettingsMenuItem, 'icon
|
|
|
54
47
|
};
|
|
55
48
|
export type SettingsMenuItem = OpenSubMenuSettingsMenuItem | ClickSettingsMenuItem | SwitchSettingsMenuItem;
|
|
56
49
|
export type AdditionalSettingsMenuItem = AdditionalSwitchSettingsMenuItem | AdditionalClickSettingsMenuItem;
|
|
57
|
-
export interface
|
|
50
|
+
export interface SelectValueSubMenuItem<T = any, U = any> {
|
|
51
|
+
type: SubMenuItemType.SELECT_VALUE;
|
|
58
52
|
value: T;
|
|
59
53
|
dataValue?: T | keyof T;
|
|
60
54
|
valueComponent?: ComponentType;
|
|
@@ -64,6 +58,26 @@ export interface SubMenuItem<T = any, U = any> {
|
|
|
64
58
|
ariaLabel?: string;
|
|
65
59
|
label?: string;
|
|
66
60
|
selected?: boolean;
|
|
61
|
+
selectItem: (value: T) => void;
|
|
62
|
+
}
|
|
63
|
+
export interface OpenSubMenuSubMenuItem {
|
|
64
|
+
type: SubMenuItemType.OPEN_SUB_MENU;
|
|
65
|
+
ariaLabel?: string;
|
|
66
|
+
label: string;
|
|
67
|
+
id: string;
|
|
68
|
+
subMenuId: SubMenuIds;
|
|
69
|
+
getSubItemForFocus: () => HTMLLIElement;
|
|
70
|
+
}
|
|
71
|
+
export type SubMenuItem = SelectValueSubMenuItem | OpenSubMenuSubMenuItem;
|
|
72
|
+
export interface SubMenuList {
|
|
73
|
+
id: SubMenuIds;
|
|
74
|
+
parentItemId: string;
|
|
75
|
+
items: SubMenuItem[];
|
|
76
|
+
returnFromSubMenu?: () => void;
|
|
77
|
+
ariaLabelReturnFromSubMenu?: string;
|
|
78
|
+
title: string;
|
|
79
|
+
closeSettingsMenu: () => void;
|
|
80
|
+
minWidth?: number;
|
|
67
81
|
}
|
|
68
82
|
export interface ContextMenuItem extends BaseMenuItem {
|
|
69
83
|
onClick: () => void;
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
+
import { ProcessedKeysCodes } from '../../../constans';
|
|
1
2
|
import { type Writable } from 'svelte/store';
|
|
2
3
|
import type { Position } from '../../../types';
|
|
4
|
+
export declare const eventStop: (event: Event) => void;
|
|
5
|
+
export declare const isChoseItemCase: (event: KeyboardEvent, extraKeys?: ProcessedKeysCodes[]) => boolean;
|
|
3
6
|
export declare const isKeyboardHandleCase: (event?: MouseEvent) => boolean;
|
|
4
7
|
export declare const handleFocusReturnToBtn: (ref: HTMLButtonElement, menuVisible: boolean, openedByKeyboard$: Writable<boolean>) => Promise<void>;
|
|
5
8
|
export declare const handleFocusReturnToElem: (ref: HTMLButtonElement, menuVisible: boolean, openedByKeyboard$: Writable<boolean>) => Promise<void>;
|
|
6
9
|
export declare const handleFocusOnMenu: (ref: HTMLUListElement, menuVisible: boolean, isOpenedByKeyboard: boolean) => Promise<void>;
|
|
7
|
-
export declare const returnFocusToMenuItem: (
|
|
10
|
+
export declare const returnFocusToMenuItem: (refMenuItems: {
|
|
11
|
+
[key: string]: HTMLLIElement;
|
|
12
|
+
}, id: string) => Promise<void>;
|
|
8
13
|
export declare const handleKeyDownMainMenu: (event: KeyboardEvent, closeCallback: () => void) => void;
|
|
9
14
|
export declare const handleKeyDownOpenSubMenuItem: (event: KeyboardEvent, openSubmenuFn: () => void, getSubItemFn: () => HTMLLIElement) => Promise<void>;
|
|
10
|
-
export declare const handleKeyDownSubMenu: (event: KeyboardEvent,
|
|
15
|
+
export declare const handleKeyDownSubMenu: (event: KeyboardEvent, returnFromSubMenu: () => void, { itemIdReturnCase, id }: {
|
|
11
16
|
itemIdReturnCase: Writable<string | undefined>;
|
|
12
17
|
id: string;
|
|
13
18
|
}, closeSettingsMenuFn: () => void) => Promise<void>;
|
package/types/config.d.ts
CHANGED
package/types/store/index.d.ts
CHANGED
|
@@ -82,8 +82,6 @@ export interface IUIState {
|
|
|
82
82
|
mobileUnmuteButtonExpanded: Writable<boolean>;
|
|
83
83
|
mobileUnmuteButtonVisible: Writable<boolean>;
|
|
84
84
|
icon3DVideoVisible: Writable<boolean>;
|
|
85
|
-
settingsMenuVisible: Writable<boolean>;
|
|
86
|
-
settingsMenuOpenedByKeyboard: Writable<boolean>;
|
|
87
85
|
scrubbingInProgress: Writable<boolean>;
|
|
88
86
|
is3DVideo: Writable<boolean>;
|
|
89
87
|
isPictureInPictureActive$: Readable<boolean>;
|
|
@@ -97,6 +95,17 @@ export interface IUIState {
|
|
|
97
95
|
overlayContainer$: Writable<HTMLDivElement | undefined>;
|
|
98
96
|
startedByKeyboard$: Writable<boolean>;
|
|
99
97
|
autoplayNextEnabled$: Writable<boolean>;
|
|
98
|
+
settingsMenu: {
|
|
99
|
+
visible$: Writable<boolean>;
|
|
100
|
+
ref$: Writable<HTMLElement | undefined>;
|
|
101
|
+
openedByBtnKeyboard$: Writable<boolean>;
|
|
102
|
+
};
|
|
103
|
+
settingsSubMenu: {
|
|
104
|
+
visible$: Writable<boolean>;
|
|
105
|
+
ref$: Writable<HTMLElement | undefined>;
|
|
106
|
+
name$: Writable<string | undefined>;
|
|
107
|
+
};
|
|
108
|
+
timerNextVideoRunning$: Writable<boolean>;
|
|
100
109
|
}
|
|
101
110
|
export interface IWebApi {
|
|
102
111
|
pictureInPictureApi?: IPictureInPictureApi;
|
|
@@ -183,9 +192,10 @@ export interface IStore {
|
|
|
183
192
|
pause: () => void;
|
|
184
193
|
togglePlay: () => void;
|
|
185
194
|
toggleMuted: () => void;
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
195
|
+
openSettingsMenu: (wasOpenedByKey?: boolean, tick?: () => Promise<void>) => void;
|
|
196
|
+
closeSettingsMenu: (fromSubMenu?: boolean) => void;
|
|
197
|
+
openSettingsSubMenu: (name: string, ref: HTMLElement) => void;
|
|
198
|
+
closeSettingsSubMenu: (ref: HTMLElement, isClosing?: boolean) => void;
|
|
189
199
|
setTrafficSavingEnabled: (trafficSavingEnabled: boolean) => void;
|
|
190
200
|
setVolume: (volume: number, preferredVolume?: number) => void;
|
|
191
201
|
setAudioStream: (stream: IAudioStream) => void;
|
|
@@ -240,6 +250,10 @@ export interface IStore {
|
|
|
240
250
|
setLooped: (isLooped: boolean) => void;
|
|
241
251
|
reportProblem: () => void;
|
|
242
252
|
setAutoplayNextEnabled: (autoplayNext: boolean) => void;
|
|
253
|
+
setTimerNextVideoRunning: (timerNextVideoRunning: boolean) => void;
|
|
254
|
+
nextVideoAnnouncementClick: () => void;
|
|
255
|
+
nextVideoAnnouncementAuto: () => void;
|
|
256
|
+
nextVideoAnnouncementCancel: () => void;
|
|
243
257
|
};
|
|
244
258
|
external: {
|
|
245
259
|
firstStart: (showAds: boolean) => void;
|
|
@@ -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' | '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';
|
|
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' | 'end_screen_next_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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VideoQuality, VideoFormat, ISources, IExternalTextTrack } from '@vkontakte/videoplayer-core';
|
|
2
|
-
import type { IValueObservable, InterfaceLanguage, Subscription } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { IValueObservable, InterfaceLanguage, Subscription, IRectangle } from '@vkontakte/videoplayer-shared';
|
|
3
3
|
import type { Manifest, VideoInfo, Interactives, InteractiveProjectInfo } from '@vkontakte/videoplayer-interactive';
|
|
4
4
|
import { PlaybackState } from '@vkontakte/videoplayer-core';
|
|
5
5
|
import type { Writable, Readable } from 'svelte/store';
|
|
@@ -63,6 +63,9 @@ export interface IVKVideoPlayerCallbacks {
|
|
|
63
63
|
onExternalFullscreenExit?: () => void;
|
|
64
64
|
onPrevVideoClick?: () => boolean;
|
|
65
65
|
onNextVideoClick?: () => boolean;
|
|
66
|
+
onNextVideoAnnouncementClick?: () => void;
|
|
67
|
+
onNextVideoAnnouncementAuto?: () => void;
|
|
68
|
+
onNextVideoAnnouncementCancel?: () => void;
|
|
66
69
|
onTrafficSavingEnabledChanged?: (isEnabled: boolean) => void;
|
|
67
70
|
onCurrentPlaybackRateChanged?: (rate: number) => void;
|
|
68
71
|
onStalledChanged?: (isStalled: boolean) => void;
|
|
@@ -97,6 +100,12 @@ export interface IVKVideoPlayerCallbacks {
|
|
|
97
100
|
height: number;
|
|
98
101
|
}) => void;
|
|
99
102
|
onReportProblem?: () => void;
|
|
103
|
+
onSettingsMenu?: (value: {
|
|
104
|
+
name?: string;
|
|
105
|
+
visible: boolean;
|
|
106
|
+
size: IRectangle;
|
|
107
|
+
position: Position;
|
|
108
|
+
}) => void;
|
|
100
109
|
};
|
|
101
110
|
adsInfo?: {
|
|
102
111
|
onLoadStarted?: () => void;
|
|
@@ -200,6 +209,7 @@ export interface AdditionalButtonDeprecated {
|
|
|
200
209
|
}
|
|
201
210
|
export interface IVKVideoPlayerConfig {
|
|
202
211
|
videos: IVideoData[];
|
|
212
|
+
videoIndex?: number;
|
|
203
213
|
interactiveData?: IInteractiveData;
|
|
204
214
|
albumId?: string;
|
|
205
215
|
statPlace?: 'embed' | 'direct' | string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IRectangle } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import type { Position } from '../types';
|
|
3
|
+
export declare const calcPosition: (childElement?: HTMLElement, parentElement?: HTMLElement) => Required<Position>;
|
|
4
|
+
export declare const getSize: (element?: HTMLElement) => IRectangle;
|