@vkontakte/videoplayer-core 2.0.34 → 2.0.35
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/package.json
CHANGED
package/player/Player.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export default class Player implements IPlayer {
|
|
|
46
46
|
startAttempt$: Subject<StartStatus>;
|
|
47
47
|
willPause$: Subject<void>;
|
|
48
48
|
willResume$: Subject<void>;
|
|
49
|
+
willDestruct$: Subject<void>;
|
|
49
50
|
watchCoverageRecord$: Subject<IRange<number>>;
|
|
50
51
|
watchCoverageLive$: Subject<IRange<number>>;
|
|
51
52
|
managedError$: Subject<IError>;
|
package/player/types.d.ts
CHANGED
|
@@ -78,6 +78,10 @@ export interface IPlayerEvents {
|
|
|
78
78
|
* Запрошено возобновление воспроизведения после паузы
|
|
79
79
|
*/
|
|
80
80
|
willResume$: IObservable<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Плеер будет уничтожен, в момент события можно синхронно запросить последние данные о его состоянии.
|
|
83
|
+
*/
|
|
84
|
+
willDestruct$: IObservable<void>;
|
|
81
85
|
/**
|
|
82
86
|
* Просмотрен промежуток видео.
|
|
83
87
|
* Параметр содержит диапазон: начальная и конечная позиция просмотра (в секундах от начала ролика).
|
|
@@ -2,13 +2,12 @@ import { IObservable, IValueObservable } from '@vkontakte/videoplayer-shared';
|
|
|
2
2
|
import { IRange } from "../../utils/range";
|
|
3
3
|
import { IStateMachine } from "../../utils/StateMachine/types";
|
|
4
4
|
import { PlaybackState } from "../types";
|
|
5
|
-
import { IProviderEntry } from "../../providers/ProviderContainer/types";
|
|
6
5
|
interface IParams {
|
|
7
6
|
playbackState: IStateMachine<PlaybackState>;
|
|
8
7
|
seekPosition: IStateMachine<number | undefined>;
|
|
9
|
-
|
|
8
|
+
playbackAbort$: IObservable<void>;
|
|
10
9
|
position$: IValueObservable<number>;
|
|
11
10
|
}
|
|
12
|
-
export declare const watchCoverageRecord: ({ playbackState, seekPosition,
|
|
13
|
-
export declare const watchCoverageLive: ({ playbackState, seekPosition,
|
|
11
|
+
export declare const watchCoverageRecord: ({ playbackState, seekPosition, playbackAbort$, position$, }: IParams) => IObservable<IRange<number>>;
|
|
12
|
+
export declare const watchCoverageLive: ({ playbackState, seekPosition, playbackAbort$, position$, }: IParams) => IObservable<IRange<number>>;
|
|
14
13
|
export {};
|
|
@@ -2,7 +2,7 @@ import { Representation, RepresentationKind } from "./types";
|
|
|
2
2
|
import StateMachine from "../../../utils/StateMachine/StateMachine";
|
|
3
3
|
import type ThroughputEstimator from "../../../utils/ThroughputEstimator";
|
|
4
4
|
import { ITuningConfig } from "../../../utils/tuningConfig";
|
|
5
|
-
import { IValueSubject, Milliseconds } from '@vkontakte/videoplayer-shared';
|
|
5
|
+
import { ISubject, IValueSubject, Milliseconds, IError } from '@vkontakte/videoplayer-shared';
|
|
6
6
|
import { Manifest } from './mpd';
|
|
7
7
|
export declare enum State {
|
|
8
8
|
NONE = "none",
|
|
@@ -17,14 +17,15 @@ export declare class Player {
|
|
|
17
17
|
private element;
|
|
18
18
|
private source;
|
|
19
19
|
private manifest;
|
|
20
|
+
private tuning;
|
|
20
21
|
private videoBufferManager;
|
|
21
22
|
private audioBufferManager;
|
|
22
23
|
private throughputEstimator;
|
|
23
24
|
private subscription;
|
|
24
25
|
state$: StateMachine<State>;
|
|
25
26
|
currentVideoRepresentation$: IValueSubject<Representation['id'] | undefined>;
|
|
27
|
+
error$: ISubject<IError>;
|
|
26
28
|
private forceEnded$;
|
|
27
|
-
private tuning;
|
|
28
29
|
constructor(params: Params);
|
|
29
30
|
initManifest(element: HTMLVideoElement, manifestUrl: string): Promise<Manifest>;
|
|
30
31
|
initRepresentations(initialVideo: Representation['id'], initialAudio: Representation['id']): Promise<void>;
|
package/utils/tuningConfig.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare type ITuningConfig = {
|
|
|
30
30
|
insufficientBufferRuleMargin: Milliseconds;
|
|
31
31
|
dashSeekInSegmentDurationThreshold: Milliseconds;
|
|
32
32
|
dashSeekInSegmentAlwaysSeekDelta: Milliseconds;
|
|
33
|
-
|
|
33
|
+
endGapTolerance: Milliseconds;
|
|
34
34
|
};
|
|
35
35
|
export declare type IOptionalTuningConfig = {
|
|
36
36
|
[key in keyof ITuningConfig]?: Partial<ITuningConfig[key]>;
|