@vkontakte/videoplayer-core 2.0.131-dev.f14d8d97.0 → 2.0.131-dev.f80b28b8.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 (35) hide show
  1. package/es2015.cjs.js +10 -66
  2. package/es2015.esm.js +10 -66
  3. package/es2018.cjs.js +10 -66
  4. package/es2018.esm.js +9 -65
  5. package/es2024.cjs.js +9 -65
  6. package/es2024.esm.js +9 -65
  7. package/esnext.cjs.js +9 -65
  8. package/esnext.esm.js +9 -65
  9. package/evergreen.esm.js +8 -64
  10. package/package.json +2 -2
  11. package/types/player/Player.d.ts +2 -9
  12. package/types/player/types.d.ts +0 -15
  13. package/types/providers/ChromecastProvider/ChromecastInitializer/index.d.ts +1 -5
  14. package/types/providers/ChromecastProvider/index.d.ts +0 -2
  15. package/types/providers/DashLiveProvider/DashLiveProvider.d.ts +0 -1
  16. package/types/providers/DashLiveProvider/utils/FilesFetcher.d.ts +1 -2
  17. package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +0 -1
  18. package/types/providers/DashLiveProvider/utils/ThroughputEstimator.d.ts +0 -4
  19. package/types/providers/DashProvider/baseDashProvider.d.ts +3 -4
  20. package/types/providers/DashProvider/lib/buffer.d.ts +3 -0
  21. package/types/providers/DashProvider/lib/fetcher.d.ts +4 -5
  22. package/types/providers/DashProvider/lib/player.d.ts +3 -8
  23. package/types/providers/DashProvider/lib/sourceBufferBufferedDiff.d.ts +19 -0
  24. package/types/providers/DashProvider/lib/types.d.ts +1 -5
  25. package/types/providers/DashProvider/lib/utils.d.ts +11 -0
  26. package/types/providers/ProviderContainer/index.d.ts +0 -4
  27. package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +1 -4
  28. package/types/providers/WebRTCLiveProvider/WebRTCLiveProvider.d.ts +0 -1
  29. package/types/providers/types.d.ts +2 -7
  30. package/types/providers/utils/HTMLVideoElement/DroppedFramesManager.d.ts +1 -3
  31. package/types/utils/StatefulIterator/index.d.ts +1 -5
  32. package/types/utils/autoSelectTrack.d.ts +3 -4
  33. package/types/utils/qualityLimits.d.ts +3 -18
  34. package/types/utils/smoothedValue/baseSmoothedValue.d.ts +0 -3
  35. package/types/utils/tuningConfig.d.ts +2 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-core",
3
- "version": "2.0.131-dev.f14d8d97.0",
3
+ "version": "2.0.131-dev.f80b28b8.0",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer core library based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -54,7 +54,7 @@
54
54
  "**/*.d.ts"
55
55
  ],
56
56
  "dependencies": {
57
- "@vkontakte/videoplayer-shared": "1.0.59-dev.f7cc031b.0",
57
+ "@vkontakte/videoplayer-shared": "1.0.59-dev.8fce45f2.0",
58
58
  "hls.js": "~1.4.7"
59
59
  }
60
60
  }
@@ -1,14 +1,11 @@
1
1
  import { IOptionalTuningConfig } from '../utils/tuningConfig';
2
- import { IError, ILogEntry, Seconds, Subject, ValueSubject, QualityLimits, VideoQuality, ITracer } from '@vkontakte/videoplayer-shared';
2
+ import { IError, ILogEntry, Seconds, Subject, ValueSubject, QualityLimits, VideoQuality } from '@vkontakte/videoplayer-shared';
3
3
  import { ChromecastState, HttpConnectionType, IAudioStream, IConfig, ICueSettings, IExternalTextTrack, IPlayer, ISeekRequest, ISources, ITextTrack, IVideoStream, PlaybackRate, PlaybackState, PredefinedQualityLimits, StartEnd, Surface, VideoFormat } from './types';
