import Core from './src/core/Core'; import BalancerOptions from './src/balancer/Utils/Options'; import BalancerAnalytics from './src/balancer/video/BalancerAnalytics'; import { LogLevel } from './src/common/log'; import NpawPluginOptions from './src/core/NpawPluginOptions'; import type { BalancerProvider, ExternalProvidersOptions } from './src/balancer/Utils/ExternalProviders'; export type CdnTimeoutsSnapshot = { connectTimeoutMilliseconds: number; readTimeoutMilliseconds: number; callTimeoutMilliseconds: number; totalTimeoutMilliseconds: number; }; export type CdnTimeoutsPatch = Partial; export { LogLevel } from './src/common/log'; export * from './src/core/NpawPluginOptions'; export type { BalancerProvider, ExternalProvidersOptions, ProviderMergeMode, ProviderSource } from './src/balancer/Utils/ExternalProviders'; export default class CdnBalancerPlugin { core: Core; private cdnBalancer; video?: BalancerAnalytics; private readonly accountCode; constructor(accountCode: string, options?: NpawPluginOptions); destroy(): void; /** * Changes the log level of the NPAW Plugin. See {@link LogLevel} for the different levels available * * @param logLevel Log level to be used */ setLogLevel(logLevel: LogLevel): void; /** * Sets Balancer options. See {@link BalancerOptions}. * @param options Balancer options */ setBalancerOptions(options: BalancerOptions): void; /** * Sets the manifest URL of the played content in the Balancer options object. * For url changes the loader is restarted. * @param url Manifest url of the content being played. * @public */ setManifestResource(url: string): void; /** * Adds an interceptor to the Balancer * @param name Name of the interceptor * @param player Video player object */ addInterceptor(name: string, player: any): void; /** * Returns Bitmovin configuration for request interception */ getBitmovinSendHttpRequest(): (type: any, request: any) => { getResponse(): any; cancel(): void; setProgressListener(): void; } | null; /** * Returns the manifest/video URL to be used following the Selector API. * If an error occurs this will return undefined */ getRecommendedManifest(): Promise; /** * @internal * @returns True if balancer is enabled, false otherwise */ isBalancerEnabled(): boolean; getManifestResolutionStats(): { parseCount: number; resolveCount: number; resolveHits: number; resolveMisses: number; lookaheadHits: number; lastHitFastHits: number; lastHitForceHits: number; multiPassHits: number; subManifestAttachments: number; manifestCount: number; lookaheadSize: number; modelHits: number; fallbackCount: number; }; /** * Merge runtime provider hosts on top of the latest /decision baseline. * See {@link ExternalProvidersOptions} for merge modes. */ setExternalProviders(providers: BalancerProvider[], options?: ExternalProvidersOptions): void; /** * Refresh the runtime provider overlay mid-session. */ updateExternalProviders(providers: BalancerProvider[], options?: ExternalProvidersOptions): void; /** * Remove the runtime provider overlay and restore /decision baseline providers. */ clearExternalProviders(): void; /** * Snapshot of the configured runtime provider overlay. */ getExternalProviders(): BalancerProvider[]; appendExternalProviders(providers: BalancerProvider[]): void; prependExternalProviders(providers: BalancerProvider[]): void; insertExternalProviders(providers: BalancerProvider[], index: number): void; setLegacyPlugin(legacyPlugin: any): void; /** * Apply a customData.options-shaped bag to the live BalancerOptions. Same * dotted-key processor the /decision response uses, so dashboards / sample * panels can drive the four-timeout / latency-trial / peak-sampler / * first-chunk-probe knobs without round-tripping through the backend. */ applyCustomData(customDataOptions: { [key: string]: any; }): void; /** * Snapshot of the active four-timeout values (connect / read / call / total, * all in milliseconds). A value of 0 or below means "no deadline" and the * corresponding timer is not armed. */ static getCdnTimeouts(): CdnTimeoutsSnapshot; /** * Mutate the active four-timeout values. Only the supplied keys are touched * (others stay as-is). `requestTimeoutMilliseconds` is kept in sync with * `callTimeoutMilliseconds` for legacy callers. Pass <= 0 to disable a timer. */ static setCdnTimeouts(timeouts: CdnTimeoutsPatch): CdnTimeoutsSnapshot; private createVideoAnalyticsIfEnabled; }