@vkontakte/videoplayer-core 2.0.157-dev.30efab63.0 → 2.0.157-dev.50bf8b6d.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 (106) hide show
  1. package/es2015.cjs +220 -0
  2. package/es2015.esm.js +34 -34
  3. package/esnext.cjs +220 -0
  4. package/esnext.esm.js +30 -30
  5. package/evergreen.esm.js +30 -30
  6. package/package.json +18 -7
  7. package/types/index.d.ts +10 -10
  8. package/types/player/Player.d.ts +16 -112
  9. package/types/player/types.d.ts +144 -103
  10. package/types/player/utils/defaults.d.ts +4 -0
  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/types.d.ts +2 -0
  19. package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +3 -3
  20. package/types/providers/DashProvider/baseDashProvider.d.ts +10 -10
  21. package/types/providers/DashProvider/lib/LiveTextManager.d.ts +1 -1
  22. package/types/providers/DashProvider/lib/buffer.d.ts +2 -2
  23. package/types/providers/DashProvider/lib/fetcher.d.ts +3 -3
  24. package/types/providers/DashProvider/lib/player.d.ts +6 -6
  25. package/types/providers/DashProvider/lib/types.d.ts +3 -3
  26. package/types/providers/DashProvider/lib/utils.d.ts +2 -2
  27. package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +16 -16
  28. package/types/providers/DashProviderVirtual/dashCmafLiveProvider.d.ts +1 -1
  29. package/types/providers/DashProviderVirtual/dashProvider.d.ts +1 -1
  30. package/types/providers/DashProviderVirtual/lib/LiveTextManager.d.ts +2 -2
  31. package/types/providers/DashProviderVirtual/lib/buffer/types.d.ts +3 -3
  32. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts +6 -6
  33. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/byteRangeVirtualBufferManager.d.ts +5 -5
  34. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/liveVirtualBuffer.d.ts +5 -5
  35. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/templateVirtualBufferManager.d.ts +5 -5
  36. package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/virtualBufferFactory.d.ts +3 -3
  37. package/types/providers/DashProviderVirtual/lib/fetcher.d.ts +3 -3
  38. package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +10 -10
  39. package/types/providers/DashProviderVirtual/lib/player/livePlayer.d.ts +8 -8
  40. package/types/providers/DashProviderVirtual/lib/player/player.d.ts +2 -2
  41. package/types/providers/DashProviderVirtual/lib/player/types.d.ts +3 -3
  42. package/types/providers/DashProviderVirtual/lib/types.d.ts +3 -3
  43. package/types/providers/DashProviderVirtual/lib/utils.d.ts +2 -2
  44. package/types/providers/HlsLiveProvider/LiveTextManager.d.ts +1 -1
  45. package/types/providers/HlsLiveProvider/index.d.ts +3 -3
  46. package/types/providers/HlsProvider/index.d.ts +2 -2
  47. package/types/providers/HlsProvider/manifestDataExtractor.d.ts +1 -1
  48. package/types/providers/MpegProvider/index.d.ts +1 -1
  49. package/types/providers/ProviderContainer/index.d.ts +3 -3
  50. package/types/providers/ProviderContainer/types.d.ts +1 -1
  51. package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +2 -2
  52. package/types/providers/ProviderContainer/utils/playbackHangup.d.ts +3 -3
  53. package/types/providers/WebRTCLiveProvider/WebRTCLiveClient.d.ts +1 -1
  54. package/types/providers/WebRTCLiveProvider/WebRTCLiveProvider.d.ts +2 -2
  55. package/types/providers/types.d.ts +41 -25
  56. package/types/providers/utils/Abr/abrController.d.ts +3 -3
  57. package/types/providers/utils/Abr/abrManager.d.ts +3 -3
  58. package/types/providers/utils/Abr/controllers/stallsController.d.ts +2 -2
  59. package/types/providers/utils/Abr/rules/audio/audioThroughputRule.d.ts +4 -4
  60. package/types/providers/utils/Abr/rules/audio/minAudioForVideoRule.d.ts +4 -4
  61. package/types/providers/utils/Abr/rules/baseRule.d.ts +2 -2
  62. package/types/providers/utils/Abr/rules/limitAboveRule.d.ts +3 -3
  63. package/types/providers/utils/Abr/rules/limitBelowRule.d.ts +3 -3
  64. package/types/providers/utils/Abr/rules/video/bufferRule.d.ts +4 -4
  65. package/types/providers/utils/Abr/rules/video/fitsContainerRule.d.ts +4 -4
  66. package/types/providers/utils/Abr/rules/video/lowerLimitRule.d.ts +3 -3
  67. package/types/providers/utils/Abr/rules/video/stallsRule.d.ts +4 -4
  68. package/types/providers/utils/Abr/rules/video/throughputRule.d.ts +4 -4
  69. package/types/providers/utils/Abr/rules/video/upperLimitRule.d.ts +3 -3
  70. package/types/providers/utils/Abr/trackHistory.d.ts +4 -4
  71. package/types/providers/utils/Abr/types.d.ts +3 -3
  72. package/types/providers/utils/Abr/utils.d.ts +2 -2
  73. package/types/providers/utils/HTMLVideoElement/DroppedFramesManager.d.ts +3 -3
  74. package/types/providers/utils/HTMLVideoElement/ElementSizeManager.d.ts +1 -1
  75. package/types/providers/utils/HTMLVideoElement/TextTrackManager.d.ts +2 -2
  76. package/types/providers/utils/HTMLVideoElement/observable.d.ts +1 -1
  77. package/types/providers/utils/HTMLVideoElement/pool.d.ts +1 -1
  78. package/types/providers/utils/StallsManager.d.ts +2 -2
  79. package/types/providers/utils/extractConnectionHeaders.d.ts +1 -1
  80. package/types/providers/utils/parsers/types.d.ts +1 -1
  81. package/types/providers/utils/syncDesiredState.d.ts +2 -2
  82. package/types/providers/utils/syncPlaybackState.d.ts +2 -2
  83. package/types/providers/utils/videoStreamRepresentaionsFilter.d.ts +6 -2
  84. package/types/utils/3d/Camera3D.d.ts +1 -1
  85. package/types/utils/3d/CameraRotationManager.d.ts +2 -2
  86. package/types/utils/3d/Scene3D.d.ts +1 -1
  87. package/types/utils/ClientChecker/services/AudioChecker.d.ts +1 -1
  88. package/types/utils/ClientChecker/services/BrowserChecker.d.ts +2 -2
  89. package/types/utils/ClientChecker/services/DeviceChecker.d.ts +3 -3
  90. package/types/utils/ClientChecker/services/DisplayChecker.d.ts +1 -1
  91. package/types/utils/ClientChecker/services/VideoChecker.d.ts +2 -2
  92. package/types/utils/StateMachine/StateMachine.d.ts +3 -2
  93. package/types/utils/StateMachine/comparators.d.ts +3 -0
  94. package/types/utils/StateMachine/types.d.ts +1 -0
  95. package/types/utils/ThroughputEstimator.d.ts +1 -1
  96. package/types/utils/VolumeMultiplierManager/VolumeMultiplierManager.d.ts +2 -2
  97. package/types/utils/autoSelectTrack.d.ts +2 -2
  98. package/types/utils/qualityLimits.d.ts +2 -2
  99. package/types/utils/setStateWithSubscribe.d.ts +1 -1
  100. package/types/utils/smoothedValue/baseSmoothedValue.d.ts +1 -1
  101. package/types/utils/smoothedValue/emaAndMaSmoothedValue.d.ts +2 -2
  102. package/types/utils/smoothedValue/emaTopExtremumValue.d.ts +2 -2
  103. package/types/utils/smoothedValue/smoothedValueFactory.d.ts +2 -2
  104. package/types/utils/smoothedValue/twoEmaSmoothedValue.d.ts +2 -2
  105. package/types/utils/tuningConfig.d.ts +8 -4
  106. package/types/utils/videoFormat.d.ts +1 -1
