@vkontakte/videoplayer-core 2.0.55 → 2.0.56
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 +1 -1
- package/packages/sdk/src/providers/DashVKProvider/lib/fetcher.d.ts +3 -1
- package/packages/sdk/src/providers/types.d.ts +1 -1
- package/providers/DashProvider/utils/DashLite.d.ts +60 -0
- package/utils/ThroughputEstimator.d.ts +1 -0
- package/utils/autoSelectVideoTrack.d.ts +2 -1
- package/utils/tuningConfig.d.ts +1 -0
package/package.json
CHANGED
|
@@ -10,10 +10,12 @@ export interface IParams {
|
|
|
10
10
|
throughputEstimator?: ThroughputEstimator;
|
|
11
11
|
requestQuic: boolean;
|
|
12
12
|
}
|
|
13
|
+
export declare type Priority = 'high' | 'low' | 'auto';
|
|
13
14
|
export interface FetchParams {
|
|
14
15
|
method?: RangeMethod;
|
|
15
16
|
onProgress?: (view: DataView, loaded: Byte) => void;
|
|
16
17
|
signal?: AbortSignal;
|
|
18
|
+
priority?: Priority;
|
|
17
19
|
}
|
|
18
20
|
export declare class Fetcher {
|
|
19
21
|
private throughputEstimator;
|
|
@@ -27,7 +29,7 @@ export declare class Fetcher {
|
|
|
27
29
|
private onHeadersReceived;
|
|
28
30
|
fetchManifest: (param_0: string) => Promise<string | null | undefined>;
|
|
29
31
|
fetchRange: (param_0: string, param_1: number, param_2: number, param_3: FetchParams) => Promise<ArrayBuffer | null | undefined>;
|
|
30
|
-
fetchRepresentation: (param_0: Representation, param_1: GenericContainerParser<unknown>, param_2?: number | undefined) => Promise<{
|
|
32
|
+
fetchRepresentation: (param_0: Representation, param_1: GenericContainerParser<unknown>, param_2?: Priority | undefined, param_3?: number | undefined) => Promise<{
|
|
31
33
|
segments: Segment[];
|
|
32
34
|
dataView: DataView;
|
|
33
35
|
} | null | undefined>;
|
|
@@ -43,7 +43,7 @@ export interface IProviderOutput {
|
|
|
43
43
|
currentVideoTrack$: IValueSubject<IVideoTrack | undefined>;
|
|
44
44
|
availableVideoTracks$: IValueSubject<IVideoTrack[]>;
|
|
45
45
|
autoVideoTrackLimitingAvailable$: IValueSubject<boolean>;
|
|
46
|
-
currentBuffer$: IValueSubject<IRange | undefined>;
|
|
46
|
+
currentBuffer$: IValueSubject<IRange<Seconds> | undefined>;
|
|
47
47
|
isBuffering$: IValueSubject<boolean>;
|
|
48
48
|
isLive$: IValueSubject<boolean | undefined>;
|
|
49
49
|
liveTime$: IValueSubject<Milliseconds | undefined>;
|
|
@@ -0,0 +1,60 @@
|
|
|
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 {};
|
|
@@ -8,6 +8,7 @@ export interface Constraints {
|
|
|
8
8
|
throughput?: Kbps;
|
|
9
9
|
tuning: ITuningConfig['autoTrackSelection'];
|
|
10
10
|
limits?: QualityLimits;
|
|
11
|
+
reserve?: Kbps;
|
|
11
12
|
playbackRate?: number;
|
|
12
13
|
forwardBufferHealth?: number;
|
|
13
14
|
current?: IVideoTrack;
|
|
@@ -20,5 +21,5 @@ export declare class TrackHistory {
|
|
|
20
21
|
recordSwitch(track: IVideoTrack): void;
|
|
21
22
|
clear(): void;
|
|
22
23
|
}
|
|
23
|
-
declare const autoSelectVideoTrack: (tracks: IVideoTrack[], { container, throughput, tuning, limits, forwardBufferHealth, playbackRate, current, history, }: Constraints) => IVideoTrack;
|
|
24
|
+
declare const autoSelectVideoTrack: (tracks: IVideoTrack[], { container, throughput, tuning, limits, reserve, forwardBufferHealth, playbackRate, current, history, }: Constraints) => IVideoTrack;
|
|
24
25
|
export default autoSelectVideoTrack;
|
package/utils/tuningConfig.d.ts
CHANGED