@vkontakte/videoplayer-core 2.0.161 → 2.0.162-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.
Files changed (111) hide show
  1. package/es2015.cjs +60 -34
  2. package/es2015.esm.js +71 -45
  3. package/esnext.cjs +60 -34
  4. package/esnext.esm.js +60 -34
  5. package/evergreen.esm.js +60 -34
  6. package/package.json +2 -2
  7. package/types/index.d.ts +12 -11
  8. package/types/player/Player.d.ts +2 -2
  9. package/types/player/types.d.ts +15 -4
  10. package/types/player/utils/defaults.d.ts +2 -2
  11. package/types/player/utils/optimisticPosition.d.ts +2 -2
  12. package/types/player/utils/selectContainer.d.ts +1 -1
  13. package/types/providers/ChromecastPresentationApiProvider/ChromecastPresentationApiInitializer.d.ts +1 -1
  14. package/types/providers/ChromecastProvider/ChromecastInitializer/index.d.ts +1 -1
  15. package/types/providers/ChromecastProvider/ChromecastInitializer/types.d.ts +1 -1
  16. package/types/providers/ChromecastProvider/types.d.ts +1 -1
  17. package/types/providers/DashLiveProvider/DashLiveProvider.d.ts +2 -2
  18. package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +3 -3
  19. package/types/providers/DashProvider/baseDashProvider.d.ts +13 -12
  20. package/types/providers/DashProvider/lib/LiveTextManager.d.ts +1 -1
  21. package/types/providers/DashProvider/lib/buffer.d.ts +6 -3
  22. package/types/providers/DashProvider/lib/fetcher.d.ts +3 -3
  23. package/types/providers/DashProvider/lib/player.d.ts +12 -7
  24. package/types/providers/DashProvider/lib/types.d.ts +3 -3
  25. package/types/providers/DashProvider/lib/utils.d.ts +3 -3
  26. package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +15 -14
  27. package/types/providers/DashProviderVirtual/dashCmafLiveProvider.d.ts +1 -1
  28. package/types/providers/DashProviderVirtual/dashProvider.d.ts +1 -1
  29. package/types/providers/DashProviderVirtual/lib/LiveTextManager.d.ts +2 -2
  30. package/types/providers/DashProviderVirtual/lib/buffer/types.d.ts +7 -3
  31. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts +9 -6
  32. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/byteRangeVirtualBufferManager.d.ts +5 -5
  33. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/liveVirtualBuffer.d.ts +5 -5
  34. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/templateVirtualBufferManager.d.ts +5 -5
  35. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/virtualBufferFactory.d.ts +3 -3
  36. package/types/providers/DashProviderVirtual/lib/fetcher.d.ts +3 -3
  37. package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +14 -10
  38. package/types/providers/DashProviderVirtual/lib/player/livePlayer.d.ts +8 -8
  39. package/types/providers/DashProviderVirtual/lib/player/player.d.ts +2 -2
  40. package/types/providers/DashProviderVirtual/lib/player/types.d.ts +5 -4
  41. package/types/providers/DashProviderVirtual/lib/types.d.ts +3 -3
  42. package/types/providers/DashProviderVirtual/lib/utils.d.ts +4 -4
  43. package/types/providers/HlsLiveProvider/LiveTextManager.d.ts +1 -1
  44. package/types/providers/HlsLiveProvider/index.d.ts +3 -3
  45. package/types/providers/HlsProvider/index.d.ts +2 -2
  46. package/types/providers/HlsProvider/manifestDataExtractor.d.ts +1 -1
  47. package/types/providers/MpegProvider/index.d.ts +1 -1
  48. package/types/providers/ProviderContainer/index.d.ts +5 -3
  49. package/types/providers/ProviderContainer/types.d.ts +1 -1
  50. package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +11 -4
  51. package/types/providers/ProviderContainer/utils/playbackHangup.d.ts +3 -3
  52. package/types/providers/WebRTCLiveProvider/WebRTCLiveClient.d.ts +1 -1
  53. package/types/providers/WebRTCLiveProvider/WebRTCLiveProvider.d.ts +2 -2
  54. package/types/providers/types.d.ts +8 -8
  55. package/types/providers/utils/Abr/abrController.d.ts +8 -5
  56. package/types/providers/utils/Abr/abrManager.d.ts +5 -3
  57. package/types/providers/utils/Abr/controllers/abrPhaseController.d.ts +17 -0
  58. package/types/providers/utils/Abr/controllers/stallsController.d.ts +2 -2
  59. package/types/providers/utils/Abr/rules/audio/audioThroughputRule.d.ts +6 -5
  60. package/types/providers/utils/Abr/rules/audio/minAudioForVideoRule.d.ts +6 -5
  61. package/types/providers/utils/Abr/rules/audioRuleFactory.d.ts +5 -5
  62. package/types/providers/utils/Abr/rules/baseRule.d.ts +10 -6
  63. package/types/providers/utils/Abr/rules/limitAboveRule.d.ts +5 -4
  64. package/types/providers/utils/Abr/rules/limitBelowRule.d.ts +5 -4
  65. package/types/providers/utils/Abr/rules/video/abandonRequestRule.d.ts +12 -0
  66. package/types/providers/utils/Abr/rules/video/bolaRule.d.ts +31 -0
  67. package/types/providers/utils/Abr/rules/video/bufferRule.d.ts +10 -5
  68. package/types/providers/utils/Abr/rules/video/failedVideoTrackRule.d.ts +6 -5
  69. package/types/providers/utils/Abr/rules/video/fitsContainerRule.d.ts +6 -5
  70. package/types/providers/utils/Abr/rules/video/insufficientBufferRule.d.ts +15 -0
  71. package/types/providers/utils/Abr/rules/video/lowerLimitRule.d.ts +5 -4
  72. package/types/providers/utils/Abr/rules/video/stallsRule.d.ts +6 -5
  73. package/types/providers/utils/Abr/rules/video/throughputRule.d.ts +8 -7
  74. package/types/providers/utils/Abr/rules/video/upperLimitRule.d.ts +5 -4
  75. package/types/providers/utils/Abr/rules/videoRuleFactory.d.ts +4 -3
  76. package/types/providers/utils/Abr/trackHistory.d.ts +1 -1
  77. package/types/providers/utils/Abr/types.d.ts +34 -8
  78. package/types/providers/utils/Abr/utils.d.ts +3 -2
  79. package/types/providers/utils/HTMLVideoElement/DroppedFramesManager.d.ts +3 -3
  80. package/types/providers/utils/HTMLVideoElement/ElementSizeManager.d.ts +1 -1
  81. package/types/providers/utils/HTMLVideoElement/TextTrackManager.d.ts +2 -2
  82. package/types/providers/utils/HTMLVideoElement/observable.d.ts +1 -1
  83. package/types/providers/utils/HTMLVideoElement/pool.d.ts +1 -1
  84. package/types/providers/utils/StallsManager.d.ts +2 -2
  85. package/types/providers/utils/extractConnectionHeaders.d.ts +1 -1
  86. package/types/providers/utils/parsers/types.d.ts +2 -1
  87. package/types/providers/utils/syncDesiredState.d.ts +2 -2
  88. package/types/providers/utils/syncPlaybackState.d.ts +2 -2
  89. package/types/providers/utils/videoStreamRepresentaionsFilter.d.ts +1 -1
  90. package/types/utils/3d/Camera3D.d.ts +1 -1
  91. package/types/utils/3d/CameraRotationManager.d.ts +2 -2
  92. package/types/utils/3d/Scene3D.d.ts +1 -1
  93. package/types/utils/ClientChecker/services/AudioChecker.d.ts +1 -1
  94. package/types/utils/ClientChecker/services/BrowserChecker.d.ts +2 -2
  95. package/types/utils/ClientChecker/services/DeviceChecker.d.ts +3 -3
  96. package/types/utils/ClientChecker/services/DisplayChecker.d.ts +1 -1
  97. package/types/utils/ClientChecker/services/VideoChecker.d.ts +2 -2
  98. package/types/utils/ThroughputEstimator.d.ts +2 -1
  99. package/types/utils/VolumeMultiplierManager/VolumeMultiplierManager.d.ts +2 -2
  100. package/types/utils/autoSelectTrack.d.ts +2 -2
  101. package/types/utils/dashMaxTvVideoQuality.d.ts +7 -0
  102. package/types/utils/qualityLimits.d.ts +2 -2
  103. package/types/utils/setStateWithSubscribe.d.ts +1 -1
  104. package/types/utils/smoothedValue/baseSmoothedValue.d.ts +2 -1
  105. package/types/utils/smoothedValue/emaAndMaSmoothedValue.d.ts +2 -2
  106. package/types/utils/smoothedValue/emaTopExtremumValue.d.ts +2 -2
  107. package/types/utils/smoothedValue/smoothedValueFactory.d.ts +2 -2
  108. package/types/utils/smoothedValue/twoEmaSmoothedValue.d.ts +2 -2
  109. package/types/utils/smoothedValue/types.d.ts +1 -0
  110. package/types/utils/tuningConfig.d.ts +45 -6
  111. package/types/utils/videoFormat.d.ts +1 -1