@@ -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 "#/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";
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";
10
10
  export interface IProvider {
11
11
  scene3D?: Scene3D;
12
12
  destroy(): void;
@@ -29,24 +29,40 @@ export interface IProviderParams<TSourceType> extends IProviderDependencies {
29
29
  panelSize?: IRectangle;
30
30
  skipVideoElVolumeSync$: IValueSubject<boolean>;
31
31
  }
32
- export interface IDesiredState {
33
- playbackState: IStateMachine<PlaybackState>;
34
- seekState: IStateMachine<SeekState>;
35
- volume: IStateMachine<IVolumeState>;
36
- playbackRate: IStateMachine<PlaybackRate>;
37
- isLooped: IStateMachine<boolean>;
38
- isLowLatency: IStateMachine<boolean>;
39
- videoStream: IStateMachine<IVideoStream | undefined>;
40
- videoTrack: IStateMachine<IVideoTrack | undefined>;
41
- audioStream: IStateMachine<IAudioStream | undefined>;
42
- autoVideoTrackSwitching: IStateMachine<boolean>;
43
- autoVideoTrackLimits: IStateMachine<QualityLimits>;
44
- externalTextTracks: IStateMachine<IExternalTextTrack[]>;
45
- internalTextTracks: IStateMachine<IInternalTextTrack[]>;
46
- currentTextTrack: IStateMachine<ITextTrack["id"] | undefined>;
47
- textTrackCuesSettings: IStateMachine<ICueSettings>;
48
- cameraOrientation: IStateMachine<Vector2D>;
32
+ export interface DesiredStateValues {
33
+ audioStream: IAudioStream | undefined;
34
+ autoVideoTrackLimits: QualityLimits;
35
+ autoVideoTrackSwitching: boolean;
36
+ cameraOrientation: Vector2D;
37
+ currentTextTrack: ITextTrack["id"] | undefined;
38
+ /**
39
+ * Дополнительные дорожки субтитров подключаемые извне
40
+ */
41
+ externalTextTracks: IExternalTextTrack[];
42
+ /**
43
+ * Дорожки субтитров подключаемые изнутри
44
+ */
45
+ internalTextTracks: IInternalTextTrack[];
46
+ isLooped: boolean;
47
+ isLowLatency: boolean;
48
+ playbackRate: PlaybackRate;
49
+ playbackState: PlaybackState;
50
+ seekState: SeekState;
51
+ textTrackCuesSettings: ICueSettings;
52
+ videoStream: IVideoStream | undefined;
53
+ /**
54
+ * Порядок смены видео дорожек:
55
+ *
56
+ * 1. Потребитель запускает переход currentVideoTrack в новое значение
57
+ * 2. Провайдер инициирует смену дорожки.
58
+ * 3. Переход завершается когда новая дорожка отрендрерилась на экране, зачастую это будет после окончания буфера старой
59
+ * В этот же момент info.currentVideoTrack обновляется на актуальное значение
60
+ * autoVideoTrackSwitching автоматически не модифицируется
61
+ */
62
+ videoTrack: IVideoTrack | undefined;
63
+ volume: IVolumeState;
49
64
  }
65
+ export type IDesiredState = { [K in keyof DesiredStateValues] : IStateMachine<DesiredStateValues[K]> };
50
66
  export interface IProviderOutput {
51
67
  position$: IValueSubject<Seconds>;
52
68
  duration$: IValueSubject<Seconds>;
@@ -1,5 +1,5 @@
1
- import type { IAbrController, IAbrRule, IBaseAbrControllerContext } from "#/providers/utils/Abr/types";
2
- import type { IBaseTrack } from "#/player/types";
1
+ import type { IAbrController, IAbrRule, IBaseAbrControllerContext } from "./types";
2
+ import type { IBaseTrack } from "../../../player/types";
3
3
  export default class AbrController<
4
4
  T extends IBaseTrack,
5
5
  C extends IBaseAbrControllerContext
@@ -7,7 +7,7 @@ export default class AbrController<
7
7
  private history;
8
8
  private rules;
9
9
  private context;
10
- init(rules: IAbrRule<T, C>[]);
10
+ init(rules: IAbrRule<T, C>[]): void;
11
11
  destroy(): void;
12
12
  updateContext(context: C): void;
13
13
  autoSelectTrack(): T;
@@ -1,6 +1,6 @@
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";
1
+ import type { IAudioTrack, IVideoTrack } from "../../../player/types";
2
+ import type { IInitAbrManagerContext, IUpdatableAbrManagerContext } from "./types";
3
+ import { StreamKind } from "../parsers/types";
4
4
  export declare class AbrManager {
5
5
  private stallsController;
6
6
  private videoAbrController;
@@ -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,8 +1,8 @@
1
- import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext, RuleConfidence } from "#/providers/utils/Abr/types";
2
- import type { IAudioTrack, IVideoTrack } from "#/player/types";
3
- import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
1
+ import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext, RuleConfidence } from "../../types";
2
+ import type { IAudioTrack, IVideoTrack } from "../../../../../player/types";
3
+ import { LimitAboveRule } from "../limitAboveRule";
4
4
  import type { Kbps } from "@vkontakte/videoplayer-shared";
5
- import type { ITuningConfig } from "#/utils/tuningConfig";
5
+ import type { ITuningConfig } from "../../../../../utils/tuningConfig";
6
6
  type AudioThroughputLogsArgs = [forwardBufferHealth: number | undefined, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, estimatedThroughput: Kbps, tuning: ITuningConfig];
7
7
  export declare class AudioThroughputRule extends LimitAboveRule<IAudioTrack, IAudioAbrContext, AudioThroughputLogsArgs> implements IAbrRule<IAudioTrack, IAudioAbrContext> {
8
8
  constructor(confidence: RuleConfidence);
@@ -1,7 +1,7 @@
1
- import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext, RuleConfidence } 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";
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";
5
5
  type MinAudioForVideoLogsArgs = [lastVideoTrackSelected: IVideoTrack | undefined, tuning: ITuningConfig];
6
6
  export declare class MinAudioForVideoRule extends LimitBelowRule<IAudioTrack, IAudioAbrContext, MinAudioForVideoLogsArgs> implements IAbrRule<IAudioTrack, IAudioAbrContext> {
7
7
  constructor(confidence: RuleConfidence);
@@ -1,5 +1,5 @@
1
- import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, RuleConfidence, RuleType } from "#/providers/utils/Abr/types";
2
- import type { IBaseTrack } from "#/player/types";
1
+ import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, RuleConfidence, RuleType } from "../types";
2
+ import type { IBaseTrack } from "../../../../player/types";
3
3
  import { Subscription } from "@vkontakte/videoplayer-shared";
4
4
  export declare abstract class BaseRule<
5
5
  T extends IBaseTrack,
@@ -1,6 +1,6 @@
1
- import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, RuleConfidence } from "#/providers/utils/Abr/types";
2
- import type { IBaseTrack } from "#/player/types";
3
- import { BaseRule } from "#/providers/utils/Abr/rules/baseRule";
1
+ import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, RuleConfidence } from "../types";
2
+ import type { IBaseTrack } from "../../../../player/types";
3
+ import { BaseRule } from "./baseRule";
4
4
  export declare abstract class LimitAboveRule<
