@vkontakte/videoplayer-core 2.0.48 → 2.0.50
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/build/polyfills/runtime/abortableFetch.d.ts +4 -0
- 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/{providers → packages/sdk/src/providers}/ChromecastProvider/ChromecastInitializer/types.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashIFProvider/dashjsTypes.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashLiveProvider/types.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashLiveProvider/utils/FilesFetcher.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashLiveProvider/utils/LiveDashPlayer.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashLiveProvider/utils/ThroughputEstimator.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashLiveProvider/utils/liveDashPlayerUtil.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashProvider/types.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashProvider/utils/DashLite.d.ts +2 -2
- package/{providers → packages/sdk/src/providers}/DashProvider/utils/stream.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashProvider/utils/xhr2.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashVKProvider/lib/buffer.d.ts +4 -4
- package/{providers → packages/sdk/src/providers}/DashVKProvider/lib/ebml.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashVKProvider/lib/fetcher.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashVKProvider/lib/isobmff.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/DashVKProvider/lib/mpd.d.ts +0 -0
- package/packages/sdk/src/providers/DashVKProvider/lib/sourceBufferTaskQueue.d.ts +16 -0
- package/{providers → packages/sdk/src/providers}/DashVKProvider/lib/webm.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/ProviderContainer/types.d.ts +0 -0
- package/{providers → packages/sdk/src/providers}/types.d.ts +2 -2
- package/{providers → packages/sdk/src/providers}/utils/LiveOffset/types.d.ts +0 -0
- package/{utils → packages/sdk/src/utils}/StateMachine/types.d.ts +0 -0
- package/{utils → packages/sdk/src/utils}/StatefulIterator/StatefulIterator.spec.d.ts +0 -0
- package/{utils → packages/sdk/src/utils}/buffer/getTotalBufferDuration.d.ts +0 -0
- package/{utils → packages/sdk/src/utils}/buffer/types.d.ts +0 -0
- package/{utils → packages/sdk/src/utils}/link.d.ts +0 -0
- package/{utils → packages/sdk/src/utils}/quality/quality.spec.d.ts +0 -0
- package/{utils → packages/sdk/src/utils}/range.d.ts +0 -0
- package/{utils → packages/sdk/src/utils}/rectangle.d.ts +0 -0
- package/player/Player.d.ts +5 -5
- package/player/types.d.ts +19 -1
- package/player/utils/optimisticPosition.d.ts +12 -0
- package/player/utils/watchCoverage.d.ts +4 -4
- package/providers/DashIFProvider/index.d.ts +1 -1
- package/providers/DashLiveProvider/DashLiveProvider.d.ts +2 -2
- package/providers/DashVKProvider/lib/player.d.ts +1 -1
- package/providers/DashVKProvider/lib/types.d.ts +1 -0
- package/providers/HlsLiveProvider/index.d.ts +2 -2
- package/providers/ProviderContainer/index.d.ts +3 -3
- package/utils/tuningConfig.d.ts +1 -0
- package/player/utils/position.d.ts +0 -11
package/package.json
CHANGED
package/{providers → packages/sdk/src/providers}/ChromecastProvider/ChromecastInitializer/types.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/{providers → packages/sdk/src/providers}/DashLiveProvider/utils/ThroughputEstimator.d.ts
RENAMED
|
File without changes
|
package/{providers → packages/sdk/src/providers}/DashLiveProvider/utils/liveDashPlayerUtil.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
@@ -45,12 +45,12 @@ export default class DashLite {
|
|
|
45
45
|
attachManifest(manifestString: string, failoverHosts?: string[], origin?: string): void;
|
|
46
46
|
_loadInitAndSidx(representation: IRepresentation, cb?: () => void): void;
|
|
47
47
|
startPlay(representation: IRepresentation): void;
|
|
48
|
-
_loadRef(representation: IRepresentation, fromTime: number, needToSeek?: boolean): void;
|
|
48
|
+
_loadRef(representation: IRepresentation, fromTime: number, needToSeek?: boolean, forcePrecise?: boolean): void;
|
|
49
49
|
setQualityByRepresentation(newRepresentation: IRepresentation, force?: boolean): void;
|
|
50
50
|
setQuality(index: number): void;
|
|
51
51
|
pauseCaching(): void;
|
|
52
52
|
resumeCaching(): void;
|
|
53
|
-
seek(time: number,
|
|
53
|
+
seek(time: number, forcePrecise?: boolean): void;
|
|
54
54
|
updateRefsForCurrentTime(): void;
|
|
55
55
|
_findRef(time: number): IRef | undefined;
|
|
56
56
|
_isLastRef(ref: IRef): boolean;
|
|
File without changes
|
|
File without changes
|
|
@@ -37,14 +37,15 @@ export declare class BufferManager {
|
|
|
37
37
|
private allInitsLoaded;
|
|
38
38
|
private tuning;
|
|
39
39
|
private fetcher;
|
|
40
|
-
private bufferUpdateQueue;
|
|
41
|
-
private bufferUpdateQueueInProgress;
|
|
42
40
|
private bufferLimit;
|
|
41
|
+
private sourceBufferTaskQueue;
|
|
42
|
+
private gapDetectionIdleCallback;
|
|
43
43
|
constructor(kind: RepresentationKind, mediaSource: MediaSource, container: Container, representations: Representation[], { fetcher, tuning, getCurrentPosition }: Dependencies);
|
|
44
44
|
startWith: (param_0: string) => Promise<void | undefined>;
|
|
45
45
|
switchTo: (param_0: string) => Promise<void | undefined>;
|
|
46
46
|
abort(): void;
|
|
47
47
|
maintain(currentPosition: Milliseconds): void;
|
|
48
|
+
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
48
49
|
destroy(): void;
|
|
49
50
|
private selectForwardBufferSegments;
|
|
50
51
|
private loadSegments;
|
|
@@ -57,11 +58,10 @@ export declare class BufferManager {
|
|
|
57
58
|
* @private
|
|
58
59
|
*/
|
|
59
60
|
private onSomeDataLoaded;
|
|
61
|
+
private abortSegment;
|
|
60
62
|
private loadAllInits;
|
|
61
|
-
private appendDataToBuffer;
|
|
62
63
|
private pruneBuffer;
|
|
63
64
|
private abortBuffer;
|
|
64
65
|
private detectGaps;
|
|
65
66
|
private checkEjectedSegments;
|
|
66
|
-
private static waitForBufferUpdate;
|
|
67
67
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Byte, IError, ISubject, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
declare class SourceBufferTaskQueue {
|
|
3
|
+
bufferFull$: ISubject<Byte>;
|
|
4
|
+
error$: ISubject<IError>;
|
|
5
|
+
private buffer;
|
|
6
|
+
private queue;
|
|
7
|
+
private currentTask;
|
|
8
|
+
constructor(buffer: SourceBuffer);
|
|
9
|
+
append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
10
|
+
remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
private onUpdateEnd;
|
|
13
|
+
private pull;
|
|
14
|
+
private execute;
|
|
15
|
+
}
|
|
16
|
+
export default SourceBufferTaskQueue;
|
|
File without changes
|
|
File without changes
|
|
@@ -2,7 +2,7 @@ import { QualityLimits } from "../utils/quality/types";
|
|
|
2
2
|
import { ITuningConfig } from "../utils/tuningConfig";
|
|
3
3
|
import { ILogger, ISubject, IValueSubject, Milliseconds, Seconds, IError } from '@vkontakte/videoplayer-shared';
|
|
4
4
|
import { IChromecastInitializer } from "./ChromecastProvider/ChromecastInitializer/types";
|
|
5
|
-
import { HttpConnectionType, ICueSettings } from "../player/types";
|
|
5
|
+
import { HttpConnectionType, ICueSettings, SeekState } from "../player/types";
|
|
6
6
|
import { IExternalTextTrack, ITextTrack, IVideoTrack, IVolumeState, PlaybackState } from "../player/types";
|
|
7
7
|
import { IRange } from "../utils/range";
|
|
8
8
|
import { IStateMachine } from "../utils/StateMachine/types";
|
|
@@ -26,7 +26,7 @@ export interface IProviderParams<TSourceType> extends IProviderDependencies {
|
|
|
26
26
|
}
|
|
27
27
|
export interface IDesiredState {
|
|
28
28
|
playbackState: IStateMachine<PlaybackState>;
|
|
29
|
-
|
|
29
|
+
seekState: IStateMachine<SeekState>;
|
|
30
30
|
volume: IStateMachine<IVolumeState>;
|
|
31
31
|
videoTrack: IStateMachine<IVideoTrack['id'] | undefined>;
|
|
32
32
|
autoVideoTrackSwitching: IStateMachine<boolean>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/player/Player.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Subject, ValueSubject, ILogEntry, IError } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import { IOptionalTuningConfig } from "../utils/tuningConfig";
|
|
3
1
|
import { HttpConnectionType, ICueSettings } from "./types";
|
|
4
2
|
import { QualityLimits, VideoQuality } from "../utils/quality/types";
|
|
5
3
|
import { IRange } from "../utils/range";
|
|
6
|
-
import {
|
|
4
|
+
import { IOptionalTuningConfig } from "../utils/tuningConfig";
|
|
5
|
+
import { IError, ILogEntry, Seconds, Subject, ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
6
|
+
import { ChromecastState, IConfig, IExternalTextTrack, IPlayer, ISeekRequest, ITextTrack, PlaybackState, StartStatus, VideoFormat } from './types';
|
|
7
7
|
export default class Player implements IPlayer {
|
|
8
8
|
private subscription;
|
|
9
9
|
private domContainer;
|
|
@@ -80,7 +80,7 @@ export default class Player implements IPlayer {
|
|
|
80
80
|
play(): IPlayer;
|
|
81
81
|
pause(): IPlayer;
|
|
82
82
|
stop(): IPlayer;
|
|
83
|
-
seekTime(time:
|
|
83
|
+
seekTime(time: Seconds, forcePrecise?: boolean): IPlayer;
|
|
84
84
|
/**
|
|
85
85
|
* NOTE: Сейчас вызов `seekPercent` до получения `duration` не сработает.
|
|
86
86
|
* @param percent: number [0, 1];
|
|
@@ -96,7 +96,7 @@ export default class Player implements IPlayer {
|
|
|
96
96
|
setTextTrackCueSettings(settings: ICueSettings): IPlayer;
|
|
97
97
|
setLooped(isLooped: boolean): IPlayer;
|
|
98
98
|
toggleChromecast(): void;
|
|
99
|
-
getExactTime():
|
|
99
|
+
getExactTime(): Seconds;
|
|
100
100
|
getAllLogs(): ILogEntry[];
|
|
101
101
|
private initDesiredStateSubscriptions;
|
|
102
102
|
private initProviderContainerSubscription;
|
package/player/types.d.ts
CHANGED
|
@@ -16,7 +16,11 @@ export interface IPlayer {
|
|
|
16
16
|
play(): IPlayer;
|
|
17
17
|
pause(): IPlayer;
|
|
18
18
|
stop(): IPlayer;
|
|
19
|
-
|
|
19
|
+
/**
|
|
20
|
+
* @param time
|
|
21
|
+
* @param forcePrecise Для длинных видео перемотка по-умолчанию может быть не точной (т.к. точная выполняется долго). С этим флагом перемотка будет гарантировано точной (но возможно медленной)
|
|
22
|
+
*/
|
|
23
|
+
seekTime(time: Seconds, forcePrecise?: boolean): IPlayer;
|
|
20
24
|
/**
|
|
21
25
|
* @param percent: number [0; 1]
|
|
22
26
|
*/
|
|
@@ -396,5 +400,19 @@ export declare enum HttpConnectionType {
|
|
|
396
400
|
HTTP2 = "http2",
|
|
397
401
|
QUIC = "quic"
|
|
398
402
|
}
|
|
403
|
+
export declare enum SeekOperationState {
|
|
404
|
+
None = "none",
|
|
405
|
+
Requested = "requested",
|
|
406
|
+
Applying = "applying"
|
|
407
|
+
}
|
|
408
|
+
declare type SeekStateNone = {
|
|
409
|
+
state: SeekOperationState.None;
|
|
410
|
+
};
|
|
411
|
+
declare type SeekStateNotNone = {
|
|
412
|
+
state: Exclude<SeekOperationState, SeekOperationState.None>;
|
|
413
|
+
position: Milliseconds;
|
|
414
|
+
forcePrecise: boolean;
|
|
415
|
+
};
|
|
416
|
+
export declare type SeekState = SeekStateNone | SeekStateNotNone;
|
|
399
417
|
export declare type FpsByQuality = Partial<Record<VideoQuality, number>>;
|
|
400
418
|
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SeekState } from "../types";
|
|
2
|
+
import { IObservable, IValueObservable, Seconds } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
import { IStateMachine } from "../../utils/StateMachine/types";
|
|
4
|
+
interface IParams {
|
|
5
|
+
seekState: IStateMachine<SeekState>;
|
|
6
|
+
position$: IValueObservable<Seconds>;
|
|
7
|
+
}
|
|
8
|
+
declare const _default: ({ seekState, position$ }: IParams) => IObservable<Seconds>;
|
|
9
|
+
/**
|
|
10
|
+
* Реализует оптимистичное изменение позиции при перемотке
|
|
11
|
+
*/
|
|
12
|
+
export default _default;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { IObservable, IValueObservable, Seconds } from '@vkontakte/videoplayer-shared';
|
|
2
2
|
import { IRange } from "../../utils/range";
|
|
3
3
|
import { IStateMachine } from "../../utils/StateMachine/types";
|
|
4
|
-
import { PlaybackState } from "../types";
|
|
4
|
+
import { PlaybackState, SeekState } from "../types";
|
|
5
5
|
interface IParams {
|
|
6
6
|
playbackState: IStateMachine<PlaybackState>;
|
|
7
|
-
|
|
7
|
+
seekState: IStateMachine<SeekState>;
|
|
8
8
|
playbackAbort$: IObservable<void>;
|
|
9
9
|
looped$: IObservable<Seconds>;
|
|
10
10
|
position$: IValueObservable<Seconds>;
|
|
11
11
|
}
|
|
12
|
-
export declare const watchCoverageRecord: ({ playbackState,
|
|
13
|
-
export declare const watchCoverageLive: ({ playbackState,
|
|
12
|
+
export declare const watchCoverageRecord: ({ playbackState, seekState, playbackAbort$, looped$, position$, }: IParams) => IObservable<IRange<number>>;
|
|
13
|
+
export declare const watchCoverageLive: ({ playbackState, seekState, playbackAbort$, looped$, position$, }: IParams) => IObservable<IRange<number>>;
|
|
14
14
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
1
|
import { IDashURLSource, VideoFormat } from "../../player/types";
|
|
3
2
|
import { IProvider, IProviderParams } from "../types";
|
|
3
|
+
import { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
4
4
|
interface IParams extends IProviderParams<IDashURLSource> {
|
|
5
5
|
format: VideoFormat;
|
|
6
6
|
config: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import { IProvider, IProviderParams } from "../types";
|
|
3
1
|
import { IDashURLSource } from "../../player/types";
|
|
2
|
+
import { IProvider, IProviderParams } from "../types";
|
|
3
|
+
import { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
4
4
|
declare type Params = IProviderParams<IDashURLSource> & {
|
|
5
5
|
config: {
|
|
6
6
|
maxPausedTime: Milliseconds;
|
|
@@ -37,7 +37,7 @@ export declare class Player {
|
|
|
37
37
|
initManifest: (param_0: HTMLVideoElement, param_1: string) => Promise<Manifest | null | undefined>;
|
|
38
38
|
initRepresentations: (param_0: string, param_1: string) => Promise<void | undefined>;
|
|
39
39
|
switchRepresentation(kind: RepresentationKind, id: Representation['id']): Promise<void>;
|
|
40
|
-
seek(
|
|
40
|
+
seek(requestedPosition: Milliseconds, forcePrecise: boolean): void;
|
|
41
41
|
stop(): void;
|
|
42
42
|
destroy(): void;
|
|
43
43
|
private tick;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import { IProvider, IProviderParams } from "../types";
|
|
3
1
|
import { IHLSLiveSource } from "../../player/types";
|
|
2
|
+
import { IProvider, IProviderParams } from "../types";
|
|
3
|
+
import { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
4
4
|
declare type Params = IProviderParams<IHLSLiveSource> & {
|
|
5
5
|
config: {
|
|
6
6
|
maxPausedTime: Milliseconds;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ISources, IVideoTrack, IVolumeState, IMetadata, VideoFormat } from "../../player/types";
|
|
1
|
+
import { IMetadata, ISources, IVideoTrack, IVolumeState, VideoFormat } from "../../player/types";
|
|
3
2
|
import { IRange } from "../../utils/range";
|
|
3
|
+
import { ITuningConfig } from "../../utils/tuningConfig";
|
|
4
|
+
import { IError, ISubject, IValueSubject, Subject, ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
4
5
|
import { IDesiredState, IProviderDependencies } from '../types';
|
|
5
6
|
import { IProviderContainer, IProviderEntry } from './types';
|
|
6
|
-
import { ITuningConfig } from "../../utils/tuningConfig";
|
|
7
7
|
interface IParams extends IProviderDependencies {
|
|
8
8
|
container: HTMLElement;
|
|
9
9
|
sources: ISources;
|
package/utils/tuningConfig.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export declare type ITuningConfig = {
|
|
|
25
25
|
segmentRequestSize: Byte;
|
|
26
26
|
representationSwitchForwardBufferGap: Milliseconds;
|
|
27
27
|
enableSubSegmentBufferFeeding: boolean;
|
|
28
|
+
segmentTimelineTolerance: Milliseconds;
|
|
28
29
|
};
|
|
29
30
|
enableTelemetryAtStart: boolean;
|
|
30
31
|
formatsToAvoid: VideoFormat[];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IObservable, IValueObservable } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import { IStateMachine } from "../../utils/StateMachine/types";
|
|
3
|
-
interface IParams {
|
|
4
|
-
seekPosition: IStateMachine<number | undefined>;
|
|
5
|
-
position$: IValueObservable<number>;
|
|
6
|
-
}
|
|
7
|
-
declare const _default: ({ seekPosition, position$ }: IParams) => IObservable<number>;
|
|
8
|
-
/**
|
|
9
|
-
* Реализует оптимистичное изменение позиции при перемотке
|
|
10
|
-
*/
|
|
11
|
-
export default _default;
|