@vkontakte/videoplayer-core 2.0.129-dev.10b6113c.0 → 2.0.129-dev.2a63ab4f.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 +33 -33
- package/es2015.esm.js +32 -32
- package/es2018.cjs.js +29 -29
- package/es2018.esm.js +26 -26
- package/esnext.cjs.js +28 -28
- package/esnext.esm.js +26 -26
- package/evergreen.esm.js +25 -25
- package/package.json +2 -7
- package/types/player/Player.d.ts +2 -4
- package/types/providers/DashProvider/baseDashProvider.d.ts +1 -2
- package/types/providers/DashProvider/lib/buffer.d.ts +1 -1
- package/types/providers/DashProvider/lib/fetcher.d.ts +2 -4
- package/types/providers/DashProvider/lib/player.d.ts +4 -4
- package/types/providers/ProviderContainer/index.d.ts +0 -1
- package/types/providers/types.d.ts +1 -2
- package/types/providers/utils/HTMLVideoElement/observable.d.ts +2 -0
- package/types/providers/utils/StallsManager.d.ts +2 -1
- package/types/providers/utils/syncDesiredState.d.ts +1 -3
- package/types/utils/tuningConfig.d.ts +6 -0
- package/es2024.cjs.js +0 -126
- package/es2024.esm.js +0 -126
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.129-dev.
|
|
3
|
+
"version": "2.0.129-dev.2a63ab4f.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -25,11 +25,6 @@
|
|
|
25
25
|
"require": "./esnext.cjs.js",
|
|
26
26
|
"types": "./types/index.d.ts"
|
|
27
27
|
},
|
|
28
|
-
"./es2024": {
|
|
29
|
-
"import": "./es2024.esm.js",
|
|
30
|
-
"require": "./es2024.cjs.js",
|
|
31
|
-
"types": "./types/index.d.ts"
|
|
32
|
-
},
|
|
33
28
|
"./es2018": {
|
|
34
29
|
"import": "./es2018.esm.js",
|
|
35
30
|
"require": "./es2018.cjs.js",
|
|
@@ -54,7 +49,7 @@
|
|
|
54
49
|
"**/*.d.ts"
|
|
55
50
|
],
|
|
56
51
|
"dependencies": {
|
|
57
|
-
"@vkontakte/videoplayer-shared": "1.0.57-dev.
|
|
52
|
+
"@vkontakte/videoplayer-shared": "1.0.57-dev.96269696.0",
|
|
58
53
|
"hls.js": "~1.4.7"
|
|
59
54
|
}
|
|
60
55
|
}
|
package/types/player/Player.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IOptionalTuningConfig } from '../utils/tuningConfig';
|
|
2
|
-
import { IError, ILogEntry, Seconds, Subject, ValueSubject, QualityLimits, VideoQuality
|
|
2
|
+
import { IError, ILogEntry, Seconds, Subject, ValueSubject, QualityLimits, VideoQuality } 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;
|
|
@@ -7,7 +7,6 @@ export default class Player implements IPlayer {
|
|
|
7
7
|
private providerContainer?;
|
|
8
8
|
private chromecastInitializer;
|
|
9
9
|
private logger;
|
|
10
|
-
private tracer;
|
|
11
10
|
private abrLogger;
|
|
12
11
|
private config;
|
|
13
12
|
private tuning;
|
|
@@ -112,7 +111,7 @@ export default class Player implements IPlayer {
|
|
|
112
111
|
dumpTelemetry: (receiver: (value: Record<string, any>) => void) => void;
|
|
113
112
|
getCurrentTime$: ValueSubject<null>;
|
|
114
113
|
};
|
|
115
|
-
constructor(tuning?: IOptionalTuningConfig
|
|
114
|
+
constructor(tuning?: IOptionalTuningConfig);
|
|
116
115
|
initVideo(config: IConfig): IPlayer;
|
|
117
116
|
destroy(): void;
|
|
118
117
|
prepare(): IPlayer;
|
|
@@ -189,7 +188,6 @@ export default class Player implements IPlayer {
|
|
|
189
188
|
private setStartingVideoTrack;
|
|
190
189
|
private initLogs;
|
|
191
190
|
private initDebugTelemetry;
|
|
192
|
-
private initTracerSubscription;
|
|
193
191
|
private initWakeLock;
|
|
194
192
|
private setVideoTrackIdByQuality;
|
|
195
193
|
private getActiveLiveDelay;
|
|
@@ -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
|
|
6
|
+
import { ISubscription, 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,7 +20,6 @@ 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;
|
|
24
23
|
protected textTracksManager: TextTrackManager;
|
|
25
24
|
protected droppedFramesManager: DroppedFramesManager;
|
|
26
25
|
protected stallsManager: StallsManager;
|
|
@@ -108,7 +108,7 @@ export declare class BufferManager {
|
|
|
108
108
|
private pruneBuffer;
|
|
109
109
|
private abortBuffer;
|
|
110
110
|
getDebugBufferState(): IRange<Milliseconds> | undefined;
|
|
111
|
-
getForwardBufferDuration(): Milliseconds;
|
|
111
|
+
getForwardBufferDuration(currentPosition?: Milliseconds | undefined): Milliseconds;
|
|
112
112
|
private detectGaps;
|
|
113
113
|
private detectGapsWhenIdle;
|
|
114
114
|
private checkEjectedSegments;
|
|
@@ -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,
|
|
3
|
+
import { Byte, IValueSubject, Milliseconds, IRange, Subject, 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,7 +10,6 @@ export interface IParams {
|
|
|
10
10
|
throughputEstimator?: ThroughputEstimator;
|
|
11
11
|
requestQuic: boolean;
|
|
12
12
|
compatibilityMode?: boolean;
|
|
13
|
-
tracer: ITracer;
|
|
14
13
|
useEnableSubtitlesParam?: boolean;
|
|
15
14
|
}
|
|
16
15
|
export type Priority = 'high' | 'low' | 'auto';
|
|
@@ -35,7 +34,6 @@ export type RepresentationFetchResult = {
|
|
|
35
34
|
export declare class Fetcher {
|
|
36
35
|
private throughputEstimator;
|
|
37
36
|
private requestQuic;
|
|
38
|
-
private tracer;
|
|
39
37
|
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
40
38
|
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
41
39
|
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
@@ -45,7 +43,7 @@ export declare class Fetcher {
|
|
|
45
43
|
private subscription;
|
|
46
44
|
private compatibilityMode;
|
|
47
45
|
private useEnableSubtitlesParam;
|
|
48
|
-
constructor({ throughputEstimator, requestQuic,
|
|
46
|
+
constructor({ throughputEstimator, requestQuic, compatibilityMode, useEnableSubtitlesParam }: IParams);
|
|
49
47
|
private onHeadersReceived;
|
|
50
48
|
fetchManifest: (param_0: string) => Promise<string | null | undefined>;
|
|
51
49
|
fetch: (param_0: string, param_1: FetchParams) => Promise<ArrayBuffer | null | undefined>;
|
|
@@ -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,
|
|
6
|
+
import { IError, ISubject, IValueSubject, Milliseconds, Subject } from '@vkontakte/videoplayer-shared';
|
|
7
7
|
export declare enum State {
|
|
8
8
|
NONE = "none",
|
|
9
9
|
MANIFEST_READY = "manifest_ready",
|
|
@@ -14,7 +14,6 @@ export interface Params {
|
|
|
14
14
|
throughputEstimator: ThroughputEstimator;
|
|
15
15
|
tuning: ITuningConfig;
|
|
16
16
|
compatibilityMode?: boolean;
|
|
17
|
-
tracer: ITracer;
|
|
18
17
|
}
|
|
19
18
|
export declare class Player {
|
|
20
19
|
private element;
|
|
@@ -22,7 +21,6 @@ export declare class Player {
|
|
|
22
21
|
private source;
|
|
23
22
|
private manifest;
|
|
24
23
|
private tuning;
|
|
25
|
-
private tracer;
|
|
26
24
|
private videoBufferManager;
|
|
27
25
|
private audioBufferManager;
|
|
28
26
|
private bufferManagers;
|
|
@@ -42,6 +40,7 @@ export declare class Player {
|
|
|
42
40
|
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
43
41
|
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
44
42
|
currentLiveTextRepresentation$: IValueSubject<TextRepresentation | null>;
|
|
43
|
+
private timeoutSourceOpenId;
|
|
45
44
|
isLive$: IValueSubject<boolean>;
|
|
46
45
|
isActiveLive$: IValueSubject<boolean>;
|
|
47
46
|
isLowLatency$: IValueSubject<boolean>;
|
|
@@ -75,12 +74,13 @@ export declare class Player {
|
|
|
75
74
|
initBuffer(): void;
|
|
76
75
|
switchRepresentation(kind: StreamKind, id: Representation['id'], dropBuffer?: boolean): Promise<void>;
|
|
77
76
|
seek(requestedPosition: Milliseconds, forcePrecise: boolean): Promise<void>;
|
|
77
|
+
warmUpMediaSourceIfNeeded(position?: Milliseconds | undefined): void;
|
|
78
|
+
get isStreamEnded(): boolean;
|
|
78
79
|
stop(): void;
|
|
79
80
|
setBufferTarget(time: Milliseconds): void;
|
|
80
81
|
getStreams(): Manifest['streams'] | undefined;
|
|
81
82
|
setPreloadOnly(preloadOnly: boolean): void;
|
|
82
83
|
destroy(): void;
|
|
83
|
-
private initTracerSubscription;
|
|
84
84
|
private isManualDecreasePlaybackInLive;
|
|
85
85
|
private normolizeLiveOffset;
|
|
86
86
|
private tick;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ITuningConfig } from '../utils/tuningConfig';
|
|
2
|
-
import { ILogger, ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IComponentLogger
|
|
2
|
+
import { ILogger, ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IComponentLogger } 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';
|
|
@@ -16,7 +16,6 @@ export interface IProviderDependencies {
|
|
|
16
16
|
throughputEstimator: ThroughputEstimator;
|
|
17
17
|
chromecastInitializer: IChromecastInitializer;
|
|
18
18
|
logger: ILogger;
|
|
19
|
-
tracer: ITracer;
|
|
20
19
|
abrLogger: IComponentLogger;
|
|
21
20
|
};
|
|
22
21
|
}
|
|
@@ -6,6 +6,7 @@ export interface IObservableVideo {
|
|
|
6
6
|
canplay$: IObservable<undefined>;
|
|
7
7
|
ended$: IObservable<undefined>;
|
|
8
8
|
looped$: IObservable<Seconds>;
|
|
9
|
+
loopExpected$: IObservable<undefined>;
|
|
9
10
|
error$: IObservable<IError>;
|
|
10
11
|
seeked$: IObservable<undefined>;
|
|
11
12
|
seeking$: IObservable<undefined>;
|
|
@@ -23,5 +24,6 @@ export interface IObservableVideo {
|
|
|
23
24
|
inFullscreen$: IValueObservable<boolean>;
|
|
24
25
|
enterPip$: IObservable<PictureInPictureEvent>;
|
|
25
26
|
leavePip$: IObservable<PictureInPictureEvent>;
|
|
27
|
+
destroy: () => void;
|
|
26
28
|
}
|
|
27
29
|
export declare const observe: (video: HTMLVideoElement) => IObservableVideo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ExactVideoQuality, IObservable, IValueSubject, Milliseconds, Kbps } from '@vkontakte/videoplayer-shared';
|
|
1
|
+
import { ExactVideoQuality, IObservable, IValueSubject, Milliseconds, Kbps, Seconds } from '@vkontakte/videoplayer-shared';
|
|
2
2
|
import { IVideoTrack } from '../../player/types';
|
|
3
3
|
import { ITuningConfig } from '../../utils/tuningConfig';
|
|
4
4
|
interface IConnectData {
|
|
@@ -7,6 +7,7 @@ interface IConnectData {
|
|
|
7
7
|
rtt$: IValueSubject<Milliseconds>;
|
|
8
8
|
isBuffering$: IObservable<boolean>;
|
|
9
9
|
isSeeked$: IObservable<boolean>;
|
|
10
|
+
looped$: IObservable<Seconds>;
|
|
10
11
|
currentStallDuration$: IObservable<Milliseconds>;
|
|
11
12
|
qualityLimitsOnStall: ITuningConfig['dash']['qualityLimitsOnStall'];
|
|
12
13
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { IListener, IObservable, ISubscription } from '@vkontakte/videoplayer-shared';
|
|
2
2
|
import { IVolumeState, PlaybackRate } from '../../player/types';
|
|
3
3
|
import { IStateMachine } from '../../utils/StateMachine/types';
|
|
4
|
-
declare const syncDesiredState: <Value>(desiredState: IStateMachine<Value | undefined>, get: () => Value | undefined,
|
|
5
|
-
set: (value: Value | undefined) => void, // Применение нового значения
|
|
6
|
-
{ equal, changed$, onError, }?: {
|
|
4
|
+
declare const syncDesiredState: <Value>(desiredState: IStateMachine<Value | undefined>, get: () => Value | undefined, set: (value: Value | undefined) => void, { equal, changed$, onError, }?: {
|
|
7
5
|
equal?: (a: Value | undefined, b: Value | undefined) => boolean;
|
|
8
6
|
changed$?: IObservable<Value | undefined>;
|
|
9
7
|
onError?: IListener<Error | unknown>;
|
|
@@ -61,6 +61,7 @@ export type ITuningConfig = {
|
|
|
61
61
|
forwardBufferTargetAuto: Milliseconds;
|
|
62
62
|
forwardBufferTargetManual: Milliseconds;
|
|
63
63
|
forwardBufferTargetPreload: Milliseconds;
|
|
64
|
+
seekBiasInTheEnd: Milliseconds;
|
|
64
65
|
maxSegmentDurationLeftToSelectNextSegment: Milliseconds;
|
|
65
66
|
minSafeBufferThreshold: number;
|
|
66
67
|
bufferPruningSafeZone: Milliseconds;
|
|
@@ -73,11 +74,15 @@ export type ITuningConfig = {
|
|
|
73
74
|
useFetchPriorityHints: boolean;
|
|
74
75
|
qualityLimitsOnStall: {
|
|
75
76
|
stallDurationNoDataBeforeQualityDecrease: Milliseconds;
|
|
77
|
+
stallDurationToBeCount: Milliseconds;
|
|
76
78
|
stallCountBeforeQualityDecrease: Milliseconds;
|
|
77
79
|
resetQualityRestrictionTimeout: Milliseconds;
|
|
80
|
+
ignoreStallsOnSeek: boolean;
|
|
78
81
|
};
|
|
79
82
|
enableBaseUrlSupport: boolean;
|
|
80
83
|
maxSegmentRetryCount: number;
|
|
84
|
+
sourceOpenTimeout: number;
|
|
85
|
+
rejectOnSourceOpenTimeout: boolean;
|
|
81
86
|
};
|
|
82
87
|
dashCmafLive: {
|
|
83
88
|
maxActiveLiveOffset: Milliseconds;
|
|
@@ -141,6 +146,7 @@ export type ITuningConfig = {
|
|
|
141
146
|
stripRangeHeader: boolean;
|
|
142
147
|
flushShortLoopedBuffers: boolean;
|
|
143
148
|
insufficientBufferRuleMargin: Milliseconds;
|
|
149
|
+
seekNearDurationBias: Seconds;
|
|
144
150
|
dashSeekInSegmentDurationThreshold: Milliseconds;
|
|
145
151
|
dashSeekInSegmentAlwaysSeekDelta: Milliseconds;
|
|
146
152
|
endGapTolerance: Milliseconds;
|