5
5
  T extends IBaseTrack,
6
6
  C extends IBaseAbrControllerContext,
@@ -1,6 +1,6 @@
1
- import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, RuleConfidence } from "#/providers/utils/Abr/types";
2
- import type { IBaseTrack } from "#/player/types";
3
- import { BaseRule } from "#/providers/utils/Abr/rules/baseRule";
1
+ import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, RuleConfidence } from "../types";
2
+ import type { IBaseTrack } from "../../../../player/types";
3
+ import { BaseRule } from "./baseRule";
4
4
  export declare abstract class LimitBelowRule<
5
5
  T extends IBaseTrack,
6
6
  C extends IBaseAbrControllerContext,
@@ -1,7 +1,7 @@
1
- import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "#/providers/utils/Abr/types";
2
- import type { IVideoTrack } from "#/player/types";
3
- import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
4
- import type { ITuningConfig } from "#/utils/tuningConfig";
1
+ import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "../../types";
2
+ import type { IVideoTrack } from "../../../../../player/types";
3
+ import { LimitAboveRule } from "../limitAboveRule";
4
+ import type { ITuningConfig } from "../../../../../utils/tuningConfig";
5
5
  type BufferRuleLogsArgs = [currentVideoTrack: IVideoTrack | undefined, lastVideoTrackSelected: IVideoTrack | undefined, forwardBufferHealth: number | undefined, abrTuning: ITuningConfig["autoTrackSelection"]];
