@vkontakte/videoplayer-core 2.0.131-dev.f14d8d97.0 → 2.0.131-dev.f8833e36.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 (73) hide show
  1. package/es2015.cjs.js +94 -33
  2. package/es2015.esm.js +90 -29
  3. package/es2018.cjs.js +95 -34
  4. package/es2018.esm.js +91 -30
  5. package/es2024.cjs.js +97 -36
  6. package/es2024.esm.js +93 -32
  7. package/esnext.cjs.js +97 -36
  8. package/esnext.esm.js +93 -32
  9. package/evergreen.esm.js +91 -30
  10. package/package.json +2 -2
  11. package/types/player/types.d.ts +0 -10
  12. package/types/providers/DashProvider/baseDashProvider.d.ts +1 -2
  13. package/types/providers/DashProvider/lib/player.d.ts +1 -4
  14. package/types/providers/DashProvider/lib/types.d.ts +1 -5
  15. package/types/providers/DashProviderNew/baseDashProvider.d.ts +57 -0
  16. package/types/providers/DashProviderNew/consts.d.ts +3 -0
  17. package/types/providers/DashProviderNew/index.d.ts +2 -0
  18. package/types/providers/DashProviderNew/lib/ElementSizeManager.d.ts +19 -0
  19. package/types/providers/DashProviderNew/lib/LiveTextManager.d.ts +23 -0
  20. package/types/providers/DashProviderNew/lib/buffer.d.ts +117 -0
  21. package/types/providers/DashProviderNew/lib/fetcher.d.ts +59 -0
  22. package/types/providers/DashProviderNew/lib/parsers/ietf/index.d.ts +13 -0
  23. package/types/providers/DashProviderNew/lib/parsers/index.d.ts +3 -0
  24. package/types/providers/DashProviderNew/lib/parsers/mpd.d.ts +3 -0
  25. package/types/providers/DashProviderNew/lib/parsers/mpeg/BoxModel.d.ts +20 -0
  26. package/types/providers/DashProviderNew/lib/parsers/mpeg/BoxParser.d.ts +21 -0
  27. package/types/providers/DashProviderNew/lib/parsers/mpeg/BoxTypeEnum.d.ts +30 -0
  28. package/types/providers/DashProviderNew/lib/parsers/mpeg/box.d.ts +74 -0
  29. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/avc1.d.ts +8 -0
  30. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/equi.d.ts +21 -0
  31. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/ftyp.d.ts +17 -0
  32. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/index.d.ts +26 -0
  33. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/mdat.d.ts +15 -0
  34. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/mdia.d.ts +8 -0
  35. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/mfhd.d.ts +11 -0
  36. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/minf.d.ts +8 -0
  37. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/moof.d.ts +8 -0
  38. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/moov.d.ts +8 -0
  39. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/mvhd.d.ts +35 -0
  40. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/prhd.d.ts +16 -0
  41. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/proj.d.ts +8 -0
  42. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/sidx.d.ts +48 -0
  43. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/st3d.d.ts +23 -0
  44. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/stbl.d.ts +8 -0
  45. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/stsd.d.ts +11 -0
  46. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/sv3d.d.ts +8 -0
  47. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/tfdt.d.ts +17 -0
  48. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/tfhd.d.ts +22 -0
  49. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/tkhd.d.ts +42 -0
  50. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/traf.d.ts +8 -0
  51. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/trak.d.ts +8 -0
  52. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/trun.d.ts +31 -0
  53. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/unknown.d.ts +6 -0
  54. package/types/providers/DashProviderNew/lib/parsers/mpeg/boxes/uuid.d.ts +11 -0
  55. package/types/providers/DashProviderNew/lib/parsers/mpeg/fullBox.d.ts +15 -0
  56. package/types/providers/DashProviderNew/lib/parsers/mpeg/isobmff.d.ts +12 -0
  57. package/types/providers/DashProviderNew/lib/parsers/webm/ebml.d.ts +76 -0
  58. package/types/providers/DashProviderNew/lib/parsers/webm/webm.d.ts +3 -0
  59. package/types/providers/DashProviderNew/lib/player.d.ts +92 -0
  60. package/types/providers/DashProviderNew/lib/sourceBufferTaskQueue.d.ts +19 -0
  61. package/types/providers/DashProviderNew/lib/types.d.ts +186 -0
  62. package/types/providers/DashProviderNew/lib/utils.d.ts +21 -0
  63. package/types/providers/DashProviderNew/newDashCmafLiveProvider.d.ts +8 -0
  64. package/types/providers/DashProviderNew/newDashProvider.d.ts +6 -0
  65. package/types/providers/ProviderContainer/index.d.ts +0 -2
  66. package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +1 -4
  67. package/types/providers/types.d.ts +1 -3
  68. package/types/providers/utils/HTMLVideoElement/observable.d.ts +0 -1
  69. package/types/providers/utils/StallsManager.d.ts +18 -4
  70. package/types/utils/StatefulIterator/index.d.ts +1 -5
  71. package/types/utils/autoSelectTrack.d.ts +6 -3
  72. package/types/utils/qualityLimits.d.ts +3 -18
  73. package/types/utils/tuningConfig.d.ts +27 -8
