@vkontakte/videoplayer-core 2.0.111-dev.974e99b3.0 → 2.0.111-dev.ae3e5b42.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.js +15 -15
- package/es2015.esm.js +15 -15
- package/es2018.cjs.js +10 -10
- package/es2018.esm.js +10 -10
- package/esnext.cjs.js +13 -13
- package/esnext.esm.js +12 -12
- package/evergreen.esm.js +14 -14
- package/package.json +2 -2
- package/types/providers/DashProvider/baseDashProvider.d.ts +0 -6
- package/types/providers/DashProvider/lib/LiveTextManager.d.ts +21 -0
- package/types/providers/DashProvider/lib/player.d.ts +3 -1
- package/types/providers/DashProvider/lib/types.d.ts +6 -0
- package/types/providers/DashProvider/lib/utils.d.ts +3 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.111-dev.
|
|
3
|
+
"version": "2.0.111-dev.ae3e5b42.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"**/*.d.ts"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@vkontakte/videoplayer-shared": "1.0.43-dev.
|
|
52
|
+
"@vkontakte/videoplayer-shared": "1.0.43-dev.91b27eda.0",
|
|
53
53
|
"hls.js": "~1.4.7"
|
|
54
54
|
}
|
|
55
55
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IAudioTrack, IDashURLSource, IHLSSource, IInternalTextTrack, IVideoTrack } from '../../player/types';
|
|
2
2
|
import { CommonInit, IProviderSubscriptionInfo, ProviderState, Representation, Stream } from './lib/types';
|
|
3
3
|
import { IProvider, IProviderParams } from '../../providers/types';
|
|
4
|
-
import TextTrackManager from '../../providers/utils/HTMLVideoElement/TextTrackManager';
|
|
5
4
|
import { TrackHistory } from '../../utils/autoSelectTrack';
|
|
6
5
|
import { IStateMachine } from '../../utils/StateMachine/types';
|
|
7
6
|
import { IRectangle, ISubscription, Milliseconds, ValueSubject, ITracer } from '@vkontakte/videoplayer-shared';
|
|
@@ -21,7 +20,6 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
21
20
|
protected params: IParams;
|
|
22
21
|
protected tracer: ITracer;
|
|
23
22
|
protected elementSize$: ValueSubject<IRectangle<number> | undefined>;
|
|
24
|
-
protected textTracksManager: TextTrackManager;
|
|
25
23
|
protected droppedFramesManager: DroppedFramesManager;
|
|
26
24
|
protected videoTracksMap: Map<IVideoTrack, {
|
|
27
25
|
stream: Stream;
|
|
@@ -31,10 +29,6 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
31
29
|
stream: Stream;
|
|
32
30
|
representation: Representation;
|
|
33
31
|
}>;
|
|
34
|
-
protected textTracksMap: Map<IInternalTextTrack, {
|
|
35
|
-
stream: Stream;
|
|
36
|
-
representation: Representation;
|
|
37
|
-
}>;
|
|
38
32
|
protected videoStreamsMap: Map<Stream, IVideoTrack[]>;
|
|
39
33
|
protected audioStreamsMap: Map<Stream, IAudioTrack[]>;
|
|
40
34
|
protected videoTrackSwitchHistory: TrackHistory<IVideoTrack>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IValueSubject, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
import { Dependencies } from './buffer';
|
|
3
|
+
import { Manifest, Stream, TextRepresentation } from './types';
|
|
4
|
+
export declare class LiveTextManager {
|
|
5
|
+
currentRepresentation$: IValueSubject<TextRepresentation | null>;
|
|
6
|
+
private representations;
|
|
7
|
+
private readonly getCurrentPosition;
|
|
8
|
+
private currentSegment;
|
|
9
|
+
constructor(streams: Stream[], deps: Pick<Dependencies, 'getCurrentPosition'>);
|
|
10
|
+
updateLive(manifest: Manifest | null): void;
|
|
11
|
+
seekLive(streams?: Stream[]): void;
|
|
12
|
+
maintain(currentPosition?: Milliseconds | undefined): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
/**
|
|
15
|
+
* @todo support multi-streams
|
|
16
|
+
* @see https://jira.mvk.com/browse/VP-2420
|
|
17
|
+
*/
|
|
18
|
+
private processStreams;
|
|
19
|
+
static isSupported(streams?: Stream[]): boolean;
|
|
20
|
+
private static filterRepresentations;
|
|
21
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpConnectionType } from '../../../player/types';
|
|
2
|
-
import { CommonInit, Manifest, Representation, StreamKind } from './types';
|
|
2
|
+
import { CommonInit, Manifest, Representation, StreamKind, TextRepresentation } from './types';
|
|
3
3
|
import StateMachine from '../../../utils/StateMachine/StateMachine';
|
|
4
4
|
import type ThroughputEstimator from '../../../utils/ThroughputEstimator';
|
|
5
5
|
import { ITuningConfig } from '../../../utils/tuningConfig';
|
|
@@ -27,6 +27,7 @@ export declare class Player {
|
|
|
27
27
|
private videoBufferManager;
|
|
28
28
|
private audioBufferManager;
|
|
29
29
|
private bufferManagers;
|
|
30
|
+
private liveTextManager;
|
|
30
31
|
private throughputEstimator;
|
|
31
32
|
private subscription;
|
|
32
33
|
private representationSubscription;
|
|
@@ -41,6 +42,7 @@ export declare class Player {
|
|
|
41
42
|
lastConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
42
43
|
lastConnectionReused$: IValueSubject<boolean | undefined>;
|
|
43
44
|
lastRequestFirstBytes$: IValueSubject<Milliseconds | undefined>;
|
|
45
|
+
currentLiveTextRepresentation$: IValueSubject<TextRepresentation | null>;
|
|
44
46
|
isLive$: IValueSubject<boolean>;
|
|
45
47
|
liveDuration$: IValueSubject<Milliseconds>;
|
|
46
48
|
liveAvailabilityStartTime$: IValueSubject<Seconds | undefined>;
|
|
@@ -31,6 +31,12 @@ export interface Representation {
|
|
|
31
31
|
fps?: number;
|
|
32
32
|
quality?: string;
|
|
33
33
|
}
|
|
34
|
+
export interface TextRepresentation extends Representation {
|
|
35
|
+
language: string;
|
|
36
|
+
label: string;
|
|
37
|
+
url: string;
|
|
38
|
+
isAuto: boolean;
|
|
39
|
+
}
|
|
34
40
|
export declare enum SegmentReferencingType {
|
|
35
41
|
BYTE_RANGE = "byteRange",
|
|
36
42
|
TEMPLATE = "template"
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference } from '../../../providers/DashProvider/lib/types';
|
|
1
|
+
import { Representation, Segment, SegmentReference, Stream, TemplateSegment, TemplateSegmentReference, TextRepresentation } from '../../../providers/DashProvider/lib/types';
|
|
2
2
|
import { IAudioStream, IAudioTrack, IInternalTextTrack, IVideoStream, IVideoTrack } from '../../../player/types';
|
|
3
3
|
export declare const representationToVideoTrack: ({ id, width, height, bitrate, fps, quality: qualityString }: Representation) => IVideoTrack | undefined;
|
|
4
4
|
export declare const representationToAudioTrack: ({ id, bitrate }: Representation) => IAudioTrack;
|
|
5
5
|
export declare const selectAudioForVideo: (videoTrack: IVideoTrack, videoTracks: IVideoTrack[], audioTracks: IAudioTrack[]) => IAudioTrack | undefined;
|
|
6
|
-
export declare const representationToTextTrack: ({ language, label
|
|
7
|
-
url: string;
|
|
8
|
-
isAuto: boolean;
|
|
9
|
-
}) => IInternalTextTrack;
|
|
6
|
+
export declare const representationToTextTrack: ({ language, label, id, url, isAuto }: TextRepresentation) => IInternalTextTrack;
|
|
10
7
|
export declare const streamToIAudioStream: ({ id, language, label, codecs, isDefault }: Stream) => IAudioStream;
|
|
11
8
|
export declare const streamToIVideoStream: ({ id, language, label, hdr, codecs }: Stream) => IVideoStream;
|
|
12
9
|
export declare const isTemplateSegment: (segment: Segment) => segment is TemplateSegment;
|
|
13
10
|
export declare const isTemplateSegmentReference: (segmentReference: SegmentReference) => segmentReference is TemplateSegmentReference;
|
|
14
11
|
export declare const isAbortError: (e: Error | unknown) => boolean;
|
|
12
|
+
export declare const isTextRepresentation: (representation: Representation | TextRepresentation) => representation is TextRepresentation;
|