UNPKG

@telnyx/webrtc

Version:
69 lines (68 loc) 4.12 kB
import { IVertoCallOptions, IWebRTCSupportedBrowser, IWebRTCInfo, IAudio } from './interfaces'; declare const isDeviceNotFoundError: (error: Error) => boolean; declare const getConstraintsWithoutDeviceId: (constraints: MediaStreamConstraints) => MediaStreamConstraints | null; declare const getUserMedia: (constraints: MediaStreamConstraints) => Promise<MediaStream | null>; declare const getDevices: (kind?: MediaDeviceKind | undefined, fullList?: boolean) => Promise<MediaDeviceInfo[]>; declare const scanResolutions: (deviceId: string) => Promise<any[]>; declare const getMediaConstraints: (options: IVertoCallOptions) => Promise<MediaStreamConstraints>; declare function hasVideo(sdp: any): boolean; declare const assureDeviceId: (id: string, label: string, kind: MediaDeviceInfo['kind']) => Promise<string>; declare const removeUnsupportedConstraints: (constraints: MediaTrackConstraints) => void; declare const checkDeviceIdConstraints: (id: string, label: string, kind: MediaDeviceInfo['kind'], constraints: MediaTrackConstraints) => Promise<MediaTrackConstraints>; declare const getTrackDebugInfo: (track?: MediaStreamTrack | null) => { id: string; kind: string; enabled: boolean; muted: boolean; readyState: MediaStreamTrackState; }; declare const getStreamTrackDebugInfo: (stream?: MediaStream | null) => { id: string; kind: string; enabled: boolean; muted: boolean; readyState: MediaStreamTrackState; }[]; declare const sdpStereoHack: (sdp: string) => string; declare const sdpMediaOrderHack: (answer: string, localOffer: string) => string; declare type SubscribeResponse = Record<string, string[] | undefined>; declare const checkSubscribeResponse: (response: SubscribeResponse, channel: string) => boolean; declare type DestructuredResult = { subscribed: string[]; alreadySubscribed: string[]; unauthorized: string[]; unsubscribed: string[]; notSubscribed: string[]; }; declare const destructSubscribeResponse: (response: SubscribeResponse) => DestructuredResult; declare const enableAudioTracks: (stream: MediaStream) => void; declare const disableAudioTracks: (stream: MediaStream) => void; declare const toggleAudioTracks: (stream: MediaStream) => void; declare const isAudioTrackEnabled: (stream: MediaStream) => boolean; declare const enableVideoTracks: (stream: MediaStream) => void; declare const disableVideoTracks: (stream: MediaStream) => void; declare const toggleVideoTracks: (stream: MediaStream) => void; declare const sdpBitrateHack: (sdp: string, max: number, min: number, start: number) => string; declare const sdpBitrateASHack: (sdp: string, bandwidthKbps: number) => string; declare function getBrowserInfo(): { browserInfo: string; name: string; version: number; supportAudio: boolean; supportVideo: boolean; }; declare function getWebRTCInfo(): IWebRTCInfo; export declare enum SUPPORTED_WEBRTC { not_supported = "not supported", full = "full", partial = "partial" } declare function getWebRTCSupportedBrowserList(): Array<IWebRTCSupportedBrowser>; declare function createAudio(file: any, id: any): IAudio | null; declare function playAudio(audioElement: IAudio): void; declare function stopAudio(audioElement: IAudio): void; declare const getPreferredCodecs: (preferred_codecs?: RTCRtpCodecCapability[]) => { audioCodecs: RTCRtpCodecCapability[]; videoCodecs: RTCRtpCodecCapability[]; }; export { getUserMedia, getDevices, scanResolutions, getMediaConstraints, assureDeviceId, removeUnsupportedConstraints, checkDeviceIdConstraints, sdpStereoHack, sdpMediaOrderHack, sdpBitrateHack, sdpBitrateASHack, checkSubscribeResponse, destructSubscribeResponse, enableAudioTracks, disableAudioTracks, toggleAudioTracks, isAudioTrackEnabled, enableVideoTracks, disableVideoTracks, toggleVideoTracks, getBrowserInfo, getWebRTCInfo, getWebRTCSupportedBrowserList, createAudio, playAudio, stopAudio, hasVideo, getPreferredCodecs, getTrackDebugInfo, getStreamTrackDebugInfo, isDeviceNotFoundError, getConstraintsWithoutDeviceId, };