@vkontakte/videoplayer-core 2.0.150-dev.c564bb3a.0 → 2.0.150-dev.ea6e4e42.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 +46 -46
- package/es2015.esm.js +42 -42
- package/es2018.cjs +34 -34
- package/es2018.esm.js +39 -39
- package/es2024.cjs +56 -56
- package/es2024.esm.js +46 -46
- package/esnext.cjs +56 -56
- package/esnext.esm.js +46 -46
- package/evergreen.esm.js +62 -62
- package/package.json +2 -2
- package/types/utils/tuningConfig.d.ts +0 -1
- package/types/providers/DashProviderNew/baseDashProvider.d.ts +0 -61
- package/types/providers/DashProviderNew/consts.d.ts +0 -3
- package/types/providers/DashProviderNew/index.d.ts +0 -2
- package/types/providers/DashProviderNew/lib/ElementSizeManager.d.ts +0 -19
- package/types/providers/DashProviderNew/lib/LiveTextManager.d.ts +0 -23
- package/types/providers/DashProviderNew/lib/buffer.d.ts +0 -130
- package/types/providers/DashProviderNew/lib/fetcher.d.ts +0 -64
- package/types/providers/DashProviderNew/lib/player.d.ts +0 -107
- package/types/providers/DashProviderNew/lib/sourceBufferBufferedDiff.d.ts +0 -19
- package/types/providers/DashProviderNew/lib/sourceBufferTaskQueue.d.ts +0 -20
- package/types/providers/DashProviderNew/lib/types.d.ts +0 -29
- package/types/providers/DashProviderNew/lib/utils.d.ts +0 -24
- package/types/providers/DashProviderNew/newDashCmafLiveProvider.d.ts +0 -8
- package/types/providers/DashProviderNew/newDashProvider.d.ts +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.150-dev.
|
|
3
|
+
"version": "2.0.150-dev.ea6e4e42.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -54,6 +54,6 @@
|
|
|
54
54
|
"**/*.d.ts"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@vkontakte/videoplayer-shared": "1.0.79-dev.
|
|
57
|
+
"@vkontakte/videoplayer-shared": "1.0.79-dev.ea6e4e42.0"
|
|
58
58
|
}
|
|
59
59
|
}
|
|
@@ -202,7 +202,6 @@ export type ITuningConfig = {
|
|
|
202
202
|
useHlsJs: boolean;
|
|
203
203
|
useNativeHLSTextTracks: boolean;
|
|
204
204
|
useNewSwitchTo: boolean;
|
|
205
|
-
useNewDashProvider: boolean;
|
|
206
205
|
useDashProviderVirtual: boolean;
|
|
207
206
|
useDashProviderVirtualMobile: boolean;
|
|
208
207
|
useNewAutoSelectVideoTrack: boolean;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { IAudioTrack, IDashURLSource, IHLSSource, IInternalTextTrack, IVideoTrack, VideoCodec } from '../../player/types';
|
|
2
|
-
import { IProviderSubscriptionInfo, ProviderState } from './lib/types';
|
|
3
|
-
import { CommonInit, Representation, Stream } from '../../providers/utils/parsers/types';
|
|
4
|
-
import { IProvider, IProviderParams } from '../../providers/types';
|
|
5
|
-
import { IObservableVideo } from '../../providers/utils/HTMLVideoElement/observable';
|
|
6
|
-
import { TrackHistory } from '../../utils/autoSelectTrack';
|
|
7
|
-
import { IStateMachine } from '../../utils/StateMachine/types';
|
|
8
|
-
import { ISubscription, ITracer, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
9
|
-
import { Player } from './lib/player';
|
|
10
|
-
import { Scene3D } from '../../utils/3d/Scene3D';
|
|
11
|
-
import DroppedFramesManager from '../../providers/utils/HTMLVideoElement/DroppedFramesManager';
|
|
12
|
-
import TextTrackManager from '../../providers/utils/HTMLVideoElement/TextTrackManager';
|
|
13
|
-
import StallsManager from '../../providers/utils/StallsManager';
|
|
14
|
-
import { ElementSizeManager } from './lib/ElementSizeManager';
|
|
15
|
-
type IParams = IProviderParams<IDashURLSource> & {
|
|
16
|
-
sourceHls?: IHLSSource;
|
|
17
|
-
forceVideoCodec?: VideoCodec;
|
|
18
|
-
};
|
|
19
|
-
export default abstract class BaseDashProvider implements IProvider {
|
|
20
|
-
scene3D: Scene3D | undefined;
|
|
21
|
-
protected subscription: ISubscription;
|
|
22
|
-
protected videoState: IStateMachine<ProviderState>;
|
|
23
|
-
protected video: HTMLVideoElement;
|
|
24
|
-
protected observableVideo: IObservableVideo | null;
|
|
25
|
-
protected player: Player;
|
|
26
|
-
protected params: IParams;
|
|
27
|
-
protected tracer: ITracer;
|
|
28
|
-
protected textTracksManager: TextTrackManager;
|
|
29
|
-
protected droppedFramesManager: DroppedFramesManager;
|
|
30
|
-
protected stallsManager: StallsManager;
|
|
31
|
-
protected elementSizeManager: ElementSizeManager;
|
|
32
|
-
protected videoTracksMap: Map<IVideoTrack, {
|
|
33
|
-
stream: Stream;
|
|
34
|
-
representation: Representation;
|
|
35
|
-
}>;
|
|
36
|
-
protected audioTracksMap: Map<IAudioTrack, {
|
|
37
|
-
stream: Stream;
|
|
38
|
-
representation: Representation;
|
|
39
|
-
}>;
|
|
40
|
-
protected textTracksMap: Map<IInternalTextTrack, {
|
|
41
|
-
stream: Stream;
|
|
42
|
-
representation: Representation;
|
|
43
|
-
}>;
|
|
44
|
-
protected videoStreamsMap: Map<Stream, IVideoTrack[]>;
|
|
45
|
-
protected audioStreamsMap: Map<Stream, IAudioTrack[]>;
|
|
46
|
-
protected videoTrackSwitchHistory: TrackHistory<IVideoTrack>;
|
|
47
|
-
protected audioTrackSwitchHistory: TrackHistory<import("../../player/types").IBaseTrack>;
|
|
48
|
-
private readonly selectedRepresentations;
|
|
49
|
-
constructor(params: IParams);
|
|
50
|
-
protected abstract seek(position: Milliseconds, forcePrecise: boolean): void;
|
|
51
|
-
protected getProviderSubscriptionInfo(): IProviderSubscriptionInfo;
|
|
52
|
-
protected subscribe(): void;
|
|
53
|
-
protected selectVideoAudioRepresentations(): [Representation, Representation | undefined] | undefined;
|
|
54
|
-
protected prepare(manifestOffset?: number): void;
|
|
55
|
-
protected syncPlayback: () => undefined;
|
|
56
|
-
protected init3DScene: (init: CommonInit) => void;
|
|
57
|
-
protected destroy3DScene: () => void;
|
|
58
|
-
protected playIfAllowed(): void;
|
|
59
|
-
destroy(): void;
|
|
60
|
-
}
|
|
61
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { IObservableVideo } from '../../../providers/utils/HTMLVideoElement/observable';
|
|
2
|
-
import { IListener, IRectangle, ISubscription, ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
3
|
-
interface ConnectParams {
|
|
4
|
-
video: HTMLVideoElement;
|
|
5
|
-
observableVideo: IObservableVideo;
|
|
6
|
-
}
|
|
7
|
-
export declare class ElementSizeManager {
|
|
8
|
-
private readonly subscription;
|
|
9
|
-
private readonly pipSize$;
|
|
10
|
-
private readonly videoSize$;
|
|
11
|
-
private readonly elementSize$;
|
|
12
|
-
private pictureInPictureWindowRemoveEventListener;
|
|
13
|
-
connect({ observableVideo, video }: ConnectParams): void;
|
|
14
|
-
getValue(): IRectangle<number> | undefined;
|
|
15
|
-
subscribe(listener: IListener<IRectangle<number> | undefined>, error?: IListener<Error | unknown>): ISubscription;
|
|
16
|
-
getObservable(): ValueSubject<IRectangle<number> | undefined>;
|
|
17
|
-
destroy(): void;
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { IValueSubject, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import { Dependencies } from './buffer';
|
|
3
|
-
import { Manifest, Stream, TextRepresentation } from '../../../providers/utils/parsers/types';
|
|
4
|
-
export declare class LiveTextManager {
|
|
5
|
-
currentRepresentation$: IValueSubject<TextRepresentation | null>;
|
|
6
|
-
private readonly maxRepresentations;
|
|
7
|
-
private representationsCursor;
|
|
8
|
-
private representations;
|
|
9
|
-
private readonly getCurrentPosition;
|
|
10
|
-
private currentSegment;
|
|
11
|
-
constructor(streams: Stream[], deps: Pick<Dependencies, 'getCurrentPosition'>);
|
|
12
|
-
updateLive(manifest: Manifest | null): void;
|
|
13
|
-
seekLive(streams?: Stream[]): void;
|
|
14
|
-
maintain(currentPosition?: Milliseconds | undefined): void;
|
|
15
|
-
destroy(): void;
|
|
16
|
-
/**
|
|
17
|
-
* @todo support multi-streams
|
|
18
|
-
* @see https://jira.mvk.com/browse/VP-2420
|
|
19
|
-
*/
|
|
20
|
-
private processStreams;
|
|
21
|
-
static isSupported(streams?: Stream[]): boolean;
|
|
22
|
-
private static filterRepresentations;
|
|
23
|
-
}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { ITuningConfig } from '../../../utils/tuningConfig';
|
|
2
|
-
import { IError, IRange, ISubject, IValueSubject, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
3
|
-
import type { Fetcher } from './fetcher';
|
|
4
|
-
import { CommonInit, Manifest, Representation, Stream, StreamKind } from '../../../providers/utils/parsers/types';
|
|
5
|
-
export interface Dependencies {
|
|
6
|
-
fetcher: Fetcher;
|
|
7
|
-
tuning: ITuningConfig;
|
|
8
|
-
getCurrentPosition: () => Milliseconds | undefined;
|
|
9
|
-
isActiveLowLatency: () => boolean;
|
|
10
|
-
compatibilityMode?: boolean;
|
|
11
|
-
manifest: Manifest | null;
|
|
12
|
-
}
|
|
13
|
-
export interface Gap extends IRange<Milliseconds> {
|
|
14
|
-
representation: Representation['id'];
|
|
15
|
-
/**
|
|
16
|
-
* дырки, которые не нужно удалять при парсинге буфера (те `detectGapsWhenIdle`).
|
|
17
|
-
* те, например, которые были обнаружены при парсинге сегментов из манифеста.
|
|
18
|
-
*
|
|
19
|
-
* в функции `detectGapsWhenIdle` мы сравниваем ранее найденные дырки с данными буфера,
|
|
20
|
-
* проблема в том, что не смотря на то, что буфер может показать, что как будто дырки нет,
|
|
21
|
-
* по факту, найденная в манифесте дырка, скорее всего, никуда не делась и это приведет к зависанию видео.
|
|
22
|
-
*/
|
|
23
|
-
persistent: boolean;
|
|
24
|
-
}
|
|
25
|
-
export declare class BufferManager {
|
|
26
|
-
currentLiveSegmentServerLatency$: IValueSubject<number>;
|
|
27
|
-
currentLowLatencySegmentLength$: IValueSubject<number>;
|
|
28
|
-
currentSegmentLength$: IValueSubject<number>;
|
|
29
|
-
onLastSegment$: IValueSubject<boolean>;
|
|
30
|
-
fullyBuffered$: IValueSubject<boolean>;
|
|
31
|
-
playingRepresentation$: IValueSubject<Representation['id'] | undefined>;
|
|
32
|
-
playingRepresentationInit$: IValueSubject<CommonInit | undefined>;
|
|
33
|
-
error$: ISubject<IError>;
|
|
34
|
-
gaps: Gap[];
|
|
35
|
-
private subscription;
|
|
36
|
-
private kind;
|
|
37
|
-
private initData;
|
|
38
|
-
private parsedInitData;
|
|
39
|
-
private representations;
|
|
40
|
-
private segments;
|
|
41
|
-
private allInitsLoaded;
|
|
42
|
-
private activeSegments;
|
|
43
|
-
private mediaSource;
|
|
44
|
-
private playingRepresentationId;
|
|
45
|
-
private downloadingRepresentationId;
|
|
46
|
-
private switchingToRepresentationId;
|
|
47
|
-
private sourceBuffer;
|
|
48
|
-
private downloadAbortController;
|
|
49
|
-
private switchAbortController;
|
|
50
|
-
private destroyAbortController;
|
|
51
|
-
private useSmartRepresentationSwitch;
|
|
52
|
-
private readonly getCurrentPosition;
|
|
53
|
-
private readonly isActiveLowLatency;
|
|
54
|
-
private tuning;
|
|
55
|
-
private forwardBufferTarget;
|
|
56
|
-
private fetcher;
|
|
57
|
-
private bufferLimit;
|
|
58
|
-
private sourceBufferTaskQueue;
|
|
59
|
-
private gapDetectionIdleCallback;
|
|
60
|
-
private initLoadIdleCallback;
|
|
61
|
-
private failedDownloads;
|
|
62
|
-
private baseUrls;
|
|
63
|
-
private baseUrlsIndex;
|
|
64
|
-
private compatibilityMode;
|
|
65
|
-
private preloadOnly;
|
|
66
|
-
private isLive;
|
|
67
|
-
private liveUpdateSegmentIndex;
|
|
68
|
-
private liveInitialAdditionalOffset;
|
|
69
|
-
private isSeekingLive;
|
|
70
|
-
private index;
|
|
71
|
-
private lastDataObtainedTimestampMs;
|
|
72
|
-
private loadByteRangeSegmentsTimeoutId;
|
|
73
|
-
private sourceBufferBufferedDiff;
|
|
74
|
-
constructor(kind: StreamKind, mediaSource: MediaSource, representations: Representation[], { fetcher, tuning, getCurrentPosition, isActiveLowLatency, compatibilityMode, manifest }: Dependencies);
|
|
75
|
-
startWith: (param_0: string) => Promise<void | undefined>;
|
|
76
|
-
switchToWithPreviousAbort(newRepresentationId: Representation['id'], dropBuffer?: boolean): void;
|
|
77
|
-
switchTo: (param_0: string, param_1: boolean | undefined) => Promise<void | undefined>;
|
|
78
|
-
switchToOld: (param_0: string, param_1: boolean | undefined) => Promise<void | undefined>;
|
|
79
|
-
warmUpMediaSource(): void;
|
|
80
|
-
abort(): Promise<boolean>;
|
|
81
|
-
maintain(currentPosition?: Milliseconds | undefined): void;
|
|
82
|
-
get lastDataObtainedTimestamp(): number;
|
|
83
|
-
private searchGaps;
|
|
84
|
-
private getActualLiveStartingSegments;
|
|
85
|
-
getLiveSegmentsToLoadState(manifest: Manifest | null): IRange<Milliseconds> | undefined;
|
|
86
|
-
seekLive: (param_0: Stream[]) => Promise<void | undefined>;
|
|
87
|
-
updateLive(manifest: Manifest | null): void;
|
|
88
|
-
proceedLowLatencyLive(): void;
|
|
89
|
-
setSmartRepresentationSwitch(state: boolean): void;
|
|
90
|
-
private updateLowLatencyLiveIfNeeded;
|
|
91
|
-
findSegmentStartTime(position: Milliseconds): Milliseconds | undefined;
|
|
92
|
-
setTarget(time: Milliseconds): void;
|
|
93
|
-
setPreloadOnly(preloadOnly: boolean): void;
|
|
94
|
-
destroy(): void;
|
|
95
|
-
private selectForwardBufferSegments;
|
|
96
|
-
private selectForwardBufferSegmentsLive;
|
|
97
|
-
private selectForwardBufferSegmentsRecord;
|
|
98
|
-
private loadSegments;
|
|
99
|
-
private loadTemplateSegment;
|
|
100
|
-
private updateRepresentationsBaseUrlIfNeeded;
|
|
101
|
-
private loadByteRangeSegments;
|
|
102
|
-
private prepareByteRangeFetchSegmentParams;
|
|
103
|
-
private prepareTemplateFetchSegmentParams;
|
|
104
|
-
private abortActiveSegments;
|
|
105
|
-
private onSomeTemplateDataLoaded;
|
|
106
|
-
/**
|
|
107
|
-
* Закидываем в буфер сегменты атомарнее чем сегмент целиком. Например, по боксам в мпеге и по блокам в вебме.
|
|
108
|
-
* Таким образом не ждём его полной загрузки и готовы играть его намного быстрее
|
|
109
|
-
* @param dataView – данные, размер буфера – весь запрос
|
|
110
|
-
* @param globalFrom – Отступ dataView от начала файла, совпадает с отсупами сегментов
|
|
111
|
-
* @param loaded – Объём загруженных в dataView данных (всё что больше – пока нули)
|
|
112
|
-
* @private
|
|
113
|
-
*/
|
|
114
|
-
private onSomeByteRangesDataLoaded;
|
|
115
|
-
private onSegmentFullyAppended;
|
|
116
|
-
private abortSegment;
|
|
117
|
-
private loadNextInit;
|
|
118
|
-
private loadInit;
|
|
119
|
-
private dropBuffer;
|
|
120
|
-
private pruneBuffer;
|
|
121
|
-
private abortBuffer;
|
|
122
|
-
getDebugBufferState(): IRange<Milliseconds> | undefined;
|
|
123
|
-
getBufferedTo(): number | null;
|
|
124
|
-
getForwardBufferDuration(currentPosition?: Milliseconds | undefined): Milliseconds;
|
|
125
|
-
private detectGaps;
|
|
126
|
-
private detectGapsWhenIdle;
|
|
127
|
-
private checkEjectedSegments;
|
|
128
|
-
private handleAsyncError;
|
|
129
|
-
calculateDurationFromSegments(): number;
|
|
130
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { HttpConnectionType } from '../../../player/types';
|
|
2
|
-
import type ThroughputEstimator from '../../../utils/ThroughputEstimator';
|
|
3
|
-
import { Byte, IValueSubject, ISubject, Milliseconds, IRange, ITracer, IError } from '@vkontakte/videoplayer-shared';
|
|
4
|
-
import { CommonInit, GenericContainerParser, Segment, SegmentReference } from '../../../providers/utils/parsers/types';
|
|
5
|
-
export declare enum RangeMethod {
|
|
6
|
-
HEADER = 0,
|
|
7
|
-
PARAM = 1
|
|
8
|
-
}
|
|
9
|
-
export interface IParams {
|
|
10
|
-
throughputEstimator?: ThroughputEstimator;
|
|
11
|
-
requestQuic: boolean;
|
|
12
|
-
compatibilityMode?: boolean;
|
|
13
|
-
tracer: ITracer;
|
|
14
|
-
useEnableSubtitlesParam?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export type Priority = 'high' | 'low' | 'auto';
|
|
17
|
-
export interface FetchParamsWithUrl extends FetchParams {
|
|
18
|
-
url: string;
|
|
19
|
-
}
|
|
20
|
-
export interface FetchParams {
|
|
21
|
-
range?: IRange<Byte>;
|
|
22
|
-
rangeMethod?: RangeMethod;
|
|
23
|
-
onProgress?: (dataView: DataView, loaded: number) => void;
|
|
24
|
-
onProgressTasks?: Promise<void>[];
|
|
25
|
-
signal?: AbortSignal;
|
|
26
|
-
priority?: Priority;
|
|
27
|
-
measureThroughput?: boolean;
|
|
28
|
-
isLowLatency?: boolean;
|
|
29
|
-
bufferOptimisation?: boolean;
|
|
30
|
-
}
|
|
31
|
-
export type RepresentationFetchResult = {
|
|
32
|
-
init: CommonInit | null;
|
|
33
|
-
segments: Segment[];
|
|
34
|
-
dataView: DataView;
|
|
35
|
-
};
|
|
36
|
-
export declare class Fetcher {
|
|
37
|
-
private throughputEstimator;
|
|
38
|
-
private requestQuic;
|
|
39
|
-
private tracer;
|
|
40
|
-
manifestRequested$: ISubject<void>;
|
|
41
|
-
firstBytesManifest$: ISubject<void>;
|
|
42
|
-
firstBytesRequested$: ISubject<void>;
|
|
43
|
-
firstBytesReceived$: ISubject<void>;
|
|
44
|
-
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
45
|
-
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
46
|
-
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
47
|
-
recoverableError$: ISubject<IError>;
|
|
48
|
-
error$: ISubject<IError>;
|
|
49
|
-
private abortAllController;
|
|
50
|
-
private compatibilityMode;
|
|
51
|
-
private useEnableSubtitlesParam;
|
|
52
|
-
private readonly subscription;
|
|
53
|
-
constructor({ throughputEstimator, requestQuic, tracer, compatibilityMode, useEnableSubtitlesParam }: IParams);
|
|
54
|
-
private onHeadersReceived;
|
|
55
|
-
fetchManifest: (param_0: string) => Promise<string | null | undefined>;
|
|
56
|
-
fetch: (param_0: string, param_1: FetchParams) => Promise<ArrayBuffer | null | undefined>;
|
|
57
|
-
fetchRepresentation(segmentReference: SegmentReference, parser: GenericContainerParser<unknown>, priority?: Priority): Promise<RepresentationFetchResult | null>;
|
|
58
|
-
destroy(): void;
|
|
59
|
-
private fetchByteRangeRepresentation;
|
|
60
|
-
private fetchTemplateRepresentation;
|
|
61
|
-
private doFetch;
|
|
62
|
-
private unsubscribeAbortSubscription;
|
|
63
|
-
}
|
|
64
|
-
export declare const suppressAbort: (e: Error | unknown) => void | never;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import { HttpConnectionType, VideoCodec } from '../../../player/types';
|
|
2
|
-
import { LiveStreamStatus } from './types';
|
|
3
|
-
import { CommonInit, Manifest, Representation, StreamKind, TextRepresentation } from '../../../providers/utils/parsers/types';
|
|
4
|
-
import StateMachine from '../../../utils/StateMachine/StateMachine';
|
|
5
|
-
import type ThroughputEstimator from '../../../utils/ThroughputEstimator';
|
|
6
|
-
import { ITuningConfig } from '../../../utils/tuningConfig';
|
|
7
|
-
import { IError, ISubject, ITracer, IValueSubject, Milliseconds, Subject } from '@vkontakte/videoplayer-shared';
|
|
8
|
-
export declare enum State {
|
|
9
|
-
NONE = "none",
|
|
10
|
-
MANIFEST_READY = "manifest_ready",
|
|
11
|
-
REPRESENTATIOS_READY = "representations_ready",
|
|
12
|
-
RUNNING = "running"
|
|
13
|
-
}
|
|
14
|
-
export interface Params {
|
|
15
|
-
throughputEstimator: ThroughputEstimator;
|
|
16
|
-
tuning: ITuningConfig;
|
|
17
|
-
compatibilityMode?: boolean;
|
|
18
|
-
forceVideoCodec?: VideoCodec;
|
|
19
|
-
tracer: ITracer;
|
|
20
|
-
}
|
|
21
|
-
export declare class Player {
|
|
22
|
-
private element;
|
|
23
|
-
private manifestUrlString;
|
|
24
|
-
private source;
|
|
25
|
-
private manifest;
|
|
26
|
-
private tuning;
|
|
27
|
-
private tracer;
|
|
28
|
-
private forceVideoCodec?;
|
|
29
|
-
private videoBufferManager;
|
|
30
|
-
private audioBufferManager;
|
|
31
|
-
private bufferManagers;
|
|
32
|
-
private liveTextManager;
|
|
33
|
-
private throughputEstimator;
|
|
34
|
-
private subscription;
|
|
35
|
-
private subscriptionRemovable;
|
|
36
|
-
private representationSubscription;
|
|
37
|
-
private fetcher;
|
|
38
|
-
state$: StateMachine<State>;
|
|
39
|
-
currentVideoRepresentation$: IValueSubject<Representation['id'] | undefined>;
|
|
40
|
-
currentVideoRepresentationInit$: IValueSubject<CommonInit | undefined>;
|
|
41
|
-
currentAudioRepresentation$: IValueSubject<Representation['id'] | undefined>;
|
|
42
|
-
currentVideoSegmentLength$: IValueSubject<number>;
|
|
43
|
-
currentAudioSegmentLength$: IValueSubject<number>;
|
|
44
|
-
error$: ISubject<IError>;
|
|
45
|
-
manifestRequested$: ISubject<void>;
|
|
46
|
-
firstBytesManifest$: ISubject<void>;
|
|
47
|
-
manifestReceived$: ISubject<void>;
|
|
48
|
-
firstBytesRequested$: ISubject<void>;
|
|
49
|
-
firstBytesReceived$: ISubject<void>;
|
|
50
|
-
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
51
|
-
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
52
|
-
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
53
|
-
currentLiveTextRepresentation$: IValueSubject<TextRepresentation | null>;
|
|
54
|
-
private timeoutSourceOpenId;
|
|
55
|
-
isLive$: IValueSubject<boolean>;
|
|
56
|
-
isActiveLive$: IValueSubject<boolean>;
|
|
57
|
-
isLowLatency$: IValueSubject<boolean>;
|
|
58
|
-
liveDuration$: IValueSubject<Milliseconds>;
|
|
59
|
-
liveSeekableDuration$: IValueSubject<Milliseconds>;
|
|
60
|
-
liveAvailabilityStartTime$: IValueSubject<Milliseconds>;
|
|
61
|
-
liveStreamStatus$: IValueSubject<LiveStreamStatus | undefined>;
|
|
62
|
-
bufferLength$: IValueSubject<Milliseconds>;
|
|
63
|
-
liveLatency$: IValueSubject<Milliseconds | undefined>;
|
|
64
|
-
liveLoadBufferLength$: IValueSubject<Milliseconds>;
|
|
65
|
-
livePositionFromPlayer$: IValueSubject<number>;
|
|
66
|
-
currentStallDuration$: IValueSubject<Milliseconds>;
|
|
67
|
-
videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
|
|
68
|
-
fetcherRecoverableError$: Subject<IError>;
|
|
69
|
-
fetcherError$: Subject<IError>;
|
|
70
|
-
private liveStreamEndTimestamp;
|
|
71
|
-
private liveBuffer;
|
|
72
|
-
private isUpdatingLive;
|
|
73
|
-
private isJumpGapAfterSeekLive;
|
|
74
|
-
private forceEnded$;
|
|
75
|
-
private gapWatchdogActive;
|
|
76
|
-
private gapWatchdogSubscription;
|
|
77
|
-
private stallWatchdogSubscription;
|
|
78
|
-
private livePauseWatchdogSubscription;
|
|
79
|
-
private destroyController;
|
|
80
|
-
constructor(params: Params);
|
|
81
|
-
initManifest: (param_0: HTMLVideoElement, param_1: string, param_2: number) => Promise<void | undefined>;
|
|
82
|
-
updateManifest: () => Promise<Manifest | null | undefined>;
|
|
83
|
-
setSmartRepresentationSwitch(state: boolean): void;
|
|
84
|
-
seekLive(nextOffset: Milliseconds): Promise<void>;
|
|
85
|
-
initRepresentations: (param_0: string, param_1: string | undefined, param_2: import("../../../player/types").URLSource | undefined) => Promise<void | undefined>;
|
|
86
|
-
initBuffer(): void;
|
|
87
|
-
switchRepresentation(kind: StreamKind, id: Representation['id'], dropBuffer?: boolean): Promise<void>;
|
|
88
|
-
seek(requestedPosition: Milliseconds, forcePrecise: boolean): Promise<void>;
|
|
89
|
-
warmUpMediaSourceIfNeeded(position?: Milliseconds | undefined): void;
|
|
90
|
-
get isStreamEnded(): boolean;
|
|
91
|
-
stop(): void;
|
|
92
|
-
setBufferTarget(time: Milliseconds): void;
|
|
93
|
-
getStreams(): Manifest['streams'] | undefined;
|
|
94
|
-
getCodecs(): Manifest['codecs'] | undefined;
|
|
95
|
-
setPreloadOnly(preloadOnly: boolean): void;
|
|
96
|
-
destroy(): void;
|
|
97
|
-
private initTracerSubscription;
|
|
98
|
-
private isManualDecreasePlaybackInLive;
|
|
99
|
-
private normolizeLiveOffset;
|
|
100
|
-
private tick;
|
|
101
|
-
private updateLive;
|
|
102
|
-
private jumpGap;
|
|
103
|
-
/**
|
|
104
|
-
* Возвращает duration в милисекундах.
|
|
105
|
-
*/
|
|
106
|
-
calculateDurationFromSegments(): number;
|
|
107
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export declare class SourceBufferBufferedDiff {
|
|
2
|
-
private lastUpdateTs;
|
|
3
|
-
private lastCallTs;
|
|
4
|
-
private prevRanges;
|
|
5
|
-
private readonly sourceBuffer;
|
|
6
|
-
private readonly mediaSource;
|
|
7
|
-
private readonly subscription;
|
|
8
|
-
constructor(mediaSource: MediaSource, sourceBuffer: SourceBuffer);
|
|
9
|
-
private updateend;
|
|
10
|
-
/**
|
|
11
|
-
* если длина массивов разная - считаем, что какие то сегменты удалили
|
|
12
|
-
*
|
|
13
|
-
* если длина одинаковая - считаем, что сегменты удалили в том случае,
|
|
14
|
-
* если в новом массиве хотя бы 1 сегмент стал меньше
|
|
15
|
-
*/
|
|
16
|
-
private isRangesRemoved;
|
|
17
|
-
wasUpdated(): boolean;
|
|
18
|
-
destroy(): void;
|
|
19
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
private destroyed;
|
|
9
|
-
private abortRequested;
|
|
10
|
-
private isAbortFixEnabled;
|
|
11
|
-
constructor(buffer: SourceBuffer, isAbortFixEnabled?: boolean);
|
|
12
|
-
append(data: BufferSource, signal?: AbortSignal): Promise<boolean>;
|
|
13
|
-
remove(from: Milliseconds, to: Milliseconds, signal?: AbortSignal): Promise<boolean>;
|
|
14
|
-
abort(init?: BufferSource): Promise<boolean>;
|
|
15
|
-
destroy(): void;
|
|
16
|
-
private completeTask;
|
|
17
|
-
private pull;
|
|
18
|
-
private execute;
|
|
19
|
-
}
|
|
20
|
-
export default SourceBufferTaskQueue;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { IObservable, ISubject, IValueSubject } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import { IDesiredState, IProviderOutput, IProviderParams } from '../../../providers/types';
|
|
3
|
-
import { IObservableVideo } from '../../../providers/utils/HTMLVideoElement/observable';
|
|
4
|
-
import { IDashURLSource } from '../../../player/types';
|
|
5
|
-
export declare enum LiveStatus {
|
|
6
|
-
ActiveLowLatency = "active_low_latency",
|
|
7
|
-
LiveWithTargetOffset = "live_with_target_offset",
|
|
8
|
-
LiveForwardBuffering = "live_forward_buffering",
|
|
9
|
-
None = "none"
|
|
10
|
-
}
|
|
11
|
-
export declare enum LiveStreamStatus {
|
|
12
|
-
Active = "active",
|
|
13
|
-
UnexpectedlyDown = "unexpectedly_down",// Стрим в сети, но трансляция оборвалась из-за тех. проблем
|
|
14
|
-
Unpublished = "unpublished"
|
|
15
|
-
}
|
|
16
|
-
export interface IProviderSubscriptionInfo {
|
|
17
|
-
output: IProviderOutput;
|
|
18
|
-
desiredState: IDesiredState;
|
|
19
|
-
observableVideo: IObservableVideo;
|
|
20
|
-
genericErrorListener: (error: Error | unknown) => void;
|
|
21
|
-
connect: <Value>(from: IObservable<Value>, to: ISubject<Value> | IValueSubject<Value> | ((v: Value) => void)) => void;
|
|
22
|
-
}
|
|
23
|
-
export declare enum ProviderState {
|
|
24
|
-
STOPPED = "stopped",
|
|
25
|
-
READY = "ready",
|
|
26
|
-
PLAYING = "playing",
|
|
27
|
-
PAUSED = "paused"
|
|
28
|
-
}
|
|
29
|
-
export type IParams = IProviderParams<IDashURLSource>;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from '../../../providers/utils/parsers/types';
|
|
2
|
-
import { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from '../../../player/types';
|
|
3
|
-
import { IRange, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
4
|
-
export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString, streamId }: Representation) => IVideoTrack | undefined;
|
|
5
|
-
export declare const representationToAudioTrack: ({ id, bitrate }: Representation) => IAudioTrack;
|
|
6
|
-
export declare const representationToTextTrack: ({ language, label }: Stream, { id, url, isAuto }: Representation & {
|
|
7
|
-
url: string;
|
|
8
|
-
isAuto: boolean;
|
|
9
|
-
}) => IInternalTextTrack;
|
|
10
|
-
export declare const textRepresentationToTextTrack: ({ language, label, id, url, isAuto }: TextRepresentation) => IInternalTextTrack;
|
|
11
|
-
export declare const streamToIAudioStream: ({ id, language, label, codecs, isDefault }: Stream) => IAudioStream;
|
|
12
|
-
export declare const streamToIVideoStream: ({ id, language, label, hdr, codecs }: Stream) => IVideoStream;
|
|
13
|
-
export declare const isTemplateSegment: (segment: Segment) => segment is TemplateSegment;
|
|
14
|
-
export declare const isTemplateSegmentReference: (segmentReference: SegmentReference) => segmentReference is TemplateSegmentReference;
|
|
15
|
-
export declare const isTextRepresentation: (representation: Representation | TextRepresentation) => representation is TextRepresentation;
|
|
16
|
-
/**
|
|
17
|
-
* @mutates intervals
|
|
18
|
-
*/
|
|
19
|
-
export declare const mergeIntervals: (intervals: IRange<Milliseconds>[]) => IRange<Milliseconds>[];
|
|
20
|
-
export declare const findInIterator: <T>(iterable: MapIterator<T> | SetIterator<T>, matchFn: (arg: T) => boolean) => T | null;
|
|
21
|
-
/**
|
|
22
|
-
* даёт `true` каждые `ms` миллисекунд
|
|
23
|
-
*/
|
|
24
|
-
export declare const semaphor: (ms: number) => () => boolean;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import { IParams } from './lib/types';
|
|
3
|
-
import BaseDashProvider from './baseDashProvider';
|
|
4
|
-
export default class NewDashCmafLiveProvider extends BaseDashProvider {
|
|
5
|
-
constructor(params: IParams);
|
|
6
|
-
protected subscribe(): void;
|
|
7
|
-
protected seek(position: Milliseconds): void;
|
|
8
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
|
-
import BaseDashProvider from './baseDashProvider';
|
|
3
|
-
export default class NewDashProvider extends BaseDashProvider {
|
|
4
|
-
protected subscribe(): void;
|
|
5
|
-
protected seek(position: Milliseconds, forcePrecise: boolean): void;
|
|
6
|
-
}
|