6
6
  export declare class BufferRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, BufferRuleLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
7
7
  constructor(confidence: RuleConfidence);
@@ -1,8 +1,8 @@
1
- import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "#/providers/utils/Abr/types";
2
- import type { IVideoTrack } from "#/player/types";
1
+ import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "../../types";
2
+ import type { IVideoTrack } from "../../../../../player/types";
3
3
  import type { IRectangle } from "@vkontakte/videoplayer-shared";
4
- import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
5
- import type { ITuningConfig } from "#/utils/tuningConfig";
4
+ import { LimitAboveRule } from "../limitAboveRule";
5
+ import type { ITuningConfig } from "../../../../../utils/tuningConfig";
6
6
  type IContainerSizeLimit = IRectangle;
7
7
  type FitsContainerLogsArgs = [containerSizeLimit: IContainerSizeLimit | undefined, containerSizeFactor: number, abrTuning: ITuningConfig["autoTrackSelection"]];
8
8
  export declare class FitsContainerRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, FitsContainerLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
@@ -1,8 +1,8 @@
1
- import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "#/providers/utils/Abr/types";
2
- import type { IVideoTrack } from "#/player/types";
1
+ import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "../../types";
2
+ import type { IVideoTrack } from "../../../../../player/types";
3
3
  import type { QualityLimits } from "@vkontakte/videoplayer-shared";
4
4
  import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
5
- import { LimitBelowRule } from "#/providers/utils/Abr/rules/limitBelowRule";
5
+ import { LimitBelowRule } from "../limitBelowRule";
6
6
  type LowerLimitLogsArgs = [limitsAreInvalid: boolean, lowestAvailableQuality: ExactVideoQuality | undefined, highestAvailableQuality: ExactVideoQuality | undefined, limits: QualityLimits];
7
7
  export declare class LowerLimitRule extends LimitBelowRule<IVideoTrack, IVideoAbrContext, LowerLimitLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
8
8
  constructor(confidence: RuleConfidence);
@@ -1,8 +1,8 @@
1
- import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "#/providers/utils/Abr/types";
2
- import type { IVideoTrack } from "#/player/types";
1
+ import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "../../types";
2
+ import type { IVideoTrack } from "../../../../../player/types";
3
3
  import type { Kbps } from "@vkontakte/videoplayer-shared";
4
- import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
5
- import type { ITuningConfig } from "#/utils/tuningConfig";
4
+ import { LimitAboveRule } from "../limitAboveRule";
5
+ import type { ITuningConfig } from "../../../../../utils/tuningConfig";
6
6
  type StallLogsArgs = [forwardBufferHealth: number | undefined, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, tuning: ITuningConfig];
7
7
  export declare class StallsRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, StallLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
8
8
  private severeStallOccurred;
@@ -1,8 +1,8 @@
1
- import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "#/providers/utils/Abr/types";
2
- import type { IVideoTrack } from "#/player/types";
1
+ import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "../../types";
2
+ import type { IVideoTrack } from "../../../../../player/types";
3
3
  import type { Kbps } from "@vkontakte/videoplayer-shared";
4
- import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
5
- import type { ITuningConfig } from "#/utils/tuningConfig";
4
+ import { LimitAboveRule } from "../limitAboveRule";
5
+ import type { ITuningConfig } from "../../../../../utils/tuningConfig";
6
6
  type ThroughputLogsArgs = [forwardBufferHealth: number | undefined, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, estimatedThroughput: Kbps, tuning: ITuningConfig];
