@vkontakte/videoplayer-statistics 1.0.113-dev.888965e7d.0 → 1.0.113-dev.9dd0ca0bc.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,6 +1,6 @@
1
1
  import type { IError, IObservable, ISubject, ISubscription, IValueObservable, IValueSubject, Milliseconds } from "@vkontakte/videoplayer-shared";
2
2
  import { ErrorCategory } from "@vkontakte/videoplayer-shared";
3
- import type { IPlayer } from "@vkontakte/videoplayer-core";
3
+ import type { IThinOneStatPlayerAdapter } from "./playerAdapter";
4
4
  import type { IOptionalConfig } from "./config";
5
5
  import type { Mode, Quality, Visibility, ConnectionType, ContentType } from "./values";
6
6
  import { ActionSeekType, AutoQuality } from "./values";
@@ -27,7 +27,7 @@ export interface IThinOneStat {
27
27
  /**
28
28
  * Привязываемся к событиям и разным изменениям состояний плеера
29
29
  */
30
- attachTo(player: IPlayer, adsEvents: IAdsEvents): ISubscription;
30
+ attachTo(player: IThinOneStatPlayerAdapter, adsEvents: IAdsEvents): ISubscription;
31
31
  attachToUi(uiEvents: IUIEvents): ISubscription;
32
32
  attachToAds(adsEvents: IAdsEvents): ISubscription;
33
33
  /**
@@ -349,7 +349,7 @@ export declare class ThinOneStat implements IThinOneStat {
349
349
  authorize(authToken?: string): void;
350
350
  reportError(payload: IReportErrorPayload): void;
351
351
  updateContext(newContext: Partial<IStatContext>): void;
352
- attachTo(player: IPlayer, adsEvents: IAdsEvents): ISubscription;
352
+ attachTo(player: IThinOneStatPlayerAdapter, adsEvents: IAdsEvents): ISubscription;
353
353
  attachToUi(events: IUIEvents): ISubscription;
354
354
  attachToAds(events: IAdsEvents): ISubscription;
355
355
  getDeviceId(): string;
@@ -1,5 +1,6 @@
1
1
  export { ThinOneStat } from "./ThinOneStat";
2
2
  export type { IThinOneStat, IStatContext } from "./ThinOneStat";
3
+ export type { IThinOneStatPlayerAdapter } from "./playerAdapter";
3
4
  export { ActionSeekType } from "./values";
4
5
  export type { ActionQualityType } from "./values";
5
6
  export type { IUIEvents } from "./events";
@@ -0,0 +1,8 @@
1
+ import type { IPlayer, IPlayerInfo, IPlayerEvents } from "@vkontakte/videoplayer-core";
2
+ export interface IThinOneStatPlayerAdapter {
3
+ info: Pick<IPlayerInfo, "atLiveEdge$" | "availableSources$" | "availableTextTracks$" | "currentAudioStream$" | "currentBuffer$" | "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$" | "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$">;
6
+ getExactTime: IPlayer["getExactTime"];
7
+ getExactLiveTime: IPlayer["getExactLiveTime"];
8
+ }
@@ -1,5 +1,6 @@
1
1
  import type { Milliseconds } from "@vkontakte/videoplayer-shared";
2
- import type { IPlayer, IObservable } from "@vkontakte/videoplayer-core";
2
+ import type { IObservable } from "@vkontakte/videoplayer-core";
3
+ import type { IThinOneStatPlayerAdapter } from "../playerAdapter";
3
4
  type GetTotalViewTime = () => Milliseconds;
4
- export declare const calculateTotalViewTime: (player: IPlayer) => IObservable<GetTotalViewTime>;
5
+ export declare const calculateTotalViewTime: (player: IThinOneStatPlayerAdapter) => IObservable<GetTotalViewTime>;
5
6
  export {};
@@ -1,7 +1,7 @@
1
- import type { IPlayer } from "@vkontakte/videoplayer-core";
1
+ import type { IThinOneStatPlayerAdapter } from "../playerAdapter";
2
2
  import type { IObservable } from "@vkontakte/videoplayer-shared";
3
3
  import type { IDownloadBytesPayload } from "../ThinOneStat";
4
4
  export type IParams = {
5
5
  maxTimeWindow: number;
6
6
  };
7
- export declare const downloadBytes: (player: IPlayer, { maxTimeWindow }: IParams) => IObservable<IDownloadBytesPayload>;
7
+ export declare const downloadBytes: (player: IThinOneStatPlayerAdapter, { maxTimeWindow }: IParams) => IObservable<IDownloadBytesPayload>;
@@ -1,7 +1,7 @@
1
- import type { IPlayer } from "@vkontakte/videoplayer-core";
1
+ import type { IThinOneStatPlayerAdapter } from "../playerAdapter";
2
2
  import type { IObservable, Milliseconds } from "@vkontakte/videoplayer-shared";
3
3
  export type IParams = {
4
4
  interval: number;
5
5
  getTotalViewTime: () => Milliseconds;
6
6
  };
7
- export declare const telemetry: (player: IPlayer, params: IParams) => IObservable<void>;
7
+ export declare const telemetry: (player: IThinOneStatPlayerAdapter, params: IParams) => IObservable<void>;
@@ -1,8 +1,8 @@
1
- import type { IPlayer } from "@vkontakte/videoplayer-core";
1
+ import type { IThinOneStatPlayerAdapter } from "../playerAdapter";
2
2
  import type { Seconds, IObservable, IRange } from "@vkontakte/videoplayer-shared";
3
3
  import type { IAdsEvents } from "../events";
4
4
  export type IParams = {
5
5
  heartbeatInterval?: Seconds;
6
6
  exactTime: boolean;
7
7
  };
8
- export declare const watchCoverage: (player: IPlayer, adsEvents: IAdsEvents, params: IParams) => IObservable<IRange<Seconds>>;
8
+ export declare const watchCoverage: (player: IThinOneStatPlayerAdapter, adsEvents: IAdsEvents, params: IParams) => IObservable<IRange<Seconds>>;
@@ -1,8 +1,8 @@
1
- import type { IPlayer } from "@vkontakte/videoplayer-core";
1
+ import type { IThinOneStatPlayerAdapter } from "../playerAdapter";
2
2
  import type { IObservable, Milliseconds } from "@vkontakte/videoplayer-shared";
3
3
  import type { IWatchedNPayload } from "../ThinOneStat";
4
4
  export type IParams = {
5
5
  targetDuration: Milliseconds;
6
6
  getTotalViewTime: () => Milliseconds;
7
7
  };
8
- export declare const watchedN: (player: IPlayer, params: IParams) => IObservable<IWatchedNPayload>;
8
+ export declare const watchedN: (player: IThinOneStatPlayerAdapter, params: IParams) => IObservable<IWatchedNPayload>;