@vkontakte/videoplayer-statistics 1.0.119-dev.ebda080eb.0 → 1.0.120-dev.477cdf9b9.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.
@@ -1,8 +1,64 @@
1
- import type { IPlayer, IPlayerInfo, IPlayerEvents } from "@vkontakte/videoplayer-core";
1
+ import type { IPlayer } from "@vkontakte/videoplayer-core";
2
+ import type { HttpConnectionMetrics, HttpConnectionType, HttpDownloadMetrics, ISeekRequest, ISources, ITextTrack, IVideoStream, PlaybackRate, PlaybackState, Surface, StartEnd, VideoFormat, VideoQuality } from "@vkontakte/videoplayer-core";
3
+ import type { IError, IObservable, IValueObservable, Kbps, Milliseconds, Seconds } from "@vkontakte/videoplayer-shared";
2
4
  export interface IThinOneStatPlayerAdapter {
3
- info: Pick<IPlayerInfo, "atLiveEdge$" | "availableSources$" | "availableTextTracks$" | "currentAudioStream$" | "currentVideoBuffer$" | "currentFormat$" | "currentPlaybackRate$" | "currentQuality$" | "currentTextTrack$" | "currentVideoStream$" | "hostname$" | "httpConnectionMetrics$" | "httpConnectionReused$" | "httpConnectionType$" | "httpDownloadMetrics$" | "isAutoQualityEnabled$" | "isLive$" | "isStalled$" | "liveTime$" | "muted$" | "playbackState$" | "position$" | "rttEstimation$" | "stallStartTime$" | "surface$" | "videoBitrate$" | "volume$">;
4
- events: Pick<IPlayerEvents, "willStart$" | "willResume$" | "willReady$" | "willSeek$" | "willStop$" | "willDestruct$" | "started$" | "playing$" | "paused$" | "seeked$" | "ended$" | "looped$" | "firstBytes$" | "firstBytesManifest$" | "firstBytesRequested$" | "firstFrame$" | "manifestRequested$" | "manifestReceived$" | "managedError$" | "fatalError$" | "fetcherRecoverableError$">;
5
- experimental: Pick<IPlayer["experimental"], "element$">;
5
+ info: {
6
+ atLiveEdge$: IValueObservable<boolean | undefined>;
7
+ availableSources$: IValueObservable<ISources | undefined>;
8
+ availableTextTracks$: IValueObservable<ITextTrack[]>;
9
+ currentAudioStream$: IValueObservable<IVideoStream | undefined>;
10
+ currentVideoBuffer$: IValueObservable<StartEnd<Seconds> | undefined>;
11
+ currentFormat$: IValueObservable<VideoFormat | undefined>;
12
+ currentPlaybackRate$: IValueObservable<PlaybackRate>;
13
+ currentQuality$: IValueObservable<VideoQuality | undefined>;
14
+ currentTextTrack$: IValueObservable<ITextTrack["id"] | undefined>;
15
+ currentVideoStream$: IValueObservable<IVideoStream | undefined>;
16
+ hostname$: IValueObservable<string | undefined>;
17
+ httpConnectionMetrics$: IValueObservable<HttpConnectionMetrics | undefined>;
18
+ httpConnectionReused$: IValueObservable<boolean | undefined>;
19
+ httpConnectionType$: IValueObservable<HttpConnectionType | undefined>;
20
+ httpDownloadMetrics$: IValueObservable<HttpDownloadMetrics | undefined>;
21
+ isAutoQualityEnabled$: IValueObservable<boolean>;
22
+ isLive$: IValueObservable<boolean | undefined>;
23
+ isStalled$: IValueObservable<boolean>;
24
+ liveTime$: IValueObservable<Milliseconds | undefined>;
25
+ muted$: IValueObservable<boolean>;
26
+ playbackState$: IValueObservable<PlaybackState | undefined>;
27
+ position$: IValueObservable<Seconds>;
28
+ rttEstimation$: IValueObservable<Milliseconds | undefined>;
29
+ stallStartTime$: IValueObservable<Milliseconds>;
30
+ surface$: IValueObservable<Surface>;
31
+ throughputEstimation$: IValueObservable<Kbps | undefined>;
32
+ videoBitrate$: IValueObservable<Kbps | undefined>;
33
+ volume$: IValueObservable<number>;
34
+ };
35
+ events: {
36
+ willStart$: IObservable<void>;
37
+ willResume$: IObservable<void>;
38
+ willReady$: IObservable<void>;
39
+ willSeek$: IObservable<ISeekRequest>;
40
+ willStop$: IObservable<void>;
41
+ willDestruct$: IObservable<void>;
42
+ started$: IObservable<void>;
43
+ playing$: IObservable<void>;
44
+ paused$: IObservable<void>;
45
+ seeked$: IObservable<void>;
46
+ ended$: IObservable<void>;
47
+ looped$: IObservable<Seconds>;
48
+ firstBytes$: IObservable<Milliseconds>;
49
+ firstBytesManifest$: IObservable<void>;
50
+ firstBytesRequested$: IObservable<void>;
51
+ firstFrame$: IObservable<Milliseconds>;
52
+ canplay$: IObservable<Milliseconds>;
53
+ manifestRequested$: IObservable<void>;
54
+ manifestReceived$: IObservable<void>;
55
+ managedError$: IObservable<IError>;
56
+ fatalError$: IObservable<IError>;
57
+ fetcherRecoverableError$: IObservable<IError>;
58
+ };
59
+ experimental: {
60
+ element$: IValueObservable<HTMLVideoElement | undefined>;
61
+ };
6
62
  getExactTime: IPlayer["getExactTime"];
7
63
  getExactLiveTime: IPlayer["getExactLiveTime"];
8
64
  }
@@ -22,6 +22,7 @@ export interface IRequiredFatParams {
22
22
  device_type: string;
23
23
  device_manufacturer: string;
24
24
  device_model: string;
25
+ device_info?: Record<string, unknown>;
25
26
  navigation?: Record<string, unknown>;
26
27
  }
27
28
  export type ILogItem = IRequiredParams & Partial<IRequiredFatParams>;
@@ -0,0 +1,2 @@
1
+ import type { Milliseconds } from "@vkontakte/videoplayer-shared";
2
+ export declare const getBufferAhead: ({ buffered, currentTime }: Pick<HTMLMediaElement, "buffered" | "currentTime">) => Milliseconds | undefined;
@@ -0,0 +1 @@
1
+ export declare const collectDeviceInfo: () => Record<string, unknown>;
@@ -3,3 +3,4 @@ export declare const isLiveTime: (time: Milliseconds | undefined) => time is Mil
3
3
  export declare const getLiveTime: (liveTime: Milliseconds | undefined) => Milliseconds;
4
4
  export declare const toMilliseconds: (seconds: Seconds | undefined) => Milliseconds;
5
5
  export declare const isValidPosition: (position: Milliseconds) => boolean;
6
+ export declare const clampTotalViewTime: (totalViewTime: Milliseconds) => Milliseconds;