@vkontakte/videoplayer-core 2.0.65 → 2.0.67
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 +4 -4
- package/es2015.esm.js +4 -4
- package/es2018.cjs.js +4 -4
- package/es2018.esm.js +4 -4
- package/esnext.cjs.js +4 -4
- package/esnext.esm.js +4 -4
- package/package.json +29 -4
- package/packages/{sdk → core}/src/providers/ChromecastProvider/ChromecastInitializer/types.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashIFProvider/dashjsTypes.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashLiveProvider/types.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashLiveProvider/utils/FilesFetcher.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashLiveProvider/utils/ThroughputEstimator.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashLiveProvider/utils/liveDashPlayerUtil.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashProvider/types.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashProvider/utils/DashLite.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashProvider/utils/stream.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashProvider/utils/xhr2.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashVKProvider/lib/buffer.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashVKProvider/lib/ebml.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashVKProvider/lib/fetcher.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashVKProvider/lib/isobmff.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashVKProvider/lib/mpd.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/DashVKProvider/lib/sourceBufferTaskQueue.d.ts +1 -1
- package/packages/{sdk → core}/src/providers/DashVKProvider/lib/webm.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/ProviderContainer/types.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/types.d.ts +0 -0
- package/packages/{sdk → core}/src/providers/utils/LiveOffset/types.d.ts +0 -0
- package/packages/{sdk → core}/src/utils/StateMachine/types.d.ts +0 -0
- package/packages/{sdk → core}/src/utils/StatefulIterator/StatefulIterator.spec.d.ts +0 -0
- package/packages/{sdk → core}/src/utils/buffer/getTotalBufferDuration.d.ts +0 -0
- package/packages/{sdk → core}/src/utils/buffer/isPositionBuffered.d.ts +0 -0
- package/packages/{sdk → core}/src/utils/buffer/types.d.ts +0 -0
- package/packages/{sdk → core}/src/utils/link.d.ts +0 -0
- package/packages/{sdk → core}/src/utils/quality/quality.spec.d.ts +0 -0
- package/player/Player.d.ts +1 -1
- package/player/utils/optimisticPosition.d.ts +1 -1
- package/providers/utils/forcePlay.d.ts +1 -1
- package/providers/utils/syncDesiredState.d.ts +2 -2
- package/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +0 -135
- package/providers/DashProvider/utils/DashLite.d.ts +0 -60
- package/utils/buffer/isPositionBuffered.d.ts +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.67",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -8,15 +8,40 @@
|
|
|
8
8
|
"main": "esnext.cjs.js",
|
|
9
9
|
"module": "esnext.esm.js",
|
|
10
10
|
"types": "index.d.ts",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"import": "esnext.esm.js",
|
|
15
|
+
"require": "esnext.cjs.js"
|
|
16
|
+
},
|
|
17
|
+
"./esnext": {
|
|
18
|
+
"import": "esnext.esm.js",
|
|
19
|
+
"require": "esnext.cjs.js"
|
|
20
|
+
},
|
|
21
|
+
"./es2018": {
|
|
22
|
+
"import": "es2018.esm.js",
|
|
23
|
+
"require": "es2018.cjs.js"
|
|
24
|
+
},
|
|
25
|
+
"./es2015": {
|
|
26
|
+
"import": "es2015.esm.js",
|
|
27
|
+
"require": "es2015.cjs.js"
|
|
28
|
+
},
|
|
29
|
+
"./esnext.esm.js": "esnext.esm.js",
|
|
30
|
+
"./esnext.cjs.js": "esnext.cjs.js",
|
|
31
|
+
"./es2018.esm.js": "es2018.esm.js",
|
|
32
|
+
"./es2018.cjs.js": "es2018.cjs.js",
|
|
33
|
+
"./es2015.esm.js": "es2015.esm.js",
|
|
34
|
+
"./es2015.cjs.js": "es2015.cjs.js"
|
|
35
|
+
},
|
|
11
36
|
"files": [
|
|
12
37
|
"*.cjs.js",
|
|
13
38
|
"*.esm.js",
|
|
14
39
|
"**/*.d.ts"
|
|
15
40
|
],
|
|
16
41
|
"dependencies": {
|
|
17
|
-
"@vkontakte/videoplayer-shared": "^1.0.
|
|
18
|
-
"dashjs": "4.4.
|
|
19
|
-
"hls.js": "1.1
|
|
42
|
+
"@vkontakte/videoplayer-shared": "^1.0.16",
|
|
43
|
+
"dashjs": "4.4.1",
|
|
44
|
+
"hls.js": "1.2.1",
|
|
20
45
|
"lodash": "4.17.21"
|
|
21
46
|
}
|
|
22
47
|
}
|
package/packages/{sdk → core}/src/providers/ChromecastProvider/ChromecastInitializer/types.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -9,7 +9,7 @@ declare class SourceBufferTaskQueue {
|
|
|
9
9
|
constructor(buffer: SourceBuffer);
|
|
10
10
|
append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
11
11
|
remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
|
|
12
|
-
abort(): Promise<boolean>;
|
|
12
|
+
abort(init?: BufferSource): Promise<boolean>;
|
|
13
13
|
destroy(): void;
|
|
14
14
|
private completeTask;
|
|
15
15
|
private pull;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/player/Player.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export default class Player implements IPlayer {
|
|
|
28
28
|
isAutoQualityEnabled$: ValueSubject<boolean>;
|
|
29
29
|
autoQualityLimitingAvailable$: ValueSubject<boolean>;
|
|
30
30
|
autoQualityLimits$: ValueSubject<QualityLimits>;
|
|
31
|
-
currentBuffer$: ValueSubject<StartEnd<number
|
|
31
|
+
currentBuffer$: ValueSubject<StartEnd<number>>;
|
|
32
32
|
isBuffering$: ValueSubject<boolean>;
|
|
33
33
|
isStalled$: ValueSubject<boolean>;
|
|
34
34
|
isEnded$: ValueSubject<boolean>;
|
|
@@ -5,8 +5,8 @@ interface IParams {
|
|
|
5
5
|
seekState: IStateMachine<SeekState>;
|
|
6
6
|
position$: IValueObservable<Seconds>;
|
|
7
7
|
}
|
|
8
|
-
declare const _default: ({ seekState, position$ }: IParams) => IObservable<Seconds>;
|
|
9
8
|
/**
|
|
10
9
|
* Реализует оптимистичное изменение позиции при перемотке
|
|
11
10
|
*/
|
|
11
|
+
declare const _default: ({ seekState, position$ }: IParams) => IObservable<Seconds>;
|
|
12
12
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare const _default: (video: HTMLVideoElement) => Promise<boolean>;
|
|
2
1
|
/**
|
|
3
2
|
* Пытаемся запустить видео обходя ошибку `NotAllowedError` путём включения `mute`.
|
|
4
3
|
* @param {HTMLVideoElement} video - видеообъект
|
|
5
4
|
* @return {Promise}<boolean> - получилось начать воспроизведение
|
|
6
5
|
*/
|
|
6
|
+
declare const _default: (video: HTMLVideoElement) => Promise<boolean>;
|
|
7
7
|
export default _default;
|
|
@@ -6,6 +6,6 @@ declare const syncDesiredState: <Value>(desiredState: IStateMachine<Value | unde
|
|
|
6
6
|
changed$?: IObservable<Value | undefined> | undefined;
|
|
7
7
|
onError?: IListener<unknown> | undefined;
|
|
8
8
|
}) => ISubscription;
|
|
9
|
-
export declare const syncVideoLooped: (video: HTMLVideoElement, desiredState: IStateMachine<boolean>, onError?: IListener<
|
|
10
|
-
export declare const syncVideoVolumeState: (video: HTMLVideoElement, desiredState: IStateMachine<IVolumeState>, changed$: IObservable<IVolumeState>, onError?: IListener<
|
|
9
|
+
export declare const syncVideoLooped: (video: HTMLVideoElement, desiredState: IStateMachine<boolean>, onError?: IListener<Error | unknown>) => ISubscription;
|
|
10
|
+
export declare const syncVideoVolumeState: (video: HTMLVideoElement, desiredState: IStateMachine<IVolumeState>, changed$: IObservable<IVolumeState>, onError?: IListener<Error | unknown>) => ISubscription;
|
|
11
11
|
export default syncDesiredState;
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import { IRepresentation } from '../types';
|
|
3
|
-
interface IParams {
|
|
4
|
-
videoElement: HTMLVideoElement;
|
|
5
|
-
playerCallback: (...args: any) => void;
|
|
6
|
-
config: {
|
|
7
|
-
minBuffer: Milliseconds;
|
|
8
|
-
lowLatencyMinBuffer: Milliseconds;
|
|
9
|
-
minBufferSegments: number;
|
|
10
|
-
lowLatencyMinBufferSegments: number;
|
|
11
|
-
maxParallelRequests: number;
|
|
12
|
-
};
|
|
13
|
-
logger: (...args: any[]) => void;
|
|
14
|
-
}
|
|
15
|
-
export default class LiveDashPlayer {
|
|
16
|
-
private paused;
|
|
17
|
-
private autoQuality;
|
|
18
|
-
private maxAutoQuality;
|
|
19
|
-
private buffering;
|
|
20
|
-
private destroyed;
|
|
21
|
-
private videoPlayStarted;
|
|
22
|
-
private lowLatency;
|
|
23
|
-
private rep?;
|
|
24
|
-
private bitrate;
|
|
25
|
-
private manifest;
|
|
26
|
-
private bitrateSwitcher?;
|
|
27
|
-
private filesFetcher?;
|
|
28
|
-
private sourceBuffer?;
|
|
29
|
-
private mediaSource?;
|
|
30
|
-
private currentManifestEntry?;
|
|
31
|
-
private manifestRequest?;
|
|
32
|
-
private manifestRefetchTimer?;
|
|
33
|
-
private bufferStates;
|
|
34
|
-
private downloadRate?;
|
|
35
|
-
private sourceJitter;
|
|
36
|
-
private chunkRateEstimator;
|
|
37
|
-
private manifestUrl;
|
|
38
|
-
private urlResolver;
|
|
39
|
-
private params;
|
|
40
|
-
constructor(params: IParams);
|
|
41
|
-
attachSource(manifestUrl: string): void;
|
|
42
|
-
/**
|
|
43
|
-
* switch to auto quality
|
|
44
|
-
*/
|
|
45
|
-
setAutoQualityEnabled(enabled: boolean): void;
|
|
46
|
-
setMaxAutoQuality(height: number | undefined): void;
|
|
47
|
-
/**
|
|
48
|
-
* switch quality by name
|
|
49
|
-
*/
|
|
50
|
-
switchByName(name: string): void;
|
|
51
|
-
/**
|
|
52
|
-
* seek to actual video position
|
|
53
|
-
*/
|
|
54
|
-
catchUp(): void;
|
|
55
|
-
stop(): void;
|
|
56
|
-
pause(): void;
|
|
57
|
-
play(onPlayNotAllowed?: () => void): void;
|
|
58
|
-
startPlay(targetQ: IRepresentation, autoQuality: boolean): void;
|
|
59
|
-
/**
|
|
60
|
-
* destroy player
|
|
61
|
-
*/
|
|
62
|
-
destroy(): void;
|
|
63
|
-
reinit(newManifestUrl: string): void;
|
|
64
|
-
/**
|
|
65
|
-
* if all retries fail...
|
|
66
|
-
*/
|
|
67
|
-
private _handleNetworkError;
|
|
68
|
-
/**
|
|
69
|
-
* Retry request
|
|
70
|
-
*/
|
|
71
|
-
private _retryCallback;
|
|
72
|
-
/**
|
|
73
|
-
* how many seconds are there in the buffer
|
|
74
|
-
*/
|
|
75
|
-
private _getBufferSizeSec;
|
|
76
|
-
/**
|
|
77
|
-
* send buffering notification to player
|
|
78
|
-
*/
|
|
79
|
-
private _notifyBuffering;
|
|
80
|
-
/**
|
|
81
|
-
* initialize video tag, add necessary event listeners
|
|
82
|
-
* @private
|
|
83
|
-
*/
|
|
84
|
-
private _initVideo;
|
|
85
|
-
/**
|
|
86
|
-
* there may be small gaps of several milliseconds when switching quality
|
|
87
|
-
* we jump over these gaps here
|
|
88
|
-
*/
|
|
89
|
-
private _fixupStall;
|
|
90
|
-
/**
|
|
91
|
-
* return best quality for rate
|
|
92
|
-
*/
|
|
93
|
-
private _selectQuality;
|
|
94
|
-
private shouldPlay;
|
|
95
|
-
/**
|
|
96
|
-
* set video source
|
|
97
|
-
*/
|
|
98
|
-
private _setVideoSrc;
|
|
99
|
-
/**
|
|
100
|
-
* initialize player with target quality
|
|
101
|
-
*/
|
|
102
|
-
private _initPlayerWith;
|
|
103
|
-
/**
|
|
104
|
-
* represents specific quality stream
|
|
105
|
-
*/
|
|
106
|
-
private _representation;
|
|
107
|
-
/**
|
|
108
|
-
* switch to quality
|
|
109
|
-
* TODO: Если новое качество выше старого – переключиться сразу. Если хуже, доиграть буфер
|
|
110
|
-
*/
|
|
111
|
-
private _switchToQuality;
|
|
112
|
-
/**
|
|
113
|
-
* check if quality is available
|
|
114
|
-
*/
|
|
115
|
-
private _qualityAvailable;
|
|
116
|
-
/**
|
|
117
|
-
* analyze bitrate data and switch qualities accordingly
|
|
118
|
-
*/
|
|
119
|
-
private _initBitrateSwitcher;
|
|
120
|
-
/**
|
|
121
|
-
* load and parse manifest file
|
|
122
|
-
*/
|
|
123
|
-
private _fetchManifest;
|
|
124
|
-
private _playVideoElement;
|
|
125
|
-
/**
|
|
126
|
-
* update internal state when manifest was received from remote
|
|
127
|
-
*/
|
|
128
|
-
private _handleManifestUpdate;
|
|
129
|
-
/**
|
|
130
|
-
* schedule manifest update after delay
|
|
131
|
-
*/
|
|
132
|
-
private _refetchManifest;
|
|
133
|
-
private _initManifest;
|
|
134
|
-
}
|
|
135
|
-
export {};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import HttpVideoBuffer from "../../../utils/buffer/HttpVideoBuffer";
|
|
3
|
-
import { IDashConfig, IRef, IRepresentation } from '../types';
|
|
4
|
-
interface IParams {
|
|
5
|
-
video: HTMLVideoElement;
|
|
6
|
-
buffer: HttpVideoBuffer;
|
|
7
|
-
selectRepresentation: (representations: IRepresentation[]) => IRepresentation;
|
|
8
|
-
onManifestReady: (representations: IRepresentation[]) => void;
|
|
9
|
-
onIdxRequestPing: (ping: Milliseconds) => void;
|
|
10
|
-
onResponseHeaders: (headers: Headers) => void;
|
|
11
|
-
onBandwidthChange: (payload: {
|
|
12
|
-
size: number;
|
|
13
|
-
duration: number;
|
|
14
|
-
speed: number;
|
|
15
|
-
}) => void;
|
|
16
|
-
onRepresentationPlay: (representation: IRepresentation) => void;
|
|
17
|
-
onError: (id: string, message: string, thrown?: Error | unknown) => void;
|
|
18
|
-
config: IDashConfig;
|
|
19
|
-
onDashCallback?: (eventName: string, param?: any) => any;
|
|
20
|
-
}
|
|
21
|
-
export default class DashLite {
|
|
22
|
-
private _params;
|
|
23
|
-
private _representations;
|
|
24
|
-
private _appendVector;
|
|
25
|
-
private _currentRepresentation?;
|
|
26
|
-
private _stream;
|
|
27
|
-
private _lastLoadOffset?;
|
|
28
|
-
private _loopTimeout?;
|
|
29
|
-
private _cachingPaused;
|
|
30
|
-
private _duration;
|
|
31
|
-
private STREAM_END_THRESHOLD;
|
|
32
|
-
private _video;
|
|
33
|
-
private _buffer;
|
|
34
|
-
private _onDashCallback;
|
|
35
|
-
private _config;
|
|
36
|
-
constructor(params: IParams);
|
|
37
|
-
/**
|
|
38
|
-
* Parse duration from ISO8601 string.
|
|
39
|
-
* @see https://en.wikipedia.org/wiki/ISO_8601#Durations
|
|
40
|
-
* @see https://github.com/moment/moment/blob/develop/src/lib/duration/create.js#L13
|
|
41
|
-
*/
|
|
42
|
-
_parseDurationFromISO8601(input: string): number;
|
|
43
|
-
getRepresentations(): IRepresentation[];
|
|
44
|
-
attachSource(manifestUrl: string, failoverHosts?: string[]): void;
|
|
45
|
-
attachManifest(manifestString: string, failoverHosts?: string[], origin?: string): void;
|
|
46
|
-
_loadInitAndSidx(representation: IRepresentation, cb?: () => void): void;
|
|
47
|
-
startPlay(representation: IRepresentation): void;
|
|
48
|
-
_loadRef(representation: IRepresentation, fromTime: number, needToSeek?: boolean, forcePrecise?: boolean): void;
|
|
49
|
-
setQualityByRepresentation(newRepresentation: IRepresentation, force?: boolean): void;
|
|
50
|
-
setQuality(index: number): void;
|
|
51
|
-
pauseCaching(): void;
|
|
52
|
-
resumeCaching(): void;
|
|
53
|
-
seek(time: number, forcePrecise?: boolean): void;
|
|
54
|
-
updateRefsForCurrentTime(): void;
|
|
55
|
-
_findRef(time: number): IRef | undefined;
|
|
56
|
-
_isLastRef(ref: IRef): boolean;
|
|
57
|
-
_findBufferRangeEnd(time: number): number;
|
|
58
|
-
destroy(): void;
|
|
59
|
-
}
|
|
60
|
-
export {};
|