import { Method } from '../../common/Constants'; import Core from '../../core/Core'; import BalancerAnalyticsOptions from './BalancerAnalyticsOptions'; import BalancerVideoView from './BalancerVideoView'; import BalancerVideoCallback from './BalancerVideoCallback'; /** How the balancer identifies a manifest; see `BalancerAnalytics.setManifestIdentity`. */ export interface ManifestIdentity { key(url: string): string; withoutCredentials(url: string): string; } export default class BalancerAnalytics implements BalancerVideoCallback { readonly options: BalancerAnalyticsOptions; waitForMetadataTimeout: number; currentView?: BalancerVideoView; private manifestIdentity?; private readonly core; private readonly accountCode; private readonly httpMethod; private readonly flags; private readonly chronos; private pendingEvents; private delayedStartInterval?; private flushInterval?; constructor(core: Core, accountCode: string, httpMethod?: Method); init(): void; start(): void; join(): void; bufferBegin(): void; bufferEnd(): void; error(code: string, message: string): void; stop(): void; destroy(): void; /** * The balancer's own rules, set by the balancer that owns this analytics: `key` is its "same manifest" * key, `withoutCredentials` drops the CDN credential params its token registry knows. The view id and the * reported `mediaResource` follow them, so a rotating token is not a new view and never reaches /start. */ setManifestIdentity(identity?: ManifestIdentity): void; onNewVideoByManifestDetected(manifestUrl: string): void; private asyncStart; private isRequiredMetadataReady; private isDecisionFinished; private initDelayedStart; private stopDelayedStart; private startNewView; private endCurrentView; private sendEvent; private pushEvent; private startFlushJob; private stopFlushJob; private buildBaseParams; private buildStartParams; private withoutCredentials; private extractResourceId; }