@vkontakte/videoplayer 1.1.98 → 1.1.99-beta.1

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.98",
3
+ "version": "1.1.99-beta.1",
4
4
  "author": "vk.ru",
5
5
  "description": "Videoplayer based on the vk.ru platform",
6
6
  "homepage": "https://vk.ru",
@@ -43,9 +43,9 @@
43
43
  ],
44
44
  "dependencies": {
45
45
  "@adtech/rbadman": "2.2.57",
46
- "@vkontakte/videoplayer-core": "2.0.167",
47
- "@vkontakte/videoplayer-interactive": "1.0.73",
48
- "@vkontakte/videoplayer-shared": "1.0.96",
49
- "@vkontakte/videoplayer-statistics": "1.0.113"
46
+ "@vkontakte/videoplayer-core": "2.0.168-beta.1",
47
+ "@vkontakte/videoplayer-interactive": "1.0.74-beta.1",
48
+ "@vkontakte/videoplayer-shared": "1.0.97-beta.1",
49
+ "@vkontakte/videoplayer-statistics": "1.0.114-beta.1"
50
50
  }
51
51
  }
@@ -3,7 +3,6 @@ export declare enum SettingsMenuItemIds {
3
3
  AUDIO_TRACKS = "audio-language-settings",
4
4
  PLAYBACK_RATE = "playback-rate-settings",
5
5
  SUBTITLES = "subtitles-settings",
6
- TRAFFIC_SAVING = "traffic-saving-settings",
7
6
  DOWNLOAD = "download",
8
7
  REPORT = "report",
9
8
  COPY_DATA = "copy-data",
@@ -1,19 +1,15 @@
1
1
  import { RootMenuId, type SettingsMenuItem } from "./types";
2
2
  import { type VideoPlaybackRate, type VideoSubtitle } from "../../../types";
3
3
  import type { IAudioStream, PlaybackRate, VideoQuality } from "@vkontakte/videoplayer-core";
4
- import type { QualitySettingsAppliesTo } from "../../../utils/userSettings";
5
4
  export type Context = {
6
5
  currentPlaybackRate: number;
7
6
  availablePlaybackRates: VideoPlaybackRate[];
8
7
  selectPlaybackRate: (playbackRate: PlaybackRate) => void;
9
- trafficSavingEnabled: boolean;
10
- toggleTrafficSaving: (value: boolean, appliesTo: QualitySettingsAppliesTo) => void;
11
8
  currentQuality: VideoQuality;
12
9
  isAutoQualityEnabled: boolean;
13
10
  isMobile: boolean;
14
11
  currentAudioStream: IAudioStream | undefined;
15
12
  availableAudioStreams: IAudioStream[];
16
- qualityDetailsSubMenuEnabled: boolean;
17
13
  currentSubtitle: Omit<VideoSubtitle, "selected">;
18
14
  onDownloadClick: () => void;
19
15
  onReportProblemClick: () => void;
@@ -19,7 +19,6 @@ export declare enum SubMenuId {
19
19
  }
20
20
  export declare enum RootMenuId {
21
21
  QUALITY_SETTINGS = "quality-settings",
22
- TRAFFIC_SAVING_SWITCH = "traffic-saving-switch",
23
22
  AUDIO_TRACKS = "audio-tracks-settings",
24
23
  PLAYBACK_RATE = "playback-rate-settings",
25
24
  SUBTITLES = "subtitles-settings",
package/types/config.d.ts CHANGED
@@ -157,6 +157,7 @@ export interface IUIConfig {
157
157
  */
158
158
  tracer: boolean;
159
159
  tracerType: TracerType;
160
+ tracerPausedAtInit: boolean;
160
161
  /** Размер буфера для событий трейсера. 0 — буфер не используется */
161
162
  tracerEventsBufferSize: number;
162
163
  apptracer: IAppTracerConfig;
@@ -192,7 +193,6 @@ export interface IUIConfig {
192
193
  nextPrevButtons: boolean;
193
194
  previewNoEmptySpace: boolean;
194
195
  exposeInternalsToGlobal: boolean;
195
- qualityDetailsSubMenuEnabled: boolean;
196
196
  forceAutoQualityWhenSevereStallHappens: boolean;
197
197
  showSlowVideoNotification: boolean;
198
198
  maxCountShowSlowVideoNotification: number;
@@ -2,6 +2,8 @@
2
2
  * Quality Store Module
3
3
  *
4
4
  * Композиция модуля через Dependency Injection.
5
+ * Создаёт qualityStore, разрешая зависимости из DI-контейнера,
6
+ * и устанавливает функцию перевода из languageStore.
5
7
  */
6
8
  import { type QualityStore } from "./qualityStore.store";
7
9
  import type { Module } from "../utils";
@@ -1,20 +1,33 @@
1
1
  /**
2
2
  * Quality Store Module
3
3
  *
4
- * Управляет состоянием качества видео: доступные качества, авто-качество.
4
+ * Управляет состоянием качества видео: доступные качества, авто-качество,
5
+ * установка качества, режим экономии трафика, высокое качество.
5
6
  */
6
7
  import type { Readable } from "svelte/store";
7
8
  import type { IPlayer } from "@vkontakte/videoplayer-core";
8
- import type { Key } from "../../../translation/types";
9
- import type { VideoQualityForRender } from "../../../types";
9
+ import { type IComponentLogger, type ITracer, type QualityLimits, type VideoQuality, Subject } from "@vkontakte/videoplayer-shared";
10
+ import type { ThinOneStat } from "@vkontakte/videoplayer-statistics";
11
+ import type { TSignature } from "../../../translation/types";
12
+ import type { VideoQualityForRender, VideoQualityUI } from "../../../types";
13
+ import { type QualitySettingsAppliesTo } from "../../../utils/userSettings";
14
+ import type { SetQualityInfo } from "../../types";
10
15
  /**
11
16
  * Зависимости модуля quality
12
17
  */
13
18
  export interface QualityStoreDeps {
14
19
  /** Плеер */
15
20
  player: IPlayer;
21
+ /** Логгер */
22
+ log: IComponentLogger;
23
+ /** Трассировщик */
24
+ tracer: ITracer;
25
+ /** ID текущего видео */
26
+ videoId$: Readable<number | undefined>;
16
27
  /** Функция перевода */
17
- t: (key: Key, params?: Record<string, string>) => string;
28
+ t: TSignature;
29
+ /** Проверка возможности сохранения предпочтений */
30
+ canSavePreferredState: (external: boolean) => boolean;
18
31
  }
19
32
  /**
20
33
  * Состояние модуля quality
@@ -24,12 +37,45 @@ export interface QualityStoreState {
24
37
  availableQualities$: Readable<VideoQualityForRender[]>;
25
38
  /** Признак доступности авто-качества */
26
39
  isAutoQualityAvailable$: Readable<boolean>;
40
+ /** Текущее качество видео */
41
+ currentQuality$: Readable<VideoQuality | undefined>;
42
+ /** Признак включённого авто-качества */
43
+ isAutoQualityEnabled$: Readable<boolean | undefined>;
44
+ /** Признак включённого режима экономии трафика */
45
+ trafficSavingEnabled$: Readable<boolean>;
46
+ /** Признак включённого режима высокого качества */
47
+ highQualityEnabled$: Readable<boolean>;
48
+ /** Признак доступности авто-лимитирования качества */
49
+ autoQualityLimitingAvailable$: Readable<boolean>;
50
+ }
51
+ /**
52
+ * Внутренние экшены качества
53
+ */
54
+ export interface QualityStoreActions {
55
+ setQuality: (quality: VideoQualityUI, info?: SetQualityInfo) => void;
56
+ setTrafficSavingEnabled: (enabled: boolean, appliesTo?: QualitySettingsAppliesTo) => void;
57
+ setHighQualityEnabled: (enabled: boolean, appliesTo?: QualitySettingsAppliesTo) => void;
58
+ }
59
+ /**
60
+ * Внешние экшены качества
61
+ */
62
+ export interface QualityStoreExternalActions {
63
+ setQuality: (quality: VideoQualityUI) => void;
64
+ setTrafficSavingEnabled: (enabled: boolean) => void;
65
+ setHighQualityEnabled: (enabled: boolean) => void;
66
+ setAutoQualityLimits: (limits: QualityLimits) => void;
27
67
  }
28
68
  /**
29
69
  * Результат создания quality store
30
70
  */
71
+ export interface QualityStoreEvents {
72
+ actionQuality$: Subject<ThinOneStat.ActionQualityType>;
73
+ }
31
74
  export interface QualityStore {
32
75
  state: QualityStoreState;
76
+ actions: QualityStoreActions;
77
+ externalActions: QualityStoreExternalActions;
78
+ events: QualityStoreEvents;
33
79
  }
34
80
  /**
35
81
  * Создаёт quality store
@@ -1,9 +1,9 @@
1
1
  import type { ChromecastState, IAudioStream, IConfig as ICoreInitVideoConfig, IExternalTextTrack, IOptionalTuningConfig, IPlayer, ISources, IVideoStream, PlaybackState, VideoFormat } from "@vkontakte/videoplayer-core";
2
2
  import type { InteractiveRange } from "@vkontakte/videoplayer-interactive";
3
- import type { AppTracer, IError, ILogger, InternalsExposure, IRectangle, IRootTracer, ISubject, ITracer, IValueObservable, IValueSubject, QualityLimits, VideoQuality } from "@vkontakte/videoplayer-shared";
3
+ import type { AppTracer, IError, ILogger, InternalsExposure, IRectangle, IRootTracer, ISubject, ITracer, IValueObservable, IValueSubject } from "@vkontakte/videoplayer-shared";
4
4
  import type { SeekAction, ThinOneStat } from "@vkontakte/videoplayer-statistics";
5
5
  import type { Readable, Writable } from "svelte/store";
6
- import type { AdditionalButtonDeprecated, AdsPlaybackState, ControlBlocksRefs, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerControlsRef, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, Position, Size, VideoPlayerView, VideoQualityUI } from "../types";
6
+ import type { AdditionalButtonDeprecated, AdsPlaybackState, ControlBlocksRefs, ControlsKeys, HotKeyMapData, IAnnotationsApi, IControlInfo, IDisabledControls, IInteractiveData, IPictureInPictureApi, IPlayerControlsRef, IPlayerPhase, ITimelinePreviewThumbsData, IVideoEpisode, IVKVideoPlayerCallbacks, IVKVideoPlayerUICallbacks, Position, Size, VideoPlayerView } from "../types";
7
7
  import type { AdmanWrapper } from "../components/Ads/admanWrapper";
8
8
  import type { QualitySettingsAppliesTo } from "../utils/userSettings";
9
9
  import type { GridTypes, PlayPrevChapterDisabledTooltipKey } from "../constans";
@@ -153,15 +153,10 @@ export interface IPlayerState {
153
153
  isEnded$: Readable<boolean>;
154
154
  volume$: Readable<number>;
155
155
  muted$: Readable<boolean>;
156
- trafficSavingEnabled$: Readable<boolean>;
157
- highQualityEnabled$: Readable<boolean>;
158
156
  availableVideoStreams$: Readable<IVideoStream[]>;
159
157
  availableAudioStreams$: Readable<IAudioStream[]>;
160
158
  videoStream$: Readable<IVideoStream | undefined>;
161
159
  audioStream$: Readable<IAudioStream | undefined>;
162
- currentQuality$: Readable<VideoQuality | undefined>;
163
- autoQualityLimitingAvailable$: Readable<boolean>;
164
- isAutoQualityEnabled$: Readable<boolean | undefined>;
165
160
  currentPlaybackRate$: Readable<number>;
166
161
  previewThumbsData$: Writable<ITimelinePreviewThumbsData | undefined>;
167
162
  chromecastState$: Readable<ChromecastState>;
@@ -203,15 +198,12 @@ export interface IStoreInternalActions {
203
198
  closeSettingsMenu: (fromSubMenu?: boolean) => void;
204
199
  openSettingsSubMenu: (name: string, ref: HTMLElement) => void;
205
200
  closeSettingsSubMenu: (ref: HTMLElement, isClosing?: boolean) => void;
206
- setTrafficSavingEnabled: (trafficSavingEnabled: boolean, appliesTo?: QualitySettingsAppliesTo) => void;
207
- setHighQualityEnabled: (highQualityEnabled: boolean, appliesTo?: QualitySettingsAppliesTo) => void;
201
+ setAudioStream: (stream: IAudioStream) => void;
202
+ setVideoStream: (stream: IVideoStream) => void;
208
203
  setVolume: (volume: number) => void;
209
204
  setMuted: (muted: boolean) => void;
210
205
  startVolumeChanging: () => void;
211
206
  stopVolumeChanging: () => void;
212
- setAudioStream: (stream: IAudioStream) => void;
213
- setVideoStream: (stream: IVideoStream) => void;
214
- setQuality: (quality: VideoQualityUI, info?: SetQualityInfo) => void;
215
207
  togglePictureInPicture: () => void;
216
208
  startScrubbing: (progress: number) => void;
217
209
  progressScrubbing: (progress: number) => void;
@@ -267,7 +259,6 @@ export interface IStoreExternalActions {
267
259
  stop: () => void;
268
260
  seekTime: (time: number) => void;
269
261
  seekEpisodeStartTime: (time: number) => void;
270
- setAutoQualityLimits: (limits: QualityLimits) => void;
271
262
  setMuted: (muted: boolean) => void;
272
263
  setVolume: (volume: number) => void;
273
264
  returnFocusToEpisodes: () => void;
@@ -283,9 +274,6 @@ export interface IStoreExternalActions {
283
274
  setLiveLowLatency: (isLowLatency: boolean) => void;
284
275
  hideControls: () => void;
285
276
  showControls: () => void;
286
- setQuality: (quality: VideoQualityUI) => void;
287
- setTrafficSavingEnabled: (trafficSavingEnabled: boolean) => void;
288
- setHighQualityEnabled: (highQualityEnabled: boolean) => void;
289
277
  changeAudioStream: (id: string) => void;
290
278
  setMinimalView: (enabled: boolean) => void;
291
279
  toggleFullscreen: () => void;
@@ -301,7 +289,6 @@ export interface IStoreInitVideoConfig extends ICoreInitVideoConfig {
301
289
  export interface IStoreEvents {
302
290
  actionRewind$: ISubject<void>;
303
291
  actionSeek$: IValueSubject<SeekAction | ThinOneStat.ActionSeekType>;
304
- actionQuality$: ISubject<ThinOneStat.ActionQualityType>;
305
292
  nextMovie$: ISubject<number>;
306
293
  }
307
294
  export interface IStore {
@@ -50,4 +50,5 @@ export declare class SubtitlesDownloader {
50
50
  destroy(): void;
51
51
  isDestroyed(): boolean;
52
52
  }
53
+ export declare const canSavePreferredState: (external: boolean, saveOnUserActionOnly: boolean) => boolean;
53
54
  export declare const getAdsDefaultStateValues: () => IAdsStateValues;
@@ -1,4 +1,4 @@
1
- import type { RecursivePartial, SafeAny } from "@vkontakte/videoplayer-shared";
1
+ import type { ITracer, RecursivePartial, SafeAny } from "@vkontakte/videoplayer-shared";
2
2
  import type { QoeClosePollReason } from "../store/modules/qoeStore/types";
3
3
  export type QoeQuestionType = "star_rating" | "checkboxes_open";
4
4
  export interface IQoeQuestionBase {
@@ -62,4 +62,5 @@ export declare const isCheckboxesOpenQuestion: (candidate: SafeAny) => candidate
62
62
  export interface QoeStoreFactoryDeps {
63
63
  config?: IQoeConfig | IQoeButtonOnlyConfig;
64
64
  callbacks?: IQoeCallbacks;
65
+ tracer?: ITracer;
65
66
  }
@@ -2,13 +2,8 @@ import type { VideoQuality } from "@vkontakte/videoplayer-shared";
2
2
  import { type PlaybackRate } from "@vkontakte/videoplayer-core";
3
3
  export declare const savePreferredVolume: (volume: number) => void;
4
4
  export declare const getPreferredVolume: () => number | undefined;
5
- export declare const savePreferredQuality: (videoId: number | undefined, value: VideoQuality) => void;
6
- export declare const deletePreferredQuality: () => void;
7
- export declare const getPreferredQuality: (currentVideoId: number | undefined) => VideoQuality | undefined;
8
5
  export declare const savePreferMute: (preferMute: boolean) => void;
9
6
  export declare const getPreferMute: () => boolean;
10
- export declare const savePreferTrafficSavingEnabled: (trafficSavingEnabled: boolean) => void;
11
- export declare const getPreferTrafficSavingEnabled: () => boolean;
12
7
  export declare const getPreferredStreamLanguage: () => string | null;
13
8
  export declare const savePreferredStreamLanguage: (language: string) => void;
14
9
  export declare const getPreferredSubtitlesLanguage: () => string | null;
@@ -33,7 +28,6 @@ export type QualitySettingsAppliesTo = "as-default" | "to-video";
33
28
  export declare const getPreferredQualitySettings: (videoId: number | undefined) => (PreferredQualitySettingsValue & {
34
29
  appliesTo: QualitySettingsAppliesTo;
35
30
  }) | null;
36
- export declare const migrateSettingsToLegacyWay: (videoId?: number) => void;
37
31
  export declare const savePreferredQualitySettings: (value: PreferredQualitySettingsValue, appliesTo?: QualitySettingsAppliesTo) => void;
38
32
  export declare const savePreferredDefaultQualitySettings: (value: DefaultPreferredQualitySettingsValue) => void;
39
33
  export declare const removePreferredQualitySettingsByVideo: () => void;