UNPKG

@telnyx/webrtc

Version:
59 lines (58 loc) 2.66 kB
import BaseSession from './BaseSession'; import { IAudioSettings, IVideoSettings, 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; }; micId: string; micLabel: string; camId: string; camLabel: string; autoRecoverCalls: boolean; ringtoneFile?: string; ringbackFile?: string; private _iceServers; private _localElement; private _remoteElement; protected _jwtAuth: boolean; protected _audioConstraints: boolean | MediaTrackConstraints; protected _videoConstraints: boolean | MediaTrackConstraints; protected _speaker: string; constructor(options: IVertoOptions); get reconnectDelay(): number; connect(): Promise<void>; checkPermissions(audio?: boolean, video?: boolean): Promise<boolean>; logout(): void; disconnect(): Promise<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; setVideoSettings(settings: IVideoSettings): Promise<MediaTrackConstraints>; disableWebcam(): void; enableWebcam(): void; set iceServers(servers: RTCIceServer[] | boolean); get iceServers(): RTCIceServer[] | boolean; set speaker(deviceId: string); get speaker(): string; set localElement(tag: HTMLMediaElement | string | Function); get localElement(): HTMLMediaElement | string | Function; set remoteElement(tag: HTMLMediaElement | string | Function); get remoteElement(): HTMLMediaElement | string | Function; 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; }