@vkontakte/videoplayer-core 2.0.56 → 2.0.59

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.56",
3
+ "version": "2.0.59",
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;
@@ -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 {};