UNPKG

@xnstream/player-sdk

Version:

XStream Player SDK - A powerful video player SDK for streaming content

33 lines 1.04 kB
import type { AnalyticsEvent, Collector } from './types'; import type { Resource } from '../types'; interface WatchTimeStat { action: string; duration: number; content_type: string; content_id: string; content_title: string; edge_id: string; user_id?: string; } export declare class WatchtimeCollector implements Collector { private watchStartTime; private totalWatchTime; private readonly video; readonly streamCode: string; private readonly resource; private readonly edge_id; private readonly context; constructor(video: HTMLVideoElement, streamCode: string, resource: Resource, edge_id: string, context?: Record<string, any>); private setupVideoEventListeners; private onPlay; private onPause; private onVisibilityChange; private getTotalWatchTimeSeconds; private getContentTitle; exportWatchtimeStats(): WatchTimeStat; flush(): AnalyticsEvent[]; reset(): void; destroy(): void; } export {}; //# sourceMappingURL=WatchtimeCollector.d.ts.map