@vkontakte/videoplayer-core 2.0.170 → 2.0.171-dev.c1327f3bc.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 +54 -58
- package/es2015.esm.js +45 -49
- package/esnext.cjs +45 -49
- package/esnext.esm.js +56 -60
- package/evergreen.esm.js +56 -60
- package/package.json +2 -2
- package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +1 -0
- package/types/providers/DashProvider/baseDashProvider.d.ts +0 -2
- package/types/providers/DashProvider/lib/sourceBufferTaskQueue.d.ts +1 -2
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +0 -1
- package/types/providers/DashProviderVirtual/lib/buffer/nativeBufferManager.d.ts +1 -1
- package/types/providers/DashProviderVirtual/lib/buffer/sourceBufferTaskQueue.d.ts +1 -2
- package/types/providers/ProviderContainer/index.d.ts +0 -1
- package/types/providers/utils/Abr/types.d.ts +0 -2
- package/types/providers/utils/HTMLVideoElement/destroy.d.ts +1 -1
- package/types/providers/utils/HTMLVideoElement/pool.d.ts +2 -3
- package/types/utils/autoSelectTrack.d.ts +3 -4
- package/types/utils/tuningConfig.d.ts +8 -16
- package/types/providers/utils/Abr/rules/video/failedVideoTrackRule.d.ts +0 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.171-dev.c1327f3bc.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.
|
|
45
|
+
"@vkontakte/videoplayer-shared": "1.0.100-dev.c1327f3bc.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -16,7 +16,6 @@ import { ElementSizeManager } from "../utils/HTMLVideoElement/ElementSizeManager
|
|
|
16
16
|
type IParams = IProviderParams<IDashURLSource> & {
|
|
17
17
|
sourceHls?: IHLSSource;
|
|
18
18
|
forceVideoCodec?: VideoCodec;
|
|
19
|
-
failedVideoTrack?: Nullable<IVideoTrack>;
|
|
20
19
|
isOnDemand?: boolean;
|
|
21
20
|
dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
|
|
22
21
|
};
|
|
@@ -34,7 +33,6 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
34
33
|
protected stallsManager: StallsManager;
|
|
35
34
|
protected elementSizeManager: ElementSizeManager;
|
|
36
35
|
protected abrManager: AbrManager;
|
|
37
|
-
protected failedVideoTrack: Nullable<IVideoTrack>;
|
|
38
36
|
protected videoTracksMap: Map<IVideoTrack, {
|
|
39
37
|
stream: Stream;
|
|
40
38
|
representation: Representation;
|
|
@@ -7,8 +7,7 @@ declare class SourceBufferTaskQueue {
|
|
|
7
7
|
private currentTask;
|
|
8
8
|
private destroyed;
|
|
9
9
|
private abortRequested;
|
|
10
|
-
|
|
11
|
-
constructor(buffer: SourceBuffer, isAbortFixEnabled?: boolean);
|
|
10
|
+
constructor(buffer: SourceBuffer);
|
|
12
11
|
append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
13
12
|
remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
|
|
14
13
|
abort(init?: BufferSource): Promise<boolean>;
|
|
@@ -16,7 +16,6 @@ import { AbrManager } from "../utils/Abr/abrManager";
|
|
|
16
16
|
type IParams = IProviderParams<IDashURLSource> & {
|
|
17
17
|
sourceHls?: IHLSSource;
|
|
18
18
|
forceVideoCodec?: VideoCodec;
|
|
19
|
-
failedVideoTrack?: Nullable<IVideoTrack>;
|
|
20
19
|
isOnDemand?: boolean;
|
|
21
20
|
dashMaxTvVideoQuality?: Nullable<ExactVideoQuality>;
|
|
22
21
|
};
|
|
@@ -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
|
|
10
|
+
init(mime: string, codecs: string): 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,8 +7,7 @@ declare class SourceBufferTaskQueue {
|
|
|
7
7
|
private currentTask;
|
|
8
8
|
private destroyed;
|
|
9
9
|
private abortRequested;
|
|
10
|
-
|
|
11
|
-
constructor(buffer: SourceBuffer, isAbortFixEnabled?: boolean);
|
|
10
|
+
constructor(buffer: SourceBuffer);
|
|
12
11
|
append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
13
12
|
remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
|
|
14
13
|
abort(init?: BufferSource): Promise<boolean>;
|
|
@@ -35,7 +35,6 @@ export default class ProviderContainer implements IProviderContainer {
|
|
|
35
35
|
private tracer;
|
|
36
36
|
private params;
|
|
37
37
|
private currentProviderStarted;
|
|
38
|
-
private currentFailedVideoTrack;
|
|
39
38
|
private volumeMultiplierManager;
|
|
40
39
|
private dashMaxTvVideoQuality;
|
|
41
40
|
private mayday;
|
|
@@ -15,7 +15,6 @@ 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",
|
|
19
18
|
TvDisabledVideoTrack = "tv_disabled_video_track_rule",
|
|
20
19
|
Stalls = "stalls_rule",
|
|
21
20
|
LowerLimit = "lower_limit_rule",
|
|
@@ -59,7 +58,6 @@ export interface IInitAbrManagerContext {
|
|
|
59
58
|
rtt$: IValueSubject<Milliseconds>;
|
|
60
59
|
throughputVariance$?: IValueSubject<number>;
|
|
61
60
|
element: HTMLMediaElement;
|
|
62
|
-
failedVideoTrack: Nullable<IVideoTrack>;
|
|
63
61
|
abrLogger: IComponentLogger;
|
|
64
62
|
panelSize?: IRectangle;
|
|
65
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const destroy: (video: HTMLMediaElement
|
|
1
|
+
export declare const destroy: (video: HTMLMediaElement) => void;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ITuningConfig } from "../../../utils/tuningConfig";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const allocate: (container: HTMLElement, { audioVideoSyncRate, disableYandexPiP, clearVideoElementInnerHTML, reuseOwnVideoElement }: ITuningConfig) => HTMLVideoElement;
|
|
2
|
+
type DisposeConstraints = Pick<ITuningConfig, "reuseOwnVideoElement">;
|
|
3
|
+
export declare const allocate: (container: HTMLElement, { audioVideoSyncRate, disableYandexPiP, reuseOwnVideoElement }: ITuningConfig) => HTMLVideoElement;
|
|
5
4
|
export declare const initializeAudio: (element: HTMLAudioElement) => HTMLAudioElement;
|
|
6
5
|
export declare const dispose: (element: HTMLMediaElement, constraints: DisposeConstraints) => void;
|
|
7
6
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ITuningConfig } from "./tuningConfig";
|
|
2
|
-
import type { Kbps, Milliseconds, IRectangle, QualityLimits, IComponentLogger
|
|
2
|
+
import type { Kbps, Milliseconds, IRectangle, QualityLimits, IComponentLogger } from "@vkontakte/videoplayer-shared";
|
|
3
3
|
import { type ExactVideoQuality } from "@vkontakte/videoplayer-shared";
|
|
4
4
|
import type { IAudioTrack, IBaseTrack, IVideoTrack } from "../player/types";
|
|
5
5
|
interface IConstraints<T extends IBaseTrack> {
|
|
@@ -11,7 +11,6 @@ interface IConstraints<T extends IBaseTrack> {
|
|
|
11
11
|
playbackRate?: number;
|
|
12
12
|
forwardBufferHealth?: number;
|
|
13
13
|
current?: T;
|
|
14
|
-
failedVideoTrack?: Nullable<T>;
|
|
15
14
|
visible?: boolean;
|
|
16
15
|
history?: TrackHistory<T>;
|
|
17
16
|
droppedVideoMaxQualityLimit?: ExactVideoQuality;
|
|
@@ -30,8 +29,8 @@ export declare class TrackHistory<T extends IBaseTrack> {
|
|
|
30
29
|
export declare const defaultEmptyArrayErrorMessage = "Assertion \"ABR Tracks is empty array\" failed";
|
|
31
30
|
export declare const getMinPossibleAudioForVideoOld: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], minVideoAudioRatio: number) => IAudioTrack | undefined;
|
|
32
31
|
export declare const getMinPossibleAudioForVideoNew: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], minVideoAudioRatio: number) => IAudioTrack | undefined;
|
|
33
|
-
export declare const autoSelectVideoTrackNew: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current,
|
|
34
|
-
export declare const autoSelectVideoTrackOld: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current,
|
|
32
|
+
export declare const autoSelectVideoTrackNew: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize }: IConstraints<IVideoTrack>) => IVideoTrack;
|
|
33
|
+
export declare const autoSelectVideoTrackOld: (videoTracks: IVideoTrack[], { container, estimatedThroughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, visible, droppedVideoMaxQualityLimit, stallsVideoMaxQualityLimit, stallsPredictedThroughput, abrLogger, panelSize }: IConstraints<IVideoTrack>) => IVideoTrack;
|
|
35
34
|
export declare const autoSelectAudioTrackForVideoOld: (selectedVideoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], { estimatedThroughput, tuning, playbackRate, forwardBufferHealth, history, abrLogger, stallsPredictedThroughput }: IConstraints<IAudioTrack>) => IAudioTrack | undefined;
|
|
36
35
|
export declare const autoSelectAudioTrackForVideoNew: (selectedVideoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[], { estimatedThroughput, tuning, playbackRate, forwardBufferHealth, history, abrLogger, stallsPredictedThroughput }: IConstraints<IAudioTrack>) => IAudioTrack | undefined;
|
|
37
36
|
export {};
|
|
@@ -15,19 +15,6 @@ export type ITuningConfig = {
|
|
|
15
15
|
heuristics: string[];
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
|
-
* Если true, внутренний video элемент не будет уничтожаться при реините провайдера
|
|
19
|
-
* и при создании нового экземляра Player.
|
|
20
|
-
* Будет веcти себя аналогично элементу переданному снаружи
|
|
21
|
-
* Для кейса прямого использовани ядра
|
|
22
|
-
*/
|
|
23
|
-
keepVideoElement: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Временный флаг для тестирования очистки video элемента
|
|
26
|
-
* Если true, при очистке будет вызван innerHTML = '' для очистки дочерних элементов трэков
|
|
27
|
-
* В противном случае они размножаются
|
|
28
|
-
*/
|
|
29
|
-
clearVideoElementInnerHTML: boolean;
|
|
30
|
-
/**
|
|
31
18
|
* Включает очистку состояния плеера при вызове метода stop()
|
|
32
19
|
*/
|
|
33
20
|
allowPlayerReuse: boolean;
|
|
@@ -182,7 +169,6 @@ export type ITuningConfig = {
|
|
|
182
169
|
useSmartRepresentationSwitch: boolean;
|
|
183
170
|
stallForceSeekOncePerStall: boolean;
|
|
184
171
|
useFetchPriorityHints: boolean;
|
|
185
|
-
useAbortMSEFix: boolean;
|
|
186
172
|
enableBaseUrlSupport: boolean;
|
|
187
173
|
maxSegmentRetryCount: number;
|
|
188
174
|
sourceOpenTimeout: number;
|
|
@@ -208,9 +194,7 @@ export type ITuningConfig = {
|
|
|
208
194
|
abrVideoRules: VideoRuleName[];
|
|
209
195
|
abrAudioRules: AudioRuleName[];
|
|
210
196
|
useDynamicBirtateRule: boolean;
|
|
211
|
-
useNewFailoverLogic: boolean;
|
|
212
197
|
useFailoverHostsOnAllProviderCrash: boolean;
|
|
213
|
-
videoTrackBanAfterProviderFail: Milliseconds;
|
|
214
198
|
saveData3gQualityLimit: ExactVideoQuality;
|
|
215
199
|
saveData2gQualityLimit: ExactVideoQuality;
|
|
216
200
|
useConnectionDataUpperLimit: boolean;
|
|
@@ -454,6 +438,14 @@ export type ITuningConfig = {
|
|
|
454
438
|
useDurationFromSegments: boolean;
|
|
455
439
|
/** включен режим проигрывания только аудио (без видео) */
|
|
456
440
|
audioOnly: boolean;
|
|
441
|
+
/**
|
|
442
|
+
* Переводить провайдер в READY по loadedmetadata вместо canplay.
|
|
443
|
+
* canplay означает, что видео уже может играться, что избыточно для READY —
|
|
444
|
+
* достаточно получить манифест (loadedmetadata).
|
|
445
|
+
* Применяется только когда желаемое состояние — READY (preload): при автоплее
|
|
446
|
+
* провайдер по-прежнему ждёт canplay, чтобы play() не вызывался до появления данных.
|
|
447
|
+
*/
|
|
448
|
+
readyOnLoadedMetadata: boolean;
|
|
457
449
|
};
|
|
458
450
|
export type IOptionalTuningConfig = RecursivePartial<ITuningConfig>;
|
|
459
451
|
export declare const fillDefault: (partial: IOptionalTuningConfig) => ITuningConfig;
|
|
@@ -1,14 +0,0 @@
|
|
|
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 {};
|