@@ -0,0 +1,186 @@
1
+ import { Byte, Kbps, Milliseconds, IRange, IObservable, ISubject, IValueSubject } from '@vkontakte/videoplayer-shared';
2
+ import { IDesiredState, IProviderOutput, IProviderParams } from '../../../providers/types';
3
+ import { IObservableVideo } from '../../../providers/utils/HTMLVideoElement/observable';
4
+ import { IDashURLSource, IVideoStream } from '../../../player/types';
5
+ export declare enum StreamKind {
6
+ VIDEO = "video",
7
+ AUDIO = "audio",
8
+ TEXT = "text"
9
+ }
10
+ export declare enum LiveStatus {
11
+ ActiveLowLatency = "active_low_latency",
12
+ LiveWithTargetOffset = "live_with_target_offset",
13
+ LiveForwardBuffering = "live_forward_buffering",
14
+ None = "none"
15
+ }
16
+ export declare enum LiveStreamStatus {
17
+ Active = "active",
18
+ UnexpectedlyDown = "unexpectedly_down",// Стрим в сети, но трансляция оборвалась из-за тех. проблем
19
+ Unpublished = "unpublished"
20
+ }
21
+ export declare enum Profile {
22
+ WEBM_AS_IN_SPEC = "urn:mpeg:dash:profile:webm-on-demand:2012",// Такой указан в спеке
23
+ WEBM_AS_IN_FFMPEG = "urn:webm:dash:profile:webm-on-demand:2012"
24
+ }
25
+ export interface Representation {
26
+ id: string;
27
+ kind: StreamKind;
28
+ segmentReference: SegmentReference;
29
+ profiles: Array<Profile | string>;
30
+ duration?: Milliseconds;
31
+ bitrate: Kbps;
32
+ mime: string;
33
+ codecs: string;
34
+ width: number;
35
+ height: number;
36
+ fps?: number;
37
+ quality?: string;
38
+ streamId?: IVideoStream['id'];
39
+ }
40
+ export interface TextRepresentation extends Representation {
41
+ language: string;
42
+ label: string;
43
+ url: string;
44
+ isAuto: boolean;
45
+ }
46
+ export interface ServerLatencyTimestamps {
47
+ serverDataReceivedTimestamp?: Milliseconds;
48
+ serverDataPreparedTime?: Milliseconds;
49
+ }
50
+ export declare enum SegmentReferencingType {
51
+ BYTE_RANGE = "byteRange",
52
+ TEMPLATE = "template"
53
+ }
54
+ export type ByteRangeSegmentReference = {
55
+ type: SegmentReferencingType.BYTE_RANGE;
56
+ url: string;
57
+ initRange: IRange<Byte>;
58
+ indexRange?: IRange<Byte>;
59
+ };
60
+ export type TemplateSegmentReference = {
61
+ type: SegmentReferencingType.TEMPLATE;
62
+ baseUrl: string;
63
+ initUrl: string;
64
+ segmentTemplateUrl: string;
65
+ totalSegmentsDurationMs: Milliseconds;
66
+ segments: {
67
+ url: string;
68
+ time: IRange<Milliseconds>;
69
+ }[];
70
+ nextSegmentBeyondManifest: {
71
+ url: string;
72
+ time: IRange<Milliseconds>;
73
+ };
74
+ timescale: number;
75
+ };
76
+ export type SegmentReference = ByteRangeSegmentReference | TemplateSegmentReference;
77
+ export interface ByteRangeSegment {
78
+ status: SegmentStatus;
79
+ time: IRange<Milliseconds>;
80
+ byte: IRange<Byte>;
81
+ }
82
+ export interface TemplateSegment {
83
+ status: SegmentStatus;
84
+ time: IRange<Milliseconds>;
85
+ size?: Byte;
86
+ url: string;
87
+ }
88
+ export type Segment = ByteRangeSegment | TemplateSegment;
89
+ export declare enum SegmentStatus {
90
+ NONE = "none",
91
+ DOWNLOADING = "downloading",
92
+ DOWNLOADED = "downloaded",
93
+ PARTIALLY_FED = "partially_fed",
94
+ PARTIALLY_EJECTED = "partially_ejected",
95
+ FED = "fed"
96
+ }
97
+ export interface Stream {
98
+ id: string;
99
+ hdr?: boolean;
100
+ language?: string;
101
+ isDefault?: boolean;
102
+ label?: string;
103
+ codecs: string;
104
+ mime: string;
105
+ representations: Representation[];
106
+ }
107
+ export interface LiveMetadata {
108
+ availabilityStartTime: Milliseconds;
109
+ publishTime: Milliseconds;
110
+ latestSegmentPublishTime: Milliseconds;
111
+ streamIsAlive: boolean;
112
+ streamIsUnpublished: boolean;
113
+ }
114
+ export interface Manifest {
115
+ duration: Milliseconds | undefined;
116
+ streams: {
117
+ [key in StreamKind]: Stream[];
118
+ };
119
+ baseUrls: string[];
120
+ live?: LiveMetadata;
121
+ }
122
+ export declare enum ProjectionType {
123
+ RECTANGULAR = 0,
124
+ EQUIRECTANGULAR = 1,
125
+ CUBEMAP = 2,
126
+ MESH = 3
127
+ }
128
+ export interface BoxLike {
129
+ id: string;
130
+ size: Byte;
131
+ contents: DataView;
132
+ }
133
+ export interface GenericContainerParser<InitData> {
134
+ validateData(data: DataView): boolean;
135
+ getIndexRange(init: InitData): IRange<Byte> | undefined;
136
+ parseInit(data: DataView): InitData;
137
+ parseSegments(data: DataView, init: InitData, indexRange?: IRange<Byte>): Segment[];
138
+ parseFeedableSegmentChunk(data: DataView, isLive?: boolean): DataView | null;
139
+ }
140
+ export interface CommonInit {
141
+ is3dVideo: boolean;
142
+ stereoMode?: number;
143
+ projectionType?: ProjectionType;
144
+ projectionData?: {
145
+ pose: {
146
+ yaw: number;
147
+ pitch: number;
148
+ roll: number;
149
+ };
150
+ bounds: {
151
+ top: number;
152
+ bottom: number;
153
+ left: number;
154
+ right: number;
155
+ };
156
+ };
157
+ }
158
+ export interface WebmInit extends CommonInit {
159
+ segmentStart: Byte;
160
+ segmentEnd: Byte;
161
+ timeScale: number;
162
+ segmentDuration: number;
163
+ cuesSeekPosition?: Byte;
164
+ }
165
+ export interface IProviderSubscriptionInfo {
166
+ output: IProviderOutput;
167
+ desiredState: IDesiredState;
168
+ observableVideo: IObservableVideo;
169
+ genericErrorListener: (error: Error | unknown) => void;
170
+ connect: <Value>(from: IObservable<Value>, to: ISubject<Value> | IValueSubject<Value> | ((v: Value) => void)) => void;
171
+ }
172
+ export declare enum ProviderState {
173
+ STOPPED = "stopped",
174
+ READY = "ready",
175
+ PLAYING = "playing",
176
+ PAUSED = "paused"
177
+ }
178
+ export type IParams = IProviderParams<IDashURLSource>;
179
+ export type MpegInit = CommonInit;
180
+ export type WebmParser = GenericContainerParser<WebmInit>;
181
+ export type MpegParser = GenericContainerParser<MpegInit> & {
182
+ getChunkEndTime(data: DataView, timescale: number): Milliseconds;
183
+ getServerLatencyTimestamps(view: DataView): ServerLatencyTimestamps;
184
+ getTimescaleFromIndex(view: DataView): number | undefined;
185
+ };
186
+ export type ContainerParser = WebmParser | MpegParser;
@@ -0,0 +1,21 @@
1
+ import { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from '../../../providers/DashProviderNew/lib/types';
2
+ import { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from '../../../player/types';
3
+ import { IRange, Milliseconds } from '@vkontakte/videoplayer-shared';
4
+ export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString, streamId }: Representation) => IVideoTrack | undefined;
5
+ export declare const representationToAudioTrack: ({ id, bitrate }: Representation) => IAudioTrack;
6
+ export declare const representationToTextTrack: ({ language, label }: Stream, { id, url, isAuto }: Representation & {
7
+ url: string;
8
+ isAuto: boolean;
9
+ }) => IInternalTextTrack;
10
+ export declare const textRepresentationToTextTrack: ({ language, label, id, url, isAuto }: TextRepresentation) => IInternalTextTrack;
11
+ export declare const streamToIAudioStream: ({ id, language, label, codecs, isDefault }: Stream) => IAudioStream;
12
+ export declare const streamToIVideoStream: ({ id, language, label, hdr, codecs }: Stream) => IVideoStream;
13
+ export declare const isTemplateSegment: (segment: Segment) => segment is TemplateSegment;
14
+ export declare const isTemplateSegmentReference: (segmentReference: SegmentReference) => segmentReference is TemplateSegmentReference;
15
+ export declare const isAbortError: (e: Error | unknown) => boolean;
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;
@@ -0,0 +1,8 @@
1
+ import { Milliseconds } from '@vkontakte/videoplayer-shared';
2
+ import { IParams } from './lib/types';
3
+ import BaseDashProvider from './baseDashProvider';
4
+ export default class NewDashCmafLiveProvider extends BaseDashProvider {
5
+ constructor(params: IParams);
6
+ protected subscribe(): void;
7
+ protected seek(position: Milliseconds): void;
8
+ }
@@ -0,0 +1,6 @@
1
+ import { Milliseconds } from '@vkontakte/videoplayer-shared';
2
+ import BaseDashProvider from './baseDashProvider';
3
+ export default class NewDashProvider extends BaseDashProvider {
4
+ protected subscribe(): void;
5
+ protected seek(position: Milliseconds, forcePrecise: boolean): void;
6
+ }
@@ -22,7 +22,6 @@ export default class ProviderContainer implements IProviderContainer {
22
22
  private subscription;
23
23
  private screenFormatsIterator;
24
24
  private chromecastFormatsIterator;
25
- private videoCodecsIterator;
26
25
  private log;
27
26
  private tracer;
28
27
  private params;
@@ -34,7 +33,6 @@ export default class ProviderContainer implements IProviderContainer {
34
33
  private initProvider;
35
34
  private reinitProvider;
36
35
  private switchToNextProvider;
37
- private switchToNextVideoCodec;
38
36
  private destroyProvider;
39
37
  private createProvider;
40
38
  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 {};
@@ -1,7 +1,7 @@
1
1
  import { ITuningConfig } from '../utils/tuningConfig';
2
2
  import { ILogger, ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IComponentLogger, ITracer, 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';
@@ -56,11 +56,9 @@ export interface IProviderOutput {
56
56
  currentVideoStream$: IValueSubject<IVideoStream | undefined>;
57
57
  availableVideoTracks$: IValueSubject<IVideoTrack[]>;
58
58
  currentVideoTrack$: IValueSubject<IVideoTrack | undefined>;
59
- availableVideoCodecs$: IValueSubject<VideoCodec[]>;
60
59
  availableAudioStreams$: IValueSubject<IAudioStream[]>;
61
60
  currentAudioStream$: IValueSubject<IAudioStream | undefined>;
62
61
  availableAudioTracks$: IValueSubject<IAudioTrack[]>;
63
- availableAudioCodecs$: IValueSubject<AudioCodec[]>;
64
62
  availableTextTracks$: IValueSubject<ITextTrack[]>;
65
63
  currentTextTrack$: IValueSubject<ITextTrack['id'] | undefined>;
66
64
  isAudioAvailable$: IValueSubject<boolean>;
@@ -6,7 +6,6 @@ export interface IObservableVideo {
6
6
  canplay$: IObservable<undefined>;
7
7
  ended$: IObservable<undefined>;
8
8
  looped$: IObservable<Seconds>;
9
- loopExpected$: IObservable<undefined>;
10
9
  error$: IObservable<IError>;
11
10
  seeked$: IObservable<undefined>;
12
11
  seeking$: IObservable<undefined>;
@@ -8,20 +8,26 @@ interface IConnectData {
8
8
  isBuffering$: IObservable<boolean>;
9
9
  isSeeked$: IObservable<boolean>;
10
10
  looped$: IObservable<Seconds>;
11
- currentStallDuration$: IObservable<Milliseconds>;
12
- qualityLimitsOnStall: ITuningConfig['dash']['qualityLimitsOnStall'];
11
+ playing$: IObservable<undefined>;
12
+ currentStallDuration$: IValueSubject<Milliseconds>;
13
+ tuning: ITuningConfig['stallsManager'];
14
+ abrParams: ITuningConfig['autoTrackSelection'];
13
15
  }
14
16
  declare class StallsManager {
15
17
  private currentStallDuration$;
16
18
  private videoLastDataObtainedTimestamp$;
17
19
  private throughput$;
18
20
  private rtt$;
19
- private qualityLimitsOnStall;
21
+ private tuning;
22
+ private abrParams;
20
23
  private isSeeked$;
21
24
  private isBuffering$;
22
- private currentStallsCount;
23
25
  private maxQualityLimit;
24
26
  private lastUniqueVideoTrackSelected;
27
+ private currentStallsCount;
28
+ private sumStallsDuration;
29
+ private lastStallDuration;
30
+ private providerStartWatchingTimestamp;
25
31
  private lastUniqueVideoTrackSelectedTimestamp;
26
32
  private predictedThroughputWithoutData;
27
33
  private qualityRestrictionTimer;
@@ -30,7 +36,15 @@ declare class StallsManager {
30
36
  connect(data: IConnectData): void;
31
37
  get videoMaxQualityLimit(): ExactVideoQuality | undefined;
32
38
  get predictedThroughput(): Kbps;
39
+ get abrTuningParams(): ITuningConfig['autoTrackSelection'];
33
40
  set lastVideoTrackSelected(lastUniqueVideoTrackSelected: IVideoTrack);
34
41
  destroy(): void;
42
+ private updateStoredAbrParams;
43
+ private calculateOptimalAbrParams;
44
+ private getStoredData;
45
+ private setStoredData;
46
+ private addStallInfoToHistory;
47
+ private updateStallData;
48
+ private subscribe;
35
49
  }
36
50
  export default StallsManager;
@@ -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
  }
@@ -26,7 +26,10 @@ export declare class TrackHistory<T extends IBaseTrack> {
26
26
  clear(): void;
27
27
  }
28
28
  export declare const defaultEmptyArrayErrorMessage = "Assertion \"ABR Tracks is empty array\" failed";
29
- 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 getMinPossibleAudioForVideoOld: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], minVideoAudioRatio: number) => IAudioTrack | undefined;
30
+ export declare const getMinPossibleAudioForVideoNew: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], minVideoAudioRatio: number) => IAudioTrack | undefined;
31
+ export declare const autoSelectVideoTrackNew: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize, }: IConstraints<IVideoTrack>) => IVideoTrack;
32
+ export declare const autoSelectVideoTrackOld: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize, }: IConstraints<IVideoTrack>) => IVideoTrack;
33
+ export declare const autoSelectAudioTrackForVideoOld: (selectedVideoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], { estimatedThroughput, tuning, playbackRate, forwardBufferHealth, history, abrLogger, stallsPredictedThroughput, }: IConstraints<IAudioTrack>) => IAudioTrack | undefined;
34
+ export declare const autoSelectAudioTrackForVideoNew: (selectedVideoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], { estimatedThroughput, tuning, playbackRate, forwardBufferHealth, history, abrLogger, stallsPredictedThroughput, }: IConstraints<IAudioTrack>) => IAudioTrack | undefined;
32
35
  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
  */
