opentok-network-test-js
Version:
Precall network test for applications using the OpenTok platform.
62 lines • 2.4 kB
TypeScript
/**
* @module NetworkTest
*/
import { SessionCredentials, InitSessionOptions } from './types/session';
import { UpdateCallback } from './types/callbacks';
import { ConnectivityTestResults } from './testConnectivity';
import { QualityTestResults } from './testQuality';
import OTKLogger from '@opentok/opentok-solutions-logging';
export interface NetworkTestOptions {
audioOnly?: boolean;
timeout?: number;
audioSource?: string;
videoSource?: string;
initSessionOptions?: InitSessionOptions;
proxyServerUrl?: string;
scalableVideo?: boolean;
fullHd?: boolean;
}
export { QualityTestResults } from './testQuality';
export { ConnectivityTestResults } from './testConnectivity';
export default class NetworkTest {
credentials: SessionCredentials;
OTInstance: typeof OT;
otLogging: OTKLogger;
options?: NetworkTestOptions;
/**
* Returns an instance of NetworkConnectivity. See the "API reference" section of the
* README.md file in the root of the opentok-network-test-js project for details.
*/
constructor(OTInstance: typeof OT, credentials: SessionCredentials, options?: NetworkTestOptions);
private validateOT;
private validateCredentials;
private validateProxyUrl;
private setProxyUrl;
private startLoggingEngine;
/**
* This method checks to see if the client can connect to TokBox servers required for
* using OpenTok.
*
* See the "API reference" section of the README.md file in the root of the
* opentok-network-test-js project for details.
*/
testConnectivity(): Promise<ConnectivityTestResults>;
/**
* This function runs a test publisher and based on the measured video bitrate,
* audio bitrate, and the audio packet loss for the published stream, it returns
* results indicating the recommended supported publisher settings.
*
* See the "API reference" section of the README.md file in the root of the
* opentok-network-test-js project for details.
*/
testQuality(updateCallback?: UpdateCallback): Promise<QualityTestResults>;
/**
* Stops the currently running test.
*
* See the "API reference" section of the README.md file in the root of the
* opentok-network-test-js project for details.
*/
stop(): void;
}
export { ErrorNames } from './errors/types';
//# sourceMappingURL=index.d.ts.map