@vkontakte/videoplayer-core 2.0.171-dev.4a3b02e4a.0 → 2.0.171-dev.881304e5f.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 +37 -43
- package/es2015.esm.js +33 -39
- package/esnext.cjs +31 -37
- package/esnext.esm.js +32 -38
- package/evergreen.esm.js +34 -40
- package/package.json +2 -2
- package/types/player/Player.d.ts +1 -0
- package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +1 -1
- package/types/providers/DashProvider/baseDashProvider.d.ts +1 -2
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +1 -2
- package/types/providers/ProviderContainer/Mayday/heuristics/TvFetcherErrorHeuristic.d.ts +10 -0
- package/types/providers/ProviderContainer/Mayday/index.d.ts +1 -0
- package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +0 -1
- package/types/providers/utils/Abr/types.d.ts +1 -4
- package/types/providers/utils/Abr/utils.d.ts +1 -3
- package/types/utils/timers.d.ts +2 -0
- package/types/utils/tuningConfig.d.ts +4 -17
- package/types/providers/utils/Abr/rules/video/downloadTimeRule.d.ts +0 -15
- package/types/utils/buffer/dynamicBufferTarget.d.ts +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.171-dev.
|
|
3
|
+
"version": "2.0.171-dev.881304e5f.0",
|
|
4
4
|
"author": "vk.ru",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.ru platform",
|
|
6
6
|
"homepage": "https://vk.ru",
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"**/*.d.ts"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@vkontakte/videoplayer-shared": "1.0.100-dev.
|
|
45
|
+
"@vkontakte/videoplayer-shared": "1.0.100-dev.881304e5f.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/types/player/Player.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export default class Player implements IPlayer {
|
|
|
30
30
|
experimental: PlayerExperimentalImpl;
|
|
31
31
|
private devNullLog;
|
|
32
32
|
private collectDecodingInfoDestroyCb;
|
|
33
|
+
private hasReleasedTimers;
|
|
33
34
|
constructor(tuning?: IOptionalTuningConfig, tracer?: ITracer, playerOptions?: IPlayerOptions);
|
|
34
35
|
private readonly doInit;
|
|
35
36
|
/**
|
|
@@ -49,8 +49,8 @@ export default class LiveDashPlayer {
|
|
|
49
49
|
private bufferStates;
|
|
50
50
|
private downloadRate?;
|
|
51
51
|
private sourceJitter;
|
|
52
|
+
/** Токен для защиты от устаревших callback'ов sourceopen при многократных вызовах _setVideoSrc */
|
|
52
53
|
private srcToken;
|
|
53
|
-
private canplayListener;
|
|
54
54
|
private chunkRateEstimator;
|
|
55
55
|
private manifestUrl;
|
|
56
56
|
private urlResolver;
|
|
@@ -54,9 +54,8 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
54
54
|
protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
|
|
55
55
|
protected subscribe(): void;
|
|
56
56
|
private syncBufferTarget;
|
|
57
|
-
private resolveAudioBufferTargetMs;
|
|
58
57
|
private resolveBufferTargetMs;
|
|
59
|
-
private
|
|
58
|
+
private resolveAudioBufferTargetMs;
|
|
60
59
|
protected selectVideoAudioRepresentations(): [Representation, Representation | undefined] | undefined;
|
|
61
60
|
protected prepare(manifestOffset?: number): void;
|
|
62
61
|
protected syncPlayback: () => void;
|
|
@@ -55,9 +55,8 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
55
55
|
protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
|
|
56
56
|
protected subscribe(): void;
|
|
57
57
|
private syncBufferTarget;
|
|
58
|
-
private resolveAudioBufferTargetMs;
|
|
59
58
|
private resolveBufferTargetMs;
|
|
60
|
-
private
|
|
59
|
+
private resolveAudioBufferTargetMs;
|
|
61
60
|
protected selectVideoAudioRepresentations(): [Representation, Representation | undefined] | undefined;
|
|
62
61
|
protected prepare(manifestOffset?: number): void;
|
|
63
62
|
protected syncPlayback: () => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IError } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IHeuristicDeps } from "../types";
|
|
3
|
+
import type { ISyncHeuristic, HeuristicResult } from "./IHeuristic";
|
|
4
|
+
export declare class TvFetcherErrorHeuristic implements ISyncHeuristic {
|
|
5
|
+
private _deps;
|
|
6
|
+
static readonly heuristicName = "TvFetcherErrorHeuristic";
|
|
7
|
+
readonly type = "sync";
|
|
8
|
+
constructor(_deps: IHeuristicDeps);
|
|
9
|
+
analyze(error: IError): HeuristicResult;
|
|
10
|
+
}
|
|
@@ -3,5 +3,6 @@ export type { IMaydayDeps, IFallbackContext, IRecommendation, RecoveryAction, IM
|
|
|
3
3
|
export type { ISyncHeuristic, IAsyncHeuristic, HeuristicResult } from "./heuristics/IHeuristic";
|
|
4
4
|
export { MediaErrorHeuristic } from "./heuristics/MediaErrorHeuristic";
|
|
5
5
|
export { FetcherErrorHeuristic } from "./heuristics/FetcherErrorHeuristic";
|
|
6
|
+
export { TvFetcherErrorHeuristic } from "./heuristics/TvFetcherErrorHeuristic";
|
|
6
7
|
export { HangupHeuristic } from "./heuristics/HangupHeuristic";
|
|
7
8
|
export { MaydayStatistics } from "./MaydayStatistics";
|
|
@@ -15,7 +15,6 @@ type LiveFormat = VideoFormat.WEB_RTC_LIVE | VideoFormat.HLS_LIVE | VideoFormat.
|
|
|
15
15
|
type AllLiveFormats = [LiveFormat, LiveFormat, LiveFormat, LiveFormat, LiveFormat];
|
|
16
16
|
export declare const getLiveFormatsPriority: ({ androidPreferredFormat, preferCMAF, preferWebRTC }: Constraints) => AllLiveFormats;
|
|
17
17
|
export declare const getChromeCastFormatsPriority: (live: boolean) => VideoFormat[];
|
|
18
|
-
export declare const selectCodec: (codecs: Set<string>) => string | undefined;
|
|
19
18
|
type CodecStream = {
|
|
20
19
|
codecs: string;
|
|
21
20
|
hdr?: boolean;
|
|
@@ -21,8 +21,7 @@ export declare enum VideoRuleName {
|
|
|
21
21
|
UpperLimit = "upper_limit_rule",
|
|
22
22
|
Throughput = "throughput_rule",
|
|
23
23
|
AbandonRequest = "abandon_request_rule",
|
|
24
|
-
InsufficientBuffer = "insufficient_buffer_rule"
|
|
25
|
-
DownloadTime = "download_time_rule"
|
|
24
|
+
InsufficientBuffer = "insufficient_buffer_rule"
|
|
26
25
|
}
|
|
27
26
|
export declare enum AudioRuleName {
|
|
28
27
|
MinAudioForVideo = "min_audio_for_video_rule",
|
|
@@ -40,7 +39,6 @@ export interface IUpdatableAbrManagerContext {
|
|
|
40
39
|
desiredVideoTrack: Nullable<IVideoTrack>;
|
|
41
40
|
limits: QualityLimits;
|
|
42
41
|
forwardBufferHealth?: number;
|
|
43
|
-
forwardBufferTarget: Milliseconds;
|
|
44
42
|
forwardVideoBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
|
|
45
43
|
forwardAudioBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
|
|
46
44
|
forwardBufferDuration?: Milliseconds;
|
|
@@ -120,7 +118,6 @@ export interface IVideoAbrContext extends IBaseAbrControllerContext {
|
|
|
120
118
|
container: Nullable<IRectangle>;
|
|
121
119
|
panelSize: Nullable<IRectangle>;
|
|
122
120
|
forwardBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
|
|
123
|
-
forwardBufferTarget: Milliseconds;
|
|
124
121
|
limits: QualityLimits;
|
|
125
122
|
visible: boolean;
|
|
126
123
|
severeStallOccurred: boolean;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../../../player/types";
|
|
3
|
-
import type { Segment } from "../parsers/types";
|
|
4
|
-
export declare const computeForwardBitrate: (segments: Nullable<Segment[]>) => Kbps;
|
|
5
3
|
export declare const bufferToPlaybackMs: (contentMs: Milliseconds | undefined, playbackRate: number) => Milliseconds;
|
|
6
4
|
export declare enum CompareTrack {
|
|
7
5
|
Descending = -1,
|
|
@@ -2,7 +2,7 @@ import type { VideoCodecName, VideoFormat } from "../player/types";
|
|
|
2
2
|
import { WebmCodecStrategy } from "../enums/WebmCodecStrategy";
|
|
3
3
|
import { AndroidPreferredFormat } from "../enums/AndroidPreferredFormat";
|
|
4
4
|
import { IOSPreferredFormat } from "../enums/IOSPreferredFormat";
|
|
5
|
-
import type { Byte, Kbps, Milliseconds, RecursivePartial, Seconds } from "@vkontakte/videoplayer-shared";
|
|
5
|
+
import type { Byte, Kbps, Milliseconds, RecursivePartial, Seconds, TimerModule } from "@vkontakte/videoplayer-shared";
|
|
6
6
|
import { type ExactVideoQuality, VideoQuality } from "@vkontakte/videoplayer-shared";
|
|
7
7
|
import { AudioRuleName, VideoRuleName } from "../providers/utils/Abr/types";
|
|
8
8
|
export type ITuningConfig = {
|
|
@@ -18,6 +18,7 @@ export type ITuningConfig = {
|
|
|
18
18
|
* Включает очистку состояния плеера при вызове метода stop()
|
|
19
19
|
*/
|
|
20
20
|
allowPlayerReuse: boolean;
|
|
21
|
+
useWorkerTimers: TimerModule[];
|
|
21
22
|
throughputEstimator: {
|
|
22
23
|
type: "TwoEma" | "EmaAndMa";
|
|
23
24
|
emaAlphaSlow: number;
|
|
@@ -146,7 +147,6 @@ export type ITuningConfig = {
|
|
|
146
147
|
forwardBufferTargetManual: Milliseconds;
|
|
147
148
|
forwardBufferTargetPreload: Milliseconds;
|
|
148
149
|
audioBufferAheadOfVideoMs: Milliseconds;
|
|
149
|
-
useDynamicBufferTarget: boolean;
|
|
150
150
|
seekBiasInTheEnd: Milliseconds;
|
|
151
151
|
maxSegmentDurationLeftToSelectNextSegment: Milliseconds;
|
|
152
152
|
minSafeBufferThreshold: number;
|
|
@@ -175,7 +175,6 @@ export type ITuningConfig = {
|
|
|
175
175
|
vktvAbrThrottle: number;
|
|
176
176
|
timeupdateEventTickThrottle: number;
|
|
177
177
|
fetcherBufferOptimisation: boolean;
|
|
178
|
-
codecsPrioritizeEnabled: boolean;
|
|
179
178
|
usePersistentGaps: boolean;
|
|
180
179
|
abrThrottle: number;
|
|
181
180
|
useVideoElementWaitingCurrentTimeReassign: boolean;
|
|
@@ -222,26 +221,14 @@ export type ITuningConfig = {
|
|
|
222
221
|
budgetFactor: number;
|
|
223
222
|
fallbackSegmentDurationMs: Milliseconds;
|
|
224
223
|
};
|
|
225
|
-
dynamicBufferTarget: {
|
|
226
|
-
maxMs: Milliseconds;
|
|
227
|
-
optimisticHeadroomLow: number;
|
|
228
|
-
optimisticHeadroomHigh: number;
|
|
229
|
-
weakThroughputLowKbps: Kbps;
|
|
230
|
-
weakThroughputHighKbps: Kbps;
|
|
231
|
-
maxFactor: number;
|
|
232
|
-
};
|
|
233
224
|
videoStreamRepresentaionsFilter: [VideoQuality, number, VideoCodecName][];
|
|
234
225
|
filterOnDemandQualityList: boolean;
|
|
235
226
|
dashMaxTvVideoQuality: boolean;
|
|
236
227
|
checkRepresentationCanPlayType: Extract<CanPlayTypeResult, "maybe" | "probably"> | false;
|
|
237
228
|
preloadFirstSegment: boolean;
|
|
238
229
|
maxQualityForFirstSegmentPreload: ExactVideoQuality;
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
safetyFactor: number;
|
|
242
|
-
bootstrapBufferMs: Milliseconds;
|
|
243
|
-
demandTolerance: number;
|
|
244
|
-
};
|
|
230
|
+
/** Включает отправку телеметрии трейсера (resume) при превышении stall watchdog */
|
|
231
|
+
tracerResumeOnUnexpectedStall: boolean;
|
|
245
232
|
};
|
|
246
233
|
dashCmafLive: {
|
|
247
234
|
externalStopControl: boolean;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
|
-
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
|
-
import type { Kbps, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
4
|
-
import { LimitAboveRule } from "../limitAboveRule";
|
|
5
|
-
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
6
|
-
type DownloadTimeLogsArgs = [estimatedThroughput: Kbps, forwardBufferDuration: Milliseconds, simulatedFinalBufferMs: Milliseconds | null];
|
|
7
|
-
export declare class DownloadTimeRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, DownloadTimeLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
8
|
-
constructor(phaseConfig: RulePhaseConfig);
|
|
9
|
-
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
10
|
-
private buildReferenceTimeline;
|
|
11
|
-
private resolveLookaheadCount;
|
|
12
|
-
private simulate;
|
|
13
|
-
protected createLogMessage(selectedTrack: IVideoTrack, estimatedThroughput: Kbps, forwardBufferDuration: Milliseconds, simulatedFinalBufferMs: Milliseconds | null): string;
|
|
14
|
-
}
|
|
15
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Kbps, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import type { ITuningConfig } from "../tuningConfig";
|
|
3
|
-
type DynamicBufferTargetConfig = ITuningConfig["dash"]["dynamicBufferTarget"];
|
|
4
|
-
export interface IDynamicBufferTargetState {
|
|
5
|
-
throughputKbps: Kbps;
|
|
6
|
-
currentBitrateKbps: Nullable<Kbps>;
|
|
7
|
-
baseTargetMs: Milliseconds;
|
|
8
|
-
}
|
|
9
|
-
export declare const computeDynamicBufferTarget: (state: IDynamicBufferTargetState, config: DynamicBufferTargetConfig) => Milliseconds;
|
|
10
|
-
export {};
|