@vkontakte/videoplayer-core 2.0.155 → 2.0.156-dev.04ce2cd1.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 +83 -136
- package/es2015.esm.js +77 -130
- package/es2018.cjs +77 -130
- package/es2018.esm.js +75 -128
- package/es2024.cjs +83 -136
- package/es2024.esm.js +81 -134
- package/esnext.cjs +83 -136
- package/esnext.esm.js +81 -134
- package/evergreen.esm.js +82 -135
- package/package.json +2 -2
- package/types/enums/AndroidPreferredFormat.d.ts +6 -6
- package/types/enums/IOSPreferredFormat.d.ts +2 -2
- package/types/enums/WebmCodecStrategy.d.ts +5 -5
- package/types/index.d.ts +16 -13
- package/types/player/Player.d.ts +219 -210
- package/types/player/types.d.ts +595 -591
- package/types/player/utils/optimisticPosition.d.ts +7 -7
- package/types/player/utils/selectContainer.d.ts +1 -1
- package/types/providers/ChromecastPresentationApiProvider/ChromecastPresentationApiConnector.d.ts +107 -106
- package/types/providers/ChromecastPresentationApiProvider/ChromecastPresentationApiInitializer.d.ts +23 -23
- package/types/providers/ChromecastPresentationApiProvider/ChromecastPresentationApiProvider.d.ts +34 -34
- package/types/providers/ChromecastPresentationApiProvider/ProgressTicker.d.ts +9 -9
- package/types/providers/ChromecastPresentationApiProvider/index.d.ts +3 -3
- package/types/providers/ChromecastPresentationApiProvider/types.d.ts +31 -31
- package/types/providers/ChromecastPresentationApiProvider/utils.d.ts +1 -1
- package/types/providers/ChromecastProvider/ChromecastInitializer/index.d.ts +22 -22
- package/types/providers/ChromecastProvider/ChromecastInitializer/types.d.ts +22 -22
- package/types/providers/ChromecastProvider/index.d.ts +23 -23
- package/types/providers/ChromecastProvider/types.d.ts +7 -7
- package/types/providers/ChromecastProvider/utils.d.ts +1 -1
- package/types/providers/DashLiveProvider/DashLiveProvider.d.ts +33 -33
- package/types/providers/DashLiveProvider/index.d.ts +1 -1
- package/types/providers/DashLiveProvider/types.d.ts +17 -17
- package/types/providers/DashLiveProvider/utils/FilesFetcher.d.ts +23 -23
- package/types/providers/DashLiveProvider/utils/LiveDashPlayer.d.ts +149 -150
- package/types/providers/DashLiveProvider/utils/ThroughputEstimator.d.ts +12 -30
- package/types/providers/DashLiveProvider/utils/liveDashPlayerUtil.d.ts +19 -22
- package/types/providers/DashProvider/baseDashProvider.d.ts +57 -56
- package/types/providers/DashProvider/dashCmafLiveProvider.d.ts +6 -6
- package/types/providers/DashProvider/dashProvider.d.ts +4 -4
- package/types/providers/DashProvider/index.d.ts +2 -2
- package/types/providers/DashProvider/lib/ElementSizeManager.d.ts +14 -14
- package/types/providers/DashProvider/lib/LiveTextManager.d.ts +21 -21
- package/types/providers/DashProvider/lib/buffer.d.ts +123 -122
- package/types/providers/DashProvider/lib/fetcher.d.ts +70 -69
- package/types/providers/DashProvider/lib/player.d.ts +109 -107
- package/types/providers/DashProvider/lib/sourceBufferTaskQueue.d.ts +17 -17
- package/types/providers/DashProvider/lib/types.d.ts +20 -20
- package/types/providers/DashProvider/lib/utils.d.ts +4 -4
- package/types/providers/DashProviderVirtual/baseDashProvider.d.ts +58 -57
- package/types/providers/DashProviderVirtual/consts.d.ts +2 -2
- package/types/providers/DashProviderVirtual/dashCmafLiveProvider.d.ts +8 -8
- package/types/providers/DashProviderVirtual/dashProvider.d.ts +6 -6
- package/types/providers/DashProviderVirtual/index.d.ts +2 -2
- package/types/providers/DashProviderVirtual/lib/ElementSizeManager.d.ts +15 -14
- package/types/providers/DashProviderVirtual/lib/LiveTextManager.d.ts +21 -21
- package/types/providers/DashProviderVirtual/lib/buffer/nativeBufferManager.d.ts +17 -17
- package/types/providers/DashProviderVirtual/lib/buffer/sourceBufferTaskQueue.d.ts +17 -17
- package/types/providers/DashProviderVirtual/lib/buffer/types.d.ts +39 -39
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/baseVirtualBufferManager.d.ts +94 -92
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/byteRangeVirtualBufferManager.d.ts +19 -19
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/liveVirtualBuffer.d.ts +25 -25
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/templateVirtualBufferManager.d.ts +19 -19
- package/types/providers/DashProviderVirtual/lib/buffer/virtualBuffer/virtualBufferFactory.d.ts +4 -4
- package/types/providers/DashProviderVirtual/lib/fetcher.d.ts +68 -67
- package/types/providers/DashProviderVirtual/lib/player/basePlayer.d.ts +103 -100
- package/types/providers/DashProviderVirtual/lib/player/livePlayer.d.ts +34 -34
- package/types/providers/DashProviderVirtual/lib/player/player.d.ts +9 -9
- package/types/providers/DashProviderVirtual/lib/player/types.d.ts +13 -13
- package/types/providers/DashProviderVirtual/lib/types.d.ts +20 -20
- package/types/providers/DashProviderVirtual/lib/utils.d.ts +4 -4
- package/types/providers/HlsLiveProvider/LiveTextManager.d.ts +35 -35
- package/types/providers/HlsLiveProvider/index.d.ts +29 -28
- package/types/providers/HlsLiveProvider/seekBackTimeExtractor.d.ts +1 -1
- package/types/providers/HlsProvider/index.d.ts +19 -19
- package/types/providers/HlsProvider/manifestDataExtractor.d.ts +13 -13
- package/types/providers/MpegProvider/index.d.ts +17 -17
- package/types/providers/ProviderContainer/index.d.ts +47 -45
- package/types/providers/ProviderContainer/types.d.ts +16 -16
- package/types/providers/ProviderContainer/utils/formatsSupport.d.ts +9 -9
- package/types/providers/ProviderContainer/utils/playbackHangup.d.ts +9 -8
- package/types/providers/WebRTCLiveProvider/WebRTCLiveClient.d.ts +185 -185
- package/types/providers/WebRTCLiveProvider/WebRTCLiveProvider.d.ts +58 -57
- package/types/providers/WebRTCLiveProvider/interface/WebRTCLiveClientOptions.d.ts +6 -6
- package/types/providers/types.d.ts +103 -102
- package/types/providers/utils/HTMLVideoElement/DroppedFramesManager.d.ts +40 -39
- package/types/providers/utils/HTMLVideoElement/TextTrackManager.d.ts +28 -28
- package/types/providers/utils/HTMLVideoElement/forcePlay.d.ts +5 -5
- package/types/providers/utils/HTMLVideoElement/observable.d.ts +25 -25
- package/types/providers/utils/HTMLVideoElement/pool.d.ts +5 -4
- package/types/providers/utils/LiveOffset/index.d.ts +12 -12
- package/types/providers/utils/LiveOffset/types.d.ts +8 -8
- package/types/providers/utils/StallsManager.d.ts +49 -49
- package/types/providers/utils/debug.d.ts +13 -12
- package/types/providers/utils/extractConnectionHeaders.d.ts +3 -3
- package/types/providers/utils/generateLiveUrl.d.ts +4 -4
- package/types/providers/utils/guessNetworkErrorCause.d.ts +1 -1
- package/types/providers/utils/mergeIntervals.d.ts +1 -1
- package/types/providers/utils/okQualityStringToVideoQuality.d.ts +1 -1
- package/types/providers/utils/parsers/ietf/index.d.ts +8 -8
- package/types/providers/utils/parsers/index.d.ts +1 -1
- package/types/providers/utils/parsers/mpd.d.ts +1 -1
- package/types/providers/utils/parsers/mpeg/BoxModel.d.ts +18 -17
- package/types/providers/utils/parsers/mpeg/BoxParser.d.ts +15 -15
- package/types/providers/utils/parsers/mpeg/BoxTypeEnum.d.ts +27 -27
- package/types/providers/utils/parsers/mpeg/box.d.ts +68 -68
- package/types/providers/utils/parsers/mpeg/boxes/avc1.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/equi.d.ts +18 -18
- package/types/providers/utils/parsers/mpeg/boxes/ftyp.d.ts +14 -14
- package/types/providers/utils/parsers/mpeg/boxes/index.d.ts +27 -26
- package/types/providers/utils/parsers/mpeg/boxes/mdat.d.ts +12 -12
- package/types/providers/utils/parsers/mpeg/boxes/mdia.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/mfhd.d.ts +8 -8
- package/types/providers/utils/parsers/mpeg/boxes/minf.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/moof.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/moov.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/mvhd.d.ts +32 -32
- package/types/providers/utils/parsers/mpeg/boxes/prhd.d.ts +13 -13
- package/types/providers/utils/parsers/mpeg/boxes/proj.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/sidx.d.ts +43 -43
- package/types/providers/utils/parsers/mpeg/boxes/st3d.d.ts +16 -16
- package/types/providers/utils/parsers/mpeg/boxes/stbl.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/stsd.d.ts +8 -8
- package/types/providers/utils/parsers/mpeg/boxes/sv3d.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/tfdt.d.ts +14 -14
- package/types/providers/utils/parsers/mpeg/boxes/tfhd.d.ts +19 -19
- package/types/providers/utils/parsers/mpeg/boxes/tkhd.d.ts +39 -39
- package/types/providers/utils/parsers/mpeg/boxes/traf.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/trak.d.ts +5 -5
- package/types/providers/utils/parsers/mpeg/boxes/trun.d.ts +28 -28
- package/types/providers/utils/parsers/mpeg/boxes/unknown.d.ts +4 -5
- package/types/providers/utils/parsers/mpeg/boxes/uuid.d.ts +10 -10
- package/types/providers/utils/parsers/mpeg/fullBox.d.ts +12 -12
- package/types/providers/utils/parsers/mpeg/isobmff.d.ts +7 -7
- package/types/providers/utils/parsers/types.d.ts +137 -139
- package/types/providers/utils/parsers/webm/ebml.d.ts +62 -62
- package/types/providers/utils/parsers/webm/webm.d.ts +1 -1
- package/types/providers/utils/restorePlaybackRateInSafari.d.ts +17 -17
- package/types/providers/utils/syncDesiredState.d.ts +10 -10
- package/types/providers/utils/syncPlaybackState.d.ts +2 -2
- package/types/providers/utils/videoStreamRepresentaionsFilter.d.ts +2 -2
- package/types/utils/3d/Camera3D.d.ts +11 -11
- package/types/utils/3d/CameraRotationManager.d.ts +59 -59
- package/types/utils/3d/Scene3D.d.ts +129 -129
- package/types/utils/3d/types.d.ts +14 -14
- package/types/utils/ClientChecker/ClientChecker.d.ts +19 -19
- package/types/utils/ClientChecker/index.d.ts +2 -2
- package/types/utils/ClientChecker/services/AudioChecker.d.ts +7 -7
- package/types/utils/ClientChecker/services/BrowserChecker.d.ts +36 -36
- package/types/utils/ClientChecker/services/DeviceChecker.d.ts +38 -38
- package/types/utils/ClientChecker/services/DisplayChecker.d.ts +20 -20
- package/types/utils/ClientChecker/services/VideoChecker.d.ts +35 -35
- package/types/utils/ClientChecker/types/checker.d.ts +1 -1
- package/types/utils/ClientChecker/types/currentClientBrowser.d.ts +10 -10
- package/types/utils/ClientChecker/types/currentClientDevice.d.ts +8 -8
- package/types/utils/ClientChecker/types/userAgentData.d.ts +21 -21
- package/types/utils/StateMachine/StateMachine.d.ts +17 -17
- package/types/utils/StateMachine/types.d.ts +56 -56
- package/types/utils/StatefulIterator/index.d.ts +13 -13
- package/types/utils/ThroughputEstimator.d.ts +22 -22
- package/types/utils/VolumeMultiplierManager/VolumeMultiplierManager.d.ts +20 -20
- package/types/utils/VolumeMultiplierManager/index.d.ts +1 -1
- package/types/utils/autoSelectTrack.d.ts +28 -27
- package/types/utils/buffer/createTimeRanges.d.ts +2 -1
- package/types/utils/buffer/getBufferedRangeForPosition.d.ts +2 -2
- package/types/utils/buffer/getForwardBufferDuration.d.ts +1 -1
- package/types/utils/buffer/getTotalBufferDuration.d.ts +1 -1
- package/types/utils/buffer/isPositionBuffered.d.ts +1 -1
- package/types/utils/buffer/isSourceBufferValid.d.ts +1 -1
- package/types/utils/changePlaybackRate.d.ts +1 -1
- package/types/utils/decodingInfoLogger.d.ts +1 -1
- package/types/utils/mediaSource.d.ts +1 -5
- package/types/utils/observeElementVisibility.d.ts +1 -1
- package/types/utils/playbackTelemetry.d.ts +4 -4
- package/types/utils/playerOptions.d.ts +3 -3
- package/types/utils/qualityLimits.d.ts +15 -14
- package/types/utils/setStateWithSubscribe.d.ts +6 -3
- package/types/utils/smoothedValue/baseSmoothedValue.d.ts +16 -16
- package/types/utils/smoothedValue/emaAndMaSmoothedValue.d.ts +5 -5
- package/types/utils/smoothedValue/emaTopExtremumValue.d.ts +8 -8
- package/types/utils/smoothedValue/smoothedValueFactory.d.ts +4 -4
- package/types/utils/smoothedValue/twoEmaSmoothedValue.d.ts +6 -6
- package/types/utils/smoothedValue/types.d.ts +16 -16
- package/types/utils/tuningConfig.d.ts +304 -287
- package/types/utils/videoFormat.d.ts +1 -1
|
@@ -1,112 +1,113 @@
|
|
|
1
|
-
import { ITuningConfig } from
|
|
2
|
-
import { ILogger, ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IComponentLogger, ITracer, IRectangle } from
|
|
3
|
-
import { IChromecastInitializer } from
|
|
4
|
-
import { HttpConnectionType, HttpConnectionMetrics, HttpDownloadMetrics, VideoCodec, AudioCodec, IAudioStream, IAudioTrack, ICueSettings, ISources, IVideoStream, SeekState } from
|
|
5
|
-
import { IExternalTextTrack, IInternalTextTrack, ITextTrack, IVideoTrack, IVolumeState, PlaybackState, PlaybackRate } from
|
|
6
|
-
import { IStateMachine } from
|
|
7
|
-
import ThroughputEstimator from
|
|
8
|
-
import { Scene3D } from
|
|
9
|
-
import { Vector2D } from
|
|
1
|
+
import type { ITuningConfig } from "../utils/tuningConfig";
|
|
2
|
+
import type { ILogger, ISubject, IValueSubject, Milliseconds, Seconds, IRange, IError, QualityLimits, IWarning, IComponentLogger, ITracer, IRectangle } from "@vkontakte/videoplayer-shared";
|
|
3
|
+
import type { IChromecastInitializer } from "./ChromecastProvider/ChromecastInitializer/types";
|
|
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
|
+
import type { IStateMachine } from "../utils/StateMachine/types";
|
|
7
|
+
import type ThroughputEstimator from "../utils/ThroughputEstimator";
|
|
8
|
+
import type { Scene3D } from "../utils/3d/Scene3D";
|
|
9
|
+
import type { Vector2D } from "../utils/3d/types";
|
|
10
10
|
export interface IProvider {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
scene3D?: Scene3D;
|
|
12
|
+
destroy(): void;
|
|
13
13
|
}
|
|
14
14
|
export interface IProviderDependencies {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
dependencies: {
|
|
16
|
+
throughputEstimator: ThroughputEstimator;
|
|
17
|
+
chromecastInitializer: IChromecastInitializer;
|
|
18
|
+
logger: ILogger;
|
|
19
|
+
tracer: ITracer;
|
|
20
|
+
abrLogger: IComponentLogger;
|
|
21
|
+
};
|
|
22
22
|
}
|
|
23
23
|
export interface IProviderParams<TSourceType> extends IProviderDependencies {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
container: HTMLElement;
|
|
25
|
+
source: TSourceType;
|
|
26
|
+
desiredState: IDesiredState;
|
|
27
|
+
output: IProviderOutput;
|
|
28
|
+
tuning: ITuningConfig;
|
|
29
|
+
panelSize?: IRectangle;
|
|
30
|
+
skipVideoElVolumeSync$: IValueSubject<boolean>;
|
|
30
31
|
}
|
|
31
32
|
export interface IDesiredState {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
33
|
+
playbackState: IStateMachine<PlaybackState>;
|
|
34
|
+
seekState: IStateMachine<SeekState>;
|
|
35
|
+
volume: IStateMachine<IVolumeState>;
|
|
36
|
+
playbackRate: IStateMachine<PlaybackRate>;
|
|
37
|
+
isLooped: IStateMachine<boolean>;
|
|
38
|
+
isLowLatency: IStateMachine<boolean>;
|
|
39
|
+
videoStream: IStateMachine<IVideoStream | undefined>;
|
|
40
|
+
videoTrack: IStateMachine<IVideoTrack | undefined>;
|
|
41
|
+
audioStream: IStateMachine<IAudioStream | undefined>;
|
|
42
|
+
autoVideoTrackSwitching: IStateMachine<boolean>;
|
|
43
|
+
autoVideoTrackLimits: IStateMachine<QualityLimits>;
|
|
44
|
+
externalTextTracks: IStateMachine<IExternalTextTrack[]>;
|
|
45
|
+
internalTextTracks: IStateMachine<IInternalTextTrack[]>;
|
|
46
|
+
currentTextTrack: IStateMachine<ITextTrack["id"] | undefined>;
|
|
47
|
+
textTrackCuesSettings: IStateMachine<ICueSettings>;
|
|
48
|
+
cameraOrientation: IStateMachine<Vector2D>;
|
|
48
49
|
}
|
|
49
50
|
export interface IProviderOutput {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
51
|
+
position$: IValueSubject<Seconds>;
|
|
52
|
+
duration$: IValueSubject<Seconds>;
|
|
53
|
+
volume$: IValueSubject<IVolumeState>;
|
|
54
|
+
currentVideoSegmentLength$: IValueSubject<number>;
|
|
55
|
+
currentAudioSegmentLength$: IValueSubject<number>;
|
|
56
|
+
availableVideoStreams$: IValueSubject<IVideoStream[]>;
|
|
57
|
+
currentVideoStream$: IValueSubject<IVideoStream | undefined>;
|
|
58
|
+
availableVideoTracks$: IValueSubject<IVideoTrack[]>;
|
|
59
|
+
currentVideoTrack$: IValueSubject<IVideoTrack | undefined>;
|
|
60
|
+
availableVideoCodecs$: IValueSubject<VideoCodec[]>;
|
|
61
|
+
availableAudioStreams$: IValueSubject<IAudioStream[]>;
|
|
62
|
+
currentAudioStream$: IValueSubject<IAudioStream | undefined>;
|
|
63
|
+
availableAudioTracks$: IValueSubject<IAudioTrack[]>;
|
|
64
|
+
availableAudioCodecs$: IValueSubject<AudioCodec[]>;
|
|
65
|
+
availableTextTracks$: IValueSubject<ITextTrack[]>;
|
|
66
|
+
currentTextTrack$: IValueSubject<ITextTrack["id"] | undefined>;
|
|
67
|
+
isAudioAvailable$: IValueSubject<boolean>;
|
|
68
|
+
autoVideoTrackLimits$: IValueSubject<QualityLimits | undefined>;
|
|
69
|
+
autoVideoTrackLimitingAvailable$: IValueSubject<boolean>;
|
|
70
|
+
canChangePlaybackSpeed$: IValueSubject<boolean | undefined>;
|
|
71
|
+
currentBuffer$: IValueSubject<IRange<Seconds> | undefined>;
|
|
72
|
+
currentNativeBuffer$: IValueSubject<IRange<Seconds> | undefined>;
|
|
73
|
+
isBuffering$: IValueSubject<boolean>;
|
|
74
|
+
isLive$: IValueSubject<boolean | undefined>;
|
|
75
|
+
isLiveEnded$: IValueSubject<boolean | null>;
|
|
76
|
+
canPlayLiveTailBuffer$: IValueSubject<boolean>;
|
|
77
|
+
isLowLatency$: IValueSubject<boolean | undefined>;
|
|
78
|
+
liveTime$: IValueSubject<Milliseconds | undefined>;
|
|
79
|
+
liveBufferTime$: IValueSubject<Seconds | undefined>;
|
|
80
|
+
liveLatency$: IValueSubject<Milliseconds | undefined>;
|
|
81
|
+
hostname$: IValueSubject<string | undefined>;
|
|
82
|
+
httpConnectionType$: IValueSubject<HttpConnectionType | undefined>;
|
|
83
|
+
httpConnectionReused$: IValueSubject<boolean | undefined>;
|
|
84
|
+
httpConnectionMetrics$: IValueSubject<HttpConnectionMetrics | undefined>;
|
|
85
|
+
httpDownloadMetrics$: IValueSubject<HttpDownloadMetrics | undefined>;
|
|
86
|
+
element$: IValueSubject<HTMLVideoElement | undefined>;
|
|
87
|
+
elementVisible$: IValueSubject<boolean>;
|
|
88
|
+
availableSources$: IValueSubject<ISources | undefined>;
|
|
89
|
+
willSeekEvent$: ISubject<void>;
|
|
90
|
+
seekedEvent$: ISubject<void>;
|
|
91
|
+
error$: ISubject<IError>;
|
|
92
|
+
fetcherRecoverableError$: ISubject<IError>;
|
|
93
|
+
fetcherError$: ISubject<IError>;
|
|
94
|
+
warning$: ISubject<IWarning>;
|
|
95
|
+
endedEvent$: ISubject<void>;
|
|
96
|
+
loopedEvent$: ISubject<Seconds>;
|
|
97
|
+
manifestRequested$: ISubject<void>;
|
|
98
|
+
firstBytesManifest$: ISubject<void>;
|
|
99
|
+
manifestReceived$: ISubject<void>;
|
|
100
|
+
firstBytesRequested$: ISubject<void>;
|
|
101
|
+
firstBytesReceived$: ISubject<void>;
|
|
102
|
+
firstBytesEvent$: ISubject<Milliseconds | void>;
|
|
103
|
+
loadedMetadataEvent$: ISubject<void>;
|
|
104
|
+
firstFrameEvent$: ISubject<void>;
|
|
105
|
+
soundProhibitedEvent$: ISubject<void>;
|
|
106
|
+
canplay$: ISubject<void>;
|
|
107
|
+
severeStallOccurred$: ISubject<boolean>;
|
|
108
|
+
is3DVideo$: ISubject<boolean>;
|
|
109
|
+
inPiP$: IValueSubject<boolean>;
|
|
110
|
+
inFullscreen$: IValueSubject<boolean>;
|
|
111
|
+
playbackState$: IValueSubject<PlaybackState | string>;
|
|
112
|
+
getCurrentTime$: IValueSubject<(() => number) | null>;
|
|
112
113
|
}
|
|
@@ -1,44 +1,45 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { ILogger, IObservable } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import { type ExactVideoQuality, Subject } from "@vkontakte/videoplayer-shared";
|
|
3
|
+
import type { ITuningConfig } from "../../../utils/tuningConfig";
|
|
4
|
+
import type { IVideoTrack } from "../../../player/types";
|
|
5
|
+
import type { IStateMachine } from "../../../utils/StateMachine/types";
|
|
5
6
|
interface IConnectData {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
logger: ILogger;
|
|
8
|
+
video: HTMLVideoElement;
|
|
9
|
+
tracks: IVideoTrack[];
|
|
10
|
+
droppedFramesChecker: ITuningConfig["droppedFramesChecker"];
|
|
11
|
+
isAuto: IStateMachine<boolean>;
|
|
12
|
+
playing$: IObservable<undefined>;
|
|
13
|
+
pause$: IObservable<undefined>;
|
|
13
14
|
}
|
|
14
15
|
declare class DroppedFramesManager {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
16
|
+
onDroopedVideoFramesLimit$: Subject<void>;
|
|
17
|
+
private subscription;
|
|
18
|
+
private log;
|
|
19
|
+
private video;
|
|
20
|
+
private droppedFramesChecker;
|
|
21
|
+
private isAuto;
|
|
22
|
+
private playing;
|
|
23
|
+
private tracks;
|
|
24
|
+
private forceChecker$;
|
|
25
|
+
private isForceCheckCounter;
|
|
26
|
+
private prevTotalVideoFrames;
|
|
27
|
+
private prevDroppedVideoFrames;
|
|
28
|
+
private currentTimer;
|
|
29
|
+
private limitCounts;
|
|
30
|
+
private currentQuality;
|
|
31
|
+
private maxQualityLimit;
|
|
32
|
+
connect(data: IConnectData): void;
|
|
33
|
+
destroy(): void;
|
|
34
|
+
get droppedVideoMaxQualityLimit(): ExactVideoQuality | undefined;
|
|
35
|
+
private subscribe;
|
|
36
|
+
private handleChangeVideoQuality;
|
|
37
|
+
private onChangeQuality;
|
|
38
|
+
private checkDroppedFrames;
|
|
39
|
+
private onDroopedVideoFramesLimitTrigger;
|
|
40
|
+
private getMaxQualityLimit;
|
|
41
|
+
private get isEnabled();
|
|
42
|
+
private get isDroppedFramesCheckerSupport();
|
|
43
|
+
private savePrevFrameCounts;
|
|
43
44
|
}
|
|
44
45
|
export default DroppedFramesManager;
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { IExternalTextTrack, IInternalTextTrack, ITextTrack } from
|
|
2
|
-
import { IDesiredState, IProviderOutput } from
|
|
1
|
+
import type { IExternalTextTrack, IInternalTextTrack, ITextTrack } from "../../../player/types";
|
|
2
|
+
import type { IDesiredState, IProviderOutput } from "../../types";
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
* TODO: сейчас externalTextTracks и internalTextTracks записываются в availableTextTracks отсюда
|
|
5
|
+
* нужно будет выпилить этот класс за исключением этой логики,
|
|
6
|
+
* когда перестанет быть необходима поддержка браузерных субтитров
|
|
7
|
+
*/
|
|
8
8
|
declare class TextTrackManager {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
31
|
}
|
|
32
32
|
export default TextTrackManager;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
* Пытаемся запустить видео обходя ошибку `NotAllowedError` путём включения `mute`.
|
|
3
|
+
* @param {HTMLVideoElement} video - видеообъект
|
|
4
|
+
* @param {Function} soundNotAllowedCallback - колбэк, который вызовется если нам не разрешили играть со звуком
|
|
5
|
+
* @return {Promise}<boolean> - получилось начать воспроизведение
|
|
6
|
+
*/
|
|
7
7
|
declare const _default: (video: HTMLVideoElement, soundNotAllowedCallback?: () => void) => Promise<boolean>;
|
|
8
8
|
export default _default;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { Seconds, IRange, IObservable, IError, IValueObservable } from
|
|
2
|
-
import { IVolumeState, PlaybackRate } from
|
|
1
|
+
import type { Seconds, IRange, IObservable, IError, IValueObservable } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IVolumeState, PlaybackRate } from "../../../player/types";
|
|
3
3
|
export interface IObservableVideo {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
4
|
+
playing$: IObservable<undefined>;
|
|
5
|
+
pause$: IObservable<undefined>;
|
|
6
|
+
canplay$: IObservable<undefined>;
|
|
7
|
+
ended$: IObservable<undefined>;
|
|
8
|
+
looped$: IObservable<Seconds>;
|
|
9
|
+
error$: IObservable<IError>;
|
|
10
|
+
seeked$: IObservable<undefined>;
|
|
11
|
+
seeking$: IObservable<undefined>;
|
|
12
|
+
progress$: IObservable<undefined>;
|
|
13
|
+
timeUpdate$: IObservable<Seconds>;
|
|
14
|
+
durationChange$: IObservable<Seconds>;
|
|
15
|
+
loadStart$: IObservable<void>;
|
|
16
|
+
loadedMetadata$: IObservable<undefined>;
|
|
17
|
+
loadedData$: IObservable<undefined>;
|
|
18
|
+
isBuffering$: IObservable<boolean>;
|
|
19
|
+
currentBuffer$: IObservable<IRange<Seconds>>;
|
|
20
|
+
volumeState$: IObservable<IVolumeState>;
|
|
21
|
+
playbackRateState$: IObservable<PlaybackRate>;
|
|
22
|
+
inPiP$: IValueObservable<boolean>;
|
|
23
|
+
inFullscreen$: IValueObservable<boolean>;
|
|
24
|
+
enterPip$: IObservable<PictureInPictureEvent>;
|
|
25
|
+
leavePip$: IObservable<PictureInPictureEvent>;
|
|
26
|
+
destroy: () => void;
|
|
27
27
|
}
|
|
28
28
|
export declare const observe: (video: HTMLVideoElement) => IObservableVideo;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ITuningConfig } from
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
1
|
+
import type { ITuningConfig } from "../../../utils/tuningConfig";
|
|
2
|
+
type AllocateConstraints = Pick<ITuningConfig, "audioVideoSyncRate" | "disableYandexPiP" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
|
|
3
|
+
type DisposeConstraints = Pick<ITuningConfig, "keepVideoElement" | "clearVideoElementInnerHTML" | "reuseOwnVideoElement">;
|
|
4
|
+
export declare const allocate: (container: HTMLElement, { audioVideoSyncRate, disableYandexPiP, clearVideoElementInnerHTML, reuseOwnVideoElement }: AllocateConstraints) => HTMLVideoElement;
|
|
5
|
+
export declare const dispose: (videoElement: HTMLVideoElement, { keepVideoElement, clearVideoElementInnerHTML, reuseOwnVideoElement }: DisposeConstraints) => void;
|
|
5
6
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Milliseconds } from
|
|
2
|
-
import { ILiveOffset } from
|
|
1
|
+
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { ILiveOffset } from "./types";
|
|
3
3
|
export default class LiveOffset implements ILiveOffset {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
private pausedTime;
|
|
5
|
+
private streamOffset;
|
|
6
|
+
private pauseTimestamp;
|
|
7
|
+
getTotalPausedTime(): Milliseconds;
|
|
8
|
+
getCurrentPausedTime(): Milliseconds;
|
|
9
|
+
getStreamOffset(): Milliseconds;
|
|
10
|
+
getTotalOffset(): Milliseconds;
|
|
11
|
+
pause(): void;
|
|
12
|
+
resume(): void;
|
|
13
|
+
resetTo(offset: Milliseconds, isPaused?: boolean): void;
|
|
14
14
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Milliseconds } from
|
|
1
|
+
import type { Milliseconds } from "@vkontakte/videoplayer-shared";
|
|
2
2
|
export interface ILiveOffset {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
getTotalPausedTime(): Milliseconds;
|
|
4
|
+
getCurrentPausedTime(): Milliseconds;
|
|
5
|
+
getStreamOffset(): Milliseconds;
|
|
6
|
+
getTotalOffset(): Milliseconds;
|
|
7
|
+
pause(): void;
|
|
8
|
+
resume(): void;
|
|
9
|
+
resetTo(offset: Milliseconds, isPaused?: boolean): void;
|
|
10
10
|
}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { ExactVideoQuality, IObservable, IValueSubject, Milliseconds, Kbps, Seconds } from
|
|
2
|
-
import { IVideoTrack } from
|
|
3
|
-
import { ITuningConfig } from
|
|
1
|
+
import type { ExactVideoQuality, IObservable, IValueSubject, Milliseconds, Kbps, Seconds } from "@vkontakte/videoplayer-shared";
|
|
2
|
+
import type { IVideoTrack } from "../../player/types";
|
|
3
|
+
import type { ITuningConfig } from "../../utils/tuningConfig";
|
|
4
4
|
interface IConnectData {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
videoLastDataObtainedTimestamp$: IValueSubject<Milliseconds>;
|
|
6
|
+
throughput$: IValueSubject<number>;
|
|
7
|
+
rtt$: IValueSubject<Milliseconds>;
|
|
8
|
+
isBuffering$: IObservable<boolean>;
|
|
9
|
+
isSeeked$: IObservable<boolean>;
|
|
10
|
+
looped$: IObservable<Seconds>;
|
|
11
|
+
playing$: IObservable<undefined>;
|
|
12
|
+
currentStallDuration$: IValueSubject<Milliseconds>;
|
|
13
|
+
tuning: ITuningConfig["stallsManager"];
|
|
14
|
+
abrParams: ITuningConfig["autoTrackSelection"];
|
|
15
|
+
duration: Seconds;
|
|
16
16
|
}
|
|
17
17
|
declare class StallsManager {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
18
|
+
private currentStallDuration$;
|
|
19
|
+
private videoLastDataObtainedTimestamp$;
|
|
20
|
+
private throughput$;
|
|
21
|
+
private rtt$;
|
|
22
|
+
private tuning;
|
|
23
|
+
private abrParams;
|
|
24
|
+
private duration;
|
|
25
|
+
private isSeeked$;
|
|
26
|
+
private isBuffering$;
|
|
27
|
+
private maxQualityLimit;
|
|
28
|
+
private lastUniqueVideoTrackSelected;
|
|
29
|
+
private currentStallsCount;
|
|
30
|
+
private sumStallsDuration;
|
|
31
|
+
private lastStallDuration;
|
|
32
|
+
private providerStartWatchingTimestamp;
|
|
33
|
+
private lastUniqueVideoTrackSelectedTimestamp;
|
|
34
|
+
private predictedThroughputWithoutData;
|
|
35
|
+
private qualityRestrictionTimer;
|
|
36
|
+
private subscription;
|
|
37
|
+
severeStallOccurred$: IValueSubject<boolean>;
|
|
38
|
+
init(data: IConnectData): void;
|
|
39
|
+
get videoMaxQualityLimit(): ExactVideoQuality | undefined;
|
|
40
|
+
get predictedThroughput(): Kbps;
|
|
41
|
+
get abrTuningParams(): ITuningConfig["autoTrackSelection"];
|
|
42
|
+
set lastVideoTrackSelected(lastUniqueVideoTrackSelected: IVideoTrack);
|
|
43
|
+
destroy(): void;
|
|
44
|
+
private resetStoredAbrParamsIfNeeded;
|
|
45
|
+
private updateStoredAbrParams;
|
|
46
|
+
private calculateOptimalAbrParams;
|
|
47
|
+
private getStoredData;
|
|
48
|
+
private setStoredData;
|
|
49
|
+
private removeStoredData;
|
|
50
|
+
private addStallInfoToHistory;
|
|
51
|
+
private updateStallData;
|
|
52
|
+
private subscribe;
|
|
53
53
|
}
|
|
54
54
|
export default StallsManager;
|