@vkontakte/videoplayer 1.1.94-dev.eb086bcd9.0 → 1.1.95-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer",
3
- "version": "1.1.94-dev.eb086bcd9.0",
3
+ "version": "1.1.95-beta.0",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -43,9 +43,9 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "@adtech/rbadman": "2.2.57",
46
- "@vkontakte/videoplayer-core": "2.0.163-dev.eb086bcd9.0",
47
- "@vkontakte/videoplayer-interactive": "1.0.69-dev.eb086bcd9.0",
48
- "@vkontakte/videoplayer-shared": "1.0.92-dev.eb086bcd9.0",
49
- "@vkontakte/videoplayer-statistics": "1.0.109-dev.eb086bcd9.0"
46
+ "@vkontakte/videoplayer-core": "2.0.164-beta.0",
47
+ "@vkontakte/videoplayer-interactive": "1.0.70-beta.0",
48
+ "@vkontakte/videoplayer-shared": "1.0.93-beta.0",
49
+ "@vkontakte/videoplayer-statistics": "1.0.110-beta.0"
50
50
  }
51
51
  }
@@ -23,6 +23,8 @@ export declare class AdmanWrapper {
23
23
  private useAdmanFromNPM;
24
24
  private isVsidOriginal;
25
25
  private preserveMutedState;
26
+ private stopAdmanOnSwitch;
27
+ private skipNoFillAds;
26
28
  private watchDogTimeout;
27
29
  private externalApi?;
28
30
  events: {
@@ -16,4 +16,6 @@ export interface IConfig {
16
16
  volumeMultiplier: number;
17
17
  isVsidOriginal: boolean;
18
18
  preserveMutedState: boolean;
19
+ stopAdmanOnSwitch: boolean;
20
+ skipNoFillAds: boolean;
19
21
  }
@@ -1,2 +1,2 @@
1
1
  import { DesktopButtonsLeftIds } from "./desktopButtonsLeftIds";
2
- export declare const desktopButtonsLeftWeights: { [key in DesktopButtonsLeftIds] : number };
2
+ export declare const desktopButtonsLeftWeights: { [key in DesktopButtonsLeftIds]: number };
@@ -6,5 +6,6 @@ export declare enum DesktopButtonsRightIds {
6
6
  SETTINGS = "settings",
7
7
  CONTEXT = "context",
8
8
  FULLSCREEN = "fullscreen",
9
- CHROMECAST = "chromecast"
9
+ CHROMECAST = "chromecast",
10
+ QOE = "qoe"
10
11
  }
@@ -1,2 +1,2 @@
1
1
  import { DesktopButtonsRightIds } from "./desktopButtonsRightIds";
2
- export declare const desktopButtonsRightWeights: { [key in DesktopButtonsRightIds] : number };
2
+ export declare const desktopButtonsRightWeights: { [key in DesktopButtonsRightIds]: number };
@@ -1,2 +1,2 @@
1
1
  import { ContextMenuItemIds } from "./contextMenuItemIds";
2
- export declare const contextMenuItemWeights: { [key in ContextMenuItemIds] : number };
2
+ export declare const contextMenuItemWeights: { [key in ContextMenuItemIds]: number };
@@ -1,2 +1,2 @@
1
1
  import { SettingsMenuItemIds } from "./settingsMenuItemIds";
2
- export declare const settingsMenuItemWeights: { [key in SettingsMenuItemIds] : number };
2
+ export declare const settingsMenuItemWeights: { [key in SettingsMenuItemIds]: number };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Отступ снизу для контейнера опроса от нижнего края плеера.
3
+ * Включает высоту контролов и дополнительный отступ.
4
+ */
5
+ export declare const QOE_POLL_BOTTOM_OFFSET: number;
6
+ /**
7
+ * Верхний отступ для расчёта максимальной высоты опроса.
8
+ */
9
+ export declare const QOE_POLL_TOP_OFFSET: number;
@@ -0,0 +1 @@
1
+ export declare const stopPropagation: (e: Event) => void;
package/types/config.d.ts CHANGED
@@ -51,6 +51,12 @@ export interface IAdsConfig {
51
51
  * Этот флаг регулирует нужно ли передавать сомтояние мьюта в основной плеер
52
52
  */
53
53
  preserveMutedState: boolean;
54
+ stopAdmanOnSwitch: boolean;
55
+ /**
56
+ * Пропускать no-fill рекламу (баннер с нулевой длительностью).
57
+ * Если true — started$ не стреляется, видео сразу продолжает воспроизведение.
58
+ */
59
+ skipNoFillAds: boolean;
54
60
  }
55
61
  export interface IUIConfig {
56
62
  isMobile: ForceOrRelay;
package/types/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VKVideoPlayer } from "./VKVideoPlayer/index.svelte";
2
- import type { AdsParams, IAdmanInitParamsExternalApi, IVKVideoPlayerConfig, IUpdatableVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, IVideoEpisode, VideoPlayerView } from "./types";
2
+ import type { AdsParams, IAdmanInitParamsExternalApi, IVKVideoPlayerConfig, IUpdatableVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, IVideoEpisode, IQoeConfig, IQoePoll, IQoeResult, IQoeQuestion, IQoeCallbacks, QoePollTranslations, VideoPlayerView } from "./types";
3
3
  import type { LanguagePack, LanguageConfig } from "./translation/types";
4
4
  import type { LogoType as VKLogoType, IAdsConfig, ISDKConfig, IDpipConfig } from "./config";
5
5
  import type { ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek } from "@vkontakte/videoplayer-core";
@@ -8,7 +8,7 @@ export { VERSION } from "./env";
8
8
  export declare const registerPlayerWebComponent: () => void;
9
9
  export { type AdditionalSettingsMenuItem, MenuItemType, type AdditionalClickSettingsMenuItem, type AdditionalSwitchSettingsMenuItem, type AdditionalContextMenuItem } from "./components/Menus/subMenuTabs/types";
10
10
  export { type AdditionalButton, ControlButtonType } from "./components/Controls/types";
11
- export type { VKVideoPlayer, IVKVideoPlayerConfig, IUpdatableVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, QualityLimits, IAdsConfig, IVideoEpisode, IDpipConfig, ISDKConfig, VideoPlayerView, IAdmanInitParamsExternalApi, VKLogoType };
11
+ export type { VKVideoPlayer, IVKVideoPlayerConfig, IUpdatableVKVideoPlayerConfig, IControlInfo, ITimelinePreviewThumbsData, IUpcomingLiveViewControlInfo, IVKVideoPlayerCallbacks, IVideoData, AdsParams, HotKeyMapData, HotKeyMapItem, HotKeyMapGroup, ISources, IDashSource, URLSource, RawSource, URLSourceWithSeek, LanguagePack, LanguageConfig, Milliseconds, IVideoLive, IInteractiveData, AdditionalButtonDeprecated, QualityLimits, IAdsConfig, IVideoEpisode, IDpipConfig, IQoeConfig, IQoePoll, IQoeResult, IQoeQuestion, IQoeCallbacks, QoePollTranslations, ISDKConfig, VideoPlayerView, IAdmanInitParamsExternalApi, VKLogoType };
12
12
  export { GridTypes } from "./constans";
13
13
  export { PlayerPhase } from "./types";
14
14
  export { isPiPSupported, isDpipSupported } from "./utils/webAPI/pictureInPictureApi";
@@ -1,7 +1,7 @@
1
1
  import type { IUIConfig } from "../config";
2
2
  import type { IVKVideoPlayerConfig } from "../types";
3
3
  import type { IStore } from "./index";
4
- import type { FakeIsPlayingStore, GraphIsOpenedStore, InteractiveControlsOpacityStore, NotificationsStore, PictureInPictureStore, SeekToInteractiveDisabledTooltipStore, ShowInteractiveTimeIndicatorTooltipStore } from "./modules";
4
+ import type { FakeIsPlayingStore, GraphIsOpenedStore, InteractiveControlsOpacityStore, NotificationsStore, PictureInPictureStore, IQoeStore, SeekToInteractiveDisabledTooltipStore, ShowInteractiveTimeIndicatorTooltipStore } from "./modules";
5
5
  import type { Interactives } from "@vkontakte/videoplayer-interactive";
6
6
  export interface ICompositionParams {
7
7
  legacyStore: IStore;
@@ -11,13 +11,14 @@ export interface ICompositionParams {
11
11
  }
12
12
  export interface ICompositionResult {
13
13
  stores: {
14
+ fakeIsPlayingStore: FakeIsPlayingStore;
15
+ graphIsOpenedStore: GraphIsOpenedStore;
16
+ interactiveControlsOpacityStore: InteractiveControlsOpacityStore;
14
17
  notificationsStore: NotificationsStore;
15
18
  pictureInPictureStore: PictureInPictureStore;
16
- fakeIsPlayingStore: FakeIsPlayingStore;
19
+ qoeStore: IQoeStore;
17
20
  seekToInteractiveDisabledTooltipStore: SeekToInteractiveDisabledTooltipStore;
18
21
  showInteractiveTimeIndicatorTooltipStore: ShowInteractiveTimeIndicatorTooltipStore;
19
- graphIsOpenedStore: GraphIsOpenedStore;
20
- interactiveControlsOpacityStore: InteractiveControlsOpacityStore;
21
22
  };
22
23
  /** Очистка ресурсов */
23
24
  destroy(): void;
@@ -12,6 +12,8 @@ export type { NotificationsStoreState, NotificationsStore, NotificationsStoreAct
12
12
  export { notificationsModule, NOTIFICATIONS_STORE_TOKEN } from "./notificationsStore";
13
13
  export type { PictureInPictureStoreState, PictureInPictureStore, PictureInPictureStoreDeps } from "./pictureInPictureStore";
14
14
  export { pictureInPictureModule, PICTURE_IN_PICTURE_STORE_TOKEN } from "./pictureInPictureStore";
15
+ export type { QoeStoreActions, QoeStoreState, IQoeStore } from "./qoeStore";
16
+ export { qoeModule, QOE_STORE_TOKEN } from "./qoeStore";
15
17
  export type { SeekToInteractiveDisabledTooltipStoreState, SeekToInteractiveDisabledTooltipStore, SeekToInteractiveDisabledTooltipStoreDeps } from "./seekToInteractiveDisabledTooltipStore";
16
18
  export { seekToInteractiveDisabledTooltipModule, SEEK_TO_INTERACTIVE_DISABLED_TOOLTIP_STORE_TOKEN } from "./seekToInteractiveDisabledTooltipStore";
17
19
  export type { ShowInteractiveTimeIndicatorTooltipStoreState, ShowInteractiveTimeIndicatorTooltipStore, ShowInteractiveTimeIndicatorTooltipStoreActions, ShowInteractiveTimeIndicatorTooltipStoreDeps } from "./showInteractiveTimeIndicatorTooltipStore";
@@ -0,0 +1,3 @@
1
+ export type { QoeStoreActions, QoeStoreState, IQoeStore } from "./types";
2
+ export { qoeModule } from "./qoeStore.module";
3
+ export { QOE_STORE_TOKEN } from "./qoeStore.token";
@@ -0,0 +1,3 @@
1
+ import type { Module } from "../utils";
2
+ import type { IQoeStore } from "./types";
3
+ export declare const qoeModule: Module<IQoeStore>;
@@ -0,0 +1,4 @@
1
+ import type { QoeStoreFactoryDeps } from "../../../types";
2
+ import type { IQoeStore } from "./types";
3
+ export declare const CLOSE_DELAY = 3e3;
4
+ export declare const createQoeStore: (deps: QoeStoreFactoryDeps) => IQoeStore;
@@ -0,0 +1,3 @@
1
+ import { InjectionToken } from "@vkontakte/videoplayer-shared";
2
+ import type { IQoeStore } from "./types";
3
+ export declare const QOE_STORE_TOKEN: InjectionToken<IQoeStore>;
@@ -0,0 +1,24 @@
1
+ import type { Readable } from "svelte/store";
2
+ import type { IQoePoll, IQoeAnswer, IQoeQuestion, QoePollTranslationKeys, IQoeResult } from "../../../types";
3
+ export interface QoeStoreState {
4
+ complete$: Readable<boolean>;
5
+ active$: Readable<boolean>;
6
+ poll$: Readable<IQoePoll | undefined>;
7
+ pollResult$: Readable<IQoeResult | undefined>;
8
+ questionIndex$: Readable<number | undefined>;
9
+ }
10
+ export type QoeClosePollReason = "manual" | "auto" | "final";
11
+ export interface QoeStoreActions {
12
+ closePoll: (reason?: QoeClosePollReason) => void;
13
+ completePoll: VoidFunction;
14
+ answerQuestion: (answer: Pick<IQoeAnswer, "numeric" | "text">) => void;
15
+ switchQuestion: (step: 1 | -1) => void;
16
+ startPoll: VoidFunction;
17
+ }
18
+ export interface IQoeStore {
19
+ actions: QoeStoreActions;
20
+ enabled: boolean;
21
+ getTranslation(key: QoePollTranslationKeys): string;
22
+ isQuestionAnswerEditable(question: IQoeQuestion): boolean;
23
+ state: QoeStoreState;
24
+ }
@@ -3,4 +3,4 @@ export type Module<T> = {
3
3
  token: InjectionToken<T>;
4
4
  factory: (container: IDIContainer) => T;
5
5
  };
6
- export declare const registerModules: <T extends any[]>(container: IDIContainer, modules: { [K in keyof T] : Module<T[K]> }) => void;
6
+ export declare const registerModules: <T extends any[]>(container: IDIContainer, modules: { [K in keyof T]: Module<T[K]> }) => void;
@@ -29,7 +29,7 @@ export interface IAdsStateValues {
29
29
  secondsToWatchBeforeSkip: number;
30
30
  postrollPassed: boolean;
31
31
  }
32
- export type IAdsState = { [K in keyof IAdsStateValues] : Writable<IAdsStateValues[K]> };
32
+ export type IAdsState = { [K in keyof IAdsStateValues]: Writable<IAdsStateValues[K]> };
33
33
  export interface IUIState {
34
34
  t: (key: Key, params?: Record<string, string>) => string;
35
35
  isMinimalView$: Writable<boolean>;
@@ -42,7 +42,7 @@ export interface IUIState {
42
42
  * Определяет, могут ли вообще контролы быть показаны.
43
43
  */
44
44
  isControlsAvailable: Writable<boolean>;
45
- controlBlocks: { [key in keyof Required<ControlBlocksRefs>] : Writable<IControlInfo | undefined> };
45
+ controlBlocks: { [key in keyof Required<ControlBlocksRefs>]: Writable<IControlInfo | undefined> };
46
46
  touched: Writable<boolean>;
47
47
  controls: {
48
48
  prevButton: Writable<IControlInfo | undefined>;
@@ -1,5 +1,5 @@
1
1
  import type { VideoQuality, VideoFormat, ISources, IExternalTextTrack, IAudioStream } from "@vkontakte/videoplayer-core";
2
- import type { IValueObservable, InterfaceLanguage, IRectangle, DevNullEntry } from "@vkontakte/videoplayer-shared";
2
+ import type { IValueObservable, InterfaceLanguage, IRectangle, DevNullEntry, RecursivePartial } from "@vkontakte/videoplayer-shared";
3
3
  import type { Chapter, Manifest, ManifestVideo, VideoInfo, IInteractiveOptions } from "@vkontakte/videoplayer-interactive";
4
4
  import type { PlaybackState } from "@vkontakte/videoplayer-core";
5
5
  import type { MediascopePixelTypes, SeekAction, ThinOneStat } from "@vkontakte/videoplayer-statistics";
@@ -11,7 +11,9 @@ import type { IUIStatistics } from "../services/statistics";
11
11
  import type { AdditionalContextMenuItem, AdditionalSettingsMenuItem } from "../components/Menus/subMenuTabs/types";
12
12
  import type { AdditionalDesktopControlPanelButton } from "../components/Controls/types";
13
13
  import type { AdmanInitParams } from "./ads";
14
+ import type { IQoeCallbacks, IQoeConfig } from "./qoe";
14
15
  export type { AdmanInitParams, AdsParams, IAdmanInitParamsExternalApi } from "./ads";
16
+ export * from "./qoe";
15
17
  export declare const enum UIType {
16
18
  DESKTOP = "desktop",
17
19
  MOBILE = "mobile"
@@ -179,6 +181,7 @@ export interface IVKVideoPlayerCallbacks {
179
181
  onClosed?: (adsSection: AdsSection) => void;
180
182
  onError?: (message: string) => void;
181
183
  };
184
+ qoe?: IQoeCallbacks;
182
185
  }
183
186
  export interface IVKVideoPlayerUICallbacks {
184
187
  onStarted?: (isMuted: boolean) => void;
@@ -331,6 +334,7 @@ export interface IVKVideoPlayerConfig {
331
334
  mediascopePixels?: MediascopePixelTypes.Pixel[];
332
335
  getVideoDeeplink?: (timestamp: number) => string;
333
336
  apptracerUserId?: string | number;
337
+ qoe?: RecursivePartial<IQoeConfig>;
334
338
  }
335
339
  /**
336
340
  * Поля, которые можно обновить, сохранив итстанс плеера
@@ -0,0 +1,64 @@
1
+ import type { RecursivePartial, SafeAny } from "@vkontakte/videoplayer-shared";
2
+ import type { QoeClosePollReason } from "../store/modules/qoeStore/types";
3
+ export type QoeQuestionType = "star_rating" | "checkboxes_open";
4
+ export interface IQoeQuestionBase {
5
+ id: number;
6
+ statement: string;
7
+ type: QoeQuestionType;
8
+ }
9
+ export interface IQoeQuestionStarRating extends IQoeQuestionBase {
10
+ type: "star_rating";
11
+ rating_max: number;
12
+ }
13
+ export interface IQoeQuestionOption {
14
+ index: number;
15
+ text: string;
16
+ is_open?: boolean;
17
+ }
18
+ export interface IQoeQuestionCheckboxesOpen extends IQoeQuestionBase {
19
+ type: "checkboxes_open";
20
+ options: IQoeQuestionOption[];
21
+ }
22
+ export type IQoeQuestion = IQoeQuestionStarRating | IQoeQuestionCheckboxesOpen;
23
+ export type QoePollTranslationKeys = "button_back" | "button_continue" | "button_send" | "poll_step_caption" | "text_answer_placeholder" | "player_button_tooltip" | "star_labels";
24
+ export type QoePollTranslations = Record<QoePollTranslationKeys, string>;
25
+ export interface IQoePoll {
26
+ questions: IQoeQuestion[];
27
+ completionMessage?: string;
28
+ translations: QoePollTranslations;
29
+ }
30
+ export interface IQoeAnswer {
31
+ questionId: number;
32
+ numeric: number[];
33
+ text?: string;
34
+ }
35
+ export interface IQoeResult {
36
+ answers: IQoeAnswer[];
37
+ }
38
+ export type QoeStartedHandler = VoidFunction;
39
+ export type QoeClosedHandler = (reason: QoeClosePollReason, result?: IQoeResult) => void;
40
+ export type QoeCompleteHandler = (result: IQoeResult) => void;
41
+ export interface IQoeCallbacks {
42
+ onStarted?: QoeStartedHandler;
43
+ onClosed?: QoeClosedHandler;
44
+ onComplete?: QoeCompleteHandler;
45
+ }
46
+ export interface IQoeConfig {
47
+ poll: IQoePoll;
48
+ /**
49
+ * Таймаут автоматического закрытия в конце
50
+ * @default 3000
51
+ */
52
+ closeDelay?: number;
53
+ }
54
+ export interface IQoeButtonOnlyConfig {
55
+ buttonOnly: true;
56
+ translations: RecursivePartial<QoePollTranslations>;
57
+ }
58
+ export declare const isQoeButtonOnlyConfig: (candidate: SafeAny) => candidate is IQoeButtonOnlyConfig;
59
+ export declare const isStarRatingQuestion: (candidate: SafeAny) => candidate is IQoeQuestionStarRating;
60
+ export declare const isCheckboxesOpenQuestion: (candidate: SafeAny) => candidate is IQoeQuestionCheckboxesOpen;
61
+ export interface QoeStoreFactoryDeps {
62
+ config: RecursivePartial<IQoeConfig>;
63
+ callbacks: IQoeCallbacks;
64
+ }