@vkontakte/videoplayer-core 2.0.173 → 2.0.174-dev.477cdf9b9.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-core",
3
- "version": "2.0.173",
3
+ "version": "2.0.174-dev.477cdf9b9.0",
4
4
  "author": "vk.ru",
5
5
  "description": "Videoplayer core library based on the vk.ru platform",
6
6
  "homepage": "https://vk.ru",
@@ -42,6 +42,6 @@
42
42
  "**/*.d.ts"
43
43
  ],
44
44
  "dependencies": {
45
- "@vkontakte/videoplayer-shared": "1.0.102"
45
+ "@vkontakte/videoplayer-shared": "1.0.103-dev.477cdf9b9.0"
46
46
  }
47
47
  }
package/types/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import type { IMpegSource, IDashSource, IHLSSource, IDashURLSource, IHLSLiveSour
3
3
  import type { VideoCodec } from "./player/types";
4
4
  import { VideoFormat, Surface, PredefinedQualityLimits, VideoCodecName } from "./player/types";
5
5
  import Player from "./player/Player";
6
- import type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, ISources, ICueSettings, IExternalTextTrack, ITextTrack, PlaybackRate, IVideoStream, IAudioStream } from "./player/types";
6
+ import type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, ISources, ICueSettings, IExternalTextTrack, ITextTrack, PlaybackRate, IVideoStream, IAudioStream, StartEnd, HttpConnectionMetrics, HttpDownloadMetrics } from "./player/types";
7
7
  import { PlaybackState, ChromecastState, HttpConnectionType } from "./player/types";
8
8
  import type { IOptionalTuningConfig } from "./utils/tuningConfig";
9
9
  export { clientChecker, isMobile } from "./utils/ClientChecker";
@@ -15,5 +15,5 @@ import { Subscription, Observable, Subject, ValueSubject, VideoQuality } from "@
15
15
  * @deprecated
16
16
  */
17
17
  declare const SDK_VERSION: string;
18
- export type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, IOptionalTuningConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ISubscription, IUnsubscriber, IObservable, IEmitter, IValueObservable, IValue, IOperator, IListener, IMpegSource, IDashSource, IDashURLSource, IHLSSource, IHLSLiveSource, URLSource, RawSource, URLSourceWithSeek, ExactVideoQuality, IRange, ISeekRequest, ICueSettings, PlaybackRate, IVideoStream, IAudioStream };
18
+ export type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, IOptionalTuningConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ISubscription, IUnsubscriber, IObservable, IEmitter, IValueObservable, IValue, IOperator, IListener, IMpegSource, IDashSource, IDashURLSource, IHLSSource, IHLSLiveSource, URLSource, RawSource, URLSourceWithSeek, ExactVideoQuality, IRange, ISeekRequest, ICueSettings, PlaybackRate, IVideoStream, IAudioStream, StartEnd, HttpConnectionMetrics, HttpDownloadMetrics };
19
19
  export { Player, PlaybackState, ChromecastState, HttpConnectionType, Surface, Subscription, VideoFormat, VideoQuality, Observable, Subject, ValueSubject, VERSION, SDK_VERSION, PredefinedQualityLimits, VideoCodec, VideoCodecName };
@@ -34,4 +34,5 @@ export default class DashLiveProvider implements IProvider {
34
34
  private seek;
35
35
  private _dashCb;
36
36
  private syncPlayback;
37
+ private isSeekOffsetSupported;
37
38
  }
@@ -5,4 +5,5 @@ export default class DashCmafLiveProvider extends BaseDashProvider {
5
5
  constructor(params: IParams);
6
6
  protected override subscribe(): void;
7
7
  protected override seek(position: Milliseconds): void;
8
+ private isSeekOffsetSupported;
8
9
  }
@@ -30,4 +30,5 @@ export default class HlsLiveProvider implements IProvider {
30
30
  private seek;
31
31
  private syncPlayback;
32
32
  private generateLiveUrl;
33
+ private isSeekOffsetSupported;
33
34
  }
@@ -12,6 +12,8 @@ export type ManifestUrl = {
12
12
  bandwidth?: Kbps;
13
13
  size?: IRectangle;
14
14
  fps?: number;
15
+ /** HLS fMP4: идентификатор аудио-группы (EXT-X-MEDIA GROUP-ID), к которой привязан вариант через STREAM-INF AUDIO= */
16
+ audioGroupId?: string;
15
17
  };
