UNPKG

@telnyx/webrtc

Version:
68 lines (67 loc) 2.98 kB
import BaseSession from './BaseSession'; import { IAudioSettings, BroadcastParams, SubscribeParams, IVertoOptions } from './util/interfaces'; import { IWebRTCCall } from './webrtc/interfaces'; import Call from './webrtc/Call'; export default abstract class BrowserSession extends BaseSession { calls: { [callId: string]: IWebRTCCall; }; private static readonly ACTIVE_CALL_STATE_NAMES; getActiveCalls(): IWebRTCCall[]; private _extractSafeCallIdentifiers; emitMultipleActiveCallsWarning(newCallId: string): void; micId: string; micLabel: string; camId: string; camLabel: string; autoRecoverCalls: boolean; ringtoneFile?: string; ringbackFile?: string; private _iceServers; private _localElement; private _localElementId; private _remoteElement; private _remoteElementId; protected _jwtAuth: boolean; protected _audioConstraints: boolean | MediaTrackConstraints; private _previousAudioConstraints; protected _videoConstraints: boolean | MediaTrackConstraints; protected _speaker: string; constructor(options: IVertoOptions); getIsRegistered(): Promise<boolean>; connect(): Promise<void>; checkPermissions(audio?: boolean, video?: boolean): Promise<boolean>; logout(): void; disconnect(): Promise<void>; serverDisconnect(): Promise<void>; socketDisconnect(): void; handleLoginError(error: any): void; speedTest(bytes: number): Promise<unknown>; getDevices(): Promise<MediaDeviceInfo[]>; getVideoDevices(): Promise<MediaDeviceInfo[]>; getAudioInDevices(): Promise<MediaDeviceInfo[]>; getAudioOutDevices(): Promise<MediaDeviceInfo[]>; validateDeviceId(id: string, label: string, kind: MediaDeviceInfo['kind']): Promise<string>; getDeviceResolutions(deviceId: string): Promise<any[]>; get mediaConstraints(): { audio: boolean | MediaTrackConstraints; video: boolean | MediaTrackConstraints; }; setAudioSettings(settings: IAudioSettings): Promise<MediaTrackConstraints>; disableMicrophone(): void; enableMicrophone(): void; set iceServers(servers: RTCIceServer[]); get iceServers(): RTCIceServer[]; set speaker(deviceId: string); get speaker(): string; set localElement(tag: HTMLMediaElement | string | Function); get localElement(): HTMLMediaElement | string | Function; get localElementId(): string; set remoteElement(tag: HTMLMediaElement | string | Function); get remoteElement(): HTMLMediaElement | string | Function; get remoteElementId(): string; vertoBroadcast({ nodeId, channel: eventChannel, data, }: BroadcastParams): void; vertoSubscribe({ nodeId, channels: eventChannel, handler, }: SubscribeParams): Promise<any>; vertoUnsubscribe({ nodeId, channels: eventChannel, }: SubscribeParams): Promise<any>; static telnyxStateCall(call: Call): Call; }