UNPKG

@msquared/pixel-streaming-client

Version:

Browser client for viewing pixel-streamed content from MSquared events

56 lines 1.92 kB
import type { ServerInfo } from "./types"; export declare const GFN_SDK_URL = "https://sdk.nvidia.com/gfn/client-sdk/1.x/gfn-client-sdk.js"; type Callbacks = { onStarted: () => void; onTerminated: (e?: GFNTerminationError) => void; }; export declare class GFNClientError extends Error { readonly name: string; } export declare const GFNClientNotInitialized: GFNClientError; export declare const GFNClientAlreadyInitialized: GFNClientError; export declare class GFNTerminationError extends GFNClientError { code: number; reason: number; readonly name: string; constructor(code: number, reason: number, message?: string, opts?: ErrorOptions); } type Config = { settings: { serviceUrl?: string; clientId: string; catalogClientId: string; partnerId: string; }; cmsId: number; nonce: string; }; declare class GFNClient { readonly config: Config; readonly serverInfo: ServerInfo; private player?; constructor(config: Config, serverInfo: ServerInfo); start(container: HTMLElement): Promise<GFNClientError | undefined>; stop(): void; listen({ onTerminated, onStarted }: Callbacks): void; } /** * Configures the GFN client and logs in using the provided nonce. * * @returns the logged in client if successful, otherwise a {@link GFNClientError} */ export declare function initClient(config: Config): Promise<GFNClient | GFNClientError>; export declare function getClient(): GFNClientError | GFNClient; export declare function getOrInitClient(config: Config): Promise<GFNClient | GFNClientError>; export type GeforceStreamConfig = { cmsId: string; nonce: string; redirect: string; zone?: string; state?: string; }; export declare function buildGfnUrl(partnerId: string, cfg: GeforceStreamConfig, { fullscreen }?: { fullscreen?: boolean; }): string; export {}; //# sourceMappingURL=index.d.ts.map