@vkontakte/videoplayer-core 2.0.171-dev.ed76c949d.0 → 2.0.171
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 +161 -49
- package/es2015.esm.js +160 -48
- package/esnext.cjs +158 -46
- package/esnext.esm.js +158 -46
- package/evergreen.esm.js +158 -46
- package/package.json +2 -2
- package/types/player/Player.d.ts +0 -1
- package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +9 -3
- package/types/providers/DashProvider/baseDashProvider.d.ts +4 -1
- package/types/providers/DashProvider/lib/sourceBufferTaskQueue.d.ts +2 -1
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +3 -1
- package/types/providers/DashProviderVirtual/lib/buffer/nativeBufferManager.d.ts +1 -1
- package/types/providers/DashProviderVirtual/lib/buffer/sourceBufferTaskQueue.d.ts +2 -1
- package/types/providers/ProviderContainer/Mayday/heuristics/HangupHeuristic.d.ts +23 -0
- package/types/providers/ProviderContainer/Mayday/index.d.ts +1 -2
- package/types/providers/ProviderContainer/Mayday/types.d.ts +0 -1
- package/types/providers/ProviderContainer/index.d.ts +1 -0
- package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +1 -0
- package/types/providers/ProviderContainer/utils/playbackHangup.d.ts +2 -6
- package/types/providers/utils/Abr/abrController.d.ts +1 -4
- package/types/providers/utils/Abr/abrManager.d.ts +0 -1
- package/types/providers/utils/Abr/controllers/stallsController.d.ts +1 -8
- package/types/providers/utils/Abr/rules/audio/audioThroughputRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/audio/minAudioForVideoRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/baseRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/abandonRequestRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/bolaRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/bufferRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/downloadTimeRule.d.ts +15 -0
- package/types/providers/utils/Abr/rules/video/failedVideoTrackRule.d.ts +14 -0
- package/types/providers/utils/Abr/rules/video/fitsContainerRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/insufficientBufferRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/lowerLimitRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/stallsRule.d.ts +2 -6
- package/types/providers/utils/Abr/rules/video/throughputRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/tvDisabledVideoTrackRule.d.ts +2 -2
- package/types/providers/utils/Abr/rules/video/upperLimitRule.d.ts +2 -2
- package/types/providers/utils/Abr/types.d.ts +8 -6
- package/types/providers/utils/Abr/utils.d.ts +3 -1
- package/types/providers/utils/HTMLVideoElement/destroy.d.ts +1 -1
- package/types/providers/utils/HTMLVideoElement/pool.d.ts +3 -2
- package/types/utils/autoSelectTrack.d.ts +4 -3
- package/types/utils/buffer/dynamicBufferTarget.d.ts +10 -0
- package/types/utils/tuningConfig.d.ts +33 -24
- package/types/providers/ProviderContainer/Mayday/GraceTimeout.d.ts +0 -17
- package/types/providers/ProviderContainer/Mayday/heuristics/StartupHangupHeuristic.d.ts +0 -46
- package/types/providers/ProviderContainer/Mayday/heuristics/TvFetcherErrorHeuristic.d.ts +0 -10
- package/types/utils/timers.d.ts +0 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.171
|
|
3
|
+
"version": "2.0.171",
|
|
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
|
|
45
|
+
"@vkontakte/videoplayer-shared": "1.0.100"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/types/player/Player.d.ts
CHANGED
|
@@ -30,7 +30,6 @@ export default class Player implements IPlayer {
|
|
|
30
30
|
experimental: PlayerExperimentalImpl;
|
|
31
31
|
private devNullLog;
|
|
32
32
|
private collectDecodingInfoDestroyCb;
|
|
33
|
-
private hasReleasedTimers;
|
|
34
33
|
constructor(tuning?: IOptionalTuningConfig, tracer?: ITracer, playerOptions?: IPlayerOptions);
|
|
35
34
|
private readonly doInit;
|
|
36
35
|
/**
|
|
@@ -49,9 +49,6 @@ export default class LiveDashPlayer {
|
|
|
49
49
|
private bufferStates;
|
|
50
50
|
private downloadRate?;
|
|
51
51
|
private sourceJitter;
|
|
52
|
-
private srcToken;
|
|
53
|
-
private videoListeners;
|
|
54
|
-
private objectUrl;
|
|
55
52
|
private chunkRateEstimator;
|
|
56
53
|
private manifestUrl;
|
|
57
54
|
private urlResolver;
|
|
@@ -60,6 +57,7 @@ export default class LiveDashPlayer {
|
|
|
60
57
|
*/
|
|
61
58
|
private waitingForFirstBufferAfterSrcChange;
|
|
62
59
|
private params;
|
|
60
|
+
private playbackStateSubscription;
|
|
63
61
|
soundProhibitedEvent$: Subject<void>;
|
|
64
62
|
constructor(params: IParams);
|
|
65
63
|
attachSource(manifestUrl: string): void;
|
|
@@ -101,6 +99,14 @@ export default class LiveDashPlayer {
|
|
|
101
99
|
* send buffering notification to player
|
|
102
100
|
*/
|
|
103
101
|
private _notifyBuffering;
|
|
102
|
+
private _notifyLoadStart;
|
|
103
|
+
/**
|
|
104
|
+
* Лоадер для случая, когда play запрошен до завершения подготовки видео:
|
|
105
|
+
* syncPlayback при этом умирает на раннем выходе по активному videoState-переходу и не вызывает play().
|
|
106
|
+
* Смотрим только переходы подготовки (MANIFEST_READY/READY): переход PAUSED→PLAYING создаётся
|
|
107
|
+
* syncPlayback позже (debounce(0)), поэтому обычный resume сюда не попадает.
|
|
108
|
+
*/
|
|
109
|
+
private _syncBufferingWithDesiredPlayback;
|
|
104
110
|
/**
|
|
105
111
|
* initialize video tag, add necessary event listeners
|
|
106
112
|
* @private
|
|
@@ -16,6 +16,7 @@ import { ElementSizeManager } from "../utils/HTMLVideoElement/ElementSizeManager
|
|
|
16
16
|
type IParams = IProviderParams<IDashURLSource> & {
|
|
17
17
|
sourceHls?: IHLSSource;
|
|
18
18
|
forceVideoCodec?: VideoCodec;
|
|
19
|
+
failedVideoTrack?: Nullable<IVideoTrack>;
|
|
19
20
|
isOnDemand?: boolean;
|
|
20
21
|
dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
|
|
21
22
|
};
|
|
@@ -33,6 +34,7 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
33
34
|
protected stallsManager: StallsManager;
|
|
34
35
|
protected elementSizeManager: ElementSizeManager;
|
|
35
36
|
protected abrManager: AbrManager;
|
|
37
|
+
protected failedVideoTrack: Nullable<IVideoTrack>;
|
|
36
38
|
protected videoTracksMap: Map<IVideoTrack, {
|
|
37
39
|
stream: Stream;
|
|
38
40
|
representation: Representation;
|
|
@@ -54,8 +56,9 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
54
56
|
protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
|
|
55
57
|
protected subscribe(): void;
|
|
56
58
|
private syncBufferTarget;
|
|
57
|
-
private resolveBufferTargetMs;
|
|
58
59
|
private resolveAudioBufferTargetMs;
|
|
60
|
+
private resolveBufferTargetMs;
|
|
61
|
+
private getCurrentVideoBitrateKbps;
|
|
59
62
|
protected selectVideoAudioRepresentations(): [Representation, Representation | undefined] | undefined;
|
|
60
63
|
protected prepare(manifestOffset?: number): void;
|
|
61
64
|
protected syncPlayback: () => void;
|
|
@@ -7,7 +7,8 @@ declare class SourceBufferTaskQueue {
|
|
|
7
7
|
private currentTask;
|
|
8
8
|
private destroyed;
|
|
9
9
|
private abortRequested;
|
|
10
|
-
|
|
10
|
+
private isAbortFixEnabled;
|
|
11
|
+
constructor(buffer: SourceBuffer, isAbortFixEnabled?: boolean);
|
|
11
12
|
append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
12
13
|
remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
|
|
13
14
|
abort(init?: BufferSource): Promise<boolean>;
|
|
@@ -16,6 +16,7 @@ import { AbrManager } from "../utils/Abr/abrManager";
|
|
|
16
16
|
type IParams = IProviderParams<IDashURLSource> & {
|
|
17
17
|
sourceHls?: IHLSSource;
|
|
18
18
|
forceVideoCodec?: VideoCodec;
|
|
19
|
+
failedVideoTrack?: Nullable<IVideoTrack>;
|
|
19
20
|
isOnDemand?: boolean;
|
|
20
21
|
dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
|
|
21
22
|
};
|
|
@@ -55,8 +56,9 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
55
56
|
protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
|
|
56
57
|
protected subscribe(): void;
|
|
57
58
|
private syncBufferTarget;
|
|
58
|
-
private resolveBufferTargetMs;
|
|
59
59
|
private resolveAudioBufferTargetMs;
|
|
60
|
+
private resolveBufferTargetMs;
|
|
61
|
+
private getCurrentVideoBitrateKbps;
|
|
60
62
|
protected selectVideoAudioRepresentations(): [Representation, Representation | undefined] | undefined;
|
|
61
63
|
protected prepare(manifestOffset?: number): void;
|
|
62
64
|
protected syncPlayback: () => void;
|
|
@@ -7,7 +7,7 @@ export declare class NativeBufferManager {
|
|
|
7
7
|
private sourceBufferTaskQueue;
|
|
8
8
|
private subscription;
|
|
9
9
|
constructor(mediaSource: MediaSource);
|
|
10
|
-
init(mime: string, codecs: string): void;
|
|
10
|
+
init(mime: string, codecs: string, useAbortMSEFix?: boolean): void;
|
|
11
11
|
addInitSegment(initView: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
12
12
|
append(segmentView: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
13
13
|
remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
|
|
@@ -7,7 +7,8 @@ declare class SourceBufferTaskQueue {
|
|
|
7
7
|
private currentTask;
|
|
8
8
|
private destroyed;
|
|
9
9
|
private abortRequested;
|
|
10
|
-
|
|
10
|
+
private isAbortFixEnabled;
|
|
11
|
+
constructor(buffer: SourceBuffer, isAbortFixEnabled?: boolean);
|
|
11
12
|
append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
12
13
|
remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
|
|
13
14
|
abort(init?: BufferSource): Promise<boolean>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Subject } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IError } from "@vkontakte/videoplayer-shared";
|
|
3
|
+
import type { IHeuristicDeps, IMaydayEvent } from "../types";
|
|
4
|
+
import type { IAsyncHeuristic, HeuristicResult } from "./IHeuristic";
|
|
5
|
+
export declare class HangupHeuristic implements IAsyncHeuristic {
|
|
6
|
+
private deps;
|
|
7
|
+
static readonly heuristicName = "HangupHeuristic";
|
|
8
|
+
readonly type = "async";
|
|
9
|
+
readonly recommendation$: Subject<IMaydayEvent>;
|
|
10
|
+
private timerId;
|
|
11
|
+
private sub;
|
|
12
|
+
private error;
|
|
13
|
+
private manifestRequested;
|
|
14
|
+
private manifestRequestedAt;
|
|
15
|
+
private manifestReceivedMs;
|
|
16
|
+
constructor(deps: IHeuristicDeps);
|
|
17
|
+
analyze(error: IError): HeuristicResult;
|
|
18
|
+
private restartTimer;
|
|
19
|
+
private expire;
|
|
20
|
+
private cancel;
|
|
21
|
+
reset(): void;
|
|
22
|
+
destroy(): void;
|
|
23
|
+
}
|
|
@@ -3,6 +3,5 @@ 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 {
|
|
7
|
-
export { StartupHangupHeuristic } from "./heuristics/StartupHangupHeuristic";
|
|
6
|
+
export { HangupHeuristic } from "./heuristics/HangupHeuristic";
|
|
8
7
|
export { MaydayStatistics } from "./MaydayStatistics";
|
|
@@ -54,7 +54,6 @@ export interface IHeuristicDeps {
|
|
|
54
54
|
getVisibilityState: () => DocumentVisibilityState | undefined;
|
|
55
55
|
getReadyState: () => number | undefined;
|
|
56
56
|
getVideoPaused: () => boolean | undefined;
|
|
57
|
-
getIsMuted: () => boolean;
|
|
58
57
|
currentNativeBuffer$: IValueSubject<IRange<Seconds> | undefined>;
|
|
59
58
|
videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds | undefined>;
|
|
60
59
|
desiredPlaybackState$: IStateMachine<PlaybackState>;
|
|
@@ -35,6 +35,7 @@ export default class ProviderContainer implements IProviderContainer {
|
|
|
35
35
|
private tracer;
|
|
36
36
|
private params;
|
|
37
37
|
private currentProviderStarted;
|
|
38
|
+
private currentFailedVideoTrack;
|
|
38
39
|
private volumeMultiplierManager;
|
|
39
40
|
private dashMaxTvVideoQuality;
|
|
40
41
|
private mayday;
|
|
@@ -15,6 +15,7 @@ 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;
|
|
18
19
|
type CodecStream = {
|
|
19
20
|
codecs: string;
|
|
20
21
|
hdr?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { IProviderEntry } from "../types";
|
|
2
2
|
import type { IObservable, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
3
|
+
import { Observable } from "@vkontakte/videoplayer-shared";
|
|
3
4
|
import type { IStateMachine } from "../../../utils/StateMachine/types";
|
|
4
5
|
import { PlaybackState } from "../../../player/types";
|
|
5
6
|
interface IParams {
|
|
@@ -11,10 +12,5 @@ interface IParams {
|
|
|
11
12
|
playbackHangupNoDataThreshold: Milliseconds;
|
|
12
13
|
useDelayedPlaybackHangupWithData: boolean;
|
|
13
14
|
}
|
|
14
|
-
|
|
15
|
-
from: PlaybackState;
|
|
16
|
-
to: PlaybackState;
|
|
17
|
-
label: string;
|
|
18
|
-
}
|
|
19
|
-
declare const _default: (params: IParams) => IObservable<IPlaybackHangupInfo>;
|
|
15
|
+
declare const _default: (params: IParams) => Observable<string>;
|
|
20
16
|
export default _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { IAbrController, IAbrRule, IBaseAbrControllerContext, IRuleInitContext
|
|
1
|
+
import type { IAbrController, IAbrRule, IBaseAbrControllerContext, IRuleInitContext } from "./types";
|
|
2
2
|
import type { IBaseTrack } from "../../../player/types";
|
|
3
|
-
export declare const formatRuleLog: ({ name, ...logData }: RuleLogData) => string;
|
|
4
3
|
export default class AbrController<
|
|
5
4
|
T extends IBaseTrack,
|
|
6
5
|
C extends IBaseAbrControllerContext
|
|
@@ -13,8 +12,6 @@ export default class AbrController<
|
|
|
13
12
|
destroy(): void;
|
|
14
13
|
updateContext(context: C): void;
|
|
15
14
|
autoSelectTrack(rules?: IAbrRule<T, C>[]): T;
|
|
16
|
-
private traceQualitySwitch;
|
|
17
|
-
private isLowQuality;
|
|
18
15
|
private selectTrackBasedOnHistory;
|
|
19
16
|
/** при переключении аудио стрима очищаем историю для предотвращения залипания в `onCooldown` */
|
|
20
17
|
historyReset(): void;
|
|
@@ -10,7 +10,6 @@ export declare class AbrManager {
|
|
|
10
10
|
private context;
|
|
11
11
|
private phaseController;
|
|
12
12
|
private allVideoRules;
|
|
13
|
-
private tracer;
|
|
14
13
|
init(context: IInitAbrManagerContext): void;
|
|
15
14
|
updateContext(updateContext: IUpdatableAbrManagerContext): void;
|
|
16
15
|
autoSelectTrack<T extends IVideoTrack | IAudioTrack>(kind: Exclude<StreamKind, StreamKind.TEXT>): T;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IObservable,
|
|
1
|
+
import type { IObservable, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
import type { ITuningConfig } from "../../../../utils/tuningConfig";
|
|
3
3
|
import type { IVideoTrack } from "../../../../player/types";
|
|
4
4
|
import type { IObservableVideo } from "../../HTMLVideoElement/observable";
|
|
@@ -10,7 +10,6 @@ interface IConnectData {
|
|
|
10
10
|
observableVideo: IObservableVideo;
|
|
11
11
|
currentStallDuration$: IValueSubject<Milliseconds>;
|
|
12
12
|
tuning: ITuningConfig["stallsManager"];
|
|
13
|
-
tracer: ITracer;
|
|
14
13
|
}
|
|
15
14
|
export declare class StallsController {
|
|
16
15
|
private currentStallDuration$;
|
|
@@ -21,9 +20,6 @@ export declare class StallsController {
|
|
|
21
20
|
private lastUniqueVideoTrackSelectedTimestamp;
|
|
22
21
|
private lastUniqueVideoTrackSelected;
|
|
23
22
|
private providerStartWatchingTimestamp;
|
|
24
|
-
private tracer;
|
|
25
|
-
private severeStallTracer;
|
|
26
|
-
private severeStallStartedAt;
|
|
27
23
|
private subscription;
|
|
28
24
|
severeStallOccurred$: IValueSubject<boolean>;
|
|
29
25
|
totalStallsCount$: IValueSubject<number>;
|
|
@@ -32,9 +28,6 @@ export declare class StallsController {
|
|
|
32
28
|
lastStallDuration$: IValueSubject<Milliseconds>;
|
|
33
29
|
init(data: IConnectData): void;
|
|
34
30
|
destroy(): void;
|
|
35
|
-
private startSevereStallTracer;
|
|
36
|
-
private endSevereStallTracer;
|
|
37
|
-
private traceUpdateStallData;
|
|
38
31
|
private updateStallData;
|
|
39
32
|
}
|
|
40
33
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext } from "../../types";
|
|
2
2
|
import type { IAudioTrack, IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
4
4
|
import type { Kbps, Nullable } from "@vkontakte/videoplayer-shared";
|
|
@@ -8,6 +8,6 @@ type AudioThroughputLogsArgs = [forwardBufferHealth: Nullable<number>, playbackR
|
|
|
8
8
|
export declare class AudioThroughputRule extends LimitAboveRule<IAudioTrack, IAudioAbrContext, AudioThroughputLogsArgs> implements IAbrRule<IAudioTrack, IAudioAbrContext> {
|
|
9
9
|
constructor(phaseConfig: RulePhaseConfig);
|
|
10
10
|
execute(context: IAudioAbrContext): IAbrRuleResolution<IAudioTrack>;
|
|
11
|
-
protected
|
|
11
|
+
protected createLogMessage(selectedTrack: IVideoTrack, forwardBufferHealth: number | undefined, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, estimatedThroughput: Kbps, tuning: ITuningConfig): string;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IAudioAbrContext } from "../../types";
|
|
2
2
|
import type { IAudioTrack, IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import { LimitBelowRule } from "../limitBelowRule";
|
|
4
4
|
import type { ITuningConfig } from "../../../../../utils/tuningConfig";
|
|
@@ -8,6 +8,6 @@ type MinAudioForVideoLogsArgs = [lastVideoTrackSelected: Nullable<IVideoTrack>,
|
|
|
8
8
|
export declare class MinAudioForVideoRule extends LimitBelowRule<IAudioTrack, IAudioAbrContext, MinAudioForVideoLogsArgs> implements IAbrRule<IAudioTrack, IAudioAbrContext> {
|
|
9
9
|
constructor(phaseConfig: RulePhaseConfig);
|
|
10
10
|
execute(context: IAudioAbrContext): IAbrRuleResolution<IAudioTrack>;
|
|
11
|
-
protected
|
|
11
|
+
protected createLogMessage(selectedTrack: IVideoTrack, lastVideoTrackSelected: Nullable<IVideoTrack>, tuning: ITuningConfig): string;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, IRuleInitContext, RuleConfidence,
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IBaseAbrControllerContext, IRuleInitContext, RuleConfidence, RuleType } from "../types";
|
|
2
2
|
import type { IBaseTrack } from "../../../../player/types";
|
|
3
3
|
import { Subscription } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import type { AbrPhase } from "../controllers/abrPhaseController";
|
|
@@ -19,5 +19,5 @@ export declare abstract class BaseRule<
|
|
|
19
19
|
destroy(): void;
|
|
20
20
|
abstract execute(context: C): IAbrRuleResolution<T>;
|
|
21
21
|
protected createResolution(context: C, selectedTrack: T, ...params: LogsArgs): IAbrRuleResolution<T>;
|
|
22
|
-
protected abstract
|
|
22
|
+
protected abstract createLogMessage(selectedTrack: T, ...params: LogsArgs): string;
|
|
23
23
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -7,6 +7,6 @@ type LogsArgs = [elapsedMs: Milliseconds, loadedFraction: number, estimatedRemai
|
|
|
7
7
|
export declare class AbandonRequestRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, LogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
8
8
|
constructor(phaseConfig: RulePhaseConfig);
|
|
9
9
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
10
|
-
protected
|
|
10
|
+
protected createLogMessage(selectedTrack: IVideoTrack, elapsedMs: Milliseconds, loadedFraction: number, estimatedRemainingMs: Milliseconds, bufferLimitMs: Milliseconds, triggered: boolean): string;
|
|
11
11
|
}
|
|
12
12
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Kbps, Seconds } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -26,6 +26,6 @@ export declare class BolaRule extends LimitAboveRule<IVideoTrack, IVideoAbrConte
|
|
|
26
26
|
private resolveSegmentDurationS;
|
|
27
27
|
private applyBolaOSafeguard;
|
|
28
28
|
private resetPlaceholder;
|
|
29
|
-
protected
|
|
29
|
+
protected createLogMessage(selectedTrack: IVideoTrack, bufferLevelS: Seconds, placeholderBufferS: Seconds, segmentDurationS: Seconds, Vp: number, gp: number, validBitrates: Kbps[], selectedIndex: number, phase: AbrPhase | undefined): string;
|
|
30
30
|
}
|
|
31
31
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Nullable } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -12,6 +12,6 @@ type BufferRuleLogsArgs = [currentVideoTrack: Nullable<IVideoTrack>, lastVideoTr
|
|
|
12
12
|
export declare class BufferRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, BufferRuleLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
13
13
|
constructor(phaseConfig: RulePhaseConfig);
|
|
14
14
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
15
|
-
protected
|
|
15
|
+
protected createLogMessage(selectedTrack: IVideoTrack, currentVideoTrack: Nullable<IVideoTrack>, lastVideoTrackSelected: Nullable<IVideoTrack>, forwardBufferHealth: Nullable<number>, abrTuning: ITuningConfig["autoTrackSelection"]): string;
|
|
16
16
|
}
|
|
17
17
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext } from "../../types";
|
|
2
|
+
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
|
+
import type { Nullable } from "@vkontakte/videoplayer-shared";
|
|
4
|
+
import { LimitAboveRule } from "../limitAboveRule";
|
|
5
|
+
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
6
|
+
type FailedVideoTracLogsArgs = [banTrack: Nullable<IVideoTrack>];
|
|
7
|
+
export declare class FailedVideoTrackRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, FailedVideoTracLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
8
|
+
protected banTrack: Nullable<IVideoTrack>;
|
|
9
|
+
constructor(phaseConfig: RulePhaseConfig);
|
|
10
|
+
init(initContext: IRuleInitContext): void;
|
|
11
|
+
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
12
|
+
protected createLogMessage(selectedTrack: IVideoTrack, banTrack: Nullable<IVideoTrack>): string;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { IRectangle, Nullable } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -9,7 +9,7 @@ type FitsContainerLogsArgs = [containerSizeLimit: Nullable<IContainerSizeLimit>,
|
|
|
9
9
|
export declare class FitsContainerRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, FitsContainerLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
10
10
|
constructor(phaseConfig: RulePhaseConfig);
|
|
11
11
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
12
|
-
protected
|
|
12
|
+
protected createLogMessage(selectedTrack: IVideoTrack, containerSizeLimit: Nullable<IContainerSizeLimit>, containerSizeFactor: number, abrTuning: ITuningConfig["autoTrackSelection"]): string;
|
|
13
13
|
private getContainerSizeLimit;
|
|
14
14
|
}
|
|
15
15
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IRuleInitContext, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -10,6 +10,6 @@ export declare class InsufficientBufferRule extends LimitAboveRule<IVideoTrack,
|
|
|
10
10
|
override init(initContext: IRuleInitContext): void;
|
|
11
11
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
12
12
|
private selectThroughputAwareFallback;
|
|
13
|
-
protected
|
|
13
|
+
protected createLogMessage(selectedTrack: IVideoTrack, forwardBufferDuration: Milliseconds | undefined, thresholdMs: Milliseconds, triggered: boolean, suppressedByGrace: boolean): string;
|
|
14
14
|
}
|
|
15
15
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Nullable, QualityLimits } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
|
|
@@ -8,6 +8,6 @@ type LowerLimitLogsArgs = [limitsAreInvalid: boolean, lowestAvailableQuality: Nu
|
|
|
8
8
|
export declare class LowerLimitRule extends LimitBelowRule<IVideoTrack, IVideoAbrContext, LowerLimitLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
9
9
|
constructor(phaseConfig: RulePhaseConfig);
|
|
10
10
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
11
|
-
protected
|
|
11
|
+
protected createLogMessage(selectedTrack: IVideoTrack, limitsAreInvalid: boolean, lowestAvailableQuality: Nullable<ExactVideoQuality>, highestAvailableQuality: Nullable<ExactVideoQuality>, limits: QualityLimits): string;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Kbps, Nullable } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -11,13 +11,9 @@ export declare class StallsRule extends LimitAboveRule<IVideoTrack, IVideoAbrCon
|
|
|
11
11
|
private lastStallDurationRestriction;
|
|
12
12
|
private maxQualityLimitOnStall;
|
|
13
13
|
private predictedThroughputWithoutData;
|
|
14
|
-
private restrictionTracer;
|
|
15
|
-
private restrictionStartedAt;
|
|
16
14
|
constructor(phaseConfig: RulePhaseConfig);
|
|
17
15
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
18
|
-
protected
|
|
19
|
-
private traceRestrictionSet;
|
|
20
|
-
private traceRestrictionReset;
|
|
16
|
+
protected createLogMessage(selectedTrack: IVideoTrack, forwardBufferHealth: Nullable<number>, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, tuning: ITuningConfig): string;
|
|
21
17
|
private updateStallQualityLimits;
|
|
22
18
|
}
|
|
23
19
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Kbps, Nullable } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
@@ -8,6 +8,6 @@ type ThroughputLogsArgs = [forwardBufferHealth: Nullable<number>, playbackRate:
|
|
|
8
8
|
export declare class ThroughputRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, ThroughputLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
9
9
|
constructor(phaseConfig: RulePhaseConfig);
|
|
10
10
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
11
|
-
protected
|
|
11
|
+
protected createLogMessage(selectedTrack: IVideoTrack, forwardBufferHealth: Nullable<number>, playbackRate: number, reserve: Kbps, playbackRateFactor: number, bitrateFactor: number, estimatedThroughput: Kbps, phase: AbrPhase | undefined, tuning: ITuningConfig): string;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import { LimitAboveRule } from "../limitAboveRule";
|
|
4
4
|
import type { RulePhaseConfig } from "../../controllers/abrPhaseController";
|
|
5
5
|
export declare class TvDisabledVideoTrackRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
6
6
|
constructor(phaseConfig: RulePhaseConfig);
|
|
7
7
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
8
|
-
protected
|
|
8
|
+
protected createLogMessage(selectedTrack: IVideoTrack): string;
|
|
9
9
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext
|
|
1
|
+
import type { IAbrRule, IAbrRuleResolution, IVideoAbrContext } from "../../types";
|
|
2
2
|
import type { IVideoTrack } from "../../../../../player/types";
|
|
3
3
|
import type { Nullable, QualityLimits, VideoQuality } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
|
|
@@ -63,7 +63,7 @@ type UpperLimitsLogsArgs = [limitsAreInvalid: boolean, lowestAvailableQuality: N
|
|
|
63
63
|
export declare class UpperLimitsRule extends LimitAboveRule<IVideoTrack, IVideoAbrContext, UpperLimitsLogsArgs> implements IAbrRule<IVideoTrack, IVideoAbrContext> {
|
|
64
64
|
constructor(phaseConfig: RulePhaseConfig);
|
|
65
65
|
execute(context: IVideoAbrContext): IAbrRuleResolution<IVideoTrack>;
|
|
66
|
-
protected
|
|
66
|
+
protected createLogMessage(selectedTrack: IVideoTrack, limitsAreInvalid: boolean, lowestAvailableQuality: Nullable<ExactVideoQuality>, highestAvailableQuality: Nullable<ExactVideoQuality>, visible: boolean, limits: QualityLimits, backgroundVideoQualityLimit: VideoQuality, effectiveType: string | undefined, connectionDataQualityLimit: ExactVideoQuality | undefined): string;
|
|
67
67
|
private getConnection;
|
|
68
68
|
private resolveConnectionDataQualityLimit;
|
|
69
69
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../../../player/types";
|
|
2
|
-
import type { Byte, IComponentLogger, IObservable, IRectangle,
|
|
2
|
+
import type { Byte, IComponentLogger, IObservable, IRectangle, IValueSubject, Kbps, Milliseconds, Nullable, QualityLimits } from "@vkontakte/videoplayer-shared";
|
|
3
3
|
import type { ITuningConfig } from "../../../utils/tuningConfig";
|
|
4
4
|
import type { Representation, Segment } from "../parsers/types";
|
|
5
5
|
import type { ElementSizeManager } from "../HTMLVideoElement/ElementSizeManager";
|
|
@@ -15,13 +15,15 @@ export declare enum VideoRuleName {
|
|
|
15
15
|
Buffer = "buffer_rule",
|
|
16
16
|
Bola = "bola_rule",
|
|
17
17
|
FitsContainer = "fits_container_rule",
|
|
18
|
+
FailedVideoTrack = "failed_video_track_rule",
|
|
18
19
|
TvDisabledVideoTrack = "tv_disabled_video_track_rule",
|
|
19
20
|
Stalls = "stalls_rule",
|
|
20
21
|
LowerLimit = "lower_limit_rule",
|
|
21
22
|
UpperLimit = "upper_limit_rule",
|
|
22
23
|
Throughput = "throughput_rule",
|
|
23
24
|
AbandonRequest = "abandon_request_rule",
|
|
24
|
-
InsufficientBuffer = "insufficient_buffer_rule"
|
|
25
|
+
InsufficientBuffer = "insufficient_buffer_rule",
|
|
26
|
+
DownloadTime = "download_time_rule"
|
|
25
27
|
}
|
|
26
28
|
export declare enum AudioRuleName {
|
|
27
29
|
MinAudioForVideo = "min_audio_for_video_rule",
|
|
@@ -39,6 +41,7 @@ export interface IUpdatableAbrManagerContext {
|
|
|
39
41
|
desiredVideoTrack: Nullable<IVideoTrack>;
|
|
40
42
|
limits: QualityLimits;
|
|
41
43
|
forwardBufferHealth?: number;
|
|
44
|
+
forwardBufferTarget: Milliseconds;
|
|
42
45
|
forwardVideoBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
|
|
43
46
|
forwardAudioBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
|
|
44
47
|
forwardBufferDuration?: Milliseconds;
|
|
@@ -56,8 +59,8 @@ export interface IInitAbrManagerContext {
|
|
|
56
59
|
rtt$: IValueSubject<Milliseconds>;
|
|
57
60
|
throughputVariance$?: IValueSubject<number>;
|
|
58
61
|
element: HTMLMediaElement;
|
|
62
|
+
failedVideoTrack: Nullable<IVideoTrack>;
|
|
59
63
|
abrLogger: IComponentLogger;
|
|
60
|
-
tracer: ITracer;
|
|
61
64
|
panelSize?: IRectangle;
|
|
62
65
|
}
|
|
63
66
|
export interface IVideoElementAbrManagerContext {
|
|
@@ -74,13 +77,12 @@ export interface IAudioTracksContext {
|
|
|
74
77
|
audioTracksDesc: IAudioTrack[];
|
|
75
78
|
}
|
|
76
79
|
export type IAbrManagerContext = Omit<IUpdatableAbrManagerContext, "videoTracks" | "audioTracks"> & IVideoElementAbrManagerContext & IInitAbrManagerContext & IVideoTracksContext & IAudioTracksContext;
|
|
77
|
-
export type RuleLogData = Record<string, string | number | boolean | undefined>;
|
|
78
80
|
export interface IAbrRuleResolution<T extends IBaseTrack> {
|
|
79
81
|
track: T;
|
|
80
82
|
confidence: number;
|
|
81
83
|
type: RuleType;
|
|
82
84
|
name: string;
|
|
83
|
-
|
|
85
|
+
logMessage: string;
|
|
84
86
|
}
|
|
85
87
|
export interface IRuleInitContext extends IInitAbrManagerContext {}
|
|
86
88
|
export interface IAbrRule<
|
|
@@ -103,7 +105,6 @@ export interface IBaseAbrControllerContext extends IVideoTracksContext {
|
|
|
103
105
|
lastVideoTrackSelected: Nullable<IVideoTrack>;
|
|
104
106
|
tuning: ITuningConfig;
|
|
105
107
|
abrLogger: IComponentLogger;
|
|
106
|
-
tracer: ITracer;
|
|
107
108
|
estimatedThroughput: Kbps;
|
|
108
109
|
reserve: Kbps;
|
|
109
110
|
forwardBufferHealth: Nullable<number>;
|
|
@@ -121,6 +122,7 @@ export interface IVideoAbrContext extends IBaseAbrControllerContext {
|
|
|
121
122
|
container: Nullable<IRectangle>;
|
|
122
123
|
panelSize: Nullable<IRectangle>;
|
|
123
124
|
forwardBufferRepresentations: Nullable<Map<Representation["id"], Segment[]>>;
|
|
125
|
+
forwardBufferTarget: Milliseconds;
|
|
124
126
|
limits: QualityLimits;
|
|
125
127
|
visible: boolean;
|
|
126
128
|
severeStallOccurred: boolean;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
1
|
+
import type { Kbps, 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;
|
|
3
5
|
export declare const bufferToPlaybackMs: (contentMs: Milliseconds | undefined, playbackRate: number) => Milliseconds;
|
|
4
6
|
export declare enum CompareTrack {
|
|
5
7
|
Descending = -1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const destroy: (video: HTMLMediaElement) => void;
|
|
1
|
+
export declare const destroy: (video: HTMLMediaElement, clearVideoElementInnerHTML: boolean) => void;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ITuningConfig } from "../../../utils/tuningConfig";
|
|
2
|
-
type
|
|
3
|
-
|
|
2
|
+
export type AllocateConstraints = Pick<ITuningConfig, "audioVideoSyncRate" | "disableYandexPiP" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
|
|
3
|
+
type DisposeConstraints = Pick<ITuningConfig, "keepVideoElement" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
|
|
4
|
+
export declare const allocate: (container: HTMLElement, { audioVideoSyncRate, disableYandexPiP, clearVideoElementInnerHTML, reuseOwnVideoElement }: ITuningConfig) => HTMLVideoElement;
|
|
4
5
|
export declare const initializeAudio: (element: HTMLAudioElement) => HTMLAudioElement;
|
|
5
6
|
export declare const dispose: (element: HTMLMediaElement, constraints: DisposeConstraints) => void;
|
|
6
7
|
export {};
|