16
18
  export type HLSManifestData = {
17
19
  qualityManifests: ManifestUrl[];
@@ -0,0 +1,12 @@
1
+ import type { ManifestUrl } from "../HlsProvider/manifestDataExtractor";
2
+ export declare const FMP4_QUALITY_QUERY_PARAMS: readonly ["mq", "lq"];
3
+ /**
4
+ * HLS fMP4: дочерний плейлист варианта не содержит EXT-X-MEDIA групп, поэтому нативный HLS
5
+ * не знает какую аудио-группу подцепить и продолжает держать предыдущую — звук пропадает при
6
+ * смене качества. Решение — грузить мастер-плейлист с зафиксированным качеством через
7
+ * mq=lq=<height>, тогда бэк сам отдаст нужный вариант с правильной аудио-группой.
8
+ *
9
+ * Возвращает undefined, если у варианта нельзя надёжно определить высоту — в этом случае
10
+ * лучше оставить дефолтное поведение провайдера, чем отправлять мусор в URL.
11
+ */
12
+ export declare const buildFmp4MasterUrl: (masterUrl: string, qualityManifest: ManifestUrl) => URL | undefined;
@@ -4,6 +4,7 @@ export declare enum OffsetParameterType {
4
4
  PLAYBACK_SHIFT = 1,
5
5
  DASH_CMAF_OFFSET_P = 2
6
6
  }
7
+ export declare const hasOffsetMarker: (url: string) => boolean;
7
8
  declare const _default: (url: string, offset?: Milliseconds, type?: OffsetParameterType) => string;
8
9
  export default _default;
9
10
  export declare const getLiveUrlOffset: (url: string, type: OffsetParameterType) => number;
@@ -1,6 +1,7 @@
1
1
  import { CurrentClientDevice } from "../types/currentClientDevice";
2
2
  import type { DisplayChecker } from "./DisplayChecker";
3
3
  import type { Checker } from "../types/checker";
4
+ import type { HighEntropyValues } from "../types/userAgentData";
4
5
  export interface OS {
5
6
  name: string;
6
7
  version: string;
@@ -10,6 +11,12 @@ export interface DeviceDetails {
10
11
  vendor: string;
11
12
  model: string;
12
13
  }
14
+ export interface DeviceHardware {
15
+ cpuCores?: number;
16
+ memoryGb?: number;
17
+ gpuVendor?: string;
18
+ gpuArchitecture?: string;
19
+ }
13
20
  export declare class DeviceChecker implements Checker {
14
21
  private _displayChecker;
15
22
  private _isMobile;
@@ -18,10 +25,14 @@ export declare class DeviceChecker implements Checker {
18
25
  private _highEntropyValues;
19
26
  private _os;
20
27
  private _details;
28
+ private _hardware;
29
+ private _gpuDetection;
21
30
  constructor(displayChecker: DisplayChecker);
22
31
  get current(): CurrentClientDevice;
23
32
  get os(): OS;
24
33
  get details(): DeviceDetails;
34
+ get hardware(): DeviceHardware;
35
+ get highEntropyValues(): HighEntropyValues;
25
36
  get isIOS(): boolean;
26
37
  get isIPadOS(): boolean;
27
38
  get isMac(): boolean;
@@ -33,6 +44,9 @@ export declare class DeviceChecker implements Checker {
33
44
  get isMobile(): boolean;
34
45
  get iOSVersion(): number | undefined;
35
46
  detect(): void;
47
+ private detectHardware;
48
+ detectGpu(): Promise<void>;
49
+ private requestGpuInfo;
36
50
  private detectHighEntropyValues;
37
51
  private detectDevice;
38
52
  private detectOS;
@@ -10,6 +10,7 @@ export declare class DisplayChecker implements Checker {
10
10
  private _screenHeight;
11
11
  private _screenWidth;
12
12
  private _colorDepth;
13
+ private _colorGamut;
13
14
  private _displayMode;
14
15
  private _isStandalone;
15
16
  get isTouch(): boolean;
@@ -21,8 +22,10 @@ export declare class DisplayChecker implements Checker {
21
22
  get pixelRatio(): number;
22
23
  get isHDR(): boolean;
23
24
  get colorDepth(): number;
25
+ get colorGamut(): ColorGamut | undefined;
24
26
  get displayMode(): DisplayMode;
25
27
  get isStandalone(): boolean;
26
28
  detect(): void;
29
+ private detectColorGamut;
27
30
  private detectDisplayMode;
28
31
  }
@@ -252,6 +252,8 @@ export type ITuningConfig = {
252
252
  maxQualityForFirstSegmentPreload: ExactVideoQuality;
253
253
  /** Включает отправку телеметрии трейсера (resume) при превышении stall watchdog */
254
254
  tracerResumeOnUnexpectedStall: boolean;
255
+ /** Включает отправку телеметрии трейсера (resume) при выборе ABR качества не выше lowQualityTelemetryLimit */
256
+ tracerResumeOnLowQuality: boolean;
255
257
  /**
256
258
  * Эксперимент: при `true` отключает `await this.reinitDecoderIfNeeded(shouldForceSeek)`
257
259
  * внутри `stallWatchdogIntervalCallback`. По умолчанию `false` — текущее поведение
@@ -315,6 +317,15 @@ export type ITuningConfig = {
315
317
  */
316
318
  maxPausedTime: number;
317
319
  catchupLiveForMutedInactiveTab: boolean;
320
+ /**
321
+ * UVP-2618. Отключать перемотку лайва, если ссылка пришла без маркера offset (`_offset_p` в пути
322
+ * или query-параметр `?offset_p=`). Применяется ко всем live-форматам: dash_live, dash_live_cmaf,
323
+ * hls_live, hls_live_cmaf. Когда манифест отдаёт DVR-окно (shiftDuration / liveSeekableDuration /
324
+ * X-Playback-Duration), но в URL нет маркера, `generateLiveUrl` не сможет подставить offset и плеер
325
+ * молча переинициализируется на live edge. Включение делает DVR-окно нулевым и скрывает таймлайн.
326
+ * По умолчанию false (прежнее поведение), включается для эксперимента.
327
+ */
328
+ disableLiveSeekWithoutOffsetMarker: boolean;
318
329
  };
319
330
  enableWakeLock: boolean;
320
331
  enableTelemetryAtStart: boolean;
@@ -355,6 +366,7 @@ export type ITuningConfig = {
355
366
  * include-threshold - записываем столлы длинее stallIgnoreThreshold
356
367
  */
357
368
  stallHandlingStrategy: "verbose" | "exclude-threshold" | "include-threshold";
369
+ stallIgnoreOnPause: boolean;
358
370
  gapWatchdogInterval: Milliseconds;
359
371
  requestQuick: boolean;
360
372
  /** @deprecated HLS.js удалён, флаг ничего не делает */