@vkontakte/videoplayer-core 2.0.130-dev.d7ad9ae5.0 → 2.0.130-dev.e0e84cc2.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.
- package/es2015.cjs.js +66 -10
- package/es2015.esm.js +66 -10
- package/es2018.cjs.js +66 -10
- package/es2018.esm.js +65 -9
- package/es2024.cjs.js +65 -9
- package/es2024.esm.js +65 -9
- package/esnext.cjs.js +65 -9
- package/esnext.esm.js +65 -9
- package/evergreen.esm.js +64 -8
- package/package.json +2 -2
- package/types/player/Player.d.ts +9 -2
- package/types/player/types.d.ts +5 -0
- package/types/providers/ChromecastProvider/ChromecastInitializer/index.d.ts +5 -1
- package/types/providers/ChromecastProvider/index.d.ts +2 -0
- package/types/providers/DashLiveProvider/DashLiveProvider.d.ts +1 -0
- package/types/providers/DashLiveProvider/utils/FilesFetcher.d.ts +2 -1
- package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +1 -0
- package/types/providers/DashLiveProvider/utils/ThroughputEstimator.d.ts +4 -0
- package/types/providers/DashProvider/baseDashProvider.d.ts +2 -2
- package/types/providers/DashProvider/lib/buffer.d.ts +0 -3
- package/types/providers/DashProvider/lib/fetcher.d.ts +5 -4
- package/types/providers/DashProvider/lib/player.d.ts +4 -2
- package/types/providers/DashProvider/lib/utils.d.ts +0 -11
- package/types/providers/ProviderContainer/index.d.ts +2 -0
- package/types/providers/WebRTCLiveProvider/WebRTCLiveProvider.d.ts +1 -0
- package/types/providers/types.d.ts +4 -1
- package/types/providers/utils/HTMLVideoElement/DroppedFramesManager.d.ts +3 -1
- package/types/utils/autoSelectTrack.d.ts +4 -3
- package/types/utils/qualityLimits.d.ts +18 -3
- package/types/utils/smoothedValue/baseSmoothedValue.d.ts +3 -0
- package/types/utils/tuningConfig.d.ts +0 -2
- package/types/providers/DashProvider/lib/sourceBufferBufferedDiff.d.ts +0 -19
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.130-dev.
|
|
3
|
+
"version": "2.0.130-dev.e0e84cc2.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.58-dev.
|
|
57
|
+
"@vkontakte/videoplayer-shared": "1.0.58-dev.0058a2b8.0",
|
|
58
58
|
"hls.js": "~1.4.7"
|
|
59
59
|
}
|
|
60
60
|
}
|
package/types/player/Player.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { IOptionalTuningConfig } from '../utils/tuningConfig';
|
|
2
|
-
import { IError, ILogEntry, Seconds, Subject, ValueSubject, QualityLimits, VideoQuality } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { IError, ILogEntry, Seconds, Subject, ValueSubject, QualityLimits, VideoQuality, ITracer } 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;
|
|
9
12
|
private config;
|
|
10
13
|
private tuning;
|
|
11
14
|
private throughputEstimator;
|
|
@@ -107,9 +110,10 @@ export default class Player implements IPlayer {
|
|
|
107
110
|
element$: ValueSubject<HTMLVideoElement | undefined>;
|
|
108
111
|
tuningConfigName$: ValueSubject<string[]>;
|
|
109
112
|
enableDebugTelemetry$: ValueSubject<boolean>;
|
|
113
|
+
dumpTelemetry: (receiver: (value: Record<string, any>) => void) => void;
|
|
110
114
|
getCurrentTime$: ValueSubject<null>;
|
|
111
115
|
};
|
|
112
|
-
constructor(tuning?: IOptionalTuningConfig);
|
|
116
|
+
constructor(tuning?: IOptionalTuningConfig, tracer?: ITracer);
|
|
113
117
|
initVideo(config: IConfig): IPlayer;
|
|
114
118
|
destroy(): void;
|
|
115
119
|
prepare(): IPlayer;
|
|
@@ -176,6 +180,7 @@ export default class Player implements IPlayer {
|
|
|
176
180
|
*/
|
|
177
181
|
releaseCamera(): this;
|
|
178
182
|
getExactTime(): Seconds;
|
|
183
|
+
getAllLogs(): ILogEntry[];
|
|
179
184
|
private getScene3D;
|
|
180
185
|
private setIntrinsicVideoSize;
|
|
181
186
|
private initDesiredStateSubscriptions;
|
|
@@ -183,7 +188,9 @@ export default class Player implements IPlayer {
|
|
|
183
188
|
private initChromecastSubscription;
|
|
184
189
|
private initStartingVideoTrack;
|
|
185
190
|
private setStartingVideoTrack;
|
|
191
|
+
private initLogs;
|
|
186
192
|
private initDebugTelemetry;
|
|
193
|
+
private initTracerSubscription;
|
|
187
194
|
private initWakeLock;
|
|
188
195
|
private setVideoTrackIdByQuality;
|
|
189
196
|
private getActiveLiveDelay;
|
package/types/player/types.d.ts
CHANGED
|
@@ -62,6 +62,10 @@ export interface IPlayer {
|
|
|
62
62
|
* Может быть точнее, чем `info.position$` в промежутках между timeupdate
|
|
63
63
|
*/
|
|
64
64
|
getExactTime(): number;
|
|
65
|
+
/**
|
|
66
|
+
* Возвращает все логи с момента инициализации плеера
|
|
67
|
+
*/
|
|
68
|
+
getAllLogs(): ILogEntry[];
|
|
65
69
|
experimental: {
|
|
66
70
|
/**
|
|
67
71
|
* Элемент, который сейчас вставлен в container.
|
|
@@ -70,6 +74,7 @@ export interface IPlayer {
|
|
|
70
74
|
element$: IValueObservable<HTMLVideoElement | undefined>;
|
|
71
75
|
tuningConfigName$: IValueSubject<string[]>;
|
|
72
76
|
enableDebugTelemetry$: IValueSubject<boolean>;
|
|
77
|
+
dumpTelemetry: (receiver: (value: Record<string, any>) => void) => void;
|
|
73
78
|
/** функция вычисления текущей позиции проигрывания из под провадера (если расчет нестандартный) */
|
|
74
79
|
getCurrentTime$: IValueSubject<(() => number) | null>;
|
|
75
80
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { ISubject, IValueSubject, IError } from '@vkontakte/videoplayer-shared';
|
|
1
|
+
import { ISubject, IValueSubject, ILogger, 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
|
+
};
|
|
7
10
|
}
|
|
8
11
|
export declare class ChromecastInitializer implements IChromecastInitializer {
|
|
9
12
|
readonly connection$: IValueSubject<IChromecastConnection | undefined>;
|
|
@@ -12,6 +15,7 @@ export declare class ChromecastInitializer implements IChromecastInitializer {
|
|
|
12
15
|
contentId?: string;
|
|
13
16
|
private readonly realCastState$;
|
|
14
17
|
private readonly subscription;
|
|
18
|
+
private readonly log;
|
|
15
19
|
private readonly params;
|
|
16
20
|
private isDestroyed;
|
|
17
21
|
constructor(params: IParams);
|
|
@@ -11,6 +11,7 @@ export default class ChromecastProvider implements IProvider {
|
|
|
11
11
|
private loadMediaTimeoutSubscription;
|
|
12
12
|
private videoState;
|
|
13
13
|
private params;
|
|
14
|
+
private log;
|
|
14
15
|
constructor(params: IParams);
|
|
15
16
|
destroy(): void;
|
|
16
17
|
private subscribe;
|
|
@@ -26,6 +27,7 @@ export default class ChromecastProvider implements IProvider {
|
|
|
26
27
|
private createMediaInfo;
|
|
27
28
|
private createLoadRequest;
|
|
28
29
|
private loadMedia;
|
|
30
|
+
private logRemoteEvent;
|
|
29
31
|
private syncPlayback;
|
|
30
32
|
}
|
|
31
33
|
export {};
|
|
@@ -9,7 +9,8 @@ export default class FilesFetcher {
|
|
|
9
9
|
private TIMEOUT;
|
|
10
10
|
private BITRATE_ESTIMATOR;
|
|
11
11
|
private MAX_PARALLEL_REQUESTS;
|
|
12
|
-
|
|
12
|
+
private logger;
|
|
13
|
+
constructor(RETRY_COUNT: number, TIMEOUT: number, BITRATE_ESTIMATOR: any, MAX_PARALLEL_REQUESTS: number, logger: (...args: any[]) => void);
|
|
13
14
|
private limitCompleteCount;
|
|
14
15
|
private _sendRequest;
|
|
15
16
|
private _getParallelRequestCount;
|
|
@@ -15,9 +15,12 @@
|
|
|
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;
|
|
18
19
|
export default class ThroughputEstimator {
|
|
19
20
|
private intervals;
|
|
20
21
|
private currentRate;
|
|
22
|
+
private logger;
|
|
23
|
+
constructor(logger: ILogger);
|
|
21
24
|
private _updateRate;
|
|
22
25
|
private _createInterval;
|
|
23
26
|
private _doMergeIntervals;
|
|
@@ -27,3 +30,4 @@ export default class ThroughputEstimator {
|
|
|
27
30
|
addInterval(timeStart: number, timeEnd: number, bytes: number): boolean;
|
|
28
31
|
getBitRate(): number;
|
|
29
32
|
}
|
|
33
|
+
export {};
|
|
@@ -3,7 +3,7 @@ import { CommonInit, IProviderSubscriptionInfo, ProviderState, Representation, S
|
|
|
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, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
6
|
+
import { ISubscription, ITracer, 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';
|
|
@@ -20,6 +20,7 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
20
20
|
protected video: HTMLVideoElement;
|
|
21
21
|
protected player: Player;
|
|
22
22
|
protected params: IParams;
|
|
23
|
+
protected tracer: ITracer;
|
|
23
24
|
protected textTracksManager: TextTrackManager;
|
|
24
25
|
protected droppedFramesManager: DroppedFramesManager;
|
|
25
26
|
protected stallsManager: StallsManager;
|
|
@@ -40,7 +41,6 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
40
41
|
protected audioStreamsMap: Map<Stream, IAudioTrack[]>;
|
|
41
42
|
protected videoTrackSwitchHistory: TrackHistory<IVideoTrack>;
|
|
42
43
|
protected audioTrackSwitchHistory: TrackHistory<import("../../player/types").IBaseTrack>;
|
|
43
|
-
private readonly selectedRepresentations;
|
|
44
44
|
constructor(params: IParams);
|
|
45
45
|
protected abstract seek(position: Milliseconds, forcePrecise: boolean): void;
|
|
46
46
|
protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
|
|
@@ -12,7 +12,6 @@ export interface Dependencies {
|
|
|
12
12
|
}
|
|
13
13
|
export interface Gap extends IRange<Milliseconds> {
|
|
14
14
|
representation: Representation['id'];
|
|
15
|
-
persistent: boolean;
|
|
16
15
|
}
|
|
17
16
|
export declare class BufferManager {
|
|
18
17
|
currentLiveSegmentServerLatency$: IValueSubject<number>;
|
|
@@ -61,7 +60,6 @@ export declare class BufferManager {
|
|
|
61
60
|
private index;
|
|
62
61
|
private lastDataObtainedTimestampMs;
|
|
63
62
|
private loadByteRangeSegmentsTimeoutId;
|
|
64
|
-
private sourceBufferBufferedDiff;
|
|
65
63
|
constructor(kind: StreamKind, mediaSource: MediaSource, representations: Representation[], { fetcher, tuning, getCurrentPosition, isActiveLowLatency, compatibilityMode, manifest }: Dependencies);
|
|
66
64
|
startWith: (param_0: string) => Promise<void | undefined>;
|
|
67
65
|
switchToWithPreviousAbort(newRepresentationId: Representation['id'], dropBuffer?: boolean): void;
|
|
@@ -110,7 +108,6 @@ export declare class BufferManager {
|
|
|
110
108
|
private pruneBuffer;
|
|
111
109
|
private abortBuffer;
|
|
112
110
|
getDebugBufferState(): IRange<Milliseconds> | undefined;
|
|
113
|
-
getBufferedTo(): number | null;
|
|
114
111
|
getForwardBufferDuration(currentPosition?: Milliseconds | undefined): Milliseconds;
|
|
115
112
|
private detectGaps;
|
|
116
113
|
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, IError } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import { Byte, IValueSubject, Milliseconds, IRange, Subject, ITracer, 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,6 +10,7 @@ export interface IParams {
|
|
|
10
10
|
throughputEstimator?: ThroughputEstimator;
|
|
11
11
|
requestQuic: boolean;
|
|
12
12
|
compatibilityMode?: boolean;
|
|
13
|
+
tracer: ITracer;
|
|
13
14
|
useEnableSubtitlesParam?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export type Priority = 'high' | 'low' | 'auto';
|
|
@@ -34,16 +35,17 @@ export type RepresentationFetchResult = {
|
|
|
34
35
|
export declare class Fetcher {
|
|
35
36
|
private throughputEstimator;
|
|
36
37
|
private requestQuic;
|
|
38
|
+
private tracer;
|
|
37
39
|
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
38
40
|
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
39
41
|
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
40
42
|
recoverableError$: Subject<IError>;
|
|
41
43
|
error$: Subject<IError>;
|
|
42
44
|
private abortAllController;
|
|
45
|
+
private subscription;
|
|
43
46
|
private compatibilityMode;
|
|
44
47
|
private useEnableSubtitlesParam;
|
|
45
|
-
|
|
46
|
-
constructor({ throughputEstimator, requestQuic, compatibilityMode, useEnableSubtitlesParam }: IParams);
|
|
48
|
+
constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam }: IParams);
|
|
47
49
|
private onHeadersReceived;
|
|
48
50
|
fetchManifest: (param_0: string) => Promise<string | null | undefined>;
|
|
49
51
|
fetch: (param_0: string, param_1: FetchParams) => Promise<ArrayBuffer | null | undefined>;
|
|
@@ -52,6 +54,5 @@ export declare class Fetcher {
|
|
|
52
54
|
private fetchByteRangeRepresentation;
|
|
53
55
|
private fetchTemplateRepresentation;
|
|
54
56
|
private doFetch;
|
|
55
|
-
private unsubscribeAbortSubscription;
|
|
56
57
|
}
|
|
57
58
|
export declare const suppressAbort: (e: Error | unknown) => void | never;
|
|
@@ -3,7 +3,7 @@ import { CommonInit, LiveStreamStatus, Manifest, Representation, StreamKind, Tex
|
|
|
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, IValueSubject, Milliseconds, Subject } from '@vkontakte/videoplayer-shared';
|
|
6
|
+
import { IError, ISubject, ITracer, IValueSubject, Milliseconds, Subject } from '@vkontakte/videoplayer-shared';
|
|
7
7
|
export declare enum State {
|
|
8
8
|
NONE = "none",
|
|
9
9
|
MANIFEST_READY = "manifest_ready",
|
|
@@ -14,6 +14,7 @@ export interface Params {
|
|
|
14
14
|
throughputEstimator: ThroughputEstimator;
|
|
15
15
|
tuning: ITuningConfig;
|
|
16
16
|
compatibilityMode?: boolean;
|
|
17
|
+
tracer: ITracer;
|
|
17
18
|
}
|
|
18
19
|
export declare class Player {
|
|
19
20
|
private element;
|
|
@@ -21,6 +22,7 @@ export declare class Player {
|
|
|
21
22
|
private source;
|
|
22
23
|
private manifest;
|
|
23
24
|
private tuning;
|
|
25
|
+
private tracer;
|
|
24
26
|
private videoBufferManager;
|
|
25
27
|
private audioBufferManager;
|
|
26
28
|
private bufferManagers;
|
|
@@ -66,7 +68,6 @@ export declare class Player {
|
|
|
66
68
|
private stallWatchdogSubscription;
|
|
67
69
|
private livePauseWatchdogSubscription;
|
|
68
70
|
private destroyController;
|
|
69
|
-
private initedPruneBufferCallback;
|
|
70
71
|
constructor(params: Params);
|
|
71
72
|
initManifest: (param_0: HTMLVideoElement, param_1: string, param_2: number) => Promise<void | undefined>;
|
|
72
73
|
updateManifest: () => Promise<Manifest | null | undefined>;
|
|
@@ -82,6 +83,7 @@ export declare class Player {
|
|
|
82
83
|
getStreams(): Manifest['streams'] | undefined;
|
|
83
84
|
setPreloadOnly(preloadOnly: boolean): void;
|
|
84
85
|
destroy(): void;
|
|
86
|
+
private initTracerSubscription;
|
|
85
87
|
private isManualDecreasePlaybackInLive;
|
|
86
88
|
private normolizeLiveOffset;
|
|
87
89
|
private tick;
|
|
@@ -1,6 +1,5 @@
|
|
|
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';
|
|
4
3
|
export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString, streamId }: Representation) => IVideoTrack | undefined;
|
|
5
4
|
export declare const representationToAudioTrack: ({ id, bitrate }: Representation) => IAudioTrack;
|
|
6
5
|
export declare const representationToTextTrack: ({ language, label }: Stream, { id, url, isAuto }: Representation & {
|
|
@@ -14,13 +13,3 @@ export declare const isTemplateSegment: (segment: Segment) => segment is Templat
|
|
|
14
13
|
export declare const isTemplateSegmentReference: (segmentReference: SegmentReference) => segmentReference is TemplateSegmentReference;
|
|
15
14
|
export declare const isAbortError: (e: Error | unknown) => boolean;
|
|
16
15
|
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,6 +22,8 @@ export default class ProviderContainer implements IProviderContainer {
|
|
|
22
22
|
private subscription;
|
|
23
23
|
private screenFormatsIterator;
|
|
24
24
|
private chromecastFormatsIterator;
|
|
25
|
+
private log;
|
|
26
|
+
private tracer;
|
|
25
27
|
private params;
|
|
26
28
|
private failoverIndex;
|
|
27
29
|
private volumeMultiplierManager;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ITuningConfig } from '../utils/tuningConfig';
|
|
2
|
-
import { ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IRectangle } from '@vkontakte/videoplayer-shared';
|
|
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
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';
|
|
@@ -15,6 +15,9 @@ export interface IProviderDependencies {
|
|
|
15
15
|
dependencies: {
|
|
16
16
|
throughputEstimator: ThroughputEstimator;
|
|
17
17
|
chromecastInitializer: IChromecastInitializer;
|
|
18
|
+
logger: ILogger;
|
|
19
|
+
tracer: ITracer;
|
|
20
|
+
abrLogger: IComponentLogger;
|
|
18
21
|
};
|
|
19
22
|
}
|
|
20
23
|
export interface IProviderParams<TSourceType> extends IProviderDependencies {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type ExactVideoQuality, IObservable, Subject } from '@vkontakte/videoplayer-shared';
|
|
1
|
+
import { type ExactVideoQuality, ILogger, 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;
|
|
6
7
|
video: HTMLVideoElement;
|
|
7
8
|
tracks: IVideoTrack[];
|
|
8
9
|
droppedFramesChecker: ITuningConfig['droppedFramesChecker'];
|
|
@@ -13,6 +14,7 @@ interface IConnectData {
|
|
|
13
14
|
declare class DroppedFramesManager {
|
|
14
15
|
onDroopedVideoFramesLimit$: Subject<void>;
|
|
15
16
|
private subscription;
|
|
17
|
+
private log;
|
|
16
18
|
private video;
|
|
17
19
|
private droppedFramesChecker;
|
|
18
20
|
private isAuto;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ITuningConfig } from '../utils/tuningConfig';
|
|
2
|
-
import { Kbps, Milliseconds, IRectangle, type ExactVideoQuality, QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { Kbps, Milliseconds, IRectangle, type ExactVideoQuality, QualityLimits, IComponentLogger } 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,6 +15,7 @@ interface IConstraints<T extends IBaseTrack> {
|
|
|
15
15
|
droppedVideoMaxQualityLimit?: ExactVideoQuality;
|
|
16
16
|
stallsVideoMaxQualityLimit?: ExactVideoQuality;
|
|
17
17
|
stallsPredictedThroughput?: Kbps;
|
|
18
|
+
abrLogger: IComponentLogger;
|
|
18
19
|
panelSize?: IRectangle;
|
|
19
20
|
}
|
|
20
21
|
export declare class TrackHistory<T extends IBaseTrack> {
|
|
@@ -26,6 +27,6 @@ export declare class TrackHistory<T extends IBaseTrack> {
|
|
|
26
27
|
}
|
|
27
28
|
export declare const defaultEmptyArrayErrorMessage = "Assertion \"ABR Tracks is empty array\" failed";
|
|
28
29
|
export declare const getMinPossibleAudioForVideo: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], minVideoAudioRatio: number) => 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;
|
|
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;
|
|
31
32
|
export {};
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { IVideoTrack, PredefinedQualityLimits } from '../player/types';
|
|
2
2
|
import { ExactVideoQuality, Nullable, QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
};
|
|
5
20
|
type LimitsAsHeightValidParams = {
|
|
6
21
|
limits?: {
|
|
7
22
|
min?: number;
|
|
@@ -10,7 +25,7 @@ type LimitsAsHeightValidParams = {
|
|
|
10
25
|
highestAvailableHeight: Nullable<number>;
|
|
11
26
|
lowestAvailableHeight: Nullable<number>;
|
|
12
27
|
};
|
|
13
|
-
export declare function areLimitsInvalid(limits
|
|
28
|
+
export declare function areLimitsInvalid({ limits, highestAvailableQuality, lowestAvailableQuality }: LimitsValidParams): boolean | (null | undefined);
|
|
14
29
|
/**
|
|
15
30
|
* Проверяем лимиты качества, когда указана высота качества.
|
|
16
31
|
*/
|
|
@@ -2,6 +2,9 @@ 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$;
|
|
5
8
|
protected smoothed: number;
|
|
6
9
|
protected pastMeasures: number[];
|
|
7
10
|
protected takenMeasures: number;
|
|
@@ -83,8 +83,6 @@ export type ITuningConfig = {
|
|
|
83
83
|
maxSegmentRetryCount: number;
|
|
84
84
|
sourceOpenTimeout: number;
|
|
85
85
|
rejectOnSourceOpenTimeout: boolean;
|
|
86
|
-
pruneBufferInterval: number | null;
|
|
87
|
-
vktvAbrThrottle: number | null;
|
|
88
86
|
};
|
|
89
87
|
dashCmafLive: {
|
|
90
88
|
maxActiveLiveOffset: Milliseconds;
|
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
}
|