@vkontakte/videoplayer-core 2.0.75-beta.0 → 2.0.75
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.d.ts +2 -2
- package/es2015.cjs.js +3 -3
- package/es2015.esm.d.ts +2 -2
- package/es2015.esm.js +3 -3
- package/es2018.cjs.d.ts +2 -2
- package/es2018.cjs.js +3 -3
- package/es2018.esm.d.ts +2 -2
- package/es2018.esm.js +3 -3
- package/esnext.cjs.js +3 -3
- package/esnext.esm.d.ts +2 -2
- package/esnext.esm.js +3 -3
- package/index.d.ts +2 -2
- package/package.json +1 -1
- package/packages/core/src/providers/DashVKProvider/lib/types.d.ts +92 -0
- package/player/Player.d.ts +2 -3
- package/player/types.d.ts +1 -11
package/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { VideoFormat, IMpegSource, IDashSource, IHLSSource, IDashURLSource, IHLSLiveSource,
|
|
1
|
+
import { VideoFormat, IMpegSource, IDashSource, IHLSSource, IDashURLSource, IHLSLiveSource, ISeekRequest, URLSource, RawSource, URLSourceWithSeek } from "./player/types";
|
|
2
2
|
import Player from "./player/Player";
|
|
3
3
|
import { IPlayer, PlaybackState, IPlayerInfo, IPlayerEvents, IConfig, ISources, ICueSettings, ChromecastState, HttpConnectionType, IExternalTextTrack, ITextTrack, PlaybackRate } from "./player/types";
|
|
4
4
|
import { VideoQuality, ExactVideoQuality } from "./utils/quality/types";
|
|
@@ -8,4 +8,4 @@ import { Subscription, Observable, Subject, ValueSubject } from '@vkontakte/vide
|
|
|
8
8
|
* Версия sdk
|
|
9
9
|
*/
|
|
10
10
|
declare const SDK_VERSION: string;
|
|
11
|
-
export { Player, IPlayer, PlaybackState, IPlayerInfo, IPlayerEvents, IConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ChromecastState, HttpConnectionType, Subscription, ISubscription, IUnsubscriber, IObservable, IEmitter, IValueObservable, IValue, IOperator, IListener, VideoFormat, IMpegSource, IDashSource, IDashURLSource, IHLSSource, IHLSLiveSource, URLSource, RawSource, URLSourceWithSeek, VideoQuality, ExactVideoQuality, Observable, Subject, ValueSubject, IRange,
|
|
11
|
+
export { Player, IPlayer, PlaybackState, IPlayerInfo, IPlayerEvents, IConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ChromecastState, HttpConnectionType, Subscription, ISubscription, IUnsubscriber, IObservable, IEmitter, IValueObservable, IValue, IOperator, IListener, VideoFormat, IMpegSource, IDashSource, IDashURLSource, IHLSSource, IHLSLiveSource, URLSource, RawSource, URLSourceWithSeek, VideoQuality, ExactVideoQuality, Observable, Subject, ValueSubject, IRange, ISeekRequest, ICueSettings, SDK_VERSION, PlaybackRate, };
|
package/package.json
CHANGED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Byte, Kbps, Milliseconds, IRange } from '@vkontakte/videoplayer-shared';
|
|
2
|
+
export declare enum RepresentationKind {
|
|
3
|
+
VIDEO = "video",
|
|
4
|
+
AUDIO = "audio",
|
|
5
|
+
TEXT = "text"
|
|
6
|
+
}
|
|
7
|
+
export declare enum Profile {
|
|
8
|
+
WEBM_AS_IN_SPEC = "urn:mpeg:dash:profile:webm-on-demand:2012",
|
|
9
|
+
WEBM_AS_IN_FFMPEG = "urn:webm:dash:profile:webm-on-demand:2012"
|
|
10
|
+
}
|
|
11
|
+
export interface Representation {
|
|
12
|
+
id: string;
|
|
13
|
+
kind: RepresentationKind;
|
|
14
|
+
segmentReference: SegmentReference;
|
|
15
|
+
profiles: Array<Profile | string>;
|
|
16
|
+
duration?: Milliseconds;
|
|
17
|
+
bitrate: Kbps;
|
|
18
|
+
mime: string;
|
|
19
|
+
codecs: string;
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
fps?: number;
|
|
23
|
+
quality?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare enum SegmentReferencingType {
|
|
26
|
+
BYTE_RANGE = "byteRange",
|
|
27
|
+
TEMPLATE = "template"
|
|
28
|
+
}
|
|
29
|
+
export declare type ByteRangeSegmentReference = {
|
|
30
|
+
type: SegmentReferencingType.BYTE_RANGE;
|
|
31
|
+
url: string;
|
|
32
|
+
initRange: IRange<Byte>;
|
|
33
|
+
indexRange?: IRange<Byte>;
|
|
34
|
+
};
|
|
35
|
+
export declare type TemplateSegmentReference = {
|
|
36
|
+
type: SegmentReferencingType.TEMPLATE;
|
|
37
|
+
baseUrl: string;
|
|
38
|
+
initUrl: string;
|
|
39
|
+
segments: {
|
|
40
|
+
url: string;
|
|
41
|
+
time: IRange<Milliseconds>;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
44
|
+
export declare type SegmentReference = ByteRangeSegmentReference | TemplateSegmentReference;
|
|
45
|
+
export interface ByteRangeSegment {
|
|
46
|
+
status: SegmentStatus;
|
|
47
|
+
time: IRange<Milliseconds>;
|
|
48
|
+
byte: IRange<Byte>;
|
|
49
|
+
}
|
|
50
|
+
export interface TemplateSegment {
|
|
51
|
+
status: SegmentStatus;
|
|
52
|
+
time: IRange<Milliseconds>;
|
|
53
|
+
size: Byte | undefined;
|
|
54
|
+
url: string;
|
|
55
|
+
}
|
|
56
|
+
export declare type Segment = ByteRangeSegment | TemplateSegment;
|
|
57
|
+
export declare enum SegmentStatus {
|
|
58
|
+
NONE = "none",
|
|
59
|
+
DOWNLOADING = "downloading",
|
|
60
|
+
DOWNLOADED = "downloaded",
|
|
61
|
+
PARTIALLY_FED = "partially_fed",
|
|
62
|
+
PARTIALLY_EJECTED = "partially_ejected",
|
|
63
|
+
FED = "fed"
|
|
64
|
+
}
|
|
65
|
+
export interface Manifest {
|
|
66
|
+
duration: Milliseconds | undefined;
|
|
67
|
+
container: Container;
|
|
68
|
+
representations: {
|
|
69
|
+
[key in RepresentationKind]: Representation[];
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export declare enum Container {
|
|
73
|
+
MP4 = "mp4",
|
|
74
|
+
WEBM = "webm"
|
|
75
|
+
}
|
|
76
|
+
export interface GenericContainerParser<InitData> {
|
|
77
|
+
validateData(data: DataView): boolean;
|
|
78
|
+
getIndexRange(init: InitData): IRange<Byte> | undefined;
|
|
79
|
+
parseInit(data: DataView): InitData;
|
|
80
|
+
parseSegments(data: DataView, init: InitData): Segment[];
|
|
81
|
+
parseFeedableSegmentChunk(data: DataView): DataView | null;
|
|
82
|
+
}
|
|
83
|
+
export interface WebmInit {
|
|
84
|
+
segmentStart: Byte;
|
|
85
|
+
segmentEnd: Byte;
|
|
86
|
+
timeScale: number;
|
|
87
|
+
segmentDuration: number;
|
|
88
|
+
cuesSeekPosition?: Byte;
|
|
89
|
+
}
|
|
90
|
+
export declare type WebmParser = GenericContainerParser<WebmInit>;
|
|
91
|
+
export declare type MpegParser = GenericContainerParser<null>;
|
|
92
|
+
export declare type ContainerParser = WebmParser | MpegParser;
|
package/player/Player.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { HttpConnectionType, ICueSettings, StartEnd, PlaybackRate } from "./type
|
|
|
2
2
|
import { QualityLimits, VideoQuality } from "../utils/quality/types";
|
|
3
3
|
import { IOptionalTuningConfig } from "../utils/tuningConfig";
|
|
4
4
|
import { IError, ILogEntry, Seconds, Subject, ValueSubject } from '@vkontakte/videoplayer-shared';
|
|
5
|
-
import { ChromecastState, IConfig, IExternalTextTrack, IPlayer, ISeekRequest, ITextTrack, PlaybackState,
|
|
5
|
+
import { ChromecastState, IConfig, IExternalTextTrack, IPlayer, ISeekRequest, ITextTrack, PlaybackState, VideoFormat } from './types';
|
|
6
6
|
export default class Player implements IPlayer {
|
|
7
7
|
private subscription;
|
|
8
8
|
private domContainer;
|
|
@@ -54,8 +54,7 @@ export default class Player implements IPlayer {
|
|
|
54
54
|
};
|
|
55
55
|
events: {
|
|
56
56
|
inited$: Subject<void>;
|
|
57
|
-
started$: Subject<
|
|
58
|
-
startAttempt$: Subject<StartStatus>;
|
|
57
|
+
started$: Subject<void>;
|
|
59
58
|
willPause$: Subject<void>;
|
|
60
59
|
willResume$: Subject<void>;
|
|
61
60
|
willDestruct$: Subject<void>;
|
package/player/types.d.ts
CHANGED
|
@@ -76,13 +76,8 @@ export interface IPlayerEvents {
|
|
|
76
76
|
/**
|
|
77
77
|
* Видео начало воспроизведение в первый раз
|
|
78
78
|
* Соответствует первому для видео внешнему запуску воспроизведения
|
|
79
|
-
* Параметр содержит значение isMuted (true если видео заиграло без звука, false если со звуком)
|
|
80
79
|
*/
|
|
81
|
-
started$: IObservable<
|
|
82
|
-
/**
|
|
83
|
-
* Попытка начать играть видео
|
|
84
|
-
*/
|
|
85
|
-
startAttempt$: IObservable<StartStatus>;
|
|
80
|
+
started$: IObservable<void>;
|
|
86
81
|
/**
|
|
87
82
|
* Запрошена пауза
|
|
88
83
|
*/
|
|
@@ -410,11 +405,6 @@ export interface ISeekRequest {
|
|
|
410
405
|
from: Seconds;
|
|
411
406
|
to: Seconds;
|
|
412
407
|
}
|
|
413
|
-
export declare enum StartStatus {
|
|
414
|
-
SuccessWithSound = "success_with_sound",
|
|
415
|
-
SuccessWithoutSound = "success_without_sound",
|
|
416
|
-
Failed = "failed"
|
|
417
|
-
}
|
|
418
408
|
export declare enum HttpConnectionType {
|
|
419
409
|
HTTP1 = "http1",
|
|
420
410
|
HTTP2 = "http2",
|