@vkontakte/videoplayer-core 2.0.162-dev.ae3aa8888.0 → 2.0.162-dev.cd8858cd1.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 +27 -27
- package/es2015.esm.js +27 -27
- package/esnext.cjs +27 -27
- package/esnext.esm.js +27 -27
- package/evergreen.esm.js +27 -27
- package/package.json +2 -2
- package/types/index.d.ts +3 -2
- package/types/player/types.d.ts +12 -2
- package/types/providers/ProviderContainer/index.d.ts +1 -0
- package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +10 -3
- package/types/utils/tuningConfig.d.ts +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.162-dev.
|
|
3
|
+
"version": "2.0.162-dev.cd8858cd1.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"**/*.d.ts"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@vkontakte/videoplayer-shared": "1.0.91-dev.
|
|
45
|
+
"@vkontakte/videoplayer-shared": "1.0.91-dev.cd8858cd1.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VERSION } from "./env";
|
|
2
2
|
import type { IMpegSource, IDashSource, IHLSSource, IDashURLSource, IHLSLiveSource, ISeekRequest, URLSource, RawSource, URLSourceWithSeek } from "./player/types";
|
|
3
|
-
import {
|
|
3
|
+
import type { VideoCodec } from "./player/types";
|
|
4
|
+
import { VideoFormat, Surface, PredefinedQualityLimits, VideoCodecName } from "./player/types";
|
|
4
5
|
import Player from "./player/Player";
|
|
5
6
|
import type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, ISources, ICueSettings, IExternalTextTrack, ITextTrack, PlaybackRate, IVideoStream, IAudioStream } from "./player/types";
|
|
6
7
|
import { PlaybackState, ChromecastState, HttpConnectionType } from "./player/types";
|
|
@@ -15,4 +16,4 @@ import { Subscription, Observable, Subject, ValueSubject, VideoQuality } from "@
|
|
|
15
16
|
*/
|
|
16
17
|
declare const SDK_VERSION: string;
|
|
17
18
|
export type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, IOptionalTuningConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ISubscription, IUnsubscriber, IObservable, IEmitter, IValueObservable, IValue, IOperator, IListener, IMpegSource, IDashSource, IDashURLSource, IHLSSource, IHLSLiveSource, URLSource, RawSource, URLSourceWithSeek, ExactVideoQuality, IRange, ISeekRequest, ICueSettings, PlaybackRate, IVideoStream, IAudioStream };
|
|
18
|
-
export { Player, PlaybackState, ChromecastState, HttpConnectionType, Surface, Subscription, VideoFormat, VideoQuality, Observable, Subject, ValueSubject, VERSION, SDK_VERSION, PredefinedQualityLimits, VideoCodec };
|
|
19
|
+
export { Player, PlaybackState, ChromecastState, HttpConnectionType, Surface, Subscription, VideoFormat, VideoQuality, Observable, Subject, ValueSubject, VERSION, SDK_VERSION, PredefinedQualityLimits, VideoCodec, VideoCodecName };
|
package/types/player/types.d.ts
CHANGED
|
@@ -326,10 +326,12 @@ export interface PlayerInfoValues {
|
|
|
326
326
|
*/
|
|
327
327
|
isBuffering$: boolean;
|
|
328
328
|
/**
|
|
329
|
-
*
|
|
329
|
+
* Состояние столла. Возникает по истечении stallIgnoreThreshold после старта нежелательной буферизации
|
|
330
|
+
* Статус только нежелательной буферизации возникает при опустошении буфера в процессе воспроизведения
|
|
330
331
|
* и не возникает при начальном наполнении буфера или после перемотки
|
|
331
332
|
*/
|
|
332
333
|
isStalled$: boolean;
|
|
334
|
+
stallStartTime$: Milliseconds;
|
|
333
335
|
/**
|
|
334
336
|
* Закончилось ли видео
|
|
335
337
|
*/
|
|
@@ -532,6 +534,10 @@ export interface IConfig {
|
|
|
532
534
|
volumeMultiplier?: number;
|
|
533
535
|
panelSize?: IRectangle;
|
|
534
536
|
isMuted?: boolean;
|
|
537
|
+
/**
|
|
538
|
+
* Нужно ли recoverableError обрабатывать как ошибку провайдера или будет снаружи обрабатываться.
|
|
539
|
+
*/
|
|
540
|
+
handleNetworkRecoverableErrorAsProviderError?: boolean;
|
|
535
541
|
}
|
|
536
542
|
export interface ISources {
|
|
537
543
|
[VideoFormat.MPEG]?: IMpegSource;
|
|
@@ -599,12 +605,16 @@ export declare enum VideoFormat {
|
|
|
599
605
|
HLS_LIVE_CMAF = "HLS_LIVE_CMAF",
|
|
600
606
|
WEB_RTC_LIVE = "WEB_RTC_LIVE"
|
|
601
607
|
}
|
|
602
|
-
export declare enum
|
|
608
|
+
export declare enum VideoCodecName {
|
|
603
609
|
AV1 = "av1",
|
|
604
610
|
VP9 = "vp9",
|
|
605
611
|
AVC1 = "avc1",
|
|
606
612
|
HEV1 = "hev1"
|
|
607
613
|
}
|
|
614
|
+
export interface VideoCodec {
|
|
615
|
+
name: VideoCodecName;
|
|
616
|
+
hdr: boolean;
|
|
617
|
+
}
|
|
608
618
|
export declare enum AudioCodec {
|
|
609
619
|
OPUS = "opus",
|
|
610
620
|
MP4A = "mp4a"
|
|
@@ -15,6 +15,7 @@ interface IParams extends IProviderDependencies {
|
|
|
15
15
|
volumeMultiplier?: number;
|
|
16
16
|
panelSize?: IRectangle;
|
|
17
17
|
skipVideoElVolumeSync$: ValueSubject<boolean>;
|
|
18
|
+
handleNetworkRecoverableErrorAsProviderError?: boolean;
|
|
18
19
|
}
|
|
19
20
|
export default class ProviderContainer implements IProviderContainer {
|
|
20
21
|
current$: IValueSubject<IProviderEntry>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { VideoCodec } from "../../../player/types";
|
|
2
|
+
import { VideoFormat, VideoCodecName, AudioCodec } from "../../../player/types";
|
|
2
3
|
import { type ITuningConfig } from "../../../utils/tuningConfig";
|
|
3
4
|
type VodFormat = VideoFormat.MPEG | VideoFormat.DASH_SEP | VideoFormat.DASH_WEBM | VideoFormat.DASH_WEBM_AV1 | VideoFormat.DASH_STREAMS | VideoFormat.DASH_ONDEMAND | VideoFormat.HLS | VideoFormat.HLS_FMP4 | VideoFormat.HLS_ONDEMAND;
|
|
4
5
|
type Constraints = Pick<ITuningConfig, "webmCodec" | "androidPreferredFormat" | "iosPreferredFormat" | "preferCMAF" | "preferWebRTC" | "preferMultiStream">;
|
|
@@ -15,7 +16,13 @@ type AllLiveFormats = [LiveFormat, LiveFormat, LiveFormat, LiveFormat, LiveForma
|
|
|
15
16
|
export declare const getLiveFormatsPriority: ({ androidPreferredFormat, preferCMAF, preferWebRTC }: Constraints) => AllLiveFormats;
|
|
16
17
|
export declare const getChromeCastFormatsPriority: (live: boolean) => VideoFormat[];
|
|
17
18
|
export declare const selectCodec: (codecs: Set<string>) => string | undefined;
|
|
18
|
-
|
|
19
|
+
type CodecStream = {
|
|
20
|
+
codecs: string;
|
|
21
|
+
hdr?: boolean;
|
|
22
|
+
};
|
|
23
|
+
export declare const filterAvailableVideoCodecs: (streams: CodecStream[], { preferHdr }: {
|
|
24
|
+
preferHdr: boolean;
|
|
25
|
+
}) => VideoCodec[];
|
|
19
26
|
export declare const filterAvailableAudioCodecs: (codecs: string[]) => AudioCodec[];
|
|
20
|
-
export declare const convertCodecName: <T extends
|
|
27
|
+
export declare const convertCodecName: <T extends VideoCodecName | AudioCodec>(codec: string) => T;
|
|
21
28
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { VideoCodecName, VideoFormat } from "../player/types";
|
|
2
2
|
import { WebmCodecStrategy } from "../enums/WebmCodecStrategy";
|
|
3
3
|
import { AndroidPreferredFormat } from "../enums/AndroidPreferredFormat";
|
|
4
4
|
import { IOSPreferredFormat } from "../enums/IOSPreferredFormat";
|
|
@@ -36,6 +36,7 @@ export type ITuningConfig = {
|
|
|
36
36
|
initialThroughput: Kbps;
|
|
37
37
|
measureNonSegmentRequests: boolean;
|
|
38
38
|
smallSampleMinDuration: Milliseconds;
|
|
39
|
+
cacheThresholdSize: Milliseconds;
|
|
39
40
|
rttPenaltyRequestSize: Byte;
|
|
40
41
|
streamMinSampleSize: Byte;
|
|
41
42
|
streamMinSampleTime: Milliseconds;
|
|
@@ -208,7 +209,7 @@ export type ITuningConfig = {
|
|
|
208
209
|
budgetFactor: number;
|
|
209
210
|
fallbackSegmentDurationMs: Milliseconds;
|
|
210
211
|
};
|
|
211
|
-
videoStreamRepresentaionsFilter: [VideoQuality, number,
|
|
212
|
+
videoStreamRepresentaionsFilter: [VideoQuality, number, VideoCodecName][];
|
|
212
213
|
filterOnDemandQualityList: boolean;
|
|
213
214
|
dashMaxTvVideoQuality: boolean;
|
|
214
215
|
};
|
|
@@ -286,7 +287,17 @@ export type ITuningConfig = {
|
|
|
286
287
|
useDelayedPlaybackHangupWithData: boolean;
|
|
287
288
|
playbackHangupNoDataThreshold: Milliseconds;
|
|
288
289
|
endGapTolerance: Milliseconds;
|
|
290
|
+
/**
|
|
291
|
+
* Время после перехода в состояние buffering, когда мы считаем что происходит stall
|
|
292
|
+
*/
|
|
289
293
|
stallIgnoreThreshold: Milliseconds;
|
|
294
|
+
/**
|
|
295
|
+
* Стратегия записи столлов
|
|
296
|
+
* verbose - записываем всё
|
|
297
|
+
* exclude-threshold - записываем столлы длинее stallIgnoreThreshold, но вычитаем длину stallIgnoreThreshold
|
|
298
|
+
* include-threshold - записываем столлы длинее stallIgnoreThreshold
|
|
299
|
+
*/
|
|
300
|
+
stallHandlingStrategy: "verbose" | "exclude-threshold" | "include-threshold";
|
|
290
301
|
gapWatchdogInterval: Milliseconds;
|
|
291
302
|
requestQuick: boolean;
|
|
292
303
|
/** @deprecated HLS.js удалён, флаг ничего не делает */
|