@vkontakte/videoplayer-core 2.0.162-dev.484b53175.0 → 2.0.162-dev.9e4e0b228.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 +27 -27
- package/es2015.esm.js +27 -27
- package/esnext.cjs +27 -27
- package/esnext.esm.js +27 -27
- package/evergreen.esm.js +27 -27
- package/package.json +2 -2
- package/types/player/Player.d.ts +2 -2
- package/types/player/types.d.ts +2 -24
- package/types/player/utils/selectContainer.d.ts +3 -0
- package/types/providers/ChromecastProvider/types.d.ts +1 -1
- package/types/providers/DashLiveProvider/DashLiveProvider.d.ts +1 -1
- package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +1 -1
- package/types/providers/DashProvider/baseDashProvider.d.ts +2 -2
- package/types/providers/DashProvider/lib/player.d.ts +1 -1
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +2 -2
- package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +2 -2
- package/types/providers/HlsLiveProvider/index.d.ts +1 -1
- package/types/providers/HlsProvider/index.d.ts +1 -1
- package/types/providers/MpegProvider/index.d.ts +1 -1
- package/types/providers/ProviderContainer/index.d.ts +2 -2
- package/types/providers/WebRTCLiveProvider/WebRTCLiveProvider.d.ts +1 -1
- package/types/providers/types.d.ts +4 -9
- package/types/providers/utils/Abr/types.d.ts +2 -2
- package/types/providers/utils/HTMLVideoElement/forcePlay.d.ts +1 -1
- package/types/providers/utils/HTMLVideoElement/observable.d.ts +1 -1
- package/types/providers/utils/HTMLVideoElement/pool.d.ts +1 -1
- package/types/providers/utils/syncDesiredState.d.ts +3 -3
- package/types/utils/changePlaybackRate.d.ts +1 -1
- package/types/player/utils/extractEmbeddableAllocation.d.ts +0 -3
- package/types/providers/utils/createAllocationResolution.d.ts +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vkontakte/videoplayer-core",
|
|
3
|
-
"version": "2.0.162-dev.
|
|
3
|
+
"version": "2.0.162-dev.9e4e0b228.0",
|
|
4
4
|
"author": "vk.com",
|
|
5
5
|
"description": "Videoplayer core library based on the vk.com platform",
|
|
6
6
|
"homepage": "https://vk.com",
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"**/*.d.ts"
|
|
43
43
|
],
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@vkontakte/videoplayer-shared": "1.0.91-dev.
|
|
45
|
+
"@vkontakte/videoplayer-shared": "1.0.91-dev.9e4e0b228.0"
|
|
46
46
|
}
|
|
47
47
|
}
|
package/types/player/Player.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IOptionalTuningConfig } from "../utils/tuningConfig";
|
|
2
|
-
import type { ILogEntry,
|
|
3
|
-
import { type IAudioStream, type IConfig, type ICueSettings, type IExternalTextTrack, type IPlayer, type ITextTrack, type IVideoStream, type PlaybackRate, type
|
|
2
|
+
import type { ILogEntry, Seconds, QualityLimits, VideoQuality, ITracer } from "@vkontakte/videoplayer-shared";
|
|
3
|
+
import { type IAudioStream, type IConfig, type ICueSettings, type IExternalTextTrack, type IPlayer, type ITextTrack, type IVideoStream, type PlaybackRate, PredefinedQualityLimits, type PlayerInfoImpl, type PlayerEventsImpl, type PlayerExperimentalImpl } from "./types";
|
|
4
4
|
import type { IPlayerOptions } from "../utils/playerOptions";
|
|
5
5
|
export default class Player implements IPlayer {
|
|
6
6
|
private readonly subscription;
|
package/types/player/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IObservable, IValueObservable, IValueSubject, ILogEntry, Kbps, Milliseconds, Seconds, IRectangle, IError, QualityLimits, VideoQuality, Subject, ValueSubject } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
import type { Pixel } from "../utils/3d/types";
|
|
3
3
|
import type { dump } from "../utils/playbackTelemetry";
|
|
4
4
|
export interface StartEnd<Unit extends number> {
|
|
@@ -527,9 +527,7 @@ export interface IVolumeState {
|
|
|
527
527
|
muted: boolean;
|
|
528
528
|
}
|
|
529
529
|
export interface IConfig {
|
|
530
|
-
|
|
531
|
-
container?: string | HTMLElement;
|
|
532
|
-
readonly allocation?: TAnyAllocation;
|
|
530
|
+
container: string | HTMLElement;
|
|
533
531
|
sources: ISources;
|
|
534
532
|
meta?: IMetadata;
|
|
535
533
|
failoverHosts?: string[];
|
|
@@ -541,26 +539,6 @@ export interface IConfig {
|
|
|
541
539
|
*/
|
|
542
540
|
handleNetworkRecoverableErrorAsProviderError?: boolean;
|
|
543
541
|
}
|
|
544
|
-
export type TAllocationParent = string | HTMLElement;
|
|
545
|
-
export type TAllocationSelf = HTMLAudioElement;
|
|
546
|
-
export interface IAllocation<Parent extends TAllocationParent = TAllocationParent> {
|
|
547
|
-
readonly strategy: string;
|
|
548
|
-
readonly parent?: Parent;
|
|
549
|
-
readonly self?: TAllocationSelf;
|
|
550
|
-
}
|
|
551
|
-
export interface IEmbeddableAllocation<Parent extends TAllocationParent = TAllocationParent> extends IAllocation<Parent> {
|
|
552
|
-
readonly strategy: "embeddable";
|
|
553
|
-
readonly parent: Parent;
|
|
554
|
-
readonly self?: never;
|
|
555
|
-
}
|
|
556
|
-
export type IStringifiedEmbeddableAllocation = IEmbeddableAllocation<string>;
|
|
557
|
-
export type IDirectEmbeddableAllocation = IEmbeddableAllocation<HTMLElement>;
|
|
558
|
-
export interface IPersonalAllocation extends IAllocation {
|
|
559
|
-
readonly strategy: "personal";
|
|
560
|
-
readonly self: TAllocationSelf;
|
|
561
|
-
readonly parent?: never;
|
|
562
|
-
}
|
|
563
|
-
export type TAnyAllocation = IStringifiedEmbeddableAllocation | IDirectEmbeddableAllocation | IPersonalAllocation;
|
|
564
542
|
export interface ISources {
|
|
565
543
|
[VideoFormat.MPEG]?: IMpegSource;
|
|
566
544
|
[VideoFormat.DASH]?: IDashURLSource;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IMetadata, ISources, VideoFormat } from "../../player/types";
|
|
2
2
|
import type { IProviderParams } from "../types";
|
|
3
3
|
import type { IChromecastConnection } from "./ChromecastInitializer/types";
|
|
4
|
-
export interface IParams extends Omit<IProviderParams<ISources>, "skipVideoElVolumeSync$"
|
|
4
|
+
export interface IParams extends Omit<IProviderParams<ISources>, "skipVideoElVolumeSync$"> {
|
|
5
5
|
meta: IMetadata;
|
|
6
6
|
format: VideoFormat;
|
|
7
7
|
connection: IChromecastConnection;
|
|
@@ -11,7 +11,7 @@ type Params = IProviderParams<IDashURLSource> & {
|
|
|
11
11
|
export default class DashLiveProvider implements IProvider {
|
|
12
12
|
private subscription;
|
|
13
13
|
private volumeSubscription;
|
|
14
|
-
private
|
|
14
|
+
private video;
|
|
15
15
|
private videoState;
|
|
16
16
|
private dash;
|
|
17
17
|
private representations$;
|
|
@@ -5,7 +5,7 @@ import { IRepresentation, State } from "../types";
|
|
|
5
5
|
import { Subject } from "@vkontakte/videoplayer-shared";
|
|
6
6
|
import { PlaybackState } from "../../../player/types";
|
|
7
7
|
interface IParams {
|
|
8
|
-
videoElement:
|
|
8
|
+
videoElement: HTMLVideoElement;
|
|
9
9
|
videoState: IStateMachine<State>;
|
|
10
10
|
playbackState: IStateMachine<PlaybackState>;
|
|
11
11
|
liveOffset: ILiveOffset;
|
|
@@ -2,7 +2,7 @@ import type { IAudioTrack, IDashURLSource, IHLSSource, IInternalTextTrack, IVide
|
|
|
2
2
|
import type { IProviderSubscriptionInfo } from "./lib/types";
|
|
3
3
|
import { ProviderState } from "./lib/types";
|
|
4
4
|
import type { CommonInit, Representation, Stream } from "../utils/parsers/types";
|
|
5
|
-
import type { IProvider,
|
|
5
|
+
import type { IProvider, IProviderParams } from "../types";
|
|
6
6
|
import type { IObservableVideo } from "../utils/HTMLVideoElement/observable";
|
|
7
7
|
import { TrackHistory } from "../../utils/autoSelectTrack";
|
|
8
8
|
import type { IStateMachine } from "../../utils/StateMachine/types";
|
|
@@ -26,7 +26,7 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
26
26
|
protected subscription: ISubscription;
|
|
27
27
|
protected volumeSubscription: ISubscription;
|
|
28
28
|
protected videoState: IStateMachine<ProviderState>;
|
|
29
|
-
protected
|
|
29
|
+
protected video: HTMLVideoElement;
|
|
30
30
|
protected observableVideo: IObservableVideo | null;
|
|
31
31
|
protected player: Player;
|
|
32
32
|
protected params: IParams;
|
|
@@ -89,7 +89,7 @@ export declare class Player {
|
|
|
89
89
|
private dashMaxTvVideoQuality;
|
|
90
90
|
private destroyController;
|
|
91
91
|
constructor(params: Params);
|
|
92
|
-
initManifest: ReturnType<typeof abortable<[
|
|
92
|
+
initManifest: ReturnType<typeof abortable<[HTMLVideoElement, string, number]>>;
|
|
93
93
|
updateManifest: ReturnType<typeof abortable<[], Manifest | null>>;
|
|
94
94
|
setSmartRepresentationSwitch(state: boolean): void;
|
|
95
95
|
seekLive(nextOffset: Milliseconds): Promise<void>;
|
|
@@ -2,7 +2,7 @@ import type { IAudioTrack, IBaseTrack, IDashURLSource, IHLSSource, IInternalText
|
|
|
2
2
|
import type { IProviderSubscriptionInfo } from "./lib/types";
|
|
3
3
|
import { ProviderState } from "./lib/types";
|
|
4
4
|
import type { CommonInit, Representation, Stream } from "../utils/parsers/types";
|
|
5
|
-
import type { IProvider,
|
|
5
|
+
import type { IProvider, IProviderParams } from "../types";
|
|
6
6
|
import type { IObservableVideo } from "../utils/HTMLVideoElement/observable";
|
|
7
7
|
import { TrackHistory } from "../../utils/autoSelectTrack";
|
|
8
8
|
import type { IStateMachine } from "../../utils/StateMachine/types";
|
|
@@ -26,7 +26,7 @@ export default abstract class BaseDashProvider implements IProvider {
|
|
|
26
26
|
protected subscription: ISubscription;
|
|
27
27
|
protected volumeSubscription: ISubscription;
|
|
28
28
|
protected videoState: IStateMachine<ProviderState>;
|
|
29
|
-
protected
|
|
29
|
+
protected video: HTMLVideoElement;
|
|
30
30
|
protected observableVideo: IObservableVideo | null;
|
|
31
31
|
protected player: BasePlayer;
|
|
32
32
|
protected params: IParams;
|
|
@@ -14,7 +14,7 @@ import type { Params } from "./types";
|
|
|
14
14
|
import { State } from "./types";
|
|
15
15
|
import { NativeBufferManager } from "../buffer/nativeBufferManager";
|
|
16
16
|
export declare abstract class BasePlayer {
|
|
17
|
-
protected element:
|
|
17
|
+
protected element: HTMLVideoElement | null;
|
|
18
18
|
protected manifestUrlString: string;
|
|
19
19
|
protected source: MediaSource | null;
|
|
20
20
|
protected manifest: Manifest | null;
|
|
@@ -79,7 +79,7 @@ export declare abstract class BasePlayer {
|
|
|
79
79
|
protected abstract setSourceInitDuration(): void;
|
|
80
80
|
protected abstract restoreAfterDeepStall(stallTraceAttributes: Record<string, number>): Promise<void>;
|
|
81
81
|
initRepresentations: ReturnType<typeof abortable<[Representation["id"], Representation["id"] | undefined, IHLSSource | undefined]>>;
|
|
82
|
-
initManifest(element:
|
|
82
|
+
initManifest(element: HTMLVideoElement, manifestBaseUrlString: string, offset: number): Promise<void>;
|
|
83
83
|
initBuffer(): void;
|
|
84
84
|
switchRepresentation(kind: StreamKind, id: Representation["id"], mode: SwithRepresentationMode): Promise<void>;
|
|
85
85
|
seek(requestedPosition: Milliseconds, forcePrecise?: boolean): Promise<void>;
|
|
@@ -12,7 +12,7 @@ export default class HlsLiveProvider implements IProvider {
|
|
|
12
12
|
private subscription;
|
|
13
13
|
private volumeSubscription;
|
|
14
14
|
private videoState;
|
|
15
|
-
private
|
|
15
|
+
private video;
|
|
16
16
|
private params;
|
|
17
17
|
private textTracksManager;
|
|
18
18
|
private liveTextManager;
|
|
@@ -3,10 +3,10 @@ import { VideoFormat } from "../../player/types";
|
|
|
3
3
|
import type { ITuningConfig } from "../../utils/tuningConfig";
|
|
4
4
|
import type { IError, ISubject, IValueSubject, IRectangle } from "@vkontakte/videoplayer-shared";
|
|
5
5
|
import { ValueSubject } from "@vkontakte/videoplayer-shared";
|
|
6
|
-
import type { IDesiredState, IProviderDependencies, IProviderOutput
|
|
6
|
+
import type { IDesiredState, IProviderDependencies, IProviderOutput } from "../types";
|
|
7
7
|
import type { IProviderContainer, IProviderEntry } from "./types";
|
|
8
8
|
interface IParams extends IProviderDependencies {
|
|
9
|
-
|
|
9
|
+
container: HTMLElement;
|
|
10
10
|
sources: ISources;
|
|
11
11
|
meta: IMetadata;
|
|
12
12
|
failoverHosts: string[];
|
|
@@ -10,7 +10,7 @@ export default class WebRTCLiveProvider implements IProvider {
|
|
|
10
10
|
private readonly volumeSubscription;
|
|
11
11
|
private readonly params;
|
|
12
12
|
private log;
|
|
13
|
-
private
|
|
13
|
+
private video;
|
|
14
14
|
private videoState;
|
|
15
15
|
private liveStreamClient;
|
|
16
16
|
private maxSeekBackTime$;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ITuningConfig } from "../utils/tuningConfig";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ILogger, ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IComponentLogger, ITracer, IRectangle } from "@vkontakte/videoplayer-shared";
|
|
3
3
|
import type { IChromecastInitializer } from "./ChromecastProvider/ChromecastInitializer/types";
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
4
|
+
import type { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics, VideoCodec, AudioCodec, IAudioStream, IAudioTrack, ICueSettings, ISources, IVideoStream, SeekState } from "../player/types";
|
|
5
|
+
import type { IExternalTextTrack, IInternalTextTrack, ITextTrack, IVideoTrack, IVolumeState, PlaybackState, PlaybackRate } from "../player/types";
|
|
6
6
|
import type { IStateMachine } from "../utils/StateMachine/types";
|
|
7
7
|
import type ThroughputEstimator from "../utils/ThroughputEstimator";
|
|
8
8
|
import type { Scene3D } from "../utils/3d/Scene3D";
|
|
@@ -21,7 +21,7 @@ export interface IProviderDependencies {
|
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
export interface IProviderParams<TSourceType> extends IProviderDependencies {
|
|
24
|
-
|
|
24
|
+
container: HTMLElement;
|
|
25
25
|
source: TSourceType;
|
|
26
26
|
desiredState: IDesiredState;
|
|
27
27
|
output: IProviderOutput;
|
|
@@ -129,8 +129,3 @@ export interface IProviderOutput {
|
|
|
129
129
|
playbackState$: IValueSubject<PlaybackState | string>;
|
|
130
130
|
getCurrentTime$: IValueSubject<(() => number) | null>;
|
|
131
131
|
}
|
|
132
|
-
export type TProviderAllocation = Extract<TAnyAllocation, IDirectEmbeddableAllocation | IPersonalAllocation>;
|
|
133
|
-
export interface IProviderAllocationResolution {
|
|
134
|
-
readonly target: HTMLMediaElement;
|
|
135
|
-
readonly video: HTMLVideoElement | null;
|
|
136
|
-
}
|
|
@@ -55,7 +55,7 @@ export interface IInitAbrManagerContext {
|
|
|
55
55
|
throughput$: IValueSubject<Kbps>;
|
|
56
56
|
rtt$: IValueSubject<Milliseconds>;
|
|
57
57
|
throughputVariance$?: IValueSubject<number>;
|
|
58
|
-
element:
|
|
58
|
+
element: HTMLVideoElement;
|
|
59
59
|
failedVideoTrack: Nullable<IVideoTrack>;
|
|
60
60
|
abrLogger: IComponentLogger;
|
|
61
61
|
panelSize?: IRectangle;
|
|
@@ -63,7 +63,7 @@ export interface IInitAbrManagerContext {
|
|
|
63
63
|
export interface IVideoElementAbrManagerContext {
|
|
64
64
|
observableVideo: IObservableVideo;
|
|
65
65
|
elementVisible$: IValueSubject<boolean>;
|
|
66
|
-
elementSizeManager
|
|
66
|
+
elementSizeManager: ElementSizeManager;
|
|
67
67
|
}
|
|
68
68
|
export interface IVideoTracksContext {
|
|
69
69
|
videoTracksAsc: IVideoTrack[];
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
* @param {Function} soundNotAllowedCallback - колбэк, который вызовется если нам не разрешили играть со звуком
|
|
5
5
|
* @return {Promise}<boolean> - получилось начать воспроизведение
|
|
6
6
|
*/
|
|
7
|
-
declare const _default: (video:
|
|
7
|
+
declare const _default: (video: HTMLVideoElement, soundNotAllowedCallback?: () => void) => Promise<boolean>;
|
|
8
8
|
export default _default;
|
|
@@ -25,4 +25,4 @@ export interface IObservableVideo {
|
|
|
25
25
|
leavePip$: IObservable<PictureInPictureEvent>;
|
|
26
26
|
destroy: () => void;
|
|
27
27
|
}
|
|
28
|
-
export declare const observe: (video:
|
|
28
|
+
export declare const observe: (video: HTMLVideoElement) => IObservableVideo;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ITuningConfig } from "../../../utils/tuningConfig";
|
|
2
|
-
|
|
2
|
+
type AllocateConstraints = Pick<ITuningConfig, "audioVideoSyncRate" | "disableYandexPiP" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
|
|
3
3
|
type DisposeConstraints = Pick<ITuningConfig, "keepVideoElement" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
|
|
4
4
|
export declare const allocate: (container: HTMLElement, { audioVideoSyncRate, disableYandexPiP, clearVideoElementInnerHTML, reuseOwnVideoElement }: AllocateConstraints) => HTMLVideoElement;
|
|
5
5
|
export declare const dispose: (videoElement: HTMLVideoElement, { keepVideoElement, clearVideoElementInnerHTML, reuseOwnVideoElement }: DisposeConstraints) => void;
|
|
@@ -6,9 +6,9 @@ declare const syncDesiredState: <Value>(desiredState: IStateMachine<Value | unde
|
|
|
6
6
|
changed$?: IObservable<Value | undefined>;
|
|
7
7
|
onError?: IListener<Error | unknown>;
|
|
8
8
|
}) => ISubscription;
|
|
9
|
-
export declare const syncVideoLooped: (video:
|
|
10
|
-
export declare const syncVideoVolumeState: (video:
|
|
9
|
+
export declare const syncVideoLooped: (video: HTMLVideoElement, desiredState: IStateMachine<boolean>, onError?: IListener<Error | unknown>) => ISubscription;
|
|
10
|
+
export declare const syncVideoVolumeState: (video: HTMLVideoElement, desiredState: IStateMachine<IVolumeState>, changed$: IObservable<IVolumeState>, onError?: IListener<Error | unknown>, params?: {
|
|
11
11
|
skipVideoElVolumeSync$: IValueSubject<boolean>;
|
|
12
12
|
}) => ISubscription;
|
|
13
|
-
export declare const syncVideoPlaybackRate: (video:
|
|
13
|
+
export declare const syncVideoPlaybackRate: (video: HTMLVideoElement, desiredState: IStateMachine<PlaybackRate>, changed$: IObservable<PlaybackRate>, onError?: IListener<Error | unknown>) => ISubscription;
|
|
14
14
|
export default syncDesiredState;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Nullable } from "@vkontakte/videoplayer-shared";
|
|
2
|
-
export declare const changePlaybackRate: (element: Nullable<
|
|
2
|
+
export declare const changePlaybackRate: (element: Nullable<HTMLVideoElement>, targetPlaybackRate: number) => void;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { IProviderAllocationResolution, TProviderAllocation } from "../types";
|
|
2
|
-
import { type AllocateConstraints } from "./HTMLVideoElement/pool";
|
|
3
|
-
export declare function resolveAllocation(allocation: TProviderAllocation, constraints: AllocateConstraints): IProviderAllocationResolution;
|