@vkontakte/videoplayer-core 2.0.130-dev.3ce761c4.0 → 2.0.130-dev.3fecde5b.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 +9 -9
- package/es2015.esm.js +9 -9
- package/es2018.cjs.js +9 -9
- package/es2018.esm.js +9 -9
- package/es2024.cjs.js +70 -0
- package/es2024.esm.js +70 -0
- package/esnext.cjs.js +9 -9
- package/esnext.esm.js +9 -9
- package/evergreen.esm.js +8 -8
- package/package.json +17 -12
- package/types/player/types.d.ts +4 -8
- package/types/providers/DashProvider/lib/buffer.d.ts +2 -0
- package/types/providers/DashProvider/lib/fetcher.d.ts +2 -2
- package/types/providers/DashProvider/lib/sourceBufferBufferedDiff.d.ts +19 -0
- package/types/providers/DashProvider/lib/utils.d.ts +2 -1
- package/types/providers/utils/syncDesiredState.d.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.130-dev.
|
|
3
|
+
"version": "2.0.130-dev.3fecde5b.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -11,29 +11,34 @@
|
|
|
11
11
|
"type": "module",
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
+
"types": "./types/index.d.ts",
|
|
14
15
|
"import": "./esnext.esm.js",
|
|
15
|
-
"require": "./esnext.cjs.js"
|
|
16
|
-
"types": "./types/index.d.ts"
|
|
16
|
+
"require": "./esnext.cjs.js"
|
|
17
17
|
},
|
|
18
18
|
"./evergreen": {
|
|
19
|
+
"types": "./types/index.d.ts",
|
|
19
20
|
"import": "./evergreen.esm.js",
|
|
20
|
-
"require": "./evergreen.cjs.js"
|
|
21
|
-
"types": "./types/index.d.ts"
|
|
21
|
+
"require": "./evergreen.cjs.js"
|
|
22
22
|
},
|
|
23
23
|
"./esnext": {
|
|
24
|
+
"types": "./types/index.d.ts",
|
|
24
25
|
"import": "./esnext.esm.js",
|
|
25
|
-
"require": "./esnext.cjs.js"
|
|
26
|
-
|
|
26
|
+
"require": "./esnext.cjs.js"
|
|
27
|
+
},
|
|
28
|
+
"./es2024": {
|
|
29
|
+
"types": "./types/index.d.ts",
|
|
30
|
+
"import": "./es2024.esm.js",
|
|
31
|
+
"require": "./es2024.cjs.js"
|
|
27
32
|
},
|
|
28
33
|
"./es2018": {
|
|
34
|
+
"types": "./types/index.d.ts",
|
|
29
35
|
"import": "./es2018.esm.js",
|
|
30
|
-
"require": "./es2018.cjs.js"
|
|
31
|
-
"types": "./types/index.d.ts"
|
|
36
|
+
"require": "./es2018.cjs.js"
|
|
32
37
|
},
|
|
33
38
|
"./es2015": {
|
|
39
|
+
"types": "./types/index.d.ts",
|
|
34
40
|
"import": "./es2015.esm.js",
|
|
35
|
-
"require": "./es2015.cjs.js"
|
|
36
|
-
"types": "./types/index.d.ts"
|
|
41
|
+
"require": "./es2015.cjs.js"
|
|
37
42
|
},
|
|
38
43
|
"./evergreen.esm.js": "./evergeen.esm.js",
|
|
39
44
|
"./esnext.esm.js": "./esnext.esm.js",
|
|
@@ -49,7 +54,7 @@
|
|
|
49
54
|
"**/*.d.ts"
|
|
50
55
|
],
|
|
51
56
|
"dependencies": {
|
|
52
|
-
"@vkontakte/videoplayer-shared": "1.0.58-dev.
|
|
57
|
+
"@vkontakte/videoplayer-shared": "1.0.58-dev.5a35d363.0",
|
|
53
58
|
"hls.js": "~1.4.7"
|
|
54
59
|
}
|
|
55
60
|
}
|
package/types/player/types.d.ts
CHANGED
|
@@ -473,24 +473,20 @@ export declare enum VideoFormat {
|
|
|
473
473
|
/** @deprecated Больше не транскодируется */
|
|
474
474
|
DASH = "DASH",// "Старый" h264 даш, слитный: Аудиодорожка слита с видео
|
|
475
475
|
DASH_SEP = "DASH_SEP",// h264, но аудиодорожка отделена
|
|
476
|
-
/** @deprecated Используйте DASH_SEP */
|
|
477
|
-
DASH_SEP_VK = "DASH_SEP",
|
|
476
|
+
/** @deprecated Используйте DASH_SEP */ DASH_SEP_VK = "DASH_SEP",
|
|
478
477
|
DASH_WEBM = "DASH_WEBM",// Видео закодировано в VP9, аудио в opus, контейнер webm
|
|
479
478
|
DASH_WEBM_AV1 = "DASH_WEBM_AV1",// Видео закодировано в AV1, остальное как _WEBM
|
|
480
479
|
DASH_STREAMS = "DASH_STREAMS",// AdaptationSet может быть несколько. На текущий момент различаются только языки аудио. Возможно позже и кодеки будут. Пока H.264/AAC
|
|
481
|
-
/** @deprecated Используйте DASH_WEBM */
|
|
482
|
-
DASH_WEBM_VK = "DASH_WEBM",
|
|
480
|
+
/** @deprecated Используйте DASH_WEBM */ DASH_WEBM_VK = "DASH_WEBM",
|
|
483
481
|
DASH_ONDEMAND = "DASH_ONDEMAND",// На бэке сегменты транскодируются на лету. Кодек H.264. Формат манифеста отличается, SegmentTemplate вместо SegmentBase
|
|
484
|
-
/** @deprecated Используйте DASH_ONDEMAND */
|
|
485
|
-
DASH_ONDEMAND_VK = "DASH_ONDEMAND",
|
|
482
|
+
/** @deprecated Используйте DASH_ONDEMAND */ DASH_ONDEMAND_VK = "DASH_ONDEMAND",
|
|
486
483
|
DASH_LIVE = "DASH_LIVE",
|
|
487
484
|
DASH_LIVE_CMAF = "DASH_LIVE_CMAF",
|
|
488
485
|
/** @deprecated */
|
|
489
486
|
DASH_LIVE_WEBM = "DASH_LIVE_WEBM",
|
|
490
487
|
HLS = "HLS",
|
|
491
488
|
HLS_ONDEMAND = "HLS_ONDEMAND",
|
|
492
|
-
/** @deprecated Используйте HLS */
|
|
493
|
-
HLS_JS = "HLS",
|
|
489
|
+
/** @deprecated Используйте HLS */ HLS_JS = "HLS",
|
|
494
490
|
HLS_LIVE = "HLS_LIVE",
|
|
495
491
|
HLS_LIVE_CMAF = "HLS_LIVE_CMAF",
|
|
496
492
|
WEB_RTC_LIVE = "WEB_RTC_LIVE"
|
|
@@ -12,6 +12,7 @@ export interface Dependencies {
|
|
|
12
12
|
}
|
|
13
13
|
export interface Gap extends IRange<Milliseconds> {
|
|
14
14
|
representation: Representation['id'];
|
|
15
|
+
persistent: boolean;
|
|
15
16
|
}
|
|
16
17
|
export declare class BufferManager {
|
|
17
18
|
currentLiveSegmentServerLatency$: IValueSubject<number>;
|
|
@@ -60,6 +61,7 @@ export declare class BufferManager {
|
|
|
60
61
|
private index;
|
|
61
62
|
private lastDataObtainedTimestampMs;
|
|
62
63
|
private loadByteRangeSegmentsTimeoutId;
|
|
64
|
+
private sourceBufferBufferedDiff;
|
|
63
65
|
constructor(kind: StreamKind, mediaSource: MediaSource, representations: Representation[], { fetcher, tuning, getCurrentPosition, isActiveLowLatency, compatibilityMode, manifest }: Dependencies);
|
|
64
66
|
startWith: (param_0: string) => Promise<void | undefined>;
|
|
65
67
|
switchToWithPreviousAbort(newRepresentationId: Representation['id'], dropBuffer?: boolean): void;
|
|
@@ -40,10 +40,9 @@ export declare class Fetcher {
|
|
|
40
40
|
recoverableError$: Subject<IError>;
|
|
41
41
|
error$: Subject<IError>;
|
|
42
42
|
private abortAllController;
|
|
43
|
-
private subscription;
|
|
44
43
|
private compatibilityMode;
|
|
45
44
|
private useEnableSubtitlesParam;
|
|
46
|
-
private readonly
|
|
45
|
+
private readonly subscription;
|
|
47
46
|
constructor({ throughputEstimator, requestQuic, compatibilityMode, useEnableSubtitlesParam }: IParams);
|
|
48
47
|
private onHeadersReceived;
|
|
49
48
|
fetchManifest: (param_0: string) => Promise<string | null | undefined>;
|
|
@@ -53,5 +52,6 @@ export declare class Fetcher {
|
|
|
53
52
|
private fetchByteRangeRepresentation;
|
|
54
53
|
private fetchTemplateRepresentation;
|
|
55
54
|
private doFetch;
|
|
55
|
+
private unsubscribeAbortSubscription;
|
|
56
56
|
}
|
|
57
57
|
export declare const suppressAbort: (e: Error | unknown) => void | never;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare class SourceBufferBufferedDiff {
|
|
2
|
+
private lastUpdateTs;
|
|
3
|
+
private lastCallTs;
|
|
4
|
+
private prevRanges;
|
|
5
|
+
private readonly sourceBuffer;
|
|
6
|
+
private readonly mediaSource;
|
|
7
|
+
private readonly subscription;
|
|
8
|
+
constructor(mediaSource: MediaSource, sourceBuffer: SourceBuffer);
|
|
9
|
+
private updateend;
|
|
10
|
+
/**
|
|
11
|
+
* если длина массивов разная - считаем, что какие то сегменты удалили
|
|
12
|
+
*
|
|
13
|
+
* если длина одинаковая - считаем, что сегменты удалили в том случае,
|
|
14
|
+
* если в новом массиве хотя бы 1 сегмент стал меньше
|
|
15
|
+
*/
|
|
16
|
+
private isRangesRemoved;
|
|
17
|
+
wasUpdated(): boolean;
|
|
18
|
+
destroy(): void;
|
|
19
|
+
}
|
|
@@ -18,8 +18,9 @@ export declare const isTextRepresentation: (representation: Representation | Tex
|
|
|
18
18
|
* @mutates intervals
|
|
19
19
|
*/
|
|
20
20
|
export declare const mergeIntervals: (intervals: IRange<Milliseconds>[]) => IRange<Milliseconds>[];
|
|
21
|
-
export declare const findInIterator: <T>(iterable:
|
|
21
|
+
export declare const findInIterator: <T>(iterable: MapIterator<T> | SetIterator<T>, matchFn: (arg: T) => boolean) => T | null;
|
|
22
22
|
/**
|
|
23
23
|
* даёт `true` каждые `ms` миллисекунд
|
|
24
24
|
*/
|
|
25
25
|
export declare const semaphor: (ms: number) => () => boolean;
|
|
26
|
+
export declare const createTimeRanges: (buffered: TimeRanges) => number[];
|
|
@@ -1,7 +1,9 @@
|
|
|
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,
|
|
4
|
+
declare const syncDesiredState: <Value>(desiredState: IStateMachine<Value | undefined>, get: () => Value | undefined, // Текущее значение состояние
|
|
5
|
+
set: (value: Value | undefined) => void, // Применение нового значения
|
|
6
|
+
{ equal, changed$, onError, }?: {
|
|
5
7
|
equal?: (a: Value | undefined, b: Value | undefined) => boolean;
|
|
6
8
|
changed$?: IObservable<Value | undefined>;
|
|
7
9
|
onError?: IListener<Error | unknown>;
|