4
4
  export default class Player implements IPlayer {
5
5
  private subscription;
6
6
  private domContainer;
7
7
  private providerContainer?;
8
8
  private chromecastInitializer;
9
- private logger;
10
- private tracer;
11
- private abrLogger;
12
9
  private config;
13
10
  private tuning;
14
11
  private throughputEstimator;
@@ -110,10 +107,9 @@ export default class Player implements IPlayer {
110
107
  element$: ValueSubject<HTMLVideoElement | undefined>;
111
108
  tuningConfigName$: ValueSubject<string[]>;
112
109
  enableDebugTelemetry$: ValueSubject<boolean>;
113
- dumpTelemetry: (receiver: (value: Record<string, any>) => void) => void;
114
110
  getCurrentTime$: ValueSubject<null>;
115
111
  };
116
- constructor(tuning?: IOptionalTuningConfig, tracer?: ITracer);
112
+ constructor(tuning?: IOptionalTuningConfig);
117
113
  initVideo(config: IConfig): IPlayer;
118
114
  destroy(): void;
119
115
  prepare(): IPlayer;
@@ -180,7 +176,6 @@ export default class Player implements IPlayer {
180
176
  */
181
177
  releaseCamera(): this;
182
178
  getExactTime(): Seconds;
183
- getAllLogs(): ILogEntry[];
184
179
  private getScene3D;
185
180
  private setIntrinsicVideoSize;
186
181
  private initDesiredStateSubscriptions;
@@ -188,9 +183,7 @@ export default class Player implements IPlayer {
188
183
  private initChromecastSubscription;
189
184
  private initStartingVideoTrack;
190
185
  private setStartingVideoTrack;
191
- private initLogs;
192
186
  private initDebugTelemetry;
193
- private initTracerSubscription;
194
187
  private initWakeLock;
195
188
  private setVideoTrackIdByQuality;
196
189
  private getActiveLiveDelay;
@@ -62,10 +62,6 @@ export interface IPlayer {
62
62
  * Может быть точнее, чем `info.position$` в промежутках между timeupdate
63
63
  */
64
64
  getExactTime(): number;
65
- /**
66
- * Возвращает все логи с момента инициализации плеера
67
- */
68
- getAllLogs(): ILogEntry[];
69
65
  experimental: {
70
66
  /**
71
67
  * Элемент, который сейчас вставлен в container.
@@ -74,7 +70,6 @@ export interface IPlayer {
74
70
  element$: IValueObservable<HTMLVideoElement | undefined>;
75
71
  tuningConfigName$: IValueSubject<string[]>;
76
72
  enableDebugTelemetry$: IValueSubject<boolean>;
77
- dumpTelemetry: (receiver: (value: Record<string, any>) => void) => void;
78
73
  /** функция вычисления текущей позиции проигрывания из под провадера (если расчет нестандартный) */
79
74
  getCurrentTime$: IValueSubject<(() => number) | null>;
80
75
  };
@@ -496,16 +491,6 @@ export declare enum VideoFormat {
496
491
  HLS_LIVE_CMAF = "HLS_LIVE_CMAF",
497
492
  WEB_RTC_LIVE = "WEB_RTC_LIVE"
498
493
  }
499
- export declare enum VideoCodec {
500
- AV1 = "av1",
501
- VP9 = "vp9",
502
- AVC1 = "avc1",// h264
503
- HEV1 = "hev1"
504
- }
505
- export declare enum AudioCodec {
506
- OPUS = "opus",
507
- MP4A = "mp4a"
508
- }
509
494
  export interface IVideoStream {
510
495
  id: string;
511
496
  language?: string;
@@ -1,12 +1,9 @@
1
- import { ISubject, IValueSubject, ILogger, IError } from '@vkontakte/videoplayer-shared';
1
+ import { ISubject, IValueSubject, IError } from '@vkontakte/videoplayer-shared';
2
2
  import { ChromecastState } from '../../../player/types';
3
3
  import { IChromecastConnection, IChromecastInitializer } from './types';
4
4
  interface IParams {
5
5
  receiverApplicationId?: string;
6
6
  isDisabled?: boolean;
7
- dependencies: {
8
- logger: ILogger;
9
- };
10
7
  }
11
8
  export declare class ChromecastInitializer implements IChromecastInitializer {
12
9
  readonly connection$: IValueSubject<IChromecastConnection | undefined>;
@@ -15,7 +12,6 @@ export declare class ChromecastInitializer implements IChromecastInitializer {
15
12
  contentId?: string;
16
13
  private readonly realCastState$;
17
14
  private readonly subscription;
18
- private readonly log;
19
15
  private readonly params;
20
16
  private isDestroyed;
21
17
  constructor(params: IParams);
@@ -11,7 +11,6 @@ export default class ChromecastProvider implements IProvider {
11
11
  private loadMediaTimeoutSubscription;
12
12
  private videoState;
13
13
  private params;
14
- private log;
15
14
  constructor(params: IParams);
16
15
  destroy(): void;
17
16
  private subscribe;
@@ -27,7 +26,6 @@ export default class ChromecastProvider implements IProvider {
27
26
  private createMediaInfo;
28
27
  private createLoadRequest;
29
28
  private loadMedia;
30
- private logRemoteEvent;
31
29
  private syncPlayback;
32
30
  }
33
31
  export {};
@@ -22,7 +22,6 @@ export default class DashLiveProvider implements IProvider {
22
22
  private maxSeekBackTime$;
23
23
  private zeroTime$;
24
24
  private liveOffset;
25
- private log;
26
25
  private params;
27
26
  constructor(params: Params);
28
27
  destroy(): void;
@@ -9,8 +9,7 @@ export default class FilesFetcher {
9
9
  private TIMEOUT;
10
10
  private BITRATE_ESTIMATOR;
11
11
  private MAX_PARALLEL_REQUESTS;
12
- private logger;
13
- constructor(RETRY_COUNT: number, TIMEOUT: number, BITRATE_ESTIMATOR: any, MAX_PARALLEL_REQUESTS: number, logger: (...args: any[]) => void);
12
+ constructor(RETRY_COUNT: number, TIMEOUT: number, BITRATE_ESTIMATOR: any, MAX_PARALLEL_REQUESTS: number);
14
13
  private limitCompleteCount;
15
14
  private _sendRequest;
16
15
  private _getParallelRequestCount;
@@ -19,7 +19,6 @@ interface IParams {
19
19
  manifestRetryMaxInterval: number;
20
20
  manifestRetryMaxCount: number;
21
21
  };
22
- logger: (...args: any[]) => void;
23
22
  }
24
23
  type AutoQualityLimits = {
25
24
  max?: number;
@@ -15,12 +15,9 @@
15
15
  * active time = (1.1 - 1.0) + (0.5 - 0.2) = 0.4
16
16
  * throughput = total size / active time = 6500 bytes/sec
17
17
  */
18
- type ILogger = (...args: any[]) => void;
19
18
  export default class ThroughputEstimator {
20
19
  private intervals;
21
20
  private currentRate;
22
- private logger;
23
- constructor(logger: ILogger);
24
21
  private _updateRate;
25
22
  private _createInterval;
26
23
  private _doMergeIntervals;
@@ -30,4 +27,3 @@ export default class ThroughputEstimator {
30
27
  addInterval(timeStart: number, timeEnd: number, bytes: number): boolean;
31
28
  getBitRate(): number;
32
29
  }
33
- export {};
@@ -1,9 +1,9 @@
1
- import { IAudioTrack, IDashURLSource, IHLSSource, IInternalTextTrack, IVideoTrack, VideoCodec } from '../../player/types';
1
+ import { IAudioTrack, IDashURLSource, IHLSSource, IInternalTextTrack, IVideoTrack } from '../../player/types';
2
2
  import { CommonInit, IProviderSubscriptionInfo, ProviderState, Representation, Stream } from './lib/types';
3
3
  import { IProvider, IProviderParams } from '../../providers/types';
4
4
  import { TrackHistory } from '../../utils/autoSelectTrack';
5
5
  import { IStateMachine } from '../../utils/StateMachine/types';
6
- import { ISubscription, ITracer, Milliseconds } from '@vkontakte/videoplayer-shared';
6
+ import { ISubscription, Milliseconds } from '@vkontakte/videoplayer-shared';
7
7
  import { Player } from './lib/player';
8
8
  import { Scene3D } from '../../utils/3d/Scene3D';
9
9
  import DroppedFramesManager from '../../providers/utils/HTMLVideoElement/DroppedFramesManager';
@@ -12,7 +12,6 @@ import StallsManager from '../../providers/utils/StallsManager';
12
12
  import { ElementSizeManager } from './lib/ElementSizeManager';
13
13
  type IParams = IProviderParams<IDashURLSource> & {
14
14
  sourceHls?: IHLSSource;
15
- forceVideoCodec?: VideoCodec;
16
15
  };
17
16
  export default abstract class BaseDashProvider implements IProvider {
18
17
  scene3D: Scene3D | undefined;
@@ -21,7 +20,6 @@ export default abstract class BaseDashProvider implements IProvider {
21
20
  protected video: HTMLVideoElement;
22
21
  protected player: Player;
23
22
  protected params: IParams;
24
- protected tracer: ITracer;
25
23
  protected textTracksManager: TextTrackManager;
26
24
  protected droppedFramesManager: DroppedFramesManager;
27
25
  protected stallsManager: StallsManager;
@@ -42,6 +40,7 @@ export default abstract class BaseDashProvider implements IProvider {
42
40
  protected audioStreamsMap: Map<Stream, IAudioTrack[]>;
43
41
  protected videoTrackSwitchHistory: TrackHistory<IVideoTrack>;
44
42
  protected audioTrackSwitchHistory: TrackHistory<import("../../player/types").IBaseTrack>;
43
+ private readonly selectedRepresentations;
45
44
  constructor(params: IParams);
46
45
  protected abstract seek(position: Milliseconds, forcePrecise: boolean): void;
47
46
  protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
@@ -12,6 +12,7 @@ export interface Dependencies {
12
12
  }
13
13
  export interface Gap extends IRange<Milliseconds> {
14
14
  representation: Representation['id'];
15
+ persistent: boolean;
15
16
  }
16
17
  export declare class BufferManager {
17
18
  currentLiveSegmentServerLatency$: IValueSubject<number>;
@@ -60,6 +61,7 @@ export declare class BufferManager {
60
61
  private index;
61
62
  private lastDataObtainedTimestampMs;
62
63
  private loadByteRangeSegmentsTimeoutId;
64
+ private sourceBufferBufferedDiff;
63
65
  constructor(kind: StreamKind, mediaSource: MediaSource, representations: Representation[], { fetcher, tuning, getCurrentPosition, isActiveLowLatency, compatibilityMode, manifest }: Dependencies);
64
66
  startWith: (param_0: string) => Promise<void | undefined>;
65
67
  switchToWithPreviousAbort(newRepresentationId: Representation['id'], dropBuffer?: boolean): void;
@@ -108,6 +110,7 @@ export declare class BufferManager {
108
110
  private pruneBuffer;
109
111
  private abortBuffer;
110
112
  getDebugBufferState(): IRange<Milliseconds> | undefined;
113
+ getBufferedTo(): number | null;
111
114
  getForwardBufferDuration(currentPosition?: Milliseconds | undefined): Milliseconds;
112
115
  private detectGaps;
113
116
  private detectGapsWhenIdle;
@@ -1,6 +1,6 @@
1
1
  import { HttpConnectionType } from '../../../player/types';
2
2
  import type ThroughputEstimator from '../../../utils/ThroughputEstimator';
3
- import { Byte, IValueSubject, Milliseconds, IRange, Subject, ITracer, IError } from '@vkontakte/videoplayer-shared';
3
+ import { Byte, IValueSubject, Milliseconds, IRange, Subject, IError } from '@vkontakte/videoplayer-shared';
4
4
  import { CommonInit, GenericContainerParser, Segment, SegmentReference } from './types';
5
5
  export declare enum RangeMethod {
6
6
  HEADER = 0,
@@ -10,7 +10,6 @@ export interface IParams {
10
10
  throughputEstimator?: ThroughputEstimator;
11
11
  requestQuic: boolean;
12
12
  compatibilityMode?: boolean;
13
- tracer: ITracer;
14
13
  useEnableSubtitlesParam?: boolean;
15
14
  }
16
15
  export type Priority = 'high' | 'low' | 'auto';
@@ -35,17 +34,16 @@ export type RepresentationFetchResult = {
35
34
  export declare class Fetcher {
36
35
  private throughputEstimator;
37
36
  private requestQuic;
38
- private tracer;
39
37
  lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
40
38
  lastConnectionReused$: IValueSubject<boolean | undefined>;
41
39
  lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
42
40
  recoverableError$: Subject<IError>;
43
41
  error$: Subject<IError>;
44
42
  private abortAllController;
45
- private subscription;
46
43
  private compatibilityMode;
47
44
  private useEnableSubtitlesParam;
48
- constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam }: IParams);
45
+ private readonly subscription;
46
+ constructor({ throughputEstimator, requestQuic, compatibilityMode, useEnableSubtitlesParam }: IParams);
49
47
  private onHeadersReceived;
50
48
  fetchManifest: (param_0: string) => Promise<string | null | undefined>;
51
49
  fetch: (param_0: string, param_1: FetchParams) => Promise<ArrayBuffer | null | undefined>;
@@ -54,5 +52,6 @@ export declare class Fetcher {
54
52
  private fetchByteRangeRepresentation;
55
53
  private fetchTemplateRepresentation;
56
54
  private doFetch;
55
+ private unsubscribeAbortSubscription;
57
56
  }
58
57
  export declare const suppressAbort: (e: Error | unknown) => void | never;
@@ -1,9 +1,9 @@
1
- import { HttpConnectionType, VideoCodec } from '../../../player/types';
1
+ import { HttpConnectionType } from '../../../player/types';
2
2
  import { CommonInit, LiveStreamStatus, Manifest, Representation, StreamKind, TextRepresentation } from './types';
3
3
  import StateMachine from '../../../utils/StateMachine/StateMachine';
4
4
  import type ThroughputEstimator from '../../../utils/ThroughputEstimator';
5
5
  import { ITuningConfig } from '../../../utils/tuningConfig';
6
- import { IError, ISubject, ITracer, IValueSubject, Milliseconds, Subject } from '@vkontakte/videoplayer-shared';
6
+ import { IError, ISubject, IValueSubject, Milliseconds, Subject } from '@vkontakte/videoplayer-shared';
7
7
  export declare enum State {
8
8
  NONE = "none",
9
9
  MANIFEST_READY = "manifest_ready",
@@ -14,8 +14,6 @@ export interface Params {
14
14
  throughputEstimator: ThroughputEstimator;
15
15
  tuning: ITuningConfig;
16
16
  compatibilityMode?: boolean;
17
- forceVideoCodec?: VideoCodec;
18
- tracer: ITracer;
19
17
  }
20
18
  export declare class Player {
21
19
  private element;
@@ -23,8 +21,6 @@ export declare class Player {
23
21
  private source;
24
22
  private manifest;
25
23
  private tuning;
26
- private tracer;
27
- private forceVideoCodec?;
28
24
  private videoBufferManager;
29
25
  private audioBufferManager;
30
26
  private bufferManagers;
@@ -70,6 +66,7 @@ export declare class Player {
70
66
  private stallWatchdogSubscription;
71
67
  private livePauseWatchdogSubscription;
72
68
  private destroyController;
69
+ private initedPruneBufferCallback;
73
70
  constructor(params: Params);
74
71
  initManifest: (param_0: HTMLVideoElement, param_1: string, param_2: number) => Promise<void | undefined>;
75
72
  updateManifest: () => Promise<Manifest | null | undefined>;
@@ -83,10 +80,8 @@ export declare class Player {
83
80
  stop(): void;
84
81
  setBufferTarget(time: Milliseconds): void;
85
82
  getStreams(): Manifest['streams'] | undefined;
86
- getCodecs(): Manifest['codecs'] | undefined;
87
83
  setPreloadOnly(preloadOnly: boolean): void;
88
84
  destroy(): void;
89
- private initTracerSubscription;
90
85
  private isManualDecreasePlaybackInLive;
91
86
  private normolizeLiveOffset;
92
87
  private tick;
@@ -0,0 +1,19 @@
1
+ export declare class SourceBufferBufferedDiff {
2
+ private lastUpdateTs;
3
+ private lastCallTs;
4
+ private prevRanges;
5
+ private readonly sourceBuffer;
6
+ private readonly mediaSource;
7
+ private readonly subscription;
8
+ constructor(mediaSource: MediaSource, sourceBuffer: SourceBuffer);
9
+ private updateend;
10
+ /**
11
+ * если длина массивов разная - считаем, что какие то сегменты удалили
12
+ *
13
+ * если длина одинаковая - считаем, что сегменты удалили в том случае,
14
+ * если в новом массиве хотя бы 1 сегмент стал меньше
15
+ */
16
+ private isRangesRemoved;
17
+ wasUpdated(): boolean;
18
+ destroy(): void;
19
+ }
@@ -1,7 +1,7 @@
1
1
  import { Byte, Kbps, Milliseconds, IRange, IObservable, ISubject, IValueSubject } from '@vkontakte/videoplayer-shared';
2
2
  import { IDesiredState, IProviderOutput, IProviderParams } from '../../../providers/types';
3
3
  import { IObservableVideo } from '../../../providers/utils/HTMLVideoElement/observable';
4
- import { VideoCodec, AudioCodec, IDashURLSource, IVideoStream } from '../../../player/types';
4
+ import { IDashURLSource, IVideoStream } from '../../../player/types';
5
5
  export declare enum StreamKind {
6
6
  VIDEO = "video",
7
7
  AUDIO = "audio",
@@ -117,10 +117,6 @@ export interface Manifest {
117
117
  [key in StreamKind]: Stream[];
118
118
  };
119
119
  baseUrls: string[];
120
- codecs?: {
121
- video?: VideoCodec[];
122
- audio?: AudioCodec[];
123
- };
124
120
  live?: LiveMetadata;
125
121
  }
126
122
  export declare enum ProjectionType {
@@ -1,5 +1,6 @@
1
1
  import { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from '../../../providers/DashProvider/lib/types';
2
2
  import { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from '../../../player/types';
3
+ import { IRange, Milliseconds } from '@vkontakte/videoplayer-shared';
3
4
  export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString, streamId }: Representation) => IVideoTrack | undefined;
4
5
  export declare const representationToAudioTrack: ({ id, bitrate }: Representation) => IAudioTrack;
5
6
  export declare const representationToTextTrack: ({ language, label }: Stream, { id, url, isAuto }: Representation & {
@@ -13,3 +14,13 @@ export declare const isTemplateSegment: (segment: Segment) => segment is Templat
13
14
  export declare const isTemplateSegmentReference: (segmentReference: SegmentReference) => segmentReference is TemplateSegmentReference;
14
15
  export declare const isAbortError: (e: Error | unknown) => boolean;
15
16
  export declare const isTextRepresentation: (representation: Representation | TextRepresentation) => representation is TextRepresentation;
17
+ /**
18
+ * @mutates intervals
19
+ */
20
+ export declare const mergeIntervals: (intervals: IRange<Milliseconds>[]) => IRange<Milliseconds>[];
21
+ export declare const findInIterator: <T>(iterable: MapIterator<T> | SetIterator<T>, matchFn: (arg: T) => boolean) => T | null;
22
+ /**
23
+ * даёт `true` каждые `ms` миллисекунд
24
+ */
25
+ export declare const semaphor: (ms: number) => () => boolean;
26
+ export declare const createTimeRanges: (buffered: TimeRanges) => number[];
@@ -22,9 +22,6 @@ export default class ProviderContainer implements IProviderContainer {
22
22
  private subscription;
23
23
  private screenFormatsIterator;
24
24
  private chromecastFormatsIterator;
25
- private videoCodecsIterator;
26
- private log;
27
- private tracer;
28
25
  private params;
29
26
  private failoverIndex;
30
27
  private volumeMultiplierManager;
@@ -34,7 +31,6 @@ export default class ProviderContainer implements IProviderContainer {
34
31
  private initProvider;
35
32
  private reinitProvider;
36
33
  private switchToNextProvider;
37
- private switchToNextVideoCodec;
38
34
  private destroyProvider;
39
35
  private createProvider;
40
36
  private createScreenProvider;
@@ -1,4 +1,4 @@
1
- import { VideoFormat, VideoCodec, AudioCodec } from '../../../player/types';
1
+ import { VideoFormat } from '../../../player/types';
2
2
  import { type ITuningConfig } from '../../../utils/tuningConfig';
3
3
  type FilterConstraints = Pick<ITuningConfig, 'useHlsJs' | 'useManagedMediaSource' | 'useOldMSEDetection'>;
4
4
  export declare const filterAvailableFormats: (formats: VideoFormat[], { useHlsJs, useManagedMediaSource, useOldMSEDetection }: FilterConstraints) => VideoFormat[];
@@ -17,7 +17,4 @@ type AllLiveFormats = [LiveFormat, LiveFormat, LiveFormat, LiveFormat, LiveForma
17
17
  export declare const getLiveFormatsPriority: ({ androidPreferredFormat, preferCMAF, preferWebRTC }: Constraints) => AllLiveFormats;
18
18
  export declare const getChromeCastFormatsPriority: (live: boolean) => VideoFormat[];
19
19
  export declare const selectCodec: (codecs: Set<string>) => string | undefined;
20
- export declare const filterAvailableVideoCodecs: (codecs: string[]) => VideoCodec[];
21
- export declare const filterAvailableAudioCodecs: (codecs: string[]) => AudioCodec[];
22
- export declare const convertCodecName: <T extends VideoCodec | AudioCodec>(codec: string) => T;
23
20
  export {};
@@ -8,7 +8,6 @@ import { URLSource } from '../../player/types';
8
8
  export default class WebRTCLiveProvider implements IProvider {
9
9
  private readonly subscription;
10
10
  private readonly params;
11
- private log;
12
11
  private video;
13
12
  private videoState;
14
13
  private liveStreamClient;
@@ -1,7 +1,7 @@
1
1
  import { ITuningConfig } from '../utils/tuningConfig';
2
- import { ILogger, ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IComponentLogger, ITracer, IRectangle } from '@vkontakte/videoplayer-shared';
2
+ import { ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IRectangle } from '@vkontakte/videoplayer-shared';
3
3
  import { IChromecastInitializer } from '../providers/ChromecastProvider/ChromecastInitializer/types';
4
- import { HttpConnectionType, VideoCodec, AudioCodec, IAudioStream, IAudioTrack, ICueSettings, ISources, IVideoStream, SeekState } from '../player/types';
4
+ import { HttpConnectionType, IAudioStream, IAudioTrack, ICueSettings, ISources, IVideoStream, SeekState } from '../player/types';
5
5
  import { IExternalTextTrack, IInternalTextTrack, ITextTrack, IVideoTrack, IVolumeState, PlaybackState, PlaybackRate } from '../player/types';
6
6
  import { IStateMachine } from '../utils/StateMachine/types';
7
7
  import ThroughputEstimator from '../utils/ThroughputEstimator';
@@ -15,9 +15,6 @@ export interface IProviderDependencies {
15
15
  dependencies: {
16
16
  throughputEstimator: ThroughputEstimator;
17
17
  chromecastInitializer: IChromecastInitializer;
18
- logger: ILogger;
19
- tracer: ITracer;
20
- abrLogger: IComponentLogger;
21
18
  };
22
19
  }
23
20
  export interface IProviderParams<TSourceType> extends IProviderDependencies {
@@ -56,11 +53,9 @@ export interface IProviderOutput {
56
53
  currentVideoStream$: IValueSubject<IVideoStream | undefined>;
57
54
  availableVideoTracks$: IValueSubject<IVideoTrack[]>;
58
55
  currentVideoTrack$: IValueSubject<IVideoTrack | undefined>;
59
- availableVideoCodecs$: IValueSubject<VideoCodec[]>;
60
56
  availableAudioStreams$: IValueSubject<IAudioStream[]>;
61
57
  currentAudioStream$: IValueSubject<IAudioStream | undefined>;
62
58
  availableAudioTracks$: IValueSubject<IAudioTrack[]>;
63
- availableAudioCodecs$: IValueSubject<AudioCodec[]>;
64
59
  availableTextTracks$: IValueSubject<ITextTrack[]>;
65
60
  currentTextTrack$: IValueSubject<ITextTrack['id'] | undefined>;
66
61
  isAudioAvailable$: IValueSubject<boolean>;
@@ -1,9 +1,8 @@
1
- import { type ExactVideoQuality, ILogger, IObservable, Subject } from '@vkontakte/videoplayer-shared';
1
+ import { type ExactVideoQuality, IObservable, Subject } from '@vkontakte/videoplayer-shared';
2
2
  import { ITuningConfig } from '../../../utils/tuningConfig';
3
3
  import { IVideoTrack } from '../../../player/types';
4
4
  import { IStateMachine } from '../../../utils/StateMachine/types';
5
5
  interface IConnectData {
6
- logger: ILogger;
7
6
  video: HTMLVideoElement;
8
7
  tracks: IVideoTrack[];
9
8
  droppedFramesChecker: ITuningConfig['droppedFramesChecker'];
@@ -14,7 +13,6 @@ interface IConnectData {
14
13
  declare class DroppedFramesManager {
15
14
  onDroopedVideoFramesLimit$: Subject<void>;
16
15
  private subscription;
17
- private log;
18
16
  private video;
19
17
  private droppedFramesChecker;
20
18
  private isAuto;
@@ -2,16 +2,12 @@ export interface IStatefulIterator<T> {
2
2
  next(): void;
3
3
  getValue(): T;
4
4
  isCompleted(): boolean;
5
- isLast(): boolean;
6
5
  }
7
6
  export declare class StatefulIterator<T> implements IStatefulIterator<T> {
8
- private readonly length;
9
- private index;
10
7
  private iterator;
11
8
  private current;
12
- constructor(array: T[]);
9
+ constructor(iteratorOrIterable: Iterable<T>);
13
10
  next(): void;
14
11
  getValue(): T;
15
12
  isCompleted(): boolean;
16
- isLast(): boolean;
17
13
  }
@@ -1,5 +1,5 @@
1
1
  import { ITuningConfig } from '../utils/tuningConfig';
2
- import { Kbps, Milliseconds, IRectangle, type ExactVideoQuality, QualityLimits, IComponentLogger } from '@vkontakte/videoplayer-shared';
2
+ import { Kbps, Milliseconds, IRectangle, type ExactVideoQuality, QualityLimits } from '@vkontakte/videoplayer-shared';
3
3
  import { IAudioTrack, IBaseTrack, IVideoTrack } from '../player/types';
4
4
  interface IConstraints<T extends IBaseTrack> {
5
5
  container?: IRectangle;
@@ -15,7 +15,6 @@ interface IConstraints<T extends IBaseTrack> {
15
15
  droppedVideoMaxQualityLimit?: ExactVideoQuality;
16
16
  stallsVideoMaxQualityLimit?: ExactVideoQuality;
17
17
  stallsPredictedThroughput?: Kbps;
18
- abrLogger: IComponentLogger;
19
18
  panelSize?: IRectangle;
20
19
  }
21
20
  export declare class TrackHistory<T extends IBaseTrack> {
@@ -27,6 +26,6 @@ export declare class TrackHistory<T extends IBaseTrack> {
27
26
  }
28
27
  export declare const defaultEmptyArrayErrorMessage = "Assertion \"ABR Tracks is empty array\" failed";
29
28
  export declare const getMinPossibleAudioForVideo: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], minVideoAudioRatio: number) => IAudioTrack | undefined;
30
- export declare const autoSelectVideoTrack: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize, }: IConstraints<IVideoTrack>) => IVideoTrack;
31
- export declare const autoSelectAudioTrackForVideo: (selectedVideoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], { estimatedThroughput, tuning, playbackRate, forwardBufferHealth, history, abrLogger, stallsPredictedThroughput, }: IConstraints<IAudioTrack>) => IAudioTrack | undefined;
29
+ export declare const autoSelectVideoTrack: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, panelSize, }: IConstraints<IVideoTrack>) => IVideoTrack;
30
+ export declare const autoSelectAudioTrackForVideo: (selectedVideoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], { estimatedThroughput, tuning, playbackRate, forwardBufferHealth, history, stallsPredictedThroughput, }: IConstraints<IAudioTrack>) => IAudioTrack | undefined;
32
31
  export {};
@@ -1,22 +1,7 @@
1
1
  import { IVideoTrack, PredefinedQualityLimits } from '../player/types';
2
2
  import { ExactVideoQuality, Nullable, QualityLimits } from '@vkontakte/videoplayer-shared';
3
- type Params = {
4
- limits: QualityLimits;
5
- highQualityLimit: ExactVideoQuality;
6
- trafficSavingLimit: ExactVideoQuality;
7
- };
8
- export declare function getQualityLimitsPredefinedType({ limits, highQualityLimit, trafficSavingLimit, }: Params): PredefinedQualityLimits;
9
- type HighQualityEnabled = {
10
- limits?: QualityLimits;
11
- highQualityLimit: ExactVideoQuality;
12
- trafficSavingLimit: ExactVideoQuality;
13
- };
14
- export declare function isHighQualityEnabled({ limits, highQualityLimit, trafficSavingLimit }: HighQualityEnabled): boolean;
15
- type LimitsValidParams = {
16
- limits?: QualityLimits;
17
- highestAvailableQuality: Nullable<ExactVideoQuality>;
18
- lowestAvailableQuality: Nullable<ExactVideoQuality>;
19
- };
3
+ export declare function getQualityLimitsPredefinedType(limits: QualityLimits, highQualityLimit: ExactVideoQuality, trafficSavingLimit: ExactVideoQuality): PredefinedQualityLimits;
4
+ export declare function isHighQualityEnabled(limits: Nullable<QualityLimits>, highQualityLimit: ExactVideoQuality, trafficSavingLimit: ExactVideoQuality): boolean;
20
5
  type LimitsAsHeightValidParams = {
21
6
  limits?: {
22
7
  min?: number;
@@ -25,7 +10,7 @@ type LimitsAsHeightValidParams = {
25
10
  highestAvailableHeight: Nullable<number>;
26
11
  lowestAvailableHeight: Nullable<number>;
27
12
  };
28
- export declare function areLimitsInvalid({ limits, highestAvailableQuality, lowestAvailableQuality }: LimitsValidParams): boolean | (null | undefined);
13
+ export declare function areLimitsInvalid(limits: Nullable<QualityLimits>, highestAvailableQuality: Nullable<ExactVideoQuality>, lowestAvailableQuality: Nullable<ExactVideoQuality>): boolean | (null | undefined);
29
14
  /**
30
15
  * Проверяем лимиты качества, когда указана высота качества.
31
16
  */
@@ -2,9 +2,6 @@ import { ISmoothedValue, IParams } from '../../utils/smoothedValue/types';
2
2
  import { IValueSubject } from '@vkontakte/videoplayer-shared';
3
3
  export declare abstract class BaseSmoothedValue implements ISmoothedValue {
4
4
  private prevReported;
5
- private rawSeries$;
6
- private smoothedSeries$;
7
- private reportedSeries$;
8
5
  protected smoothed: number;
9
6
  protected pastMeasures: number[];
10
7
  protected takenMeasures: number;
@@ -83,7 +83,8 @@ export type ITuningConfig = {
83
83
  maxSegmentRetryCount: number;
84
84
  sourceOpenTimeout: number;
85
85
  rejectOnSourceOpenTimeout: boolean;
86
- codecsPrioritizeEnabled: boolean;
86
+ pruneBufferInterval: number | null;
87
+ vktvAbrThrottle: number | null;
87
88
  };
88
89
  dashCmafLive: {
89
90
  maxActiveLiveOffset: Milliseconds;