@vkontakte/videoplayer-core 2.0.57 → 2.0.58

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vkontakte/videoplayer-core",
3
- "version": "2.0.57",
3
+ "version": "2.0.58",
4
4
  "author": "vk.com",
5
5
  "description": "Videoplayer core library based on the vk.com platform",
6
6
  "homepage": "https://vk.com",
@@ -23,6 +23,7 @@ export declare class BufferManager {
23
23
  private initData;
24
24
  private representations;
25
25
  private segments;
26
+ private allInitsLoaded;
26
27
  private activeSegments;
27
28
  private mediaSource;
28
29
  private playingRepresentationId;
@@ -32,19 +33,20 @@ export declare class BufferManager {
32
33
  private downloadAbortController;
33
34
  private destroyAbortController;
34
35
  private getCurrentPosition;
35
- private loadAllInitsPromise;
36
- private allInitsLoaded;
37
36
  private tuning;
37
+ private forwardBufferTarget;
38
38
  private fetcher;
39
39
  private bufferLimit;
40
40
  private sourceBufferTaskQueue;
41
41
  private gapDetectionIdleCallback;
42
+ private initLoadIdleCallback;
42
43
  constructor(kind: RepresentationKind, mediaSource: MediaSource, container: Container, representations: Representation[], { fetcher, tuning, getCurrentPosition }: Dependencies);
43
44
  startWith: (param_0: string) => Promise<void | undefined>;
44
45
  switchTo: (param_0: string) => Promise<void | undefined>;
45
46
  abort(): void;
46
47
  maintain(currentPosition: Milliseconds): void;
47
48
  findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
49
+ setTarget(time: Milliseconds): void;
48
50
  destroy(): void;
49
51
  private selectForwardBufferSegments;
50
52
  private loadSegments;
@@ -58,7 +60,8 @@ export declare class BufferManager {
58
60
  */
59
61
  private onSomeDataLoaded;
60
62
  private abortSegment;
61
- private loadAllInits;
63
+ private loadNextInit;
64
+ private loadInit;
62
65
  private pruneBuffer;
63
66
  private abortBuffer;
64
67
  private detectGaps;
@@ -16,6 +16,7 @@ export interface FetchParams {
16
16
  onProgress?: (view: DataView, loaded: Byte) => void;
17
17
  signal?: AbortSignal;
18
18
  priority?: Priority;
19
+ measureThroughput?: boolean;
19
20
  }
20
21
  export declare class Fetcher {
21
22
  private throughputEstimator;
@@ -8,8 +8,9 @@ declare class SourceBufferTaskQueue {
8
8
  constructor(buffer: SourceBuffer);
9
9
  append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
10
10
  remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
11
+ abort(): Promise<boolean>;
11
12
  destroy(): void;
12
- private onUpdateEnd;
13
+ private completeTask;
13
14
  private pull;
14
15
  private execute;
15
16
  }
@@ -40,6 +40,7 @@ export declare class Player {
40
40
  switchRepresentation(kind: RepresentationKind, id: Representation['id']): Promise<void>;
41
41
  seek(requestedPosition: Milliseconds, forcePrecise: boolean): void;
42
42
  stop(): void;
43
+ setBufferTarget(time: Milliseconds): void;
43
44
  destroy(): void;
44
45
  private tick;
45
46
  private jumGap;
@@ -13,7 +13,7 @@ declare class ThroughputEstimator {
13
13
  destroy(): void;
14
14
  trackXHR(xhr: XMLHttpRequest): void;
15
15
  trackStream(stream: ReadableStream): void;
16
- addRawSpeed(size: Byte, time: Milliseconds): void;
16
+ addRawSpeed(size: Byte, time: Milliseconds, concurrency?: number): void;
17
17
  /**
18
18
  * Стоит использовать только когда другие методы совсем не получается
19
19
  */
@@ -5,6 +5,8 @@ interface IParams {
5
5
  emaAlphaFast: number;
6
6
  changeThreshold: number;
7
7
  fastDirection: 1 | -1;
8
+ deviationDepth: number;
9
+ deviationFactor: number;
8
10
  label?: string;
9
11
  }
10
12
  export declare class SmoothedValue {
@@ -12,6 +14,8 @@ export declare class SmoothedValue {
12
14
  private slow;
13
15
  private fast;
14
16
  private smoothed;
17
+ private pastMeasures;
18
+ private measuresCursor;
15
19
  private params;
16
20
  private rawSeries$;
17
21
  private smoothedSeries$;
@@ -9,6 +9,8 @@ export declare type ITuningConfig = {
9
9
  rttPenaltyRequestSize: Byte;
10
10
  streamMinSampleSize: Byte;
11
11
  streamMinSampleTime: Milliseconds;
12
+ deviationDepth: number;
13
+ deviationFactor: number;
12
14
  };
13
15
  autoTrackSelection: {
14
16
  bitrateFactorAtEmptyBuffer: number;
@@ -17,13 +19,15 @@ export declare type ITuningConfig = {
17
19
  usePixelRatio: boolean;
18
20
  containerSizeFactor: number;
19
21
  lazyQualitySwitch: boolean;
22
+ minBufferToSwitchUp: number;
20
23
  considerPlaybackRate: boolean;
21
24
  trackCooldown: Milliseconds;
22
25
  };
23
26
  dash: {
24
27
  /** @deprecated */
25
- extraInitSize: Milliseconds;
26
28
  forwardBufferTarget: Milliseconds;
29
+ forwardBufferTargetAuto: Milliseconds;
30
+ forwardBufferTargetManual: Milliseconds;
27
31
  segmentRequestSize: Byte;
28
32
  representationSwitchForwardBufferGap: Milliseconds;
29
33
  enableSubSegmentBufferFeeding: boolean;