@vkontakte/videoplayer-core 2.0.170 → 2.0.171-dev.167890e34.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.
Files changed (27) hide show
  1. package/es2015.cjs +46 -56
  2. package/es2015.esm.js +54 -64
  3. package/esnext.cjs +54 -64
  4. package/esnext.esm.js +55 -65
  5. package/evergreen.esm.js +55 -65
  6. package/package.json +2 -2
  7. package/types/player/Player.d.ts +1 -0
  8. package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +2 -0
  9. package/types/providers/DashProvider/baseDashProvider.d.ts +1 -4
  10. package/types/providers/DashProvider/lib/sourceBufferTaskQueue.d.ts +1 -2
  11. package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +1 -3
  12. package/types/providers/DashProviderVirtual/lib/buffer/nativeBufferManager.d.ts +1 -1
  13. package/types/providers/DashProviderVirtual/lib/buffer/sourceBufferTaskQueue.d.ts +1 -2
  14. package/types/providers/ProviderContainer/Mayday/heuristics/TvFetcherErrorHeuristic.d.ts +10 -0
  15. package/types/providers/ProviderContainer/Mayday/index.d.ts +1 -0
  16. package/types/providers/ProviderContainer/index.d.ts +0 -1
  17. package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +0 -1
  18. package/types/providers/utils/Abr/types.d.ts +1 -6
  19. package/types/providers/utils/Abr/utils.d.ts +1 -3
  20. package/types/providers/utils/HTMLVideoElement/destroy.d.ts +1 -1
  21. package/types/providers/utils/HTMLVideoElement/pool.d.ts +2 -3
  22. package/types/utils/autoSelectTrack.d.ts +3 -4
  23. package/types/utils/timers.d.ts +2 -0
  24. package/types/utils/tuningConfig.d.ts +12 -33
  25. package/types/providers/utils/Abr/rules/video/downloadTimeRule.d.ts +0 -15
  26. package/types/providers/utils/Abr/rules/video/failedVideoTrackRule.d.ts +0 -14
  27. package/types/utils/buffer/dynamicBufferTarget.d.ts +0 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-core",
3
- "version": "2.0.170",
3
+ "version": "2.0.171-dev.167890e34.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.99"
45
+ "@vkontakte/videoplayer-shared": "1.0.100-dev.167890e34.0"
46
46
  }
47
47
  }
