import { AudioLevelChangeHandler, RtcAuthParams, RtcOptions, RtcStream } from "./types"; import { LogLevel } from "./logging"; import { CodecPreferences } from "./v3/types"; declare class BandwidthRtc { private streamAvailableHandler?; private streamUnavailableHandler?; private logLevel?; private delegate?; constructor(logLevel?: LogLevel); /** * Creates the delegate object using the specific version * @param authParams connection credentials with version * @returns */ private createDelegateObject; /** * Connect to the Bandwidth WebRTC platform * @param authParams connection credentials * @param options additional connection options; usually unnecessary */ connect(authParams: RtcAuthParams, options?: RtcOptions): Promise; /** * Set the log level for logs that will appear in the browser's console * Defaults to "warn" * @param logLevel log level */ setLogLevel(logLevel: LogLevel): void; /** * Set the function that will be called when a subscribed stream becomes available * @param callback callback function */ onStreamAvailable(callback: { (event: RtcStream): void; }): void; /** * Set the function that will be called when a subscribed stream becomes unavailable * @param callback callback function */ onStreamUnavailable(callback: { (streamId: string): void; }): void; /** * Publish media to the Bandwidth WebRTC platform * * This function can publish an existing MediaStream, or it can create and publish a new media stream from MediaStreamConstraints * @param input existing media or specific constraints to publish (optional, defaults to basic audio/video constraints) * @param audioLevelChangeHandler handler that can be called when the audio level of the published stream changes (optional) * @param alias stream alias/tag that will be included in subscription events and billing records, should not be PII (optional) * @param codecPreferences preferred audio and video codecs (optional, should almost never be needed) */ publish(input?: MediaStreamConstraints | MediaStream, audioLevelChangeHandler?: AudioLevelChangeHandler, alias?: string, codecPreferences?: CodecPreferences): Promise; /** * Unpublish one or more streams. * @param streams streams to unpublish; leave empty to unpublish all streams */ unpublish(...streams: RtcStream[] | string[]): Promise; /** * Returns an array of available video input devices */ getVideoInputs(): Promise; /** * Returns an array of available audio input devices */ getAudioInputs(): Promise; /** * Returns an array of available audio output devices */ getAudioOutputs(): Promise; /** * Returns an array of available media devices, optionally filtered by device kind * @param filter Device kind to filter on */ getMediaDevices(filter?: string): Promise; sendDtmf(tone: string, streamId?: string): void; /** * Enable/disable the mic (audio tracks) * @param enabled whether audio streams should be enabled * @param stream specific stream to operate on; optional, defaults to all streams */ setMicEnabled(enabled: boolean, stream?: RtcStream | string): void; /** * Enable/disable the camera (video tracks) * @param enabled whether video streams should be enabled * @param stream specific stream to operate on; optional, defaults to all streams */ setCameraEnabled(enabled: boolean, stream?: RtcStream | string): void; /** * Disconnect from the Bandwidth WebRTC platform, and tear down all published streams */ disconnect(): void; } export default BandwidthRtc;