7
7
  export declare class ThroughputRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, ThroughputLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
8
8
  constructor(confidence: RuleConfidence);
@@ -1,8 +1,8 @@
1
- import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "#/providers/utils/Abr/types";
2
- import type { IVideoTrack } from "#/player/types";
1
+ import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext, RuleConfidence } from "../../types";
2
+ import type { IVideoTrack } from "../../../../../player/types";
3
3
  import type { QualityLimits, VideoQuality } from "@vkontakte/videoplayer-shared";
4
4
  import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
5
- import { LimitAboveRule } from "#/providers/utils/Abr/rules/limitAboveRule";
5
+ import { LimitAboveRule } from "../limitAboveRule";
6
6
  type UpperLimitsLogsArgs = [limitsAreInvalid: boolean, lowestAvailableQuality: ExactVideoQuality | undefined, highestAvailableQuality: ExactVideoQuality | undefined, visible: boolean, limits: QualityLimits, backgroundVideoQualityLimit: VideoQuality];
7
7
  export declare class UpperLimitsRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, UpperLimitsLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
8
8
  constructor(confidence: RuleConfidence);
@@ -1,9 +1,9 @@
1
- import type { IBaseTrack } from "#/player/types";
1
+ import type { IBaseTrack } from "../../../player/types";
2
2
  import type { Milliseconds } from "@vkontakte/videoplayer-shared";
3
3
  export declare class TrackHistory<T extends IBaseTrack> {
4
4
  last: T | undefined;
5
5
  history: Record<IBaseTrack["id"], Milliseconds>;
6
- recordSelection(track: T);
7
- recordSwitch(track: T | undefined);
8
- clear();
6
+ recordSelection(track: T): void;
7
+ recordSwitch(track: T | undefined): void;
8
+ clear(): void;
9
9
  }
@@ -1,7 +1,7 @@
1
- import type { IAudioTrack, IBaseTrack, IVideoTrack } from "#/player/types";
1
+ import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../../../player/types";
2
2
  import type { IComponentLogger, IObservable, IRectangle, IValueSubject, Kbps, Milliseconds, QualityLimits } from "@vkontakte/videoplayer-shared";
3
- import type { ITuningConfig } from "#/utils/tuningConfig";
4
- import type { Representation, Segment } from "#/providers/utils/parsers/types";
3
+ import type { ITuningConfig } from "../../../utils/tuningConfig";
4
+ import type { Representation, Segment } from "../parsers/types";
5
5
  import type { ElementSizeManager } from "../HTMLVideoElement/ElementSizeManager";
6
6
  import type { IObservableVideo } from "../HTMLVideoElement/observable";