@@ -30,6 +30,7 @@ export default class Player implements IPlayer {
30
30
  experimental: PlayerExperimentalImpl;
31
31
  private devNullLog;
32
32
  private collectDecodingInfoDestroyCb;
33
+ private hasReleasedTimers;
33
34
  constructor(tuning?: IOptionalTuningConfig, tracer?: ITracer, playerOptions?: IPlayerOptions);
34
35
  private readonly doInit;
35
36
  /**
@@ -49,6 +49,8 @@ export default class LiveDashPlayer {
49
49
  private bufferStates;
50
50
  private downloadRate?;
51
51
  private sourceJitter;
52
+ /** Токен для защиты от устаревших callback'ов sourceopen при многократных вызовах _setVideoSrc */
53
+ private srcToken;
52
54
  private chunkRateEstimator;
53
55
  private manifestUrl;
54
56
  private urlResolver;
@@ -16,7 +16,6 @@ import { ElementSizeManager } from "../utils/HTMLVideoElement/ElementSizeManager
16
16
  type IParams = IProviderParams<IDashURLSource> & {
17
17
  sourceHls?: IHLSSource;
18
18
  forceVideoCodec?: VideoCodec;
19
- failedVideoTrack?: Nullable<IVideoTrack>;
20
19
  isOnDemand?: boolean;
21
20
  dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
22
21
  };
@@ -34,7 +33,6 @@ export default abstract class BaseDashProvider implements IProvider {
34
33
  protected stallsManager: StallsManager;
35
34
  protected elementSizeManager: ElementSizeManager;
36
35
  protected abrManager: AbrManager;
37
- protected failedVideoTrack: Nullable<IVideoTrack>;
38
36
  protected videoTracksMap: Map<IVideoTrack, {
39
37
  stream: Stream;
40
38
  representation: Representation;
@@ -56,9 +54,8 @@ export default abstract class BaseDashProvider implements IProvider {
56
54
  protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
57
55
  protected subscribe(): void;
58
56
  private syncBufferTarget;
59
- private resolveAudioBufferTargetMs;
60
57
  private resolveBufferTargetMs;
61
- private getCurrentVideoBitrateKbps;
58
+ private resolveAudioBufferTargetMs;
62
59
  protected selectVideoAudioRepresentations(): [Representation, Representation | undefined] | undefined;
63
60
  protected prepare(manifestOffset?: number): void;
64
61
  protected syncPlayback: () => void;
@@ -7,8 +7,7 @@ declare class SourceBufferTaskQueue {
7
7
  private currentTask;
8
8
  private destroyed;
9
9
  private abortRequested;
10
- private isAbortFixEnabled;
11
- constructor(buffer: SourceBuffer, isAbortFixEnabled?: boolean);
10
+ constructor(buffer: SourceBuffer);
12
11
  append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
13
12
  remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
14
13
  abort(init?: BufferSource): Promise<boolean>;
@@ -16,7 +16,6 @@ import { AbrManager } from "../utils/Abr/abrManager";
16
16
  type IParams = IProviderParams<IDashURLSource> & {
17
17
  sourceHls?: IHLSSource;
18
18
  forceVideoCodec?: VideoCodec;
19
- failedVideoTrack?: Nullable<IVideoTrack>;
20
19
  isOnDemand?: boolean;
21
20
  dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
22
21
  };
@@ -56,9 +55,8 @@ export default abstract class BaseDashProvider implements IProvider {
56
55
  protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
57
56
  protected subscribe(): void;
58
57
  private syncBufferTarget;
59
- private resolveAudioBufferTargetMs;
60
58
  private resolveBufferTargetMs;
61
- private getCurrentVideoBitrateKbps;
59
+ private resolveAudioBufferTargetMs;
62
60
  protected selectVideoAudioRepresentations(): [Representation, Representation | undefined] | undefined;
63
61
  protected prepare(manifestOffset?: number): void;
64
62
  protected syncPlayback: () => void;
@@ -7,7 +7,7 @@ export declare class NativeBufferManager {
7
7
  private sourceBufferTaskQueue;
8
8
  private subscription;
9
9
  constructor(mediaSource: MediaSource);
10
- init(mime: string, codecs: string, useAbortMSEFix?: boolean): void;
10
+ init(mime: string, codecs: string): void;
11
11
  addInitSegment(initView: BufferSource, signal?: AbortSignal): Promise<boolean>;
12
12
  append(segmentView: BufferSource, signal?: AbortSignal): Promise<boolean>;
13
13
  remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
@@ -7,8 +7,7 @@ declare class SourceBufferTaskQueue {
7
7
  private currentTask;
8
8
  private destroyed;
9
9
  private abortRequested;
10
- private isAbortFixEnabled;
11
- constructor(buffer: SourceBuffer, isAbortFixEnabled?: boolean);
10
+ constructor(buffer: SourceBuffer);
12
11
  append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
13
12
  remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
14
13
  abort(init?: BufferSource): Promise<boolean>;
@@ -0,0 +1,10 @@
1
+ import type { IError } from "@vkontakte/videoplayer-shared";
2
+ import type { IHeuristicDeps } from "../types";
3
+ import type { ISyncHeuristic, HeuristicResult } from "./IHeuristic";
4
+ export declare class TvFetcherErrorHeuristic implements ISyncHeuristic {
5
+ private _deps;
6
+ static readonly heuristicName = "TvFetcherErrorHeuristic";
7
+ readonly type = "sync";
8
+ constructor(_deps: IHeuristicDeps);
9
+ analyze(error: IError): HeuristicResult;
10
+ }
@@ -3,5 +3,6 @@ export type { IMaydayDeps, IFallbackContext, IRecommendation, RecoveryAction, IM
3
3
  export type { ISyncHeuristic, IAsyncHeuristic, HeuristicResult } from "./heuristics/IHeuristic";
4
4
  export { MediaErrorHeuristic } from "./heuristics/MediaErrorHeuristic";
5
5
  export { FetcherErrorHeuristic } from "./heuristics/FetcherErrorHeuristic";
6
+ export { TvFetcherErrorHeuristic } from "./heuristics/TvFetcherErrorHeuristic";
6
7
  export { HangupHeuristic } from "./heuristics/HangupHeuristic";
7
8
  export { MaydayStatistics } from "./MaydayStatistics";
@@ -35,7 +35,6 @@ export default class ProviderContainer implements IProviderContainer {
35
35
  private tracer;
36
36
  private params;
37
37
  private currentProviderStarted;
38
- private currentFailedVideoTrack;
39
38
  private volumeMultiplierManager;
40
39
  private dashMaxTvVideoQuality;
41
40
  private mayday;
@@ -15,7 +15,6 @@ type LiveFormat = VideoFormat.WEB_RTC_LIVE | VideoFormat.HLS_LIVE | VideoFormat.
15
15
  type AllLiveFormats = [LiveFormat, LiveFormat, LiveFormat, LiveFormat, LiveFormat];
16
16
  export declare const getLiveFormatsPriority: ({ androidPreferredFormat, preferCMAF, preferWebRTC }: Constraints) => AllLiveFormats;
17
17
  export declare const getChromeCastFormatsPriority: (live: boolean) => VideoFormat[];
18
- export declare const selectCodec: (codecs: Set<string>) => string | undefined;
19
18
  type CodecStream = {
20
19
  codecs: string;
21
20
  hdr?: boolean;
@@ -15,15 +15,13 @@ export declare enum VideoRuleName {
15
15
  Buffer = "buffer_rule",
16
16
  Bola = "bola_rule",
17
17
  FitsContainer = "fits_container_rule",
18
- FailedVideoTrack = "failed_video_track_rule",
19
18
  TvDisabledVideoTrack = "tv_disabled_video_track_rule",
20
19
  Stalls = "stalls_rule",
21
20
  LowerLimit = "lower_limit_rule",
22
21
  UpperLimit = "upper_limit_rule",
23
22
  Throughput = "throughput_rule",
24
23
  AbandonRequest = "abandon_request_rule",
25
- InsufficientBuffer = "insufficient_buffer_rule",
26
- DownloadTime = "download_time_rule"
24
+ InsufficientBuffer = "insufficient_buffer_rule"
27
25
  }
28
26
  export declare enum AudioRuleName {
29
27
  MinAudioForVideo = "min_audio_for_video_rule",
@@ -41,7 +39,6 @@ export interface IUpdatableAbrManagerContext {
41
39
  desiredVideoTrack: Nullable<IVideoTrack>;
42
40
  limits: QualityLimits;
43
41
  forwardBufferHealth?: number;
44
- forwardBufferTarget: Milliseconds;
45
42
  forwardVideoBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
46
43
  forwardAudioBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
47
44
  forwardBufferDuration?: Milliseconds;
@@ -59,7 +56,6 @@ export interface IInitAbrManagerContext {
59
56
  rtt$: IValueSubject<Milliseconds>;
60
57
  throughputVariance$?: IValueSubject<number>;
61
58
  element: HTMLMediaElement;
62
- failedVideoTrack: Nullable<IVideoTrack>;
63
59
  abrLogger: IComponentLogger;
64
60
  panelSize?: IRectangle;
65
61
  }
@@ -122,7 +118,6 @@ export interface IVideoAbrContext extends IBaseAbrControllerContext {
122
118
  container: Nullable<IRectangle>;
123
119
  panelSize: Nullable<IRectangle>;
124
120
  forwardBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
125
- forwardBufferTarget: Milliseconds;
126
121
  limits: QualityLimits;
127
122
  visible: boolean;
128
123
  severeStallOccurred: boolean;
@@ -1,7 +1,5 @@
1
- import type { Kbps, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
1
+ import type { Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
2
2
  import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../../../player/types";
3
- import type { Segment } from "../parsers/types";
4
- export declare const computeForwardBitrate: (segments: Nullable<Segment[]>) => Kbps;
5
3
  export declare const bufferToPlaybackMs: (contentMs: Milliseconds | undefined, playbackRate: number) => Milliseconds;
6
4
  export declare enum CompareTrack {
7
5
  Descending = -1,
@@ -1 +1 @@
1
- export declare const destroy: (video: HTMLMediaElement, clearVideoElementInnerHTML: boolean) => void;
1
+ export declare const destroy: (video: HTMLMediaElement) => void;
@@ -1,7 +1,6 @@
1
1
  import type { ITuningConfig } from "../../../utils/tuningConfig";
2
- export type AllocateConstraints = Pick<ITuningConfig, "audioVideoSyncRate" | "disableYandexPiP" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
3
- type DisposeConstraints = Pick<ITuningConfig, "keepVideoElement" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
4
- export declare const allocate: (container: HTMLElement, { audioVideoSyncRate, disableYandexPiP, clearVideoElementInnerHTML, reuseOwnVideoElement }: ITuningConfig) => HTMLVideoElement;
2
+ type DisposeConstraints = Pick<ITuningConfig, "reuseOwnVideoElement">;
3
+ export declare const allocate: (container: HTMLElement, { audioVideoSyncRate, disableYandexPiP, reuseOwnVideoElement }: ITuningConfig) => HTMLVideoElement;
5
4
  export declare const initializeAudio: (element: HTMLAudioElement) => HTMLAudioElement;
6
5
  export declare const dispose: (element: HTMLMediaElement, constraints: DisposeConstraints) => void;
7
6
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { ITuningConfig } from "./tuningConfig";
2
- import type { Kbps, Milliseconds, IRectangle, QualityLimits, IComponentLogger, Nullable } from "@vkontakte/videoplayer-shared";
2
+ import type { Kbps, Milliseconds, IRectangle, QualityLimits, IComponentLogger } from "@vkontakte/videoplayer-shared";
3
3
  import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
4
4
  import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../player/types";
5
5
  interface IConstraints<T extends IBaseTrack> {
@@ -11,7 +11,6 @@ interface IConstraints<T extends IBaseTrack> {
11
11
  playbackRate?: number;
12
12
  forwardBufferHealth?: number;
13
13
  current?: T;
14
- failedVideoTrack?: Nullable<T>;
15
14
  visible?: boolean;
16
15
  history?: TrackHistory<T>;
17
16
  droppedVideoMaxQualityLimit?: ExactVideoQuality;
@@ -30,8 +29,8 @@ export declare class TrackHistory<T extends IBaseTrack> {
30
29
  export declare const defaultEmptyArrayErrorMessage = "Assertion \"ABR Tracks is empty array\" failed";
31
30
  export declare const getMinPossibleAudioForVideoOld: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], minVideoAudioRatio: number) => IAudioTrack | undefined;
32
31
  export declare const getMinPossibleAudioForVideoNew: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], minVideoAudioRatio: number) => IAudioTrack | undefined;
33
- export declare const autoSelectVideoTrackNew: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, failedVideoTrack, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize }: IConstraints<IVideoTrack>) => IVideoTrack;
34
- export declare const autoSelectVideoTrackOld: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, failedVideoTrack, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize }: IConstraints<IVideoTrack>) => IVideoTrack;
32
+ export declare const autoSelectVideoTrackNew: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize }: IConstraints<IVideoTrack>) => IVideoTrack;
33
+ export declare const autoSelectVideoTrackOld: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize }: IConstraints<IVideoTrack>) => IVideoTrack;
35
34
  export declare const autoSelectAudioTrackForVideoOld: (selectedVideoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], { estimatedThroughput, tuning, playbackRate, forwardBufferHealth, history, abrLogger, stallsPredictedThroughput }: IConstraints<IAudioTrack>) => IAudioTrack | undefined;
36
35
  export declare const autoSelectAudioTrackForVideoNew: (selectedVideoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], { estimatedThroughput, tuning, playbackRate, forwardBufferHealth, history, abrLogger, stallsPredictedThroughput }: IConstraints<IAudioTrack>) => IAudioTrack | undefined;
37
36
  export {};
@@ -0,0 +1,2 @@
1
+ import type { ITimers } from "@vkontakte/videoplayer-shared";
2
+ export declare const timers: ITimers;
@@ -2,7 +2,7 @@ import type { VideoCodecName, VideoFormat } from "../player/types";
2
2
  import { WebmCodecStrategy } from "../enums/WebmCodecStrategy";
3
3
  import { AndroidPreferredFormat } from "../enums/AndroidPreferredFormat";
4
4
  import { IOSPreferredFormat } from "../enums/IOSPreferredFormat";
5
- import type { Byte, Kbps, Milliseconds, RecursivePartial, Seconds } from "@vkontakte/videoplayer-shared";
5
+ import type { Byte, Kbps, Milliseconds, RecursivePartial, Seconds, TimerModule } from "@vkontakte/videoplayer-shared";
6
6
  import { type ExactVideoQuality, VideoQuality } from "@vkontakte/videoplayer-shared";
7
7
  import { AudioRuleName, VideoRuleName } from "../providers/utils/Abr/types";
8
8
  export type ITuningConfig = {
@@ -15,22 +15,10 @@ export type ITuningConfig = {
15
15
  heuristics: string[];
16
16
  };
17
17
  /**
18
- * Если true, внутренний video элемент не будет уничтожаться при реините провайдера
19
- * и при создании нового экземляра Player.
20
- * Будет веcти себя аналогично элементу переданному снаружи
21
- * Для кейса прямого использовани ядра
22
- */
23
- keepVideoElement: boolean;
24
- /**
25
- * Временный флаг для тестирования очистки video элемента
26
- * Если true, при очистке будет вызван innerHTML = '' для очистки дочерних элементов трэков
27
- * В противном случае они размножаются
28
- */
29
- clearVideoElementInnerHTML: boolean;
30
- /**
31
18
  * Включает очистку состояния плеера при вызове метода stop()
32
19
  */
33
20
  allowPlayerReuse: boolean;
21
+ useWorkerTimers: TimerModule[];
34
22
  throughputEstimator: {
35
23
  type: "TwoEma" | "EmaAndMa";
36
24
  emaAlphaSlow: number;
@@ -159,7 +147,6 @@ export type ITuningConfig = {
159
147
  forwardBufferTargetManual: Milliseconds;
160
148
  forwardBufferTargetPreload: Milliseconds;
161
149
  audioBufferAheadOfVideoMs: Milliseconds;
162
- useDynamicBufferTarget: boolean;
163
150
  seekBiasInTheEnd: Milliseconds;
164
151
  maxSegmentDurationLeftToSelectNextSegment: Milliseconds;
165
152
  minSafeBufferThreshold: number;
@@ -182,14 +169,12 @@ export type ITuningConfig = {
182
169
  useSmartRepresentationSwitch: boolean;
183
170
  stallForceSeekOncePerStall: boolean;
184
171
  useFetchPriorityHints: boolean;
185
- useAbortMSEFix: boolean;
186
172
  enableBaseUrlSupport: boolean;
187
173
  maxSegmentRetryCount: number;
188
174
  sourceOpenTimeout: number;
189
175
  vktvAbrThrottle: number;
190
176
  timeupdateEventTickThrottle: number;
191
177
  fetcherBufferOptimisation: boolean;
192
- codecsPrioritizeEnabled: boolean;
193
178
  usePersistentGaps: boolean;
194
179
  abrThrottle: number;
195
180
  useVideoElementWaitingCurrentTimeReassign: boolean;
@@ -208,9 +193,7 @@ export type ITuningConfig = {
208
193
  abrVideoRules: VideoRuleName[];
209
194
  abrAudioRules: AudioRuleName[];
210
195
  useDynamicBirtateRule: boolean;
211
- useNewFailoverLogic: boolean;
212
196
  useFailoverHostsOnAllProviderCrash: boolean;
213
- videoTrackBanAfterProviderFail: Milliseconds;
214
197
  saveData3gQualityLimit: ExactVideoQuality;
215
198
  saveData2gQualityLimit: ExactVideoQuality;
216
199
  useConnectionDataUpperLimit: boolean;
@@ -238,26 +221,14 @@ export type ITuningConfig = {
238
221
  budgetFactor: number;
239
222
  fallbackSegmentDurationMs: Milliseconds;
240
223
  };
241
- dynamicBufferTarget: {
242
- maxMs: Milliseconds;
243
- optimisticHeadroomLow: number;
244
- optimisticHeadroomHigh: number;
245
- weakThroughputLowKbps: Kbps;
246
- weakThroughputHighKbps: Kbps;
247
- maxFactor: number;
248
- };
249
224
  videoStreamRepresentaionsFilter: [VideoQuality, number, VideoCodecName][];
250
225
  filterOnDemandQualityList: boolean;
251
226
  dashMaxTvVideoQuality: boolean;
252
227
  checkRepresentationCanPlayType: Extract<CanPlayTypeResult, "maybe" | "probably"> | false;
253
228
  preloadFirstSegment: boolean;
254
229
  maxQualityForFirstSegmentPreload: ExactVideoQuality;
255
- downloadTime: {
256
- minLookaheadSegments: number;
257
- safetyFactor: number;
258
- bootstrapBufferMs: Milliseconds;
259
- demandTolerance: number;
260
- };
230
+ /** Включает отправку телеметрии трейсера (resume) при превышении stall watchdog */
231
+ tracerResumeOnUnexpectedStall: boolean;
261
232
  };
262
233
  dashCmafLive: {
263
234
  externalStopControl: boolean;
@@ -454,6 +425,14 @@ export type ITuningConfig = {
454
425
  useDurationFromSegments: boolean;
455
426
  /** включен режим проигрывания только аудио (без видео) */
456
427
  audioOnly: boolean;
428
+ /**
429
+ * Переводить провайдер в READY по loadedmetadata вместо canplay.
430
+ * canplay означает, что видео уже может играться, что избыточно для READY —
431
+ * достаточно получить манифест (loadedmetadata).
432
+ * Применяется только когда желаемое состояние — READY (preload): при автоплее
433
+ * провайдер по-прежнему ждёт canplay, чтобы play() не вызывался до появления данных.
434
+ */
435
+ readyOnLoadedMetadata: boolean;
457
436
  };
458
437
  export type IOptionalTuningConfig = RecursivePartial<ITuningConfig>;
459
438
  export declare const fillDefault: (partial: IOptionalTuningConfig) => ITuningConfig;
@@ -1,15 +0,0 @@
1
- import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
2
- import type { IVideoTrack } from "../../../../../player/types";
3
- import type { Kbps, Milliseconds } from "@vkontakte/videoplayer-shared";
4
- import { LimitAboveRule } from "../limitAboveRule";
5
- import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
6
- type DownloadTimeLogsArgs = [estimatedThroughput: Kbps, forwardBufferDuration: Milliseconds, simulatedFinalBufferMs: Milliseconds | null];
7
- export declare class DownloadTimeRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, DownloadTimeLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
8
- constructor(phaseConfig: RulePhaseConfig);
9
- execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
10
- private buildReferenceTimeline;
11
- private resolveLookaheadCount;
12
- private simulate;
13
- protected createLogMessage(selectedTrack: IVideoTrack, estimatedThroughput: Kbps, forwardBufferDuration: Milliseconds, simulatedFinalBufferMs: Milliseconds | null): string;
14
- }
15
- export {};
@@ -1,14 +0,0 @@
1
- import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext } from "../../types";
2
- import type { IVideoTrack } from "../../../../../player/types";
3
- import type { Nullable } from "@vkontakte/videoplayer-shared";
4
- import { LimitAboveRule } from "../limitAboveRule";
5
- import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
6
- type FailedVideoTracLogsArgs = [banTrack: Nullable<IVideoTrack>];
7
- export declare class FailedVideoTrackRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, FailedVideoTracLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
8
- protected banTrack: Nullable<IVideoTrack>;
9
- constructor(phaseConfig: RulePhaseConfig);
10
- init(initContext: IRuleInitContext): void;
11
- execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
12
- protected createLogMessage(selectedTrack: IVideoTrack, banTrack: Nullable<IVideoTrack>): string;
13
- }
14
- export {};
@@ -1,10 +0,0 @@
1
- import type { Kbps, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
2
- import type { ITuningConfig } from "../tuningConfig";
3
- type DynamicBufferTargetConfig = ITuningConfig["dash"]["dynamicBufferTarget"];
4
- export interface IDynamicBufferTargetState {
5
- throughputKbps: Kbps;
6
- currentBitrateKbps: Nullable<Kbps>;
7
- baseTargetMs: Milliseconds;
8
- }
9
- export declare const computeDynamicBufferTarget: (state: IDynamicBufferTargetState, config: DynamicBufferTargetConfig) => Milliseconds;
10
- export {};