@vkontakte/videoplayer-core 2.0.161-dev.e4f30602d.0 → 2.0.161-dev.e774e8df3.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 +10 -10
- package/es2015.esm.js +11 -11
- package/esnext.cjs +10 -10
- package/esnext.esm.js +11 -11
- package/evergreen.esm.js +31 -31
- package/package.json +2 -2
- package/types/providers/DashProvider/lib/buffer.d.ts +1 -0
- package/types/providers/DashProvider/lib/player.d.ts +2 -0
- package/types/providers/DashProviderVirtual/lib/buffer/nativeBufferManager.d.ts +2 -1
- package/types/providers/DashProviderVirtual/lib/buffer/types.d.ts +2 -1
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts +2 -2
- package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +4 -2
- package/types/providers/DashProviderVirtual/lib/player/livePlayer.d.ts +1 -1
- package/types/providers/DashProviderVirtual/lib/player/player.d.ts +1 -1
- package/types/providers/HlsProvider/index.d.ts +1 -1
- package/types/providers/MpegProvider/index.d.ts +1 -1
- package/types/providers/utils/Abr/abrController.d.ts +2 -0
- package/types/utils/ThroughputEstimator.d.ts +3 -1
- package/types/utils/tuningConfig.d.ts +28 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.161-dev.
|
|
3
|
+
"version": "2.0.161-dev.e774e8df3.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"**/*.d.ts"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@vkontakte/videoplayer-shared": "1.0.90-dev.
|
|
45
|
+
"@vkontakte/videoplayer-shared": "1.0.90-dev.e774e8df3.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { IError, IRange, ISubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
1
|
+
import type { IError, IRange, ISubject, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
export declare class NativeBufferManager {
|
|
3
3
|
error$: ISubject<IError>;
|
|
4
|
+
updateEnd$: IValueSubject<void>;
|
|
4
5
|
private mediaSource;
|
|
5
6
|
private sourceBuffer;
|
|
6
7
|
private sourceBufferTaskQueue;
|
|
@@ -32,10 +32,11 @@ export interface IVirtualBufferManager<T extends Segment = Segment> {
|
|
|
32
32
|
getForwardBufferRepresentations(currentPosition?: Milliseconds): Map<Representation["id"], T[]>;
|
|
33
33
|
getForwardPlaybackBufferDuration(currentPosition?: Milliseconds): Milliseconds;
|
|
34
34
|
getPlaybackBufferState(): IRange<Milliseconds> | null;
|
|
35
|
+
getMutexInfo(): string;
|
|
35
36
|
setTarget(time: Milliseconds): void;
|
|
36
37
|
setPreloadOnly(preloadOnly: boolean): void;
|
|
37
38
|
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
38
|
-
calculateDurationFromSegments(
|
|
39
|
+
calculateDurationFromSegments(): Milliseconds;
|
|
39
40
|
destroy(): void;
|
|
40
41
|
get lastDataObtainedTimestamp(): Milliseconds;
|
|
41
42
|
}
|
package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts
CHANGED
|
@@ -59,7 +59,6 @@ export declare abstract class BaseVirtualBufferManager<T extends Segment> implem
|
|
|
59
59
|
startWith: ReturnType<typeof abortable<[Representation["id"]]>>;
|
|
60
60
|
switchTo(newRepresentationId: Representation["id"], mode?: SwithRepresentationMode): Promise<void>;
|
|
61
61
|
protected getSwitchWithAbort(): ReturnType<typeof abortable<[Representation["id"], SwithRepresentationMode], void>>;
|
|
62
|
-
switchToOld: ReturnType<typeof abortable<[Representation["id"], boolean | undefined], void>>;
|
|
63
62
|
prepareSeek(): Promise<void>;
|
|
64
63
|
seek(position: Milliseconds | undefined): Promise<void>;
|
|
65
64
|
maintain(currentPosition?: Milliseconds | undefined): Promise<void>;
|
|
@@ -69,7 +68,8 @@ export declare abstract class BaseVirtualBufferManager<T extends Segment> implem
|
|
|
69
68
|
abort(): Promise<void>;
|
|
70
69
|
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
71
70
|
getRepresentationInitialTime(): Seconds;
|
|
72
|
-
|
|
71
|
+
getMutexInfo(): string;
|
|
72
|
+
calculateDurationFromSegments(): Milliseconds;
|
|
73
73
|
get lastDataObtainedTimestamp(): Milliseconds;
|
|
74
74
|
setTarget(time: Milliseconds): void;
|
|
75
75
|
setPreloadOnly(preloadOnly: boolean): void;
|
|
@@ -73,7 +73,7 @@ export declare abstract class BasePlayer {
|
|
|
73
73
|
private isOnDemand;
|
|
74
74
|
protected constructor(params: Params);
|
|
75
75
|
protected abstract prepareManifestUrlString(manifestBaseUrlString: string, offset: number): string;
|
|
76
|
-
protected abstract
|
|
76
|
+
protected abstract setSourceInitDuration(): void;
|
|
77
77
|
protected abstract restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
78
78
|
initRepresentations: ReturnType<typeof abortable<[Representation["id"], Representation["id"] | undefined, IHLSSource | undefined]>>;
|
|
79
79
|
initManifest(element: HTMLVideoElement, manifestBaseUrlString: string, offset: number): Promise<void>;
|
|
@@ -82,7 +82,6 @@ export declare abstract class BasePlayer {
|
|
|
82
82
|
seek(requestedPosition: Milliseconds, forcePrecise?: boolean): Promise<void>;
|
|
83
83
|
warmUpMediaSourceIfNeeded(position?: Milliseconds | undefined): void;
|
|
84
84
|
getForwardBufferRepresentations(kind: Exclude<StreamKind, StreamKind.TEXT>): Map<Representation["id"], Segment[]> | undefined;
|
|
85
|
-
calculateDurationFromSegments(representationId: Representation["id"]): Milliseconds;
|
|
86
85
|
get isStreamEnded(): boolean;
|
|
87
86
|
getStreams(): Manifest["streams"] | undefined;
|
|
88
87
|
getCodecs(): Manifest["codecs"] | undefined;
|
|
@@ -90,6 +89,9 @@ export declare abstract class BasePlayer {
|
|
|
90
89
|
setPreloadOnly(preloadOnly: boolean): void;
|
|
91
90
|
stop(): void;
|
|
92
91
|
destroy(): void;
|
|
92
|
+
updateSourceDurationFromSegments(): void;
|
|
93
|
+
calculateDurationFromBuffersSegments(): Milliseconds;
|
|
94
|
+
private isAnyBufferUpdating;
|
|
93
95
|
protected get isStreamNotOpen(): boolean;
|
|
94
96
|
protected reinitDecoderIfNeeded(force?: boolean): Promise<void>;
|
|
95
97
|
protected stallWatchdogIntervalCallback(): Promise<void>;
|
|
@@ -18,7 +18,7 @@ export declare class LivePlayer extends BasePlayer {
|
|
|
18
18
|
initBuffer(): void;
|
|
19
19
|
protected forcePositionToRepresentationInitialTime(): Promise<void>;
|
|
20
20
|
protected tick(): Promise<void>;
|
|
21
|
-
protected
|
|
21
|
+
protected setSourceInitDuration(): void;
|
|
22
22
|
protected isStallExceeded(timeInWaiting: Milliseconds): boolean;
|
|
23
23
|
protected restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
24
24
|
protected updateManifest(): Promise<Manifest | null>;
|
|
@@ -4,7 +4,7 @@ export declare class Player extends BasePlayer {
|
|
|
4
4
|
constructor(params: Params);
|
|
5
5
|
protected prepareManifestUrlString(manifestBaseUrlString: string, _offset: number): string;
|
|
6
6
|
protected initRepresentationSubscriptions(): void;
|
|
7
|
-
protected
|
|
7
|
+
protected setSourceInitDuration(): void;
|
|
8
8
|
protected restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
9
9
|
protected initDisableStallWatchdogSubscription(): void;
|
|
10
10
|
protected initEndOfVideoSubscription(): void;
|
|
@@ -13,7 +13,7 @@ export default class MpegProvider implements IProvider {
|
|
|
13
13
|
private subscribe;
|
|
14
14
|
destroy(): void;
|
|
15
15
|
private prepare;
|
|
16
|
-
|
|
16
|
+
protected playIfAllowed(): void;
|
|
17
17
|
private seek;
|
|
18
18
|
private syncPlayback;
|
|
19
19
|
private handleQualityLimitTransition;
|
|
@@ -20,6 +20,8 @@ declare class ThroughputEstimator {
|
|
|
20
20
|
addRawThroughput(rate: Kbps): void;
|
|
21
21
|
addRawRtt(time: Milliseconds): void;
|
|
22
22
|
private sanityCheck;
|
|
23
|
-
private static
|
|
23
|
+
private static loadStored;
|
|
24
|
+
private static writeStored;
|
|
25
|
+
private static validateStored;
|
|
24
26
|
}
|
|
25
27
|
export default ThroughputEstimator;
|
|
@@ -45,6 +45,24 @@ export type ITuningConfig = {
|
|
|
45
45
|
continuesByteSequenceInterval: Milliseconds;
|
|
46
46
|
maxLastEvaluationTimeout: Milliseconds;
|
|
47
47
|
};
|
|
48
|
+
/**
|
|
49
|
+
* TTL + проверка типа сети для кешированного throughput из localStorage.
|
|
50
|
+
* При включении: если сохранённое значение старше storedThroughputTtlMs
|
|
51
|
+
* или тип сети изменился (Wi-Fi→3G) — значение отбрасывается.
|
|
52
|
+
* Предотвращает старт в 4K при переходе с Wi-Fi на мобильную сеть.
|
|
53
|
+
*
|
|
54
|
+
* При OFF (дефолт): читаем/пишем как до фикса — plain number в legacy-ключ
|
|
55
|
+
* one_video_*. Это даёт безопасный rollback JS-версии без потери данных.
|
|
56
|
+
* При ON: новый формат (JSON с timestamp+networkType) → новый ключ vk_uvp_*.
|
|
57
|
+
*/
|
|
58
|
+
useThroughputTtl: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Срок жизни кешированного throughput (мс). По умолчанию 4 часа.
|
|
61
|
+
* После истечения TTL значение из localStorage игнорируется —
|
|
62
|
+
* используется browser estimation или initialThroughput.
|
|
63
|
+
* Применимо только при useThroughputTtl=true.
|
|
64
|
+
*/
|
|
65
|
+
storedThroughputTtlMs: Milliseconds;
|
|
48
66
|
};
|
|
49
67
|
autoTrackSelection: {
|
|
50
68
|
bitrateFactorAtEmptyBuffer: number;
|
|
@@ -130,6 +148,8 @@ export type ITuningConfig = {
|
|
|
130
148
|
useNewRepresentationSwitch: boolean;
|
|
131
149
|
useDelayedRepresentationSwitch: boolean;
|
|
132
150
|
useSmartRepresentationSwitch: boolean;
|
|
151
|
+
seekStallExitPolicy: boolean;
|
|
152
|
+
mutexStallExitPolicy: boolean;
|
|
133
153
|
useFetchPriorityHints: boolean;
|
|
134
154
|
useAbortMSEFix: boolean;
|
|
135
155
|
enableBaseUrlSupport: boolean;
|
|
@@ -343,9 +363,17 @@ export type ITuningConfig = {
|
|
|
343
363
|
* Очищаем кэш урлов при падение провайдера.
|
|
344
364
|
*/
|
|
345
365
|
dropUrlCacheWhenProviderCrashed?: boolean;
|
|
366
|
+
/**
|
|
367
|
+
* При смене/реините провайдера игнорируем результат того, смогло видео заиграть или нет.
|
|
368
|
+
*/
|
|
369
|
+
ignoreForcePlayResultWhenProviderChanged?: boolean;
|
|
346
370
|
hls: {
|
|
347
371
|
filterOnDemandQualityList: boolean;
|
|
348
372
|
};
|
|
373
|
+
/**
|
|
374
|
+
* Устанавливаем длительность видео на основе последнего сегмента.
|
|
375
|
+
*/
|
|
376
|
+
useDurationFromSegments: boolean;
|
|
349
377
|
};
|
|
350
378
|
export type IOptionalTuningConfig = RecursivePartial<ITuningConfig>;
|
|
351
379
|
export declare const fillDefault: (partial: IOptionalTuningConfig) => ITuningConfig;
|