@vkontakte/videoplayer 1.1.53 → 1.1.54-dev.06ca9c38.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 +25 -18
- package/es2015.esm.js +25 -18
- package/es2018.cjs.js +25 -18
- package/es2018.esm.js +25 -18
- package/esnext.cjs.js +24 -17
- package/esnext.esm.js +24 -17
- package/evergreen.esm.js +24 -17
- package/package.json +5 -5
- package/types/VKVideoPlayer/index.d.ts +2 -0
- package/types/config.d.ts +1 -0
- package/types/store/index.d.ts +12 -3
- package/types/translation/types.d.ts +1 -1
- package/types/utils/hooks/useIosSafariFullscreen.d.ts +6 -0
- package/types/utils/hooks/useIosSafariFullscreenSubtitles.d.ts +7 -0
- package/types/utils/notificationShowManager.d.ts +9 -0
- package/types/utils/subtitles.d.ts +10 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.54-dev.06ca9c38.0",
|
|
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": "
|
|
54
|
-
"@vkontakte/videoplayer-interactive": "
|
|
55
|
-
"@vkontakte/videoplayer-shared": "
|
|
56
|
-
"@vkontakte/videoplayer-statistics": "
|
|
53
|
+
"@vkontakte/videoplayer-core": "2.0.123-dev.f75ea2c9.0",
|
|
54
|
+
"@vkontakte/videoplayer-interactive": "1.0.29-dev.cad91cc7.0",
|
|
55
|
+
"@vkontakte/videoplayer-shared": "1.0.52-dev.19177dc3.0",
|
|
56
|
+
"@vkontakte/videoplayer-statistics": "1.0.69-dev.75124e85.0"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -34,11 +34,13 @@ export declare class VKVideoPlayer extends HTMLElement {
|
|
|
34
34
|
private readonly logger;
|
|
35
35
|
private readonly log;
|
|
36
36
|
private readonly subscription;
|
|
37
|
+
private readonly interactiveSubscription;
|
|
37
38
|
annotationsApi: AnnotationsApi | undefined;
|
|
38
39
|
private createPlayerTimeout;
|
|
39
40
|
private prevIsid;
|
|
40
41
|
private isInited;
|
|
41
42
|
private internalsExposure;
|
|
43
|
+
private notificationManager;
|
|
42
44
|
constructor();
|
|
43
45
|
private connectedCallback;
|
|
44
46
|
private disconnectedCallback;
|
package/types/config.d.ts
CHANGED
package/types/store/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAudioStream, IConfig, IExternalTextTrack, IOptionalTuningConfig, IPlayer, ISources, IVideoStream, PlaybackRate } from '@vkontakte/videoplayer-core';
|
|
1
|
+
import type { IAudioStream, IConfig, IExternalTextTrack, IOptionalTuningConfig, IPlayer, ISources, ITextTrack, IVideoStream, PlaybackRate } from '@vkontakte/videoplayer-core';
|
|
2
2
|
import { ChromecastState, PlaybackState, VideoFormat } from '@vkontakte/videoplayer-core';
|
|
3
3
|
import { type IError, type ILogger, InterfaceLanguage, type IRectangle, type IValueObservable, type QualityLimits, VideoQuality, type InternalsExposure } from '@vkontakte/videoplayer-shared';
|
|
4
4
|
import type { IUIConfig } from '../config';
|
|
@@ -14,6 +14,7 @@ import { GridTypes, type PlayPrevChapterDisabledTooltipKey } from '../constans';
|
|
|
14
14
|
import { UIOneStat } from '../services/statistics';
|
|
15
15
|
import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem, ContextMenuItem, SettingsMenuItem } from '../components/Menus/types';
|
|
16
16
|
import type { AdditionalButton, AdditionalDesktopControlPanelButton } from '../components/Controls/types';
|
|
17
|
+
import type { getNotificationManager } from '../utils/notificationShowManager';
|
|
17
18
|
export interface IAdsState {
|
|
18
19
|
position: Writable<number>;
|
|
19
20
|
duration: Writable<number>;
|
|
@@ -22,6 +23,7 @@ export interface IAdsState {
|
|
|
22
23
|
secondsToWatchBeforeSkip: Writable<number>;
|
|
23
24
|
postrollPassed: Writable<boolean>;
|
|
24
25
|
}
|
|
26
|
+
export type NotificationId = 'slow_video';
|
|
25
27
|
export interface IUIState {
|
|
26
28
|
controlsVisible: Writable<boolean>;
|
|
27
29
|
touched: Writable<boolean>;
|
|
@@ -106,6 +108,9 @@ export interface IUIState {
|
|
|
106
108
|
ref$: Writable<HTMLElement | undefined>;
|
|
107
109
|
name$: Writable<string | undefined>;
|
|
108
110
|
};
|
|
111
|
+
notifications: {
|
|
112
|
+
notificationsToShow: Writable<Partial<Record<NotificationId, boolean>>>;
|
|
113
|
+
};
|
|
109
114
|
}
|
|
110
115
|
export interface IWebApi {
|
|
111
116
|
pictureInPictureApi?: IPictureInPictureApi;
|
|
@@ -150,6 +155,7 @@ export interface IStore {
|
|
|
150
155
|
currentPlaybackRate$: Readable<number>;
|
|
151
156
|
availablePlaybackRates$: Readable<VideoPlaybackRate[]>;
|
|
152
157
|
currentSubtitle$: Writable<Omit<VideoSubtitle, 'selected'>>;
|
|
158
|
+
availableTextTracks$: Readable<ITextTrack[]>;
|
|
153
159
|
availableSubtitlesList$: Readable<VideoSubtitle[]>;
|
|
154
160
|
currentSubtitleCaptions$: Readable<VideoSubtitleParsed['texts']>;
|
|
155
161
|
isAutoSubtitleCaptionVisible$: Writable<boolean>;
|
|
@@ -192,6 +198,8 @@ export interface IStore {
|
|
|
192
198
|
pause: () => void;
|
|
193
199
|
togglePlay: () => void;
|
|
194
200
|
toggleMuted: () => void;
|
|
201
|
+
showNotification: (id: NotificationId) => void;
|
|
202
|
+
closeNotification: (id: NotificationId) => void;
|
|
195
203
|
openSettingsMenu: (wasOpenedByKey?: boolean, tick?: () => Promise<void>) => void;
|
|
196
204
|
closeSettingsMenu: (fromSubMenu?: boolean) => void;
|
|
197
205
|
openSettingsSubMenu: (name: string, ref: HTMLElement) => void;
|
|
@@ -204,7 +212,7 @@ export interface IStore {
|
|
|
204
212
|
setPlaybackRate: (playbackRate: PlaybackRate) => void;
|
|
205
213
|
incrementPlaybackRate: () => void;
|
|
206
214
|
decrementPlaybackRate: () => void;
|
|
207
|
-
setSubtitle: (subtitle
|
|
215
|
+
setSubtitle: (subtitle?: VideoSubtitle) => void;
|
|
208
216
|
toggleSubtitle: () => void;
|
|
209
217
|
togglePictureInPicture: () => void;
|
|
210
218
|
startScrubbing: (progress: number) => void;
|
|
@@ -320,10 +328,11 @@ interface IStoreParams {
|
|
|
320
328
|
statistics?: UIOneStat;
|
|
321
329
|
saveRate: boolean;
|
|
322
330
|
internalsExposure: InternalsExposure | null;
|
|
331
|
+
notificationManager: ReturnType<typeof getNotificationManager>;
|
|
323
332
|
}
|
|
324
333
|
/**
|
|
325
334
|
* Store приложения.
|
|
326
335
|
* Если будет слишком большим - можно разделить его на модули
|
|
327
336
|
*/
|
|
328
|
-
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, stopPlayer, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalSettingsMenuItems, additionalContextMenuItems, playPrevVideo, playNextVideo, looped, statistics: uiStatistics, saveRate, internalsExposure, }: IStoreParams) => IStore;
|
|
337
|
+
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, stopPlayer, hasInteractiveBranches, playPrevChapterDisabledTooltip, additionalButtons, additionalSettingsMenuItems, additionalContextMenuItems, playPrevVideo, playNextVideo, looped, statistics: uiStatistics, saveRate, internalsExposure, notificationManager, }: IStoreParams) => IStore;
|
|
329
338
|
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' | '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' | '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' | 'end_screen_recommended_video' | 'slow_video_notification_button' | 'slow_video_notification_force_description' | 'slow_video_notification_suggest_description';
|
|
3
3
|
export type LanguagePack = Record<Key, string>;
|
|
4
4
|
export type LanguageConfig = {
|
|
5
5
|
language: string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type Settings = {
|
|
2
|
+
timeout: number;
|
|
3
|
+
maxShowCount: number;
|
|
4
|
+
};
|
|
5
|
+
export declare const getNotificationManager: ({ maxShowCount, timeout }: Settings) => {
|
|
6
|
+
notificationShowed: (notificationId: string) => void;
|
|
7
|
+
canShowNotification: (notificationId: string) => boolean;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ITextTrack } from '@vkontakte/videoplayer-core';
|
|
2
|
+
export declare class NativeSubtitles {
|
|
3
|
+
private readonly video;
|
|
4
|
+
constructor(video: HTMLVideoElement);
|
|
5
|
+
private getTracksArray;
|
|
6
|
+
attach(track: ITextTrack, showing?: boolean): void;
|
|
7
|
+
detachAll(): void;
|
|
8
|
+
updateSrc(track: ITextTrack): void;
|
|
9
|
+
getCurrentShowingId(): string | null;
|
|
10
|
+
}
|