7
7
  export declare enum RuleConfidence {
@@ -1,4 +1,4 @@
1
- import type { IAudioTrack, IBaseTrack, IVideoTrack } from "#/player/types";
1
+ import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../../../player/types";
2
2
  export declare enum CompareTrack {
3
3
  Descending = -1,
4
4
  Ascending = 1
@@ -7,7 +7,7 @@ export declare const isVideoTrack: (track: IBaseTrack) => track is IVideoTrack;
7
7
  export declare const getAudioTrackComparator: (type: CompareTrack) => (track1: IAudioTrack, track2: IAudioTrack) => number;
8
8
  export declare const getVideoTrackComparator: (type: CompareTrack) => (track1: IVideoTrack, track2: IVideoTrack) => number;
9
9
  export declare const getTrackComparator: <T extends IBaseTrack>(compareTrack: CompareTrack) => (track1: T, track2: T) => number;
10
- export declare const isLowerTrack: unknown;
10
+ export declare const isLowerTrack: <T extends IBaseTrack>(track1: T, track2: T) => boolean;
11
11
  export declare const logBase: (base: number, x: number) => number;
12
12
  export declare const bitrateFactorFromBufferLevel: (forwardBufferHealth: number, emptyFactor: number, fullFactor: number) => number;
13
13
  export declare const getMinPossibleAudioForVideo: (videoTrack: IVideoTrack | undefined, sortedVideoTracksAsc: IVideoTrack[], sortedAudioTracksAsc: IAudioTrack[], minVideoAudioRatio: number) => IAudioTrack | undefined;
@@ -1,8 +1,8 @@
1
1
  import type { ILogger, IObservable } from "@vkontakte/videoplayer-shared";
2
2
  import { type ExactVideoQuality, Subject } from "@vkontakte/videoplayer-shared";
3
- import type { ITuningConfig } from "#/utils/tuningConfig";
4
- import type { IVideoTrack } from "#/player/types";
5
- import type { IStateMachine } from "#/utils/StateMachine/types";
3
+ import type { ITuningConfig } from "../../../utils/tuningConfig";
4
+ import type { IVideoTrack } from "../../../player/types";
5
+ import type { IStateMachine } from "../../../utils/StateMachine/types";
6
6
  interface IConnectData {
7
7
  logger: ILogger;
8
8
  video: HTMLVideoElement;
@@ -1,4 +1,4 @@
1
- import type { IObservableVideo } from "#/providers/utils/HTMLVideoElement/observable";
1
+ import type { IObservableVideo } from "./observable";
2
2
  import type { IListener, IRectangle, ISubscription, IValueSubject } from "@vkontakte/videoplayer-shared";
3
3
  interface ConnectParams {
4
4
  video: HTMLVideoElement;
@@ -1,5 +1,5 @@
1
- import type { IExternalTextTrack, IInternalTextTrack, ITextTrack } from "#/player/types";
2
- import type { IDesiredState, IProviderOutput } from "#/providers/types";
1
+ import type { IExternalTextTrack, IInternalTextTrack, ITextTrack } from "../../../player/types";
2
+ import type { IDesiredState, IProviderOutput } from "../../types";
3
3
  /**
4
4
  * TODO: сейчас externalTextTracks и internalTextTracks записываются в availableTextTracks отсюда
5
5
  * нужно будет выпилить этот класс за исключением этой логики,
@@ -1,5 +1,5 @@
1
1
  import type { Seconds, IRange, IObservable, IError, IValueObservable } from "@vkontakte/videoplayer-shared";
2
- import type { IVolumeState, PlaybackRate } from "#/player/types";
2
+ import type { IVolumeState, PlaybackRate } from "../../../player/types";
3
3
  export interface IObservableVideo {
4
4
  playing$: IObservable<undefined>;
5
5
  pause$: IObservable<undefined>;
@@ -1,4 +1,4 @@
1
- import type { ITuningConfig } from "#/utils/tuningConfig";
1
+ import type { ITuningConfig } from "../../../utils/tuningConfig";
2
2
  type AllocateConstraints = Pick<ITuningConfig, "audioVideoSyncRate" | "disableYandexPiP" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
3
3
  type DisposeConstraints = Pick<ITuningConfig, "keepVideoElement" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
4
4
  export declare const allocate: (container: HTMLElement, { audioVideoSyncRate, disableYandexPiP, clearVideoElementInnerHTML, reuseOwnVideoElement }: AllocateConstraints) => HTMLVideoElement;
@@ -1,6 +1,6 @@
1
1
  import type { ExactVideoQuality, IObservable, IValueSubject, Milliseconds, Kbps, Seconds } from "@vkontakte/videoplayer-shared";
2
- import type { IVideoTrack } from "#/player/types";
3
- import type { ITuningConfig } from "#/utils/tuningConfig";
2
+ import type { IVideoTrack } from "../../player/types";
3
+ import type { ITuningConfig } from "../../utils/tuningConfig";
4
4
  interface IConnectData {
5
5
  videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
6
6
  throughput$: IValueSubject<number>;
@@ -1,4 +1,4 @@
1
- import { HttpConnectionType } from "#/player/types";
1
+ import { HttpConnectionType } from "../../player/types";
2
2
  declare const _default: (headers: Headers) => {
3
3
  type: HttpConnectionType | undefined;
4
4
  reused: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { Byte, IRange, Kbps, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
2
- import type { IVideoStream, VideoCodec, AudioCodec } from "#/player/types";
2
+ import type { IVideoStream, VideoCodec, AudioCodec } from "../../../player/types";
3
3
  export declare enum StreamKind {
4
4
  VIDEO = "video",
5
5
  AUDIO = "audio",
@@ -1,6 +1,6 @@
1
1
  import type { IListener, IObservable, ISubscription, IValueSubject } from "@vkontakte/videoplayer-shared";
2
- import type { IVolumeState, PlaybackRate } from "#/player/types";
3
- import type { IStateMachine } from "#/utils/StateMachine/types";
2
+ import type { IVolumeState, PlaybackRate } from "../../player/types";
3
+ import type { IStateMachine } from "../../utils/StateMachine/types";
4
4
  declare const syncDesiredState: <Value>(desiredState: IStateMachine<Value | undefined>, get: () => Value | undefined, set: (value: Value | undefined) => void, { equal, changed$, onError }?: {
5
5
  equal?: (a: Value | undefined, b: Value | undefined) => boolean;
6
6
  changed$?: IObservable<Value | undefined>;
@@ -1,4 +1,4 @@
1
- import type { IStateMachine } from "#/utils/StateMachine/types";
2
- import type { PlaybackState } from "#/player/types";
1
+ import type { IStateMachine } from "../../utils/StateMachine/types";
2
+ import type { PlaybackState } from "../../player/types";
3
3
  declare const _default: (playbackState: IStateMachine<PlaybackState>, value: PlaybackState, ignoreCurrentTransition?: boolean) => void;
4
4
  export default _default;
@@ -1,4 +1,8 @@
1
- import type { ITuningConfig } from "#/utils/tuningConfig";
2
- import type { Manifest } from "./parsers/types";
1
+ import type { ITuningConfig } from "../../utils/tuningConfig";
2
+ import type { Manifest, Representation } from "./parsers/types";
3
3
  /** @mutates streams.video */
4
4
  export declare const markVideoStreamRepresentaionsFilter: (streams: Manifest["streams"], videoStreamRepresentaionsFilter: ITuningConfig["dash"]["videoStreamRepresentaionsFilter"]) => void;
5
+ export declare function isTvDisabled({ codecs, height, fps }: Pick<Representation, "fps" | "height"> & {
6
+ codecs: string | string[];
7
+ }, videoStreamRepresentaionsFilter: ITuningConfig["dash"]["videoStreamRepresentaionsFilter"]): boolean;
8
+ export declare const parseDashLiveCodecs: (codecs: string) => string[];
@@ -1,4 +1,4 @@
1
- import type { Degree, Vector2D, Vector3D } from "#/utils/3d/types";
1
+ import type { Degree, Vector2D, Vector3D } from "./types";
2
2
  /**
3
3
  * Модель камеры трехмерной сцены
4
4
  */
@@ -1,5 +1,5 @@
1
- import type { Camera3D } from "#/utils/3d/Camera3D";
2
- import type { DegreePerSecond, CameraRotationManagerParams, Degree, Vector3D } from "#/utils/3d/types";
1
+ import type { Camera3D } from "./Camera3D";
2
+ import type { DegreePerSecond, CameraRotationManagerParams, Degree, Vector3D } from "./types";
3
3
  /**
4
4
  * Класс управляющий вращением камеры
5
5
  */
@@ -1,4 +1,4 @@
1
- import type { Degree, Pixel, Scene3DParams, Vector2D, Vector3D } from "#/utils/3d/types";
1
+ import type { Degree, Pixel, Scene3DParams, Vector2D, Vector3D } from "./types";
2
2
  /**
3
3
  * Класс описывающий 3D сцену - канву на которой будет рисоваться проекция
4
4
  */
@@ -1,4 +1,4 @@
1
- import type { Checker } from "#/utils/ClientChecker/types/checker";
1
+ import type { Checker } from "../types/checker";
2
2
  export declare const mp3Mime = "audio/mpeg";
3
3
  export declare class AudioChecker implements Checker {
4
4
  private _audio;
@@ -1,5 +1,5 @@
1
- import { CurrentClientBrowser } from "#/utils/ClientChecker/types/currentClientBrowser";
2
- import type { Checker } from "#/utils/ClientChecker/types/checker";
1
+ import { CurrentClientBrowser } from "../types/currentClientBrowser";
2
+ import type { Checker } from "../types/checker";
3
3
  export declare class BrowserChecker implements Checker {
4
4
  private _current;
5
5
  private _current_version;
@@ -1,6 +1,6 @@
1
- import { CurrentClientDevice } from "#/utils/ClientChecker/types/currentClientDevice";
2
- import type { DisplayChecker } from "#/utils/ClientChecker/services/DisplayChecker";
3
- import type { Checker } from "#/utils/ClientChecker/types/checker";
1
+ import { CurrentClientDevice } from "../types/currentClientDevice";
2
+ import type { DisplayChecker } from "./DisplayChecker";
3
+ import type { Checker } from "../types/checker";
4
4
  export interface OS {
5
5
  name: string;
6
6
  version: string;
@@ -1,4 +1,4 @@
1
- import type { Checker } from "#/utils/ClientChecker/types/checker";
1
+ import type { Checker } from "../types/checker";
2
2
  export { isMobile } from "../utils/isMobile";
3
3
  export declare class DisplayChecker implements Checker {
4
4
  private _maxTouchPoints;
@@ -1,7 +1,7 @@
1
- import { VideoFormat } from "#/player/types";
1
+ import { VideoFormat } from "../../../player/types";
2
2
  import type { DeviceChecker } from "./DeviceChecker";
3
3
  import type { BrowserChecker } from "./BrowserChecker";
4
- import type { Checker } from "#/utils/ClientChecker/types/checker";
4
+ import type { Checker } from "../types/checker";
5
5
  type Protocols = {
6
6
  mms: boolean;
7
7
  mse: boolean;
@@ -1,6 +1,7 @@
1
1
  import type { IObservable, ISubject } from "@vkontakte/videoplayer-shared";
2
- import type { IStateMachine, ITransition } from "./types";
2
+ import type { IStateMachine, ITransition, TComparator } from "./types";
3
3
  export default class StateMachine<TState> implements IStateMachine<TState> {
4
+ private readonly comparator;
4
5
  private state;
5
6
  private prevState;
6
7
  private transition?;
@@ -10,7 +11,7 @@ export default class StateMachine<TState> implements IStateMachine<TState> {
10
11
  forceChanged$: ISubject<ITransition<TState>>;
11
12
  stateChangeStarted$: IObservable<ITransition<TState>>;
12
13
  stateChangeEnded$: IObservable<ITransition<TState>>;
13
- constructor(initialState: TState);
14
+ constructor(initialState: TState, comparator?: TComparator);
14
15
  setState(newState: TState): void;
15
16
  startTransitionTo(newState: TState): void;
16
17
  getTransition(): ITransition<TState> | undefined;
@@ -0,0 +1,3 @@
1
+ import type { TComparator } from "./types";
2
+ export declare const shallowEquals: TComparator;
3
+ export declare const deepEquals: TComparator;
@@ -58,3 +58,4 @@ export interface ITransition<TState> {
58
58
  */
59
59
  canceledTransition?: ITransition<TState>;
60
60
  }
61
+ export type TComparator = (v1: any, v2: any) => boolean;
@@ -1,5 +1,5 @@
1
1
  import type { Byte, Kbps, Milliseconds, IValueSubject } from "@vkontakte/videoplayer-shared";
2
- import type { ITuningConfig } from "#/utils/tuningConfig";
2
+ import type { ITuningConfig } from "./tuningConfig";
3
3
  declare class ThroughputEstimator {
4
4
  private throughput;
5
5
  private rtt;
@@ -1,6 +1,6 @@
1
1
  import type { IError, ISubject, IValueSubject } from "@vkontakte/videoplayer-shared";
2
- import type { IProviderOutput } from "#/providers/types";
3
- import type { IProviderEntry } from "#/providers/ProviderContainer/types";
2
+ import type { IProviderOutput } from "../../providers/types";
3
+ import type { IProviderEntry } from "../../providers/ProviderContainer/types";
4
4
  export declare class VolumeMultiplierManager {
5
5
  private providerOutput;
6
6
  private provider$;
@@ -1,7 +1,7 @@
1
- import type { ITuningConfig } from "#/utils/tuningConfig";
1
+ import type { ITuningConfig } from "./tuningConfig";
2
2
  import type { Kbps, Milliseconds, IRectangle, QualityLimits, IComponentLogger } from "@vkontakte/videoplayer-shared";
3
3
  import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
4
- import type { IAudioTrack, IBaseTrack, IVideoTrack } from "#/player/types";
4
+ import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../player/types";
5
5
  interface IConstraints<T extends IBaseTrack> {
6
6
  container?: IRectangle;
7
7
  estimatedThroughput?: Kbps;
@@ -1,5 +1,5 @@
1
- import type { IVideoTrack } from "#/player/types";
2
- import { PredefinedQualityLimits } from "#/player/types";
1
+ import type { IVideoTrack } from "../player/types";
2
+ import { PredefinedQualityLimits } from "../player/types";
3
3
  import type { ExactVideoQuality, Nullable, QualityLimits } from "@vkontakte/videoplayer-shared";
4
4
  export declare function getQualityLimitsPredefinedType(limits: QualityLimits, highQualityLimit: ExactVideoQuality, trafficSavingLimit: ExactVideoQuality): PredefinedQualityLimits;
5
5
  type LimitsAsHeightValidParams = {
@@ -1,5 +1,5 @@
1
1
  import type { IValueSubject } from "@vkontakte/videoplayer-shared";
2
- import type { IStateMachine } from "#/utils/StateMachine/types";
2
+ import type { IStateMachine } from "./StateMachine/types";
3
3
  export declare const setStateWithSubscribe: <
4
4
  State,
5
5
  Value
@@ -1,4 +1,4 @@
1
- import type { ISmoothedValue, IParams } from "#/utils/smoothedValue/types";
1
+ import type { ISmoothedValue, IParams } from "./types";
2
2
  import type { IValueSubject } from "@vkontakte/videoplayer-shared";
3
3
  export declare abstract class BaseSmoothedValue implements ISmoothedValue {
4
4
  private prevReported;
@@ -1,5 +1,5 @@
1
- import type { IEmaAndMaParams } from "#/utils/smoothedValue/types";
2
- import { BaseSmoothedValue } from "#/utils/smoothedValue/baseSmoothedValue";
1
+ import type { IEmaAndMaParams } from "./types";
2
+ import { BaseSmoothedValue } from "./baseSmoothedValue";
3
3
  export declare class EmaAndMaSmoothedValue extends BaseSmoothedValue {
4
4
  private emaSmoothed;
5
5
  constructor(params: IEmaAndMaParams);
@@ -1,5 +1,5 @@
1
- import { BaseSmoothedValue } from "#/utils/smoothedValue/baseSmoothedValue";
2
- import type { IEmaTopExtremumParams } from "#/utils/smoothedValue/types";
1
+ import { BaseSmoothedValue } from "./baseSmoothedValue";
2
+ import type { IEmaTopExtremumParams } from "./types";
3
3
  export declare class EmaTopExtremumValue extends BaseSmoothedValue {
4
4
  private readonly extremumInterval;
5
5
  private furtherValues;
@@ -1,5 +1,5 @@
1
- import type { ITuningConfig } from "#/utils/tuningConfig";
2
- import type { ISmoothedValue } from "#/utils/smoothedValue/types";
1
+ import type { ITuningConfig } from "../tuningConfig";
2
+ import type { ISmoothedValue } from "./types";
3
3
  export declare class SmoothedValueFactory {
4
4
  static getSmoothedValue(initialThroughput: number, fastDirection: 1 | -1, tuning: ITuningConfig["throughputEstimator"]): ISmoothedValue;
5
5
  static getLiveBufferSmoothedValue(initialBufferLength: number, tuning: ITuningConfig["dashCmafLive"]["lowLatency"]["bufferEstimator"]): ISmoothedValue;