@vkontakte/videoplayer-core 2.0.119-dev.76657cc8.0 → 2.0.119-dev.df6b2fd8.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 +20 -20
- package/es2015.esm.js +21 -21
- package/es2018.cjs.js +22 -22
- package/es2018.esm.js +22 -22
- package/esnext.cjs.js +21 -21
- package/esnext.esm.js +21 -21
- package/evergreen.esm.js +21 -21
- package/package.json +2 -2
- package/types/index.d.ts +2 -2
- package/types/player/Player.d.ts +3 -1
- package/types/player/types.d.ts +13 -0
- package/types/utils/qualityLimits.d.ts +9 -0
- package/types/utils/tuningConfig.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.119-dev.
|
|
3
|
+
"version": "2.0.119-dev.df6b2fd8.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.51-dev.
|
|
52
|
+
"@vkontakte/videoplayer-shared": "1.0.51-dev.5628c766.0",
|
|
53
53
|
"hls.js": "~1.4.7"
|
|
54
54
|
}
|
|
55
55
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VERSION } from './env';
|
|
2
|
-
import { VideoFormat, IMpegSource, IDashSource, IHLSSource, IDashURLSource, IHLSLiveSource, ISeekRequest, URLSource, RawSource, URLSourceWithSeek, Surface } from './player/types';
|
|
2
|
+
import { VideoFormat, IMpegSource, IDashSource, IHLSSource, IDashURLSource, IHLSLiveSource, ISeekRequest, URLSource, RawSource, URLSourceWithSeek, Surface, PredefinedQualityLimits } from './player/types';
|
|
3
3
|
import Player from './player/Player';
|
|
4
4
|
import { IPlayer, PlaybackState, IPlayerInfo, IPlayerEvents, IConfig, ISources, ICueSettings, ChromecastState, HttpConnectionType, IExternalTextTrack, ITextTrack, PlaybackRate, IVideoStream, IAudioStream } from './player/types';
|
|
5
5
|
import type { IOptionalTuningConfig } from './utils/tuningConfig';
|
|
@@ -9,4 +9,4 @@ import { Subscription, Observable, Subject, ValueSubject, VideoQuality } from '@
|
|
|
9
9
|
* @deprecated
|
|
10
10
|
*/
|
|
11
11
|
declare const SDK_VERSION: string;
|
|
12
|
-
export { Player, IPlayer, PlaybackState, IPlayerInfo, IPlayerEvents, IConfig, IOptionalTuningConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ChromecastState, HttpConnectionType, Surface, 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, VERSION, SDK_VERSION, PlaybackRate, IVideoStream, IAudioStream, };
|
|
12
|
+
export { Player, IPlayer, PlaybackState, IPlayerInfo, IPlayerEvents, IConfig, IOptionalTuningConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ChromecastState, HttpConnectionType, Surface, 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, VERSION, SDK_VERSION, PlaybackRate, IVideoStream, IAudioStream, PredefinedQualityLimits, };
|
package/types/player/Player.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IOptionalTuningConfig } from '../utils/tuningConfig';
|
|
2
2
|
import { IError, ILogEntry, Seconds, Subject, ValueSubject, QualityLimits, VideoQuality, ITracer } from '@vkontakte/videoplayer-shared';
|
|
3
|
-
import { ChromecastState, HttpConnectionType, IAudioStream, IConfig, ICueSettings, IExternalTextTrack, IPlayer, ISeekRequest, ISources, ITextTrack, IVideoStream, PlaybackRate, PlaybackState, StartEnd, Surface, VideoFormat } from './types';
|
|
3
|
+
import { ChromecastState, HttpConnectionType, IAudioStream, IConfig, ICueSettings, IExternalTextTrack, IPlayer, ISeekRequest, ISources, ITextTrack, IVideoStream, PlaybackRate, PlaybackState, PredefinedQualityLimits, StartEnd, Surface, VideoFormat } from './types';
|
|
4
4
|
export default class Player implements IPlayer {
|
|
5
5
|
private subscription;
|
|
6
6
|
private domContainer;
|
|
@@ -34,6 +34,7 @@ export default class Player implements IPlayer {
|
|
|
34
34
|
isAutoQualityEnabled$: ValueSubject<boolean>;
|
|
35
35
|
autoQualityLimitingAvailable$: ValueSubject<boolean>;
|
|
36
36
|
autoQualityLimits$: ValueSubject<QualityLimits>;
|
|
37
|
+
predefinedQualityLimitType$: ValueSubject<PredefinedQualityLimits>;
|
|
37
38
|
availableAudioStreams$: ValueSubject<IAudioStream[]>;
|
|
38
39
|
currentAudioStream$: ValueSubject<IVideoStream | undefined>;
|
|
39
40
|
availableAudioTracks$: ValueSubject<import("./types").IBaseTrack[]>;
|
|
@@ -125,6 +126,7 @@ export default class Player implements IPlayer {
|
|
|
125
126
|
setQuality(quality: VideoQuality): IPlayer;
|
|
126
127
|
setAutoQuality(enable: boolean): IPlayer;
|
|
127
128
|
setAutoQualityLimits(limits: QualityLimits): IPlayer;
|
|
129
|
+
setPredefinedQualityLimits(type: PredefinedQualityLimits): this;
|
|
128
130
|
setPlaybackRate(playbackRate: PlaybackRate): IPlayer;
|
|
129
131
|
setExternalTextTracks(tracks: Omit<IExternalTextTrack, 'type'>[]): IPlayer;
|
|
130
132
|
selectTextTrack(id: ITextTrack['id'] | undefined): IPlayer;
|
package/types/player/types.d.ts
CHANGED
|
@@ -38,6 +38,10 @@ export interface IPlayer {
|
|
|
38
38
|
setQuality(quality: VideoQuality): IPlayer;
|
|
39
39
|
setAutoQuality(enable: boolean): IPlayer;
|
|
40
40
|
setAutoQualityLimits(limit: QualityLimits): IPlayer;
|
|
41
|
+
/**
|
|
42
|
+
* Установить предопределенные настройки лимитов.
|
|
43
|
+
*/
|
|
44
|
+
setPredefinedQualityLimits(type: PredefinedQualityLimits): IPlayer;
|
|
41
45
|
startCameraManualRotation(mx: number, my: number): IPlayer;
|
|
42
46
|
stopCameraManualRotation(immediate: boolean): IPlayer;
|
|
43
47
|
moveCameraFocusPX(mx: Pixel, my: Pixel, dt: number): IPlayer;
|
|
@@ -260,6 +264,10 @@ export interface IPlayerInfo {
|
|
|
260
264
|
* Текущие лимиты авто-качества
|
|
261
265
|
*/
|
|
262
266
|
autoQualityLimits$: IValueObservable<QualityLimits>;
|
|
267
|
+
/**
|
|
268
|
+
* Показывает, подходят ли текущие лимиты качества под.
|
|
269
|
+
*/
|
|
270
|
+
predefinedQualityLimitType$: IValueObservable<PredefinedQualityLimits>;
|
|
263
271
|
/**
|
|
264
272
|
* Текущая скорость воспроизведения
|
|
265
273
|
*/
|
|
@@ -568,4 +576,9 @@ export declare enum Surface {
|
|
|
568
576
|
PIP = "pip",
|
|
569
577
|
INVISIBLE = "invisible"
|
|
570
578
|
}
|
|
579
|
+
export declare enum PredefinedQualityLimits {
|
|
580
|
+
TRAFFIC_SAVING = "traffic_saving",
|
|
581
|
+
HIGH_QUALITY = "high_quality",
|
|
582
|
+
UNKNOWN = "unknown"
|
|
583
|
+
}
|
|
571
584
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PredefinedQualityLimits } from '../player/types';
|
|
2
|
+
import { ExactVideoQuality, QualityLimits } from '@vkontakte/videoplayer-shared';
|
|
3
|
+
type Params = {
|
|
4
|
+
limits: QualityLimits;
|
|
5
|
+
highQualityLimit: ExactVideoQuality;
|
|
6
|
+
trafficSavingLimit: ExactVideoQuality;
|
|
7
|
+
};
|
|
8
|
+
export declare function getQualityLimitsPredefinedType({ limits, highQualityLimit, trafficSavingLimit }: Params): PredefinedQualityLimits;
|
|
9
|
+
export {};
|
|
@@ -43,6 +43,8 @@ export type ITuningConfig = {
|
|
|
43
43
|
trackCooldownDecreaseQuality: Milliseconds;
|
|
44
44
|
backgroundVideoQualityLimit: VideoQuality;
|
|
45
45
|
activeVideoAreaThreshold: number;
|
|
46
|
+
trafficSavingLimit: ExactVideoQuality;
|
|
47
|
+
highQualityLimit: ExactVideoQuality;
|
|
46
48
|
};
|
|
47
49
|
droppedFramesChecker: {
|
|
48
50
|
enabled: boolean;
|