@vkontakte/videoplayer 1.1.37-dev.aaebf6d2.0 → 1.1.38-dev.02602b16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es2015.cjs.js +17 -17
- package/es2015.esm.js +17 -17
- package/es2018.cjs.js +17 -17
- package/es2018.esm.js +17 -17
- package/esnext.cjs.js +17 -17
- package/esnext.esm.js +17 -17
- package/evergreen.esm.js +17 -17
- package/package.json +10 -10
- package/types/VKVideoPlayer/index.d.ts +85 -0
- package/types/components/Ads/admanWrapper.d.ts +82 -0
- package/types/components/Ads/utils.d.ts +1 -0
- package/types/config.d.ts +117 -0
- package/types/constans/controls.d.ts +27 -0
- package/types/constans/debounce-timers.d.ts +1 -0
- package/types/constans/grid.d.ts +14 -0
- package/types/constans/index.d.ts +8 -0
- package/types/constans/interactives.d.ts +7 -0
- package/types/constans/keyboard.d.ts +51 -0
- package/types/constans/lang.d.ts +2 -0
- package/types/constans/storage-keys.d.ts +1 -0
- package/types/constans/throttle-timers.d.ts +1 -0
- package/types/env.d.ts +2 -0
- package/types/index.d.ts +12 -0
- package/types/services/sentry.d.ts +28 -0
- package/types/services/statistics.d.ts +13 -0
- package/types/store/index.d.ts +276 -0
- package/types/store/micro/base.d.ts +8 -0
- package/types/store/micro/fakeIsPlaying.d.ts +13 -0
- package/types/store/micro/index.d.ts +2 -0
- package/types/store/micro/interactiveControlsOpacity.d.ts +13 -0
- package/types/store/micro/seekToInteractiveDisabledTooltip.d.ts +9 -0
- package/types/store/micro/showInteractiveTimeIndicatorTooltip.d.ts +15 -0
- package/types/store/utils.d.ts +30 -0
- package/types/translation/index.d.ts +6 -0
- package/types/translation/packs/en.d.ts +3 -0
- package/types/translation/packs/ru.d.ts +3 -0
- package/types/translation/types.d.ts +8 -0
- package/types/types/index.d.ts +461 -0
- package/types/utils/WebVttParser.d.ts +19 -0
- package/types/utils/changeVolume.d.ts +6 -0
- package/types/utils/clipboard.d.ts +1 -0
- package/types/utils/dom.d.ts +2 -0
- package/types/utils/fetchFile.d.ts +1 -0
- package/types/utils/findCurrentSubtltlePhrase.d.ts +2 -0
- package/types/utils/formatSeconds.d.ts +1 -0
- package/types/utils/fullscreen.d.ts +24 -0
- package/types/utils/getActualEpisode.d.ts +10 -0
- package/types/utils/getHotKeyMapData.d.ts +2 -0
- package/types/utils/getQualityLabel.d.ts +2 -0
- package/types/utils/grid.d.ts +6 -0
- package/types/utils/isIphoneOrOldIpad.d.ts +2 -0
- package/types/utils/keyboardHandleCases.d.ts +2 -0
- package/types/utils/menuNavigation.d.ts +13 -0
- package/types/utils/roundFps.d.ts +1 -0
- package/types/utils/sanitizeHtml.d.ts +5 -0
- package/types/utils/stack/index.d.ts +9 -0
- package/types/utils/stack/node.d.ts +5 -0
- package/types/utils/subtitleLanguages.d.ts +1 -0
- package/types/utils/updatePlayerControlsInfo.d.ts +3 -0
- package/types/utils/userSettings.d.ts +10 -0
- package/types/utils/videoConfig.d.ts +2 -0
- package/types/utils/volumeChange.d.ts +5 -0
- package/types/utils/webAPI/annotationsApi/annotationsApi.d.ts +29 -0
- package/types/utils/webAPI/annotationsApi/errors.d.ts +7 -0
- package/types/utils/webAPI/language.d.ts +2 -0
- package/types/utils/webAPI/mediaSessionApi.d.ts +8 -0
- package/types/utils/webAPI/pictureInPictureApi/documentPictureInPictureApi.d.ts +23 -0
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApi.d.ts +38 -0
- package/types/utils/webAPI/pictureInPictureApi/pictureInPictureApiFactory.d.ts +4 -0
- package/index.d.ts +0 -477
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { IAnnotationsApi } from '../../../types';
|
|
2
|
+
export declare class AnnotationsApi implements IAnnotationsApi {
|
|
3
|
+
private rootAnnotationsContainer;
|
|
4
|
+
private annotations;
|
|
5
|
+
private subscriptions;
|
|
6
|
+
private mutationObserver;
|
|
7
|
+
private playerSize;
|
|
8
|
+
constructor(container: HTMLElement);
|
|
9
|
+
add(annotationName: string, annotation: HTMLElement): void | never;
|
|
10
|
+
get(annotationName: string): HTMLElement | never;
|
|
11
|
+
remove(annotationName: string): void | never;
|
|
12
|
+
clear(): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
private isElementExceedsBoundaries;
|
|
15
|
+
/** @deprecated Больше не используется. Контейнер теперь определяется самостоятельно */
|
|
16
|
+
registryRootContainer(container: HTMLElement): void;
|
|
17
|
+
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
18
|
+
addLayer(layerName: string): HTMLElement | never;
|
|
19
|
+
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
20
|
+
getLayer(layerName: string): HTMLElement | undefined;
|
|
21
|
+
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
22
|
+
removeLayer(layerName: string): void;
|
|
23
|
+
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
24
|
+
clearLayer(layerName: string): void;
|
|
25
|
+
/** @deprecated Метод больше не является публичным */
|
|
26
|
+
detach(): void;
|
|
27
|
+
/** @deprecated Больше нет необходимости переназначать контейнер для аннотаций в ходе работы плеера */
|
|
28
|
+
reattach(): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const ANNOTATION_EMPTY_ROOT_CONTAINER_ERROR = "Inner error. Unexpectedly root annotation container null reference exception";
|
|
2
|
+
export declare const ANNOTATION_ALREADY_EXIST_ERROR = "Annotation with such name already exists";
|
|
3
|
+
export declare const ANNOTATION_DOESNT_EXIST_ERROR = "Annotation with such name does not exist";
|
|
4
|
+
export declare const ANNOTATION_EXCEED_PLAYER_LIMITS_ERROR = "Annotation exceed player boundaries";
|
|
5
|
+
export declare class AnnotationsError extends Error {
|
|
6
|
+
constructor(message: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MediaSessionApiActionHandler, MediaSessionApiMetadata } from '../../types';
|
|
2
|
+
export declare class MediaSessionApi {
|
|
3
|
+
isSupported(): boolean;
|
|
4
|
+
setMetaData({ title, artist, thumbUrl }: MediaSessionApiMetadata): void;
|
|
5
|
+
updateActionHandlers(actionHandlers: MediaSessionApiActionHandler[]): void;
|
|
6
|
+
private resetActionHandlers;
|
|
7
|
+
private setActionHandlers;
|
|
8
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IPictureInPictureApi } from '../../../types';
|
|
2
|
+
import { ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import { PictureInPictureType } from '../../../types';
|
|
4
|
+
export declare class DocumentPictureInPictureApi implements IPictureInPictureApi {
|
|
5
|
+
private playerDomElement;
|
|
6
|
+
private playerParentShadowRoot;
|
|
7
|
+
private playerDummyElement;
|
|
8
|
+
private svelteContext;
|
|
9
|
+
private pipWindow;
|
|
10
|
+
info: {
|
|
11
|
+
isActive$: ValueSubject<boolean>;
|
|
12
|
+
type: PictureInPictureType;
|
|
13
|
+
};
|
|
14
|
+
isSupported(): boolean;
|
|
15
|
+
isActive(): boolean;
|
|
16
|
+
setPlayerDomElement(playerDomElement: HTMLElement, playerParentShadowRoot: ShadowRoot): void;
|
|
17
|
+
setContext(svelteContext: Map<unknown, unknown>): void;
|
|
18
|
+
request(): Promise<void>;
|
|
19
|
+
remove(): Promise<void>;
|
|
20
|
+
dispose(): Promise<void>;
|
|
21
|
+
private createStretchedContainer;
|
|
22
|
+
}
|
|
23
|
+
export declare function isInstanceOfDocumentPictureInPictureApi(pictureInPictureApi?: IPictureInPictureApi): pictureInPictureApi is DocumentPictureInPictureApi;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { IPictureInPictureApi } from '../../../types';
|
|
2
|
+
import { PictureInPictureType } from '../../../types';
|
|
3
|
+
import { ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
4
|
+
declare const PICTURE_IN_PICTURE_EVENTS: readonly ["enterpictureinpicture", "leavepictureinpicture", "resize"];
|
|
5
|
+
type PictureInPictureEvents = typeof PICTURE_IN_PICTURE_EVENTS[number];
|
|
6
|
+
type PictureInPictureEventHandlers = {
|
|
7
|
+
[key in PictureInPictureEvents]: (event: Event) => void;
|
|
8
|
+
};
|
|
9
|
+
export declare class PictureInPictureApi implements IPictureInPictureApi {
|
|
10
|
+
private isRequested;
|
|
11
|
+
private videoElement;
|
|
12
|
+
private playerContainer;
|
|
13
|
+
private playerDummyElement;
|
|
14
|
+
private svelteContext;
|
|
15
|
+
private externalEventHandlers;
|
|
16
|
+
private readonly eventHandlers;
|
|
17
|
+
info: {
|
|
18
|
+
isActive$: ValueSubject<boolean>;
|
|
19
|
+
type: PictureInPictureType;
|
|
20
|
+
};
|
|
21
|
+
isSupported(): boolean;
|
|
22
|
+
isActive(): boolean;
|
|
23
|
+
setContext(svelteContext: Map<unknown, unknown>): void;
|
|
24
|
+
revealPictureInPicture(): Promise<void>;
|
|
25
|
+
request(): Promise<void>;
|
|
26
|
+
remove(): Promise<void>;
|
|
27
|
+
assignPlayerContainer(playerContainer: HTMLElement): void;
|
|
28
|
+
updateVideoElement(): void;
|
|
29
|
+
registryEventHandlers(): void;
|
|
30
|
+
registryExternalEventHandlers(externalEventHandlers: Partial<PictureInPictureEventHandlers>): void;
|
|
31
|
+
unregistryEventHandlers(): void;
|
|
32
|
+
dispose(): Promise<void>;
|
|
33
|
+
private onEnterPictureInPicture;
|
|
34
|
+
private onLeavePictureInPicture;
|
|
35
|
+
private onResize;
|
|
36
|
+
}
|
|
37
|
+
export declare function isInstanceOfPictureInPictureApi(pictureInPictureApi?: IPictureInPictureApi): pictureInPictureApi is PictureInPictureApi;
|
|
38
|
+
export {};
|
package/index.d.ts
DELETED
|
@@ -1,477 +0,0 @@
|
|
|
1
|
-
import { RecursivePartial, InterfaceLanguage, Milliseconds, ExactVideoQuality, ErrorCategory, QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
export { InterfaceLanguage, Milliseconds, QualityLimits, VKNumericLanguage, loadVKLangPack } from '@vkontakte/videoplayer-shared';
|
|
3
|
-
import { IOptionalTuningConfig, VideoFormat, PlaybackState, VideoQuality, ISources, IExternalTextTrack, PlaybackRate } from '@vkontakte/videoplayer-core';
|
|
4
|
-
export { IDashSource, ISources, RawSource, URLSource, URLSourceWithSeek, VideoFormat, VideoQuality } from '@vkontakte/videoplayer-core';
|
|
5
|
-
import { IOptionalConfig } from '@vkontakte/videoplayer-statistics';
|
|
6
|
-
import { Manifest, VideoInfo } from '@vkontakte/videoplayer-interactive';
|
|
7
|
-
|
|
8
|
-
type ForceOrRelay = boolean | undefined;
|
|
9
|
-
declare enum LogoType {
|
|
10
|
-
VK = "vk",
|
|
11
|
-
VK_VIDEO = "vk_video",
|
|
12
|
-
VK_VIDEO_MOBILE = "vk_video_mobile"
|
|
13
|
-
}
|
|
14
|
-
interface IUIConfig {
|
|
15
|
-
isMobile: ForceOrRelay;
|
|
16
|
-
isSmoothVideoRotate: boolean;
|
|
17
|
-
showSupport: boolean;
|
|
18
|
-
supportLink: string;
|
|
19
|
-
showLogo: ForceOrRelay;
|
|
20
|
-
logoLink: string;
|
|
21
|
-
logoType: LogoType;
|
|
22
|
-
defaultLanguage: InterfaceLanguage;
|
|
23
|
-
downloadVKLanguages: boolean;
|
|
24
|
-
updateBuiltinLanguages: boolean;
|
|
25
|
-
ads: {
|
|
26
|
-
enable: ForceOrRelay;
|
|
27
|
-
loadTimeout: Milliseconds;
|
|
28
|
-
initTimeout: Milliseconds;
|
|
29
|
-
slot?: number;
|
|
30
|
-
preview?: number;
|
|
31
|
-
};
|
|
32
|
-
volumeDefault: number;
|
|
33
|
-
volumeMinRestore: number;
|
|
34
|
-
loaderDelay: Milliseconds;
|
|
35
|
-
allowChangingFullscreenTarget: boolean;
|
|
36
|
-
minSubtitlesFontSize: number;
|
|
37
|
-
autoSubtitlesTimeout: Milliseconds;
|
|
38
|
-
trafficSavingLimit: ExactVideoQuality;
|
|
39
|
-
episodeMinWidthPc: number;
|
|
40
|
-
controls: {
|
|
41
|
-
hideTimeout: Milliseconds;
|
|
42
|
-
hideTimeoutMobile: Milliseconds;
|
|
43
|
-
hideTimeoutInitial: Milliseconds;
|
|
44
|
-
hideTimeoutFullscreen: Milliseconds;
|
|
45
|
-
hideTimeoutCursor: Milliseconds;
|
|
46
|
-
hideTimeoutTooltips: Milliseconds;
|
|
47
|
-
collapseMobileUnmute: Milliseconds;
|
|
48
|
-
hide360IconTimeout: Milliseconds;
|
|
49
|
-
volumeBarTimeout: Milliseconds;
|
|
50
|
-
hideHotKeyHelpers: Milliseconds;
|
|
51
|
-
playbackRateMin: number;
|
|
52
|
-
playbackRateMax: number;
|
|
53
|
-
playbackRateStep: number;
|
|
54
|
-
seekStepKeyboard: Milliseconds;
|
|
55
|
-
seekStepMobile: Milliseconds;
|
|
56
|
-
seekStepFrame: Milliseconds;
|
|
57
|
-
volumeStepKeyboard: number;
|
|
58
|
-
volumeStepWheel: number;
|
|
59
|
-
};
|
|
60
|
-
hideThumbTimerAfterTouch: boolean;
|
|
61
|
-
sentry: {
|
|
62
|
-
dsn: string;
|
|
63
|
-
sampleRate: number;
|
|
64
|
-
whiteErrorCategoryList: ErrorCategory[];
|
|
65
|
-
blackErrorCategoryList: ErrorCategory[];
|
|
66
|
-
whiteErrorIdList: string[];
|
|
67
|
-
blackErrorIdList: string[];
|
|
68
|
-
};
|
|
69
|
-
features: {
|
|
70
|
-
autoplay: boolean;
|
|
71
|
-
statistics: boolean;
|
|
72
|
-
sentry: boolean;
|
|
73
|
-
preload: boolean;
|
|
74
|
-
subtitles: boolean;
|
|
75
|
-
timelinePreview: boolean;
|
|
76
|
-
episodes: boolean;
|
|
77
|
-
fullscreen: boolean;
|
|
78
|
-
mediaSession: boolean;
|
|
79
|
-
annotations: boolean;
|
|
80
|
-
download: boolean;
|
|
81
|
-
pip: boolean;
|
|
82
|
-
dpip: boolean;
|
|
83
|
-
liveRewind: boolean;
|
|
84
|
-
playbackRate: boolean;
|
|
85
|
-
trafficSaving: boolean;
|
|
86
|
-
episodesClustering: boolean;
|
|
87
|
-
copyVideoLink: boolean;
|
|
88
|
-
videoRotate: boolean;
|
|
89
|
-
interactiveGraph: boolean;
|
|
90
|
-
seekToInteractive: boolean;
|
|
91
|
-
interactiveLastFrame: boolean;
|
|
92
|
-
interactiveTextPermanent: boolean;
|
|
93
|
-
interactiveHideTime: boolean;
|
|
94
|
-
interactivePlayPrevChapter: boolean;
|
|
95
|
-
interactiveTimeIndicator: boolean;
|
|
96
|
-
thumbTimer: boolean;
|
|
97
|
-
hotKeyMapModal: boolean;
|
|
98
|
-
hotKeyHelpers: boolean;
|
|
99
|
-
saveDebugInfoToFile: boolean;
|
|
100
|
-
additionalButtons: boolean;
|
|
101
|
-
contextMenuButton: boolean;
|
|
102
|
-
};
|
|
103
|
-
interactive: {
|
|
104
|
-
historyMaxLength: number;
|
|
105
|
-
noInteractionEventTimeout: number;
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
interface ISDKConfig {
|
|
109
|
-
ui: RecursivePartial<IUIConfig>;
|
|
110
|
-
core: IOptionalTuningConfig;
|
|
111
|
-
statistics: IOptionalConfig;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
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' | 'pip_dummy_title' | 'submenu_traffic_saving' | 'submenu_quality' | 'submenu_playback_rate' | 'submenu_settings' | '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_record_title' | 'aria_label_menu_traffic_saving' | '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';
|
|
115
|
-
type LanguagePack = Record<Key, string>;
|
|
116
|
-
type LanguageConfig = {
|
|
117
|
-
language: string;
|
|
118
|
-
fallback: InterfaceLanguage;
|
|
119
|
-
pack: LanguagePack;
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
declare enum GridTypes {
|
|
123
|
-
XS = "xs",
|
|
124
|
-
S = "s",
|
|
125
|
-
M = "m",
|
|
126
|
-
L = "l",
|
|
127
|
-
XL = "xl"
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
interface IVKVideoPlayerCallbacks {
|
|
131
|
-
onInited?: () => void;
|
|
132
|
-
onStarted?: () => void;
|
|
133
|
-
onEnded?: () => void;
|
|
134
|
-
onPlay?: () => void;
|
|
135
|
-
onPause?: () => void;
|
|
136
|
-
onVolumeChange?: (volume: number) => void;
|
|
137
|
-
onFullscreenEnter?: () => void;
|
|
138
|
-
onFullscreenExit?: () => void;
|
|
139
|
-
onMute?: () => void;
|
|
140
|
-
onUnmute?: () => void;
|
|
141
|
-
onAudioDisabledHint?: () => void;
|
|
142
|
-
onAudioDoesNotExistHint?: () => void;
|
|
143
|
-
onEpisodeClicked?: (byKeyboard: boolean) => void;
|
|
144
|
-
onEpisodeChanged?: (episode: IVideoEpisode) => void;
|
|
145
|
-
onTimeupdate?: (duration: number, position: number) => void;
|
|
146
|
-
onSeek?: (from: number, to: number) => void;
|
|
147
|
-
onCrashed?: () => void;
|
|
148
|
-
onCurrentFormatChanged?: (currentFormat: VideoFormat | undefined) => void;
|
|
149
|
-
onThroughputEstimationChanged?: (throughputEstimation: number | undefined) => void;
|
|
150
|
-
onVideoBitrateChanged?: (videoBitrate: number | undefined) => void;
|
|
151
|
-
onPlayerPhaseChanged?: (value?: PlayerPhase) => void;
|
|
152
|
-
onPlaybackStateChanged?: (value?: PlaybackState) => void;
|
|
153
|
-
onIsLiveChanged?: (value?: boolean) => void;
|
|
154
|
-
onIsActiveLiveChanged?: (value?: boolean) => void;
|
|
155
|
-
onIsAudioAvailableChanged?: (value?: boolean) => void;
|
|
156
|
-
onCopyVideoLink?: (withTimestamp: boolean, currentTimestamp: number) => string;
|
|
157
|
-
onOpenHotKeyMap?: (mapData: HotKeyMapData) => void;
|
|
158
|
-
onCurrentQualityChanged?: (currentQuality: VideoQuality | undefined) => void;
|
|
159
|
-
onAvailableQualitiesChanged?: (availableQualities: VideoQuality[]) => void;
|
|
160
|
-
onPiPEnter?: () => void;
|
|
161
|
-
onPiPExit?: () => void;
|
|
162
|
-
onLiveTime?: (liveTime: number | undefined) => void;
|
|
163
|
-
onReplayInteractiveVideo?: () => void;
|
|
164
|
-
onInteractiveHistoryChanged?: (chapterIds: string[]) => void;
|
|
165
|
-
onDisabledInteractiveClick?: () => void;
|
|
166
|
-
onDisabledPlayPrevChapterClick?: (message: string | undefined) => void;
|
|
167
|
-
onDisabledSeekToInteractiveClick?: (message: string | undefined) => void;
|
|
168
|
-
onInteractiveTimeIndicatorClick?: () => void;
|
|
169
|
-
onInteractiveTimeIndicatorHintDeactivated?: () => void;
|
|
170
|
-
onPrevVideoClick?: () => boolean;
|
|
171
|
-
onNextVideoClick?: () => boolean;
|
|
172
|
-
onTrafficSavingEnabledChanged?: (isEnabled: boolean) => void;
|
|
173
|
-
onCurrentPlaybackRateChanged?: (rate: number) => void;
|
|
174
|
-
onStalledChanged?: (isStalled: boolean) => void;
|
|
175
|
-
onLogoClicked?: () => void;
|
|
176
|
-
uiInfo?: {
|
|
177
|
-
onControlsVisibleChanged?: (value?: boolean) => void;
|
|
178
|
-
onIsMobileChanged?: (value?: boolean) => void;
|
|
179
|
-
onPrevButtonChanged?: (value?: IControlInfo) => void;
|
|
180
|
-
onPlayButtonChanged?: (value?: IControlInfo) => void;
|
|
181
|
-
onReplayButtonChanged?: (value?: IControlInfo) => void;
|
|
182
|
-
onNextButtonChanged?: (value?: IControlInfo) => void;
|
|
183
|
-
onPlayPrevChapterChanged?: (value?: IControlInfo) => void;
|
|
184
|
-
onSeekToInteractiveButtonChanged?: (value?: IControlInfo) => void;
|
|
185
|
-
onGraphButtonChanged?: (value?: IControlInfo) => void;
|
|
186
|
-
onLiveButtonChanged?: (value?: IControlInfo) => void;
|
|
187
|
-
onTimeUpdateChanged?: (value?: IControlInfo) => void;
|
|
188
|
-
onEpisodesChanged?: (value?: IControlInfo) => void;
|
|
189
|
-
onVolumeChanged?: (value?: IControlInfo) => void;
|
|
190
|
-
onSubtitlesChanged?: (value?: IControlInfo) => void;
|
|
191
|
-
onSettingsChanged?: (value?: IControlInfo) => void;
|
|
192
|
-
onFullscreenChanged?: (value?: IControlInfo) => void;
|
|
193
|
-
onChromecastChanged?: (value?: IControlInfo) => void;
|
|
194
|
-
onPipChanged?: (value?: IControlInfo) => void;
|
|
195
|
-
onVkLogoChanged?: (value?: IControlInfo) => void;
|
|
196
|
-
onInteractiveTimeIndicatorChanged?: (value?: IControlInfo) => void;
|
|
197
|
-
onPlayerSizeChanged?: (value?: {
|
|
198
|
-
width: number;
|
|
199
|
-
height: number;
|
|
200
|
-
}) => void;
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
type AdsParams = Record<string, unknown>;
|
|
204
|
-
interface IVideoEpisode {
|
|
205
|
-
time: number;
|
|
206
|
-
text: string;
|
|
207
|
-
interactive?: boolean;
|
|
208
|
-
completed?: boolean;
|
|
209
|
-
}
|
|
210
|
-
interface ITimelinePreviewThumbsData {
|
|
211
|
-
countPerImage: number;
|
|
212
|
-
countPerRow: number;
|
|
213
|
-
countTotal: number;
|
|
214
|
-
frameHeight: number;
|
|
215
|
-
frameWidth: number;
|
|
216
|
-
frequency: number;
|
|
217
|
-
isUV: boolean;
|
|
218
|
-
links: string[];
|
|
219
|
-
}
|
|
220
|
-
interface IVideoLive {
|
|
221
|
-
status: 'started' | 'upcoming' | 'waiting' | 'finished' | 'postlive' | 'failed';
|
|
222
|
-
startTime?: number;
|
|
223
|
-
}
|
|
224
|
-
interface IVideoDataBase {
|
|
225
|
-
title: string;
|
|
226
|
-
thumbUrl?: string;
|
|
227
|
-
unitedVideoId?: number;
|
|
228
|
-
duration: number;
|
|
229
|
-
adsParams?: AdsParams;
|
|
230
|
-
videoEpisodes?: IVideoEpisode[];
|
|
231
|
-
previewThumbsData?: ITimelinePreviewThumbsData;
|
|
232
|
-
isClip?: boolean;
|
|
233
|
-
subtitles?: Array<Omit<IExternalTextTrack, 'type'>>;
|
|
234
|
-
}
|
|
235
|
-
interface IVideoDataWithSources extends IVideoDataBase {
|
|
236
|
-
sources: ISources;
|
|
237
|
-
live?: never;
|
|
238
|
-
}
|
|
239
|
-
interface IVideoDataWithLive extends IVideoDataBase {
|
|
240
|
-
live: IVideoLive;
|
|
241
|
-
sources?: never;
|
|
242
|
-
}
|
|
243
|
-
type IVideoData = IVideoDataWithSources | IVideoDataWithLive;
|
|
244
|
-
interface IInteractiveData {
|
|
245
|
-
manifest: string | Manifest;
|
|
246
|
-
initChapterId?: string;
|
|
247
|
-
visitedChapters?: string[];
|
|
248
|
-
videosInfo?: VideoInfo[];
|
|
249
|
-
videoLoader?: (owner_id: string, video_id: string) => Promise<IVKVideoPlayerConfig>;
|
|
250
|
-
historyApi: {
|
|
251
|
-
get: (videoId: string) => Promise<number[]>;
|
|
252
|
-
save: (videoId: string, videoIds: number[]) => Promise<void>;
|
|
253
|
-
};
|
|
254
|
-
projectInfo?: {
|
|
255
|
-
pid: string;
|
|
256
|
-
title: string;
|
|
257
|
-
videoId: string;
|
|
258
|
-
variantPayloadType: string;
|
|
259
|
-
};
|
|
260
|
-
tooltipHelpHintActive?: boolean;
|
|
261
|
-
}
|
|
262
|
-
interface AdditionalButton {
|
|
263
|
-
iconUrl: string;
|
|
264
|
-
onClick?: (event?: MouseEvent) => void;
|
|
265
|
-
tooltip?: string;
|
|
266
|
-
ariaLabel?: string;
|
|
267
|
-
testId?: string;
|
|
268
|
-
hideOnDesktopGridTypes?: GridTypes[];
|
|
269
|
-
hideOnMobile?: boolean;
|
|
270
|
-
}
|
|
271
|
-
interface IVKVideoPlayerConfig {
|
|
272
|
-
videos: IVideoData[];
|
|
273
|
-
interactiveData?: IInteractiveData;
|
|
274
|
-
albumId?: string;
|
|
275
|
-
statPlace?: 'embed' | 'direct' | string;
|
|
276
|
-
statAuthToken?: string;
|
|
277
|
-
statUserSalt?: string;
|
|
278
|
-
statTrackCode?: string;
|
|
279
|
-
refreshStatAuthToken?: () => Promise<string | undefined>;
|
|
280
|
-
preload?: boolean;
|
|
281
|
-
autoplay?: boolean;
|
|
282
|
-
repeat?: boolean;
|
|
283
|
-
volume?: number;
|
|
284
|
-
muted?: boolean;
|
|
285
|
-
fromTime?: number;
|
|
286
|
-
canRewindLive?: boolean;
|
|
287
|
-
supportLink?: string;
|
|
288
|
-
showAds?: boolean;
|
|
289
|
-
adsSlotId?: number;
|
|
290
|
-
adsParams?: AdsParams;
|
|
291
|
-
adsPreviewParam?: number;
|
|
292
|
-
interfaceLanguage?: InterfaceLanguage | string;
|
|
293
|
-
logoClickable?: boolean;
|
|
294
|
-
logoHidden?: boolean;
|
|
295
|
-
isMobile?: boolean;
|
|
296
|
-
/** @deprecated */
|
|
297
|
-
isMediaSessionEnabled?: boolean;
|
|
298
|
-
/** @deprecated */
|
|
299
|
-
isPictureInPictureEnabled?: boolean;
|
|
300
|
-
isAudioDisabled?: boolean;
|
|
301
|
-
isLiveCatchUpMode?: boolean;
|
|
302
|
-
canDownload?: boolean;
|
|
303
|
-
fullScreenTarget?: HTMLElement;
|
|
304
|
-
failoverHosts?: string[];
|
|
305
|
-
showThumbTimer?: boolean;
|
|
306
|
-
is3DVideo?: boolean;
|
|
307
|
-
callbacks?: IVKVideoPlayerCallbacks;
|
|
308
|
-
additionalButtons?: AdditionalButton[];
|
|
309
|
-
refDomain?: string;
|
|
310
|
-
}
|
|
311
|
-
interface IControlInfo {
|
|
312
|
-
/** @deprecated Используйте новое поле left */
|
|
313
|
-
positionStartX: number;
|
|
314
|
-
/** @deprecated Используйте новое поле right */
|
|
315
|
-
positionEndX: number;
|
|
316
|
-
left: number;
|
|
317
|
-
right: number;
|
|
318
|
-
top: number;
|
|
319
|
-
bottom: number;
|
|
320
|
-
isDisplayed: boolean;
|
|
321
|
-
}
|
|
322
|
-
declare const enum PlayerPhase {
|
|
323
|
-
Thumb = "thumb",
|
|
324
|
-
Video = "video",
|
|
325
|
-
Ads = "ads",
|
|
326
|
-
Crashed = "crashed",
|
|
327
|
-
WaitingLive = "waitingLive",
|
|
328
|
-
WaitingRecord = "waitingRecord"
|
|
329
|
-
}
|
|
330
|
-
interface IAnnotationsApi {
|
|
331
|
-
/** @deprecated Больше не используется. Контейнер теперь определяется самостоятельно */
|
|
332
|
-
registryRootContainer: (container: HTMLElement) => void;
|
|
333
|
-
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
334
|
-
addLayer: (layerName: string) => HTMLElement | never;
|
|
335
|
-
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
336
|
-
getLayer: (layerName: string) => HTMLElement | undefined;
|
|
337
|
-
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
338
|
-
removeLayer: (layerName: string) => void;
|
|
339
|
-
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
340
|
-
clearLayer: (layerName: string) => void;
|
|
341
|
-
/** @deprecated Метод больше не является публичным */
|
|
342
|
-
detach: () => void;
|
|
343
|
-
/** @deprecated Больше нет необходимости переназначать контейнер для аннотаций в ходе работы плеера */
|
|
344
|
-
reattach: () => void;
|
|
345
|
-
add: (annotationName: string, annotation: HTMLElement) => void | never;
|
|
346
|
-
get: (annotationName: string) => HTMLElement | never;
|
|
347
|
-
remove: (annotationName: string) => void | never;
|
|
348
|
-
clear: () => void;
|
|
349
|
-
destroy: () => void;
|
|
350
|
-
}
|
|
351
|
-
interface HotKeyMapItem {
|
|
352
|
-
description: string;
|
|
353
|
-
value: string;
|
|
354
|
-
}
|
|
355
|
-
interface HotKeyMapGroup {
|
|
356
|
-
title: string;
|
|
357
|
-
items: HotKeyMapItem[];
|
|
358
|
-
}
|
|
359
|
-
interface HotKeyMapData {
|
|
360
|
-
title: string;
|
|
361
|
-
groups: HotKeyMapGroup[];
|
|
362
|
-
closeBtnText: string;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
declare class AnnotationsApi implements IAnnotationsApi {
|
|
366
|
-
private rootAnnotationsContainer;
|
|
367
|
-
private annotations;
|
|
368
|
-
private subscriptions;
|
|
369
|
-
private mutationObserver;
|
|
370
|
-
private playerSize;
|
|
371
|
-
constructor(container: HTMLElement);
|
|
372
|
-
add(annotationName: string, annotation: HTMLElement): void | never;
|
|
373
|
-
get(annotationName: string): HTMLElement | never;
|
|
374
|
-
remove(annotationName: string): void | never;
|
|
375
|
-
clear(): void;
|
|
376
|
-
destroy(): void;
|
|
377
|
-
private isElementExceedsBoundaries;
|
|
378
|
-
/** @deprecated Больше не используется. Контейнер теперь определяется самостоятельно */
|
|
379
|
-
registryRootContainer(container: HTMLElement): void;
|
|
380
|
-
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
381
|
-
addLayer(layerName: string): HTMLElement | never;
|
|
382
|
-
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
383
|
-
getLayer(layerName: string): HTMLElement | undefined;
|
|
384
|
-
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
385
|
-
removeLayer(layerName: string): void;
|
|
386
|
-
/** @deprecated Логики со слоями больше нет. Теперь все аннотации добавляются на единый общий слой */
|
|
387
|
-
clearLayer(layerName: string): void;
|
|
388
|
-
/** @deprecated Метод больше не является публичным */
|
|
389
|
-
detach(): void;
|
|
390
|
-
/** @deprecated Больше нет необходимости переназначать контейнер для аннотаций в ходе работы плеера */
|
|
391
|
-
reattach(): void;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
declare class VKVideoPlayer extends HTMLElement {
|
|
395
|
-
private svelteStubComponent?;
|
|
396
|
-
private svelteRootComponent?;
|
|
397
|
-
private store?;
|
|
398
|
-
private microStoresRoot?;
|
|
399
|
-
private statistics;
|
|
400
|
-
private sentry;
|
|
401
|
-
private _shadowRoot;
|
|
402
|
-
private playerContainer;
|
|
403
|
-
private rootContainer;
|
|
404
|
-
private uiConfig;
|
|
405
|
-
private coreConfig;
|
|
406
|
-
private statisticsConfig;
|
|
407
|
-
private interactiveController;
|
|
408
|
-
private interactiveContainer;
|
|
409
|
-
private graphMadePause;
|
|
410
|
-
private currentPlayingVideoIndex;
|
|
411
|
-
private needToRepeatPlaylist;
|
|
412
|
-
private videoConfig;
|
|
413
|
-
private pictureInPictureApi;
|
|
414
|
-
private mediaSessionApi;
|
|
415
|
-
private unsubscribePlayerPhaseSubscription;
|
|
416
|
-
private readonly logger;
|
|
417
|
-
private readonly log;
|
|
418
|
-
private readonly subscription;
|
|
419
|
-
annotationsApi: AnnotationsApi | undefined;
|
|
420
|
-
private createPlayerTimeout;
|
|
421
|
-
private prevIsid;
|
|
422
|
-
private isInited;
|
|
423
|
-
constructor();
|
|
424
|
-
private connectedCallback;
|
|
425
|
-
private disconnectedCallback;
|
|
426
|
-
private initPlayerRootContainers;
|
|
427
|
-
private needToShowNextPrevButtons;
|
|
428
|
-
private isNextButtonActive;
|
|
429
|
-
private isPrevButtonActive;
|
|
430
|
-
private isControlDisabled;
|
|
431
|
-
private getNextVideoInfo;
|
|
432
|
-
private createPlayer;
|
|
433
|
-
private addPlayerInfoSubscriptions;
|
|
434
|
-
private playNextVideo;
|
|
435
|
-
private playPrevVideo;
|
|
436
|
-
private repeatPlaylist;
|
|
437
|
-
private createPlayerWithCurrentVideo;
|
|
438
|
-
private playPrevChapter;
|
|
439
|
-
private seekToInteractive;
|
|
440
|
-
private toggleGraph;
|
|
441
|
-
private initInteractives;
|
|
442
|
-
private initInteractivesStatistics;
|
|
443
|
-
initPlayer(videoConfig: IVKVideoPlayerConfig, sdkConfig?: Partial<ISDKConfig>): void;
|
|
444
|
-
private isOneVideoPlaylist;
|
|
445
|
-
/**
|
|
446
|
-
* Обновление плейлиста. Будут перезаписаны все видео после текущего
|
|
447
|
-
*/
|
|
448
|
-
updateNextVideos(videos: IVideoData[]): void;
|
|
449
|
-
private initMediaSession;
|
|
450
|
-
private setupMediaSessionForVideo;
|
|
451
|
-
private setupMediaSessionForAds;
|
|
452
|
-
play(): void;
|
|
453
|
-
pause(): void;
|
|
454
|
-
stop(): void;
|
|
455
|
-
setMuted(muted: boolean): void;
|
|
456
|
-
setVolume(volume: number): void;
|
|
457
|
-
setRepeat(repeat: boolean): void;
|
|
458
|
-
seekTime(time: number): void;
|
|
459
|
-
seekEpisodeStartTime(time: number): void;
|
|
460
|
-
returnFocusToEpisodes(): void;
|
|
461
|
-
setPlaybackRate(playbackRate: PlaybackRate): void;
|
|
462
|
-
setAutoQualityLimits(limits: QualityLimits): void;
|
|
463
|
-
addLanguage(config: LanguageConfig): void;
|
|
464
|
-
setLanguage(language: InterfaceLanguage | string): Promise<void>;
|
|
465
|
-
setLiveStart(sources: ISources): void;
|
|
466
|
-
setWaitRecord(): void;
|
|
467
|
-
setLiveEnd(videoData: IVideoData): void;
|
|
468
|
-
getDeviceId(): string | undefined;
|
|
469
|
-
replayInteractiveVideo(): void;
|
|
470
|
-
showInteractiveIndicatorTooltip(newValue: boolean, useTimeout?: boolean): void;
|
|
471
|
-
}
|
|
472
|
-
|
|
473
|
-
declare const VERSION: string;
|
|
474
|
-
|
|
475
|
-
declare const registerPlayerWebComponent: () => void;
|
|
476
|
-
|
|
477
|
-
export { AdditionalButton, AdsParams, GridTypes, HotKeyMapData, HotKeyMapGroup, HotKeyMapItem, IControlInfo, IInteractiveData, IVKVideoPlayerCallbacks, IVKVideoPlayerConfig, IVideoData, IVideoLive, LanguageConfig, LanguagePack, VERSION, VKVideoPlayer, registerPlayerWebComponent };
|