@@ -24,8 +24,12 @@ export type ITuningConfig = {
24
24
  };
25
25
  autoTrackSelection: {
26
26
  bitrateFactorAtEmptyBuffer: number;
27
+ minBitrateFactorAtEmptyBuffer: number;
28
+ maxBitrateFactorAtEmptyBuffer: number;
27
29
  bitrateAudioFactorAtEmptyBuffer: number;
28
30
  bitrateFactorAtFullBuffer: number;
31
+ minBitrateFactorAtFullBuffer: number;
32
+ maxBitrateFactorAtFullBuffer: number;
29
33
  bitrateAudioFactorAtFullBuffer: number;
30
34
  minVideoAudioRatio: number;
31
35
  minAvailableThroughputAudioRatio: number;
@@ -36,6 +40,8 @@ export type ITuningConfig = {
36
40
  pixelRatioLogBase: number;
37
41
  pixelRatioLogCoefficients: number[];
38
42
  containerSizeFactor: number;
43
+ minContainerSizeFactor: number;
44
+ maxContainerSizeFactor: number;
39
45
  lazyQualitySwitch: boolean;
40
46
  minBufferToSwitchUp: number;
41
47
  considerPlaybackRate: boolean;
@@ -46,6 +52,25 @@ export type ITuningConfig = {
46
52
  trafficSavingLimit: ExactVideoQuality;
47
53
  highQualityLimit: ExactVideoQuality;
48
54
  };
55
+ stallsManager: {
56
+ stallDurationNoDataBeforeQualityDecrease: Milliseconds;
57
+ stallDurationToBeCount: Milliseconds;
58
+ stallCountBeforeQualityDecrease: Milliseconds;
59
+ resetQualityRestrictionTimeout: Milliseconds;
60
+ ignoreStallsOnSeek: boolean;
61
+ stallsMetricsHistoryLength: number;
62
+ maxPossibleStallDuration: Milliseconds;
63
+ minTvtToBeCounted: Seconds;
64
+ maxTvtToBeCounted: Seconds;
65
+ targetStallsDurationPerTvt: number;
66
+ deviationStallsDurationPerTvt: number;
67
+ criticalStallsDurationPerTvt: number;
68
+ abrAdjustingSpeed: number;
69
+ emaAlpha: number;
70
+ useTotalStallsDurationPerTvt: boolean;
71
+ useAverageStallsDurationPerTvt: boolean;
72
+ useEmaStallsDurationPerTvt: boolean;
73
+ };
49
74
  droppedFramesChecker: {
50
75
  enabled: boolean;
51
76
  percentLimit: number;
@@ -72,18 +97,10 @@ export type ITuningConfig = {
72
97
  enableSubSegmentBufferFeeding: boolean;
73
98
  bufferEmptinessTolerance: Milliseconds;
74
99
  useFetchPriorityHints: boolean;
75
- qualityLimitsOnStall: {
76
- stallDurationNoDataBeforeQualityDecrease: Milliseconds;
77
- stallDurationToBeCount: Milliseconds;
78
- stallCountBeforeQualityDecrease: Milliseconds;
79
- resetQualityRestrictionTimeout: Milliseconds;
80
- ignoreStallsOnSeek: boolean;
81
- };
82
100
  enableBaseUrlSupport: boolean;
83
101
  maxSegmentRetryCount: number;
84
102
  sourceOpenTimeout: number;
85
103
  rejectOnSourceOpenTimeout: boolean;
86
- codecsPrioritizeEnabled: boolean;
87
104
  };
88
105
  dashCmafLive: {
89
106
  maxActiveLiveOffset: Milliseconds;
@@ -158,6 +175,8 @@ export type ITuningConfig = {
158
175
  useNativeHLSTextTracks: boolean;
159
176
  useManagedMediaSource: boolean;
160
177
  useNewSwitchTo: boolean;
178
+ useNewDashProvider: boolean;
179
+ useNewAutoSelectVideoTrack: boolean;
161
180
  useSafariEndlessRequestBugfix: boolean;
162
181
  useRefactoredSearchGap: boolean;
163
182
  isAudioDisabled: boolean;