@vkontakte/videoplayer-core 2.0.180 → 2.0.181-dev.111b83b80.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 +17 -17
- package/es2015.esm.js +17 -17
- package/esnext.cjs +16 -16
- package/esnext.esm.js +16 -16
- package/evergreen.esm.js +16 -16
- package/package.json +2 -2
- package/types/index.d.ts +2 -2
- package/types/player/Player.d.ts +1 -2
- package/types/player/types.d.ts +4 -8
- package/types/providers/DashProvider/baseDashProvider.d.ts +1 -1
- package/types/providers/DashProvider/lib/buffer.d.ts +1 -0
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +1 -1
- package/types/providers/types.d.ts +1 -3
- package/types/providers/utils/TextTrackManager.d.ts +16 -0
- package/types/utils/buffer/getBackwardBufferDuration.d.ts +3 -0
- package/types/utils/buffer/isPositionBuffered.d.ts +1 -0
- package/types/utils/tuningConfig.d.ts +1 -1
- package/types/providers/utils/HTMLVideoElement/TextTrackManager.d.ts +0 -32
- package/types/utils/setStateWithSubscribe.d.ts +0 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.181-dev.111b83b80.0",
|
|
4
4
|
"author": "vk.ru",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.ru platform",
|
|
6
6
|
"homepage": "https://vk.ru",
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"**/*.d.ts"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@vkontakte/videoplayer-shared": "1.0.
|
|
45
|
+
"@vkontakte/videoplayer-shared": "1.0.110-dev.111b83b80.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { IMpegSource, IDashSource, IHLSSource, IDashURLSource, IHLSLiveSour
|
|
|
3
3
|
import type { VideoCodec } from "./player/types";
|
|
4
4
|
import { VideoFormat, Surface, PredefinedQualityLimits, VideoCodecName } from "./player/types";
|
|
5
5
|
import Player from "./player/Player";
|
|
6
|
-
import type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, ISources,
|
|
6
|
+
import type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, ISources, IExternalTextTrack, ITextTrack, PlaybackRate, IVideoStream, IAudioStream, StartEnd, HttpConnectionMetrics, HttpDownloadMetrics } from "./player/types";
|
|
7
7
|
import { PlaybackState, ChromecastState, HttpConnectionType } from "./player/types";
|
|
8
8
|
import type { IOptionalTuningConfig } from "./utils/tuningConfig";
|
|
9
9
|
export { clientChecker, isMobile } from "./utils/ClientChecker";
|
|
@@ -15,5 +15,5 @@ import { Subscription, Observable, Subject, ValueSubject, VideoQuality } from "@
|
|
|
15
15
|
* @deprecated
|
|
16
16
|
*/
|
|
17
17
|
declare const SDK_VERSION: string;
|
|
18
|
-
export type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, IOptionalTuningConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ISubscription, IUnsubscriber, IObservable, IEmitter, IValueObservable, IValue, IOperator, IListener, IMpegSource, IDashSource, IDashURLSource, IHLSSource, IHLSLiveSource, URLSource, RawSource, URLSourceWithSeek, ExactVideoQuality, IRange, ISeekRequest,
|
|
18
|
+
export type { IPlayer, IPlayerInfo, IPlayerEvents, IConfig, IOptionalTuningConfig, ILogEntry, ISources, IExternalTextTrack, ITextTrack, ISubscription, IUnsubscriber, IObservable, IEmitter, IValueObservable, IValue, IOperator, IListener, IMpegSource, IDashSource, IDashURLSource, IHLSSource, IHLSLiveSource, URLSource, RawSource, URLSourceWithSeek, ExactVideoQuality, IRange, ISeekRequest, PlaybackRate, IVideoStream, IAudioStream, StartEnd, HttpConnectionMetrics, HttpDownloadMetrics };
|
|
19
19
|
export { Player, PlaybackState, ChromecastState, HttpConnectionType, Surface, Subscription, VideoFormat, VideoQuality, Observable, Subject, ValueSubject, VERSION, SDK_VERSION, PredefinedQualityLimits, VideoCodec, VideoCodecName };
|
package/types/player/Player.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IOptionalTuningConfig } from "../utils/tuningConfig";
|
|
2
2
|
import type { ILogEntry, ITracer, QualityLimits, Seconds, VideoQuality, DebugData } from "@vkontakte/videoplayer-shared";
|
|
3
|
-
import { type IAudioStream, type IConfig, type
|
|
3
|
+
import { type IAudioStream, type IConfig, type IExternalTextTrack, type IPlayer, type ITextTrack, type IVideoStream, type PlaybackRate, type PlayerEventsImpl, type PlayerExperimentalImpl, type PlayerInfoImpl, PredefinedQualityLimits } from "./types";
|
|
4
4
|
import type { IPlayerOptions } from "../utils/playerOptions";
|
|
5
5
|
export default class Player implements IPlayer {
|
|
6
6
|
private readonly subscription;
|
|
@@ -71,7 +71,6 @@ export default class Player implements IPlayer {
|
|
|
71
71
|
setPlaybackRate(playbackRate: PlaybackRate): IPlayer;
|
|
72
72
|
setExternalTextTracks(tracks: Omit<IExternalTextTrack, "type">[]): IPlayer;
|
|
73
73
|
selectTextTrack(id: ITextTrack["id"] | undefined): IPlayer;
|
|
74
|
-
setTextTrackCueSettings(settings: ICueSettings): IPlayer;
|
|
75
74
|
setLiveLowLatency(isLowLatency: boolean): IPlayer;
|
|
76
75
|
setLooped(isLooped: boolean): IPlayer;
|
|
77
76
|
toggleChromecast(): void;
|
package/types/player/types.d.ts
CHANGED
|
@@ -56,8 +56,10 @@ export interface IPlayer {
|
|
|
56
56
|
setPlaybackRate(playbackRate: PlaybackRate): IPlayer;
|
|
57
57
|
setLooped(isLooped: boolean): IPlayer;
|
|
58
58
|
setExternalTextTracks(tracks: Omit<IExternalTextTrack, "type">[]): IPlayer;
|
|
59
|
+
/**
|
|
60
|
+
* Запоминает выбранную дорожку субтитров. Отрисовка субтитров на стороне UI
|
|
61
|
+
*/
|
|
59
62
|
selectTextTrack(id: ITextTrack["id"] | undefined): IPlayer;
|
|
60
|
-
setTextTrackCueSettings(settings: ICueSettings): IPlayer;
|
|
61
63
|
setLiveLowLatency(isLowLatency: boolean): IPlayer;
|
|
62
64
|
/**
|
|
63
65
|
* Включает или отключает Chromecast
|
|
@@ -407,7 +409,7 @@ export interface PlayerInfoValues {
|
|
|
407
409
|
*/
|
|
408
410
|
availableTextTracks$: ITextTrack[];
|
|
409
411
|
/**
|
|
410
|
-
* Выбранная
|
|
412
|
+
* Выбранная дорожка субтитров
|
|
411
413
|
*/
|
|
412
414
|
currentTextTrack$: ITextTrack["id"] | undefined;
|
|
413
415
|
/**
|
|
@@ -685,12 +687,6 @@ export interface IInternalTextTrack extends ITextTrackBase {
|
|
|
685
687
|
url: string;
|
|
686
688
|
}
|
|
687
689
|
export type ITextTrack = IExternalTextTrack | IInternalTextTrack;
|
|
688
|
-
export interface ICueSettings {
|
|
689
|
-
align?: "left" | "center" | "right";
|
|
690
|
-
position?: number | "auto";
|
|
691
|
-
size?: number;
|
|
692
|
-
line?: number | "auto";
|
|
693
|
-
}
|
|
694
690
|
export declare enum VideoDestination {
|
|
695
691
|
SCREEN = "SCREEN",
|
|
696
692
|
CHROMECAST = "CHROMECAST"
|
|
@@ -8,7 +8,7 @@ import type { IStateMachine } from "../../utils/StateMachine/types";
|
|
|
8
8
|
import type { ExactVideoQuality, ISubscription, ITracer, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
9
9
|
import { Player } from "./lib/player";
|
|
10
10
|
import DroppedFramesManager from "../utils/HTMLVideoElement/DroppedFramesManager";
|
|
11
|
-
import TextTrackManager from "../utils/
|
|
11
|
+
import TextTrackManager from "../utils/TextTrackManager";
|
|
12
12
|
import StallsManager from "../utils/StallsManager";
|
|
13
13
|
import { AbrManager } from "../utils/Abr/abrManager";
|
|
14
14
|
import { ElementSizeManager } from "../utils/HTMLVideoElement/ElementSizeManager";
|
|
@@ -74,6 +74,7 @@ export declare class BufferManager {
|
|
|
74
74
|
private liveUpdateSegmentIndex;
|
|
75
75
|
private liveInitialAdditionalOffset;
|
|
76
76
|
private isSeekingLive;
|
|
77
|
+
private isBackwardPruneInFlight;
|
|
77
78
|
private index;
|
|
78
79
|
private lastDataObtainedTimestampMs;
|
|
79
80
|
private loadByteRangeSegmentsTimeoutId;
|
|
@@ -7,7 +7,7 @@ import type { IObservableMediaElement } from "../utils/HTMLVideoElement/observab
|
|
|
7
7
|
import type { IStateMachine } from "../../utils/StateMachine/types";
|
|
8
8
|
import type { ExactVideoQuality, ISubscription, ITracer, Milliseconds, Nullable } from "@vkontakte/videoplayer-shared";
|
|
9
9
|
import DroppedFramesManager from "../utils/HTMLVideoElement/DroppedFramesManager";
|
|
10
|
-
import TextTrackManager from "../utils/
|
|
10
|
+
import TextTrackManager from "../utils/TextTrackManager";
|
|
11
11
|
import StallsManager from "../utils/StallsManager";
|
|
12
12
|
import { ElementSizeManager } from "../utils/HTMLVideoElement/ElementSizeManager";
|
|
13
13
|
import type { BasePlayer } from "./lib/player/basePlayer";
|
|
@@ -2,7 +2,7 @@ import type { ITuningConfig } from "../utils/tuningConfig";
|
|
|
2
2
|
import type { IComponentLogger, IError, ILogger, IRange, IRectangle, ISubject, ITracer, IValueSubject, IWarning, Milliseconds, QualityLimits, Seconds } from "@vkontakte/videoplayer-shared";
|
|
3
3
|
import type { IChromecastInitializer } from "./ChromecastProvider/ChromecastInitializer/types";
|
|
4
4
|
import type { IExternalTextTrack, IInternalTextTrack, ITextTrack, IVideoTrack, IVolumeState, PlaybackRate, PlaybackState } from "../player/types";
|
|
5
|
-
import type { AudioCodec, HttpConnectionMetrics, HttpConnectionType, HttpDownloadMetrics, IAudioStream, IAudioTrack,
|
|
5
|
+
import type { AudioCodec, HttpConnectionMetrics, HttpConnectionType, HttpDownloadMetrics, IAudioStream, IAudioTrack, ISources, IVideoStream, SeekState, VideoCodec } from "../player/types";
|
|
6
6
|
import type { IStateMachine } from "../utils/StateMachine/types";
|
|
7
7
|
import type ThroughputEstimator from "../utils/ThroughputEstimator";
|
|
8
8
|
export interface IProvider {
|
|
@@ -44,7 +44,6 @@ export interface DesiredStateValues {
|
|
|
44
44
|
playbackRate: PlaybackRate;
|
|
45
45
|
playbackState: PlaybackState;
|
|
46
46
|
seekState: SeekState;
|
|
47
|
-
textTrackCuesSettings: ICueSettings;
|
|
48
47
|
videoStream: IVideoStream | undefined;
|
|
49
48
|
/**
|
|
50
49
|
* Порядок смены видео дорожек:
|
|
@@ -76,7 +75,6 @@ export interface IProviderOutput {
|
|
|
76
75
|
availableAudioTracks$: IValueSubject<IAudioTrack[]>;
|
|
77
76
|
availableAudioCodecs$: IValueSubject<AudioCodec[]>;
|
|
78
77
|
availableTextTracks$: IValueSubject<ITextTrack[]>;
|
|
79
|
-
currentTextTrack$: IValueSubject<ITextTrack["id"] | undefined>;
|
|
80
78
|
isAudioAvailable$: IValueSubject<boolean>;
|
|
81
79
|
autoVideoTrackLimits$: IValueSubject<QualityLimits | undefined>;
|
|
82
80
|
autoVideoTrackLimitingAvailable$: IValueSubject<boolean>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IExternalTextTrack, IInternalTextTrack } from "../../player/types";
|
|
2
|
+
import type { IDesiredState, IProviderOutput } from "../types";
|
|
3
|
+
declare class TextTrackManager {
|
|
4
|
+
private available$;
|
|
5
|
+
private error$;
|
|
6
|
+
private subscription;
|
|
7
|
+
private externalTracks;
|
|
8
|
+
private internalTracks;
|
|
9
|
+
private emittedIds;
|
|
10
|
+
connect(desiredState: Pick<IDesiredState, "externalTextTracks" | "internalTextTracks">, providerOutput: Pick<IProviderOutput, "availableTextTracks$" | "error$">): void;
|
|
11
|
+
setExternal(tracks: IExternalTextTrack[]): void;
|
|
12
|
+
setInternal(tracks: IInternalTextTrack[]): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
private emitAvailable;
|
|
15
|
+
}
|
|
16
|
+
export default TextTrackManager;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
declare const _default: (timeRanges: TimeRanges, position: Milliseconds, tolerance?: number) => boolean;
|
|
3
3
|
export default _default;
|
|
4
|
+
export declare const isTimeRangeBuffered: (timeRanges: TimeRanges, from: Milliseconds, to: Milliseconds) => boolean;
|
|
@@ -283,6 +283,7 @@ export type ITuningConfig = {
|
|
|
283
283
|
* дешевле замершего воспроизведения.
|
|
284
284
|
*/
|
|
285
285
|
recoverStuckSegmentLoading: boolean;
|
|
286
|
+
skipReloadOfFullyBufferedPartiallyEjectedSegments: boolean;
|
|
286
287
|
};
|
|
287
288
|
dashCmafLive: {
|
|
288
289
|
externalStopControl: boolean;
|
|
@@ -385,7 +386,6 @@ export type ITuningConfig = {
|
|
|
385
386
|
/** @deprecated HLS.js удалён, флаг ничего не делает */
|
|
386
387
|
useHlsJs: boolean;
|
|
387
388
|
disableHlsOnDesktop: boolean;
|
|
388
|
-
useNativeHLSTextTracks: boolean;
|
|
389
389
|
useNewSwitchTo: boolean;
|
|
390
390
|
alwaysAbortPreviousSwitch: boolean;
|
|
391
391
|
useDashProviderVirtual: boolean;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { IExternalTextTrack, IInternalTextTrack, ITextTrack } from "../../../player/types";
|
|
2
|
-
import type { IDesiredState, IProviderOutput } from "../../types";
|
|
3
|
-
/**
|
|
4
|
-
* TODO: сейчас externalTextTracks и internalTextTracks записываются в availableTextTracks отсюда
|
|
5
|
-
* нужно будет выпилить этот класс за исключением этой логики,
|
|
6
|
-
* когда перестанет быть необходима поддержка браузерных субтитров
|
|
7
|
-
*/
|
|
8
|
-
declare class TextTrackManager {
|
|
9
|
-
private available$;
|
|
10
|
-
private current$;
|
|
11
|
-
private error$;
|
|
12
|
-
private video;
|
|
13
|
-
private cueSettings;
|
|
14
|
-
private subscription;
|
|
15
|
-
private externalTracks;
|
|
16
|
-
private internalTracks;
|
|
17
|
-
private baseURL?;
|
|
18
|
-
constructor(baseURL?: string);
|
|
19
|
-
connect(video: HTMLVideoElement, desiredState: Pick<IDesiredState, "externalTextTracks" | "internalTextTracks" | "currentTextTrack" | "textTrackCuesSettings">, providerOutput: Pick<IProviderOutput, "availableTextTracks$" | "currentTextTrack$" | "error$">): void;
|
|
20
|
-
private subscribe;
|
|
21
|
-
private applyCueSettings;
|
|
22
|
-
private htmlTextTracksAsArray;
|
|
23
|
-
private htmlTextTrackToITextTrack;
|
|
24
|
-
private static isHealthyTrack;
|
|
25
|
-
setExternal(tracks: IExternalTextTrack[]): void;
|
|
26
|
-
setInternal(tracks: IInternalTextTrack[]): void;
|
|
27
|
-
select(selectedId: ITextTrack["id"] | undefined): void;
|
|
28
|
-
destroy(): void;
|
|
29
|
-
private attach;
|
|
30
|
-
private detach;
|
|
31
|
-
}
|
|
32
|
-
export default TextTrackManager;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IValueSubject } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
import type { IStateMachine } from "./StateMachine/types";
|
|
3
|
-
export declare const setStateWithSubscribe: <
|
|
4
|
-
State,
|
|
5
|
-
Value
|
|
6
|
-
>(nextState: State | undefined, currentState: IStateMachine<State | undefined>, availableValues: IValueSubject<Array<Value>> | undefined, predicate: (value: Value) => boolean) => void;
|