@@ -1,17 +1,18 @@
1
- import type { HttpConnectionMetrics, HttpConnectionType, HttpDownloadMetrics, IHLSSource, VideoCodec } from "../../../../player/types";
1
+ import type { HttpConnectionMetrics, HttpConnectionType, HttpDownloadMetrics, IHLSSource, VideoCodec } from "#/player/types";
2
2
  import type { LiveStreamStatus } from "../types";
3
- import type { CommonInit, Manifest, Representation, Segment, TextRepresentation } from "../../../utils/parsers/types";
4
- import { StreamKind } from "../../../utils/parsers/types";
5
- import StateMachine from "../../../../utils/StateMachine/StateMachine";
6
- import type ThroughputEstimator from "../../../../utils/ThroughputEstimator";
7
- import type { ITuningConfig } from "../../../../utils/tuningConfig";
3
+ import type { CommonInit, Manifest, Representation, Segment, TextRepresentation } from "#/providers/utils/parsers/types";
4
+ import { StreamKind } from "#/providers/utils/parsers/types";
5
+ import StateMachine from "#/utils/StateMachine/StateMachine";
6
+ import type ThroughputEstimator from "#/utils/ThroughputEstimator";
7
+ import type { ITuningConfig } from "#/utils/tuningConfig";
8
8
  import type { IError, IRange, ISubject, ISubscription, ITracer, IValueSubject, Milliseconds, Nullable, Seconds } from "@vkontakte/videoplayer-shared";
9
9
  import { abortable, Subject, Subscription, SubscriptionRemovable } from "@vkontakte/videoplayer-shared";
10
+ import type { VideoSegmentLoadProgress } from "#/providers/utils/Abr/types";
10
11
  import { Fetcher } from "../fetcher";
11
- import type { Dependencies, IVirtualBufferManager, SwithRepresentationMode } from "../buffer/types";
12
- import type { Params } from "./types";
13
- import { State } from "./types";
14
- import { NativeBufferManager } from "../buffer/nativeBufferManager";
12
+ import type { Dependencies, IVirtualBufferManager, SwithRepresentationMode } from "#/providers/DashProviderVirtual/lib/buffer/types";
13
+ import type { Params } from "#/providers/DashProviderVirtual/lib/player/types";
14
+ import { State } from "#/providers/DashProviderVirtual/lib/player/types";
15
+ import { NativeBufferManager } from "#/providers/DashProviderVirtual/lib/buffer/nativeBufferManager";
15
16
  export declare abstract class BasePlayer {
16
17
  protected element: HTMLVideoElement | null;
17
18
  protected manifestUrlString: string;
@@ -72,6 +73,7 @@ export declare abstract class BasePlayer {
72
73
  fetcherError$: Subject<IError>;
73
74
  updateDurationError$: Subject<IError>;
74
75
  private isOnDemand;
76
+ private dashMaxTvVideoQuality;
75
77
  protected constructor(params: Params);
76
78
  protected abstract prepareManifestUrlString(manifestBaseUrlString: string, offset: number): string;
77
79
  protected abstract setSourceInitDuration(): void;
@@ -83,6 +85,8 @@ export declare abstract class BasePlayer {
83
85
  seek(requestedPosition: Milliseconds, forcePrecise?: boolean): Promise<void>;
84
86
  warmUpMediaSourceIfNeeded(position?: Milliseconds | undefined): void;
85
87
  getForwardBufferRepresentations(kind: Exclude<StreamKind, StreamKind.TEXT>): Map<Representation["id"], Segment[]> | undefined;
88
+ getActiveVideoSegmentProgress(): VideoSegmentLoadProgress | undefined;
89
+ getMpdVideoSegmentDuration(): Milliseconds | undefined;
86
90
  get isStreamEnded(): boolean;
87
91
  getStreams(): Manifest["streams"] | undefined;
88
92
  getCodecs(): Manifest["codecs"] | undefined;
@@ -1,12 +1,12 @@
1
- import { BasePlayer } from "./basePlayer";
2
- import type { ISmoothedValue } from "../../../../utils/smoothedValue/types";
1
+ import { BasePlayer } from "#/providers/DashProviderVirtual/lib/player/basePlayer";
2
+ import type { ISmoothedValue } from "#/utils/smoothedValue/types";
3
3
  import type { ISubscription, Milliseconds } from "@vkontakte/videoplayer-shared";
4
- import type { Params } from "./types";
5
- import type { Manifest, Representation } from "../../../utils/parsers/types";
6
- import type { LiveVirtualBuffer } from "../buffer/virtualBuffer/liveVirtualBuffer";
7
- import type { IHLSSource } from "../../../../player/types";
8
- import { LiveTextManager } from "../LiveTextManager";
9
- import type { Dependencies } from "../buffer/types";
4
+ import type { Params } from "#/providers/DashProviderVirtual/lib/player/types";
5
+ import type { Manifest, Representation } from "#/providers/utils/parsers/types";
6
+ import type { LiveVirtualBuffer } from "#/providers/DashProviderVirtual/lib/buffer/virtualBuffer/liveVirtualBuffer";
7
+ import type { IHLSSource } from "#/player/types";
8
+ import { LiveTextManager } from "#/providers/DashProviderVirtual/lib/LiveTextManager";
9
+ import type { Dependencies } from "#/providers/DashProviderVirtual/lib/buffer/types";
10
10
  export declare class LivePlayer extends BasePlayer {
11
11
  protected liveTextManager: LiveTextManager | null;
12
12
  protected liveStreamEndTimestamp: Milliseconds;
@@ -1,5 +1,5 @@
1
- import { BasePlayer } from "./basePlayer";
2
- import type { Params } from "./types";
1
+ import { BasePlayer } from "#/providers/DashProviderVirtual/lib/player/basePlayer";
2
+ import type { Params } from "#/providers/DashProviderVirtual/lib/player/types";
3
3
  export declare class Player extends BasePlayer {
4
4
  constructor(params: Params);
5
5
  protected prepareManifestUrlString(manifestBaseUrlString: string, _offset: number): string;
@@ -1,7 +1,7 @@
1
- import type ThroughputEstimator from "../../../../utils/ThroughputEstimator";
2
- import type { ITuningConfig } from "../../../../utils/tuningConfig";
3
- import type { VideoCodec } from "../../../../player/types";
4
- import type { ITracer } from "@vkontakte/videoplayer-shared";
1
+ import type ThroughputEstimator from "#/utils/ThroughputEstimator";
2
+ import type { ITuningConfig } from "#/utils/tuningConfig";
3
+ import type { VideoCodec } from "#/player/types";
4
+ import type { ExactVideoQuality, ITracer, Nullable } from "@vkontakte/videoplayer-shared";
5
5
  export declare enum State {
6
6
  NONE = "none",
7
7
  MANIFEST_READY = "manifest_ready",
@@ -15,4 +15,5 @@ export interface Params {
15
15
  forceVideoCodec?: VideoCodec;
16
16
  tracer: ITracer;
17
17
  isOnDemand?: boolean;
18
+ dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
18
19
  }
@@ -1,7 +1,7 @@
1
1
  import type { IObservable, ISubject, IValueSubject } from "@vkontakte/videoplayer-shared";
2
- import type { IDesiredState, IProviderOutput, IProviderParams } from "../../types";
3
- import type { IObservableVideo } from "../../utils/HTMLVideoElement/observable";
4
- import type { IDashURLSource } from "../../../player/types";
2
+ import type { IDesiredState, IProviderOutput, IProviderParams } from "#/providers/types";
3
+ import type { IObservableVideo } from "#/providers/utils/HTMLVideoElement/observable";
4
+ import type { IDashURLSource } from "#/player/types";
5
5
  export declare enum LiveStatus {
6
6
  ActiveLowLatency = "active_low_latency",
7
7
  LiveWithTargetOffset = "live_with_target_offset",
@@ -1,13 +1,13 @@
1
- import type { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from "../../utils/parsers/types";
2
- import type { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from "../../../player/types";
3
- export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString, streamId }: Representation) => IVideoTrack | undefined;
1
+ import type { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from "#/providers/utils/parsers/types";
2
+ import type { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from "#/player/types";
3
+ export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString, streamId, tvDisabled }: Representation) => IVideoTrack | undefined;
4
4
  export declare const representationToAudioTrack: ({ id, bitrate }: Representation) => IAudioTrack;
5
5
  export declare const representationToTextTrack: ({ language, label }: Stream, { id, url, isAuto }: Representation & {
6
6
  url: string;
7
7
  isAuto: boolean;
8
8
  }) => IInternalTextTrack;
9
9
  export declare const textRepresentationToTextTrack: ({ language, label, id, url, isAuto }: TextRepresentation) => IInternalTextTrack;
10
- export declare const streamToIAudioStream: ({ id, language, label, codecs, isDefault }: Stream) => IAudioStream;
10
+ export declare const streamToIAudioStream: ({ id, language, label, codecs, isDefault, channels }: Stream) => IAudioStream;
11
11
  export declare const streamToIVideoStream: ({ id, language, label, hdr, codecs }: Stream) => IVideoStream;
12
12
  export declare const isTemplateSegment: (segment: Segment) => segment is TemplateSegment;
13
13
  export declare const isTemplateSegmentReference: (segmentReference: SegmentReference) => segmentReference is TemplateSegmentReference;
@@ -1,4 +1,4 @@
1
- import type { IInternalTextTrack } from "../../player/types";
1
+ import type { IInternalTextTrack } from "#/player/types";
2
2
  import type { IValueSubject, Milliseconds, IError, ISubject } from "@vkontakte/videoplayer-shared";
3
3
  import type { HLSManifestData } from "../HlsProvider/manifestDataExtractor";
4
4
  type FetchManifestData = (url: string, init?: RequestInit) => Promise<HLSManifestData>;
@@ -1,6 +1,6 @@
1
- import type { IHLSLiveSource } from "../../player/types";
2
- import { VideoFormat } from "../../player/types";
3
- import type { IProvider, IProviderParams } from "../types";
1
+ import type { IHLSLiveSource } from "#/player/types";
2
+ import { VideoFormat } from "#/player/types";
3
+ import type { IProvider, IProviderParams } from "#/providers/types";
4
4
  import type { Milliseconds } from "@vkontakte/videoplayer-shared";
5
5
  type Params = IProviderParams<IHLSLiveSource> & {
6
6
  config: {
@@ -1,5 +1,5 @@
1
- import type { IHLSSource } from "../../player/types";
2
- import type { IProvider, IProviderParams } from "../types";
1
+ import type { IHLSSource } from "#/player/types";
2
+ import type { IProvider, IProviderParams } from "#/providers/types";
3
3
  type Params = IProviderParams<IHLSSource> & {
4
4
  isOnDemand: boolean;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import type { Kbps, IRectangle, VideoQuality } from "@vkontakte/videoplayer-shared";
2
- import type { IInternalTextTrack } from "../../player/types";
2
+ import type { IInternalTextTrack } from "#/player/types";
3
3
  export type ManifestUrl = {
4
4
  id: string;
5
5
  quality: VideoQuality;
@@ -1,4 +1,4 @@
1
- import type { IMpegSource } from "../../player/types";
1
+ import type { IMpegSource } from "#/player/types";
2
2
  import type { IProvider, IProviderParams } from "../types";
3
3
  type Params = IProviderParams<IMpegSource>;
4
4
  export default class MpegProvider implements IProvider {
@@ -1,6 +1,6 @@
1
- import type { IMetadata, ISources } from "../../player/types";
2
- import { VideoFormat } from "../../player/types";
3
- import type { ITuningConfig } from "../../utils/tuningConfig";
1
+ import type { IMetadata, ISources } from "#/player/types";
2
+ import { VideoFormat } from "#/player/types";
3
+ import type { ITuningConfig } from "#/utils/tuningConfig";
4
4
  import type { IError, ISubject, IValueSubject, IRectangle } from "@vkontakte/videoplayer-shared";
5
5
  import { ValueSubject } from "@vkontakte/videoplayer-shared";
6
6
  import type { IDesiredState, IProviderDependencies, IProviderOutput } from "../types";
@@ -15,6 +15,7 @@ interface IParams extends IProviderDependencies {
15
15
  volumeMultiplier?: number;
16
16
  panelSize?: IRectangle;
17
17
  skipVideoElVolumeSync$: ValueSubject<boolean>;
18
+ handleNetworkRecoverableErrorAsProviderError?: boolean;
18
19
  }
19
20
  export default class ProviderContainer implements IProviderContainer {
20
21
  current$: IValueSubject<IProviderEntry>;
@@ -36,6 +37,7 @@ export default class ProviderContainer implements IProviderContainer {
36
37
  private failoverIndex;
37
38
  private currentFailedVideoTrack;
38
39
  private volumeMultiplierManager;
40
+ private dashMaxTvVideoQuality;
39
41
  constructor(params: IParams);
40
42
  init(): void;
41
43
  destroy(): void;
@@ -1,5 +1,5 @@
1
1
  import type { ISubject, IValueObservable, IError } from "@vkontakte/videoplayer-shared";
2
- import type { VideoDestination, VideoFormat } from "../../player/types";
2
+ import type { VideoDestination, VideoFormat } from "#/player/types";
3
3
  import type { IProvider, IProviderOutput } from "../types";
4
4
  export interface IProviderContainer {
5
5
  current$: IValueObservable<IProviderEntry>;
@@ -1,5 +1,6 @@
1
- import { VideoFormat, VideoCodec, AudioCodec } from "../../../player/types";
2
- import { type ITuningConfig } from "../../../utils/tuningConfig";
1
+ import type { VideoCodec } from "#/player/types";
2
+ import { VideoFormat, VideoCodecName, AudioCodec } from "#/player/types";
3
+ import { type ITuningConfig } from "#/utils/tuningConfig";
3
4
  type VodFormat = VideoFormat.MPEG | VideoFormat.DASH_SEP | VideoFormat.DASH_WEBM | VideoFormat.DASH_WEBM_AV1 | VideoFormat.DASH_STREAMS | VideoFormat.DASH_ONDEMAND | VideoFormat.HLS | VideoFormat.HLS_FMP4 | VideoFormat.HLS_ONDEMAND;
4
5
  type Constraints = Pick<ITuningConfig, "webmCodec" | "androidPreferredFormat" | "iosPreferredFormat" | "preferCMAF" | "preferWebRTC" | "preferMultiStream">;
5
6
  /**
@@ -15,7 +16,13 @@ type AllLiveFormats = [LiveFormat, LiveFormat, LiveFormat, LiveFormat, LiveForma
15
16
  export declare const getLiveFormatsPriority: ({ androidPreferredFormat, preferCMAF, preferWebRTC }: Constraints) => AllLiveFormats;
16
17
  export declare const getChromeCastFormatsPriority: (live: boolean) => VideoFormat[];
17
18
  export declare const selectCodec: (codecs: Set<string>) => string | undefined;
18
- export declare const filterAvailableVideoCodecs: (codecs: string[]) => VideoCodec[];
19
+ type CodecStream = {
20
+ codecs: string;
21
+ hdr?: boolean;
22
+ };
23
+ export declare const filterAvailableVideoCodecs: (streams: CodecStream[], { preferHdr }: {
24
+ preferHdr: boolean;
25
+ }) => VideoCodec[];
19
26
  export declare const filterAvailableAudioCodecs: (codecs: string[]) => AudioCodec[];
20
- export declare const convertCodecName: <T extends VideoCodec | AudioCodec>(codec: string) => T;
27
+ export declare const convertCodecName: <T extends VideoCodecName | AudioCodec>(codec: string) => T;
21
28
  export {};
@@ -1,8 +1,8 @@
1
- import type { IProviderEntry } from "../types";
1
+ import type { IProviderEntry } from "#/providers/ProviderContainer/types";
2
2
  import type { IObservable, Milliseconds } from "@vkontakte/videoplayer-shared";
3
3
  import { Observable } from "@vkontakte/videoplayer-shared";
4
- import type { IStateMachine } from "../../../utils/StateMachine/types";
5
- import { PlaybackState } from "../../../player/types";
4
+ import type { IStateMachine } from "#/utils/StateMachine/types";
5
+ import { PlaybackState } from "#/player/types";
6
6
  interface IParams {
7
7
  desiredPlaybackState$: IStateMachine<PlaybackState>;
8
8
  position$: IObservable<number>;
@@ -1,4 +1,4 @@
1
- import type { WebRTCLiveClientOptions } from "./interface/WebRTCLiveClientOptions";
1
+ import type { WebRTCLiveClientOptions } from "#/providers/WebRTCLiveProvider/interface/WebRTCLiveClientOptions";
2
2
  /**
3
3
  *
4
4
  */
@@ -1,5 +1,5 @@
1
- import type { IProvider, IProviderParams } from "../types";
2
- import type { URLSource } from "../../player/types";
1
+ import type { IProvider, IProviderParams } from "#/providers/types";
2
+ import type { URLSource } from "#/player/types";
3
3
  /**
4
4
  * @class WebRTCLiveProvider
5
5
  *
@@ -1,12 +1,12 @@
1
- import type { ITuningConfig } from "../utils/tuningConfig";
1
+ import type { ITuningConfig } from "#/utils/tuningConfig";
2
2
  import type { ILogger, ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IComponentLogger, ITracer, IRectangle } from "@vkontakte/videoplayer-shared";
3
- import type { IChromecastInitializer } from "./ChromecastProvider/ChromecastInitializer/types";
4
- import type { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics, VideoCodec, AudioCodec, IAudioStream, IAudioTrack, ICueSettings, ISources, IVideoStream, SeekState } from "../player/types";
5
- import type { IExternalTextTrack, IInternalTextTrack, ITextTrack, IVideoTrack, IVolumeState, PlaybackState, PlaybackRate } from "../player/types";
6
- import type { IStateMachine } from "../utils/StateMachine/types";
7
- import type ThroughputEstimator from "../utils/ThroughputEstimator";
8
- import type { Scene3D } from "../utils/3d/Scene3D";
9
- import type { Vector2D } from "../utils/3d/types";
3
+ import type { IChromecastInitializer } from "#/providers/ChromecastProvider/ChromecastInitializer/types";
4
+ import type { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics, VideoCodec, AudioCodec, IAudioStream, IAudioTrack, ICueSettings, ISources, IVideoStream, SeekState } from "#/player/types";
5
+ import type { IExternalTextTrack, IInternalTextTrack, ITextTrack, IVideoTrack, IVolumeState, PlaybackState, PlaybackRate } from "#/player/types";
6
+ import type { IStateMachine } from "#/utils/StateMachine/types";
7
+ import type ThroughputEstimator from "#/utils/ThroughputEstimator";
8
+ import type { Scene3D } from "#/utils/3d/Scene3D";
9
+ import type { Vector2D } from "#/utils/3d/types";
10
10
  export interface IProvider {
11
11
  scene3D?: Scene3D;
12
12
  destroy(): void;
@@ -1,15 +1,18 @@
1
- import type { IAbrController, IAbrRule, IBaseAbrControllerContext, IInitAbrManagerContext } from "./types";
2
- import type { IBaseTrack } from "../../../player/types";
1
+ import type { IAbrController, IAbrRule, IBaseAbrControllerContext, IRuleInitContext } from "#/providers/utils/Abr/types";
2
+ import type { IBaseTrack } from "#/player/types";
3
3
  export default class AbrController<
4
4
  T extends IBaseTrack,
5
5
  C extends IBaseAbrControllerContext
6
6
  > implements IAbrController<T> {
7
7
  private history;
8
8
  private rules;
9
- private context;
10
- init(rules: IAbrRule<T, C>[], initContext: IInitAbrManagerContext): void;
9
+ private _context;
10
+ get context(): C;
11
+ init(rules: IAbrRule<T, C>[], initContext: IRuleInitContext): void;
11
12
  destroy(): void;
12
13
  updateContext(context: C): void;
13
- autoSelectTrack(): T;
14
+ autoSelectTrack(rules?: IAbrRule<T, C>[]): T;
14
15
  private selectTrackBasedOnHistory;
16
+ /** при переключении аудио стрима очищаем историю для предотвращения залипания в `onCooldown` */
17
+ historyReset(): void;
15
18
  }
@@ -1,6 +1,6 @@
1
- import type { IAudioTrack, IVideoTrack } from "../../../player/types";
2
- import type { IInitAbrManagerContext, IUpdatableAbrManagerContext } from "./types";
3
- import { StreamKind } from "../parsers/types";
1
+ import type { IAudioTrack, IVideoTrack } from "#/player/types";
2
+ import type { IInitAbrManagerContext, IUpdatableAbrManagerContext } from "#/providers/utils/Abr/types";
3
+ import { StreamKind } from "#/providers/utils/parsers/types";
4
4
  export declare class AbrManager {
5
5
  private stallsController;
6
6
  private videoAbrController;
@@ -8,6 +8,8 @@ export declare class AbrManager {
8
8
  private subscription;
9
9
  private lastVideoTrackSelected$;
10
10
  private context;
11
+ private phaseController;
12
+ private allVideoRules;
11
13
  init(context: IInitAbrManagerContext): void;
12
14
  updateContext(updateContext: IUpdatableAbrManagerContext): void;
13
15
  autoSelectTrack<T extends IVideoTrack | IAudioTrack>(kind: Exclude<StreamKind, StreamKind.TEXT>): T;
@@ -0,0 +1,17 @@
1
+ import type { IObservable } from "@vkontakte/videoplayer-shared";
2
+ import type { IVideoAbrContext, RuleConfidence } from "#/providers/utils/Abr/types";
3
+ export declare enum AbrPhase {
4
+ Startup = "startup",
5
+ Steady = "steady"
6
+ }
7
+ export type RulePhaseConfig = Readonly<Partial<Record<AbrPhase, RuleConfidence>>>;
8
+ export declare const uniformPhaseConfig: (confidence: RuleConfidence) => RulePhaseConfig;
9
+ export declare class AbrPhaseController {
10
+ private _phase;
11
+ private readonly subscription;
12
+ constructor(isSeeked$?: IObservable<boolean>);
13
+ get phase(): AbrPhase;
14
+ updatePhase(context: IVideoAbrContext): void;
15
+ reset(): void;
16
+ destroy(): void;
17
+ }
@@ -1,6 +1,6 @@
1
1
  import type { IObservable, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
2
- import type { ITuningConfig } from "../../../../utils/tuningConfig";
3
- import type { IVideoTrack } from "../../../../player/types";
2
+ import type { ITuningConfig } from "#/utils/tuningConfig";
3
+ import type { IVideoTrack } from "#/player/types";
4
4
  import type { IObservableVideo } from "../../HTMLVideoElement/observable";
5
5
  interface IConnectData {
6
6
  videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
@@ -1,11 +1,12 @@
1
- import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext, RuleConfidence } from "../../types";
2
- import type { IAudioTrack, IVideoTrack } from "../../../../../player/types";
3
- import { LimitAboveRule } from "../limitAboveRule";
1
+ import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext } from "#/providers/utils/Abr/types";
2
+ import type { IAudioTrack, IVideoTrack } from "#/player/types";
3
+ import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
4
4
  import type { Kbps, Nullable } from "@vkontakte/videoplayer-shared";
5
- import type { ITuningConfig } from "../../../../../utils/tuningConfig";
5
+ import type { ITuningConfig } from "#/utils/tuningConfig";
6
+ import type { RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
6
7
  type AudioThroughputLogsArgs = [forwardBufferHealth: Nullable<number>, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, estimatedThroughput: Kbps, tuning: ITuningConfig];
7
8
  export declare class AudioThroughputRule extends LimitAboveRule<IAudioTrack, IAudioAbrContext, AudioThroughputLogsArgs> implements IAbrRule<IAudioTrack, IAudioAbrContext> {
8
- constructor(confidence: RuleConfidence);
9
+ constructor(phaseConfig: RulePhaseConfig);
9
10
  execute(context: IAudioAbrContext): IAbrRuleResolution<IAudioTrack>;
10
11
  protected createLogMessage(selectedTrack: IVideoTrack, forwardBufferHealth: number | undefined, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, estimatedThroughput: Kbps, tuning: ITuningConfig): string;
11
12
  }
@@ -1,11 +1,12 @@
1
- import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext, RuleConfidence } from "../../types";
2
- import type { IAudioTrack, IVideoTrack } from "../../../../../player/types";
3
- import { LimitBelowRule } from "../limitBelowRule";
4
- import type { ITuningConfig } from "../../../../../utils/tuningConfig";
1
+ import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext } from "#/providers/utils/Abr/types";
2
+ import type { IAudioTrack, IVideoTrack } from "#/player/types";
3
+ import { LimitBelowRule } from "#/providers/utils/Abr/rules/limitBelowRule";
4
+ import type { ITuningConfig } from "#/utils/tuningConfig";
5
5
  import type { Nullable } from "@vkontakte/videoplayer-shared";
6
+ import type { RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
6
7
  type MinAudioForVideoLogsArgs = [lastVideoTrackSelected: Nullable<IVideoTrack>, tuning: ITuningConfig];
7
8
  export declare class MinAudioForVideoRule extends LimitBelowRule<IAudioTrack, IAudioAbrContext, MinAudioForVideoLogsArgs> implements IAbrRule<IAudioTrack, IAudioAbrContext> {
8
- constructor(confidence: RuleConfidence);
9
+ constructor(phaseConfig: RulePhaseConfig);
9
10
  execute(context: IAudioAbrContext): IAbrRuleResolution<IAudioTrack>;
10
11
  protected createLogMessage(selectedTrack: IVideoTrack, lastVideoTrackSelected: Nullable<IVideoTrack>, tuning: ITuningConfig): string;
11
12
  }
@@ -1,7 +1,7 @@
1
- import { AudioRuleName } from "../types";
2
- import type { IAbrRule, IAudioAbrContext } from "../types";
3
- import { RuleConfidence } from "../types";
4
- import type { IAudioTrack } from "../../../../player/types";
1
+ import { AudioRuleName } from "#/providers/utils/Abr/types";
2
+ import type { IAbrRule, IAudioAbrContext } from "#/providers/utils/Abr/types";
3
+ import type { IAudioTrack } from "#/player/types";
4
+ import { type RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
5
5
  export declare class AudioRuleFactory {
6
- static createRule(ruleName: AudioRuleName, confidence?: RuleConfidence): IAbrRule<IAudioTrack, IAudioAbrContext>;
6
+ static createRule(ruleName: AudioRuleName, phaseConfig?: RulePhaseConfig): IAbrRule<IAudioTrack, IAudioAbrContext>;
7
7
  }
@@ -1,19 +1,23 @@
1
- import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, IInitAbrManagerContext, RuleConfidence, RuleType } from "../types";
2
- import type { IBaseTrack } from "../../../../player/types";
1
+ import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, IRuleInitContext, RuleConfidence, RuleType } from "#/providers/utils/Abr/types";
2
+ import type { IBaseTrack } from "#/player/types";
3
3
  import { Subscription } from "@vkontakte/videoplayer-shared";
4
+ import type { AbrPhase } from "#/providers/utils/Abr/controllers/abrPhaseController";
5
+ import { type RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
4
6
  export declare abstract class BaseRule<
5
7
  T extends IBaseTrack,
6
8
  C extends IBaseAbrControllerContext,
7
9
  LogsArgs extends unknown[]
8
10
  > implements IAbrRule<T, C> {
11
+ readonly phaseConfig: RulePhaseConfig;
12
+ readonly activePhases: ReadonlySet<AbrPhase>;
9
13
  protected subscription: Subscription;
10
- protected confidence: RuleConfidence;
11
14
  protected type: RuleType;
12
15
  protected name: string;
13
- constructor(confidence: RuleConfidence);
14
- init(_initContext: IInitAbrManagerContext): void;
16
+ protected confidence: RuleConfidence;
17
+ constructor(phaseConfig: RulePhaseConfig);
18
+ init(_initContext: IRuleInitContext): void;
15
19
  destroy(): void;
16
20
  abstract execute(context: C): IAbrRuleResolution<T>;
17
- protected createResolution(selectedTrack: T, ...params: LogsArgs): IAbrRuleResolution<T>;
21
+ protected createResolution(context: C, selectedTrack: T, ...params: LogsArgs): IAbrRuleResolution<T>;
18
22
  protected abstract createLogMessage(selectedTrack: T, ...params: LogsArgs): string;
19
23
  }
@@ -1,11 +1,12 @@
1
- import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, RuleConfidence } from "../types";
2
- import type { IBaseTrack } from "../../../../player/types";
3
- import { BaseRule } from "./baseRule";
1
+ import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext } from "#/providers/utils/Abr/types";
2
+ import type { IBaseTrack } from "#/player/types";
3
+ import { BaseRule } from "#/providers/utils/Abr/rules/baseRule";
4
+ import type { RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
4
5
  export declare abstract class LimitAboveRule<
5
6
  T extends IBaseTrack,
6
7
  C extends IBaseAbrControllerContext,
7
8
  LogsArgs extends unknown[] = unknown[]
8
9
  > extends BaseRule<T, C, LogsArgs> implements IAbrRule<T, C> {
9
- constructor(confidence: RuleConfidence);
10
+ constructor(phaseConfig: RulePhaseConfig);
10
11
  abstract execute(context: C): IAbrRuleResolution<T>;
11
12
  }
@@ -1,11 +1,12 @@
1
- import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, RuleConfidence } from "../types";
2
- import type { IBaseTrack } from "../../../../player/types";
3
- import { BaseRule } from "./baseRule";
1
+ import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext } from "#/providers/utils/Abr/types";
2
+ import type { IBaseTrack } from "#/player/types";
3
+ import { BaseRule } from "#/providers/utils/Abr/rules/baseRule";
4
+ import type { RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
4
5
  export declare abstract class LimitBelowRule<
5
6
  T extends IBaseTrack,
6
7
  C extends IBaseAbrControllerContext,
7
8
  LogsArgs extends unknown[] = unknown[]
8
9
  > extends BaseRule<T, C, LogsArgs> implements IAbrRule<T, C> {
9
- constructor(confidence: RuleConfidence);
10
+ constructor(phaseConfig: RulePhaseConfig);
10
11
  abstract execute(context: C): IAbrRuleResolution<T>;
11
12
  }
@@ -0,0 +1,12 @@
1
+ import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "#/providers/utils/Abr/types";
2
+ import type { IVideoTrack } from "#/player/types";
3
+ import type { Milliseconds } from "@vkontakte/videoplayer-shared";
4
+ import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
5
+ import type { RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
6
+ type LogsArgs = [elapsedMs: Milliseconds, loadedFraction: number, estimatedRemainingMs: Milliseconds, bufferLimitMs: Milliseconds, triggered: boolean];
7
+ export declare class AbandonRequestRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, LogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
8
+ constructor(phaseConfig: RulePhaseConfig);
9
+ execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
10
+ protected createLogMessage(selectedTrack: IVideoTrack, elapsedMs: Milliseconds, loadedFraction: number, estimatedRemainingMs: Milliseconds, bufferLimitMs: Milliseconds, triggered: boolean): string;
11
+ }
12
+ export {};
@@ -0,0 +1,31 @@
1
+ import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext } from "#/providers/utils/Abr/types";
2
+ import type { IVideoTrack } from "#/player/types";
3
+ import type { Kbps, Seconds } from "@vkontakte/videoplayer-shared";
4
+ import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
5
+ import { AbrPhase, type RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
6
+ export declare const calculateUtilities: (bitratesAsc: Kbps[]) => number[];
7
+ export declare const calculateVpAndGp: (utilityHigh: number, bufferTargetS: Seconds, minBufferS: Seconds) => {
8
+ Vp: number;
9
+ gp: number;
10
+ };
11
+ export declare const calculateScores: (bitratesAsc: Kbps[], utilities: number[], Vp: number, gp: number, effectiveBufferS: Seconds) => number[];
12
+ export declare const argmax: (values: number[]) => number;
13
+ export declare const adjustBufferForFinite: (effectiveBufferS: Seconds, remainingDurationS: Seconds, finiteThresholdS: Seconds, _bufferTargetS: Seconds) => Seconds;
14
+ export declare const calculateMinBufferLevelForRep: (qIndex: number, bitratesAsc: Kbps[], utilities: number[], Vp: number, gp: number) => Seconds;
15
+ export declare const calculateMaxBufferLevelForRep: (qIndex: number, utilities: number[], Vp: number, gp: number) => Seconds;
16
+ export declare const pickIndexByThroughput: (bitratesAsc: Kbps[], throughputKbps: Kbps) => number;
17
+ type BolaLogsArgs = [bufferLevelS: Seconds, placeholderBufferS: Seconds, segmentDurationS: Seconds, Vp: number, gp: number, validBitrates: Kbps[], selectedIndex: number, phase: AbrPhase | undefined];
18
+ export declare class BolaRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, BolaLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
19
+ private placeholderBufferS;
20
+ private lastCallTimeMs;
21
+ private lastBufferLevelS;
22
+ constructor(phaseConfig: RulePhaseConfig);
23
+ init(initContext?: IRuleInitContext): void;
24
+ destroy(): void;
25
+ execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
26
+ private resolveSegmentDurationS;
27
+ private applyBolaOSafeguard;
28
+ private resetPlaceholder;
29
+ protected createLogMessage(selectedTrack: IVideoTrack, bufferLevelS: Seconds, placeholderBufferS: Seconds, segmentDurationS: Seconds, Vp: number, gp: number, validBitrates: Kbps[], selectedIndex: number, phase: AbrPhase | undefined): string;
30
+ }
31
+ export {};
@@ -1,11 +1,16 @@
1
- import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "../../types";
2
- import type { IVideoTrack } from "../../../../../player/types";
1
+ import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "#/providers/utils/Abr/types";
2
+ import type { IVideoTrack } from "#/player/types";
3
3
  import type { Nullable } from "@vkontakte/videoplayer-shared";
4
- import { LimitAboveRule } from "../limitAboveRule";
5
- import type { ITuningConfig } from "../../../../../utils/tuningConfig";
4
+ import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
5
+ import type { ITuningConfig } from "#/utils/tuningConfig";
6
+ import type { RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
6
7
  type BufferRuleLogsArgs = [currentVideoTrack: Nullable<IVideoTrack>, lastVideoTrackSelected: Nullable<IVideoTrack>, forwardBufferHealth: Nullable<number>, abrTuning: ITuningConfig["autoTrackSelection"]];
8
+ /**
9
+ * @deprecated Заменено на связку `BolaRule` + `InsufficientBufferRule` в фазовой архитектуре ABR.
10
+ * Не использовать в новых наборах правил.
11
+ */
7
12
  export declare class BufferRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, BufferRuleLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
8
- constructor(confidence: RuleConfidence);
13
+ constructor(phaseConfig: RulePhaseConfig);
9
14
  execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
10
15
  protected createLogMessage(selectedTrack: IVideoTrack, currentVideoTrack: Nullable<IVideoTrack>, lastVideoTrackSelected: Nullable<IVideoTrack>, forwardBufferHealth: Nullable<number>, abrTuning: ITuningConfig["autoTrackSelection"]): string;
11
16
  }
@@ -1,12 +1,13 @@
1
- import type { IAbrRule, IAbrRuleResolution, IInitAbrManagerContext, IVideoAbrContext, RuleConfidence } from "../../types";
2
- import type { IVideoTrack } from "../../../../../player/types";
1
+ import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext } from "#/providers/utils/Abr/types";
2
+ import type { IVideoTrack } from "#/player/types";
3
3
  import type { Nullable } from "@vkontakte/videoplayer-shared";
4
- import { LimitAboveRule } from "../limitAboveRule";
4
+ import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
5
+ import type { RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
5
6
  type FailedVideoTracLogsArgs = [banTrack: Nullable<IVideoTrack>];
6
7
  export declare class FailedVideoTrackRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, FailedVideoTracLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
7
8
  protected banTrack: Nullable<IVideoTrack>;
8
- constructor(confidence: RuleConfidence);
9
- init(initContext: IInitAbrManagerContext): void;
9
+ constructor(phaseConfig: RulePhaseConfig);
10
+ init(initContext: IRuleInitContext): void;
10
11
  execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
11
12
  protected createLogMessage(selectedTrack: IVideoTrack, banTrack: Nullable<IVideoTrack>): string;
12
13
  }
@@ -1,12 +1,13 @@
1
- import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "../../types";
2
- import type { IVideoTrack } from "../../../../../player/types";
1
+ import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "#/providers/utils/Abr/types";
2
+ import type { IVideoTrack } from "#/player/types";
3
3
  import type { IRectangle, Nullable } from "@vkontakte/videoplayer-shared";
4
- import { LimitAboveRule } from "../limitAboveRule";
5
- import type { ITuningConfig } from "../../../../../utils/tuningConfig";
4
+ import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
5
+ import type { ITuningConfig } from "#/utils/tuningConfig";
6
+ import type { RulePhaseConfig } from "#/providers/utils/Abr/controllers/abrPhaseController";
6
7
  type IContainerSizeLimit = IRectangle;
7
8
  type FitsContainerLogsArgs = [containerSizeLimit: Nullable<IContainerSizeLimit>, containerSizeFactor: number, abrTuning: ITuningConfig["autoTrackSelection"]];
8
9
  export declare class FitsContainerRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, FitsContainerLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
9
- constructor(confidence: RuleConfidence);
10
+ constructor(phaseConfig: RulePhaseConfig);
10
11
  execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
11
12
  protected createLogMessage(selectedTrack: IVideoTrack, containerSizeLimit: Nullable<IContainerSizeLimit>, containerSizeFactor: number, abrTuning: ITuningConfig["autoTrackSelection"]): string;
12
13
  private getContainerSizeLimit;