@telnyx/webrtc 2.25.10 → 2.25.11-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/bundle.js +1 -1
- package/lib/bundle.mjs +1 -1
- package/lib/packages/js/src/Modules/Verto/BrowserSession.d.ts +3 -0
- package/lib/packages/js/src/Modules/Verto/util/debug.d.ts +46 -0
- package/lib/packages/js/src/Modules/Verto/util/interfaces.d.ts +1 -0
- package/lib/packages/js/src/Modules/Verto/util/webrtc/index.d.ts +2 -1
- package/lib/packages/js/src/Modules/Verto/webrtc/BaseCall.d.ts +1 -0
- package/lib/packages/js/src/Modules/Verto/webrtc/Peer.d.ts +3 -2
- package/lib/packages/js/src/Modules/Verto/webrtc/helpers.d.ts +6 -1
- package/lib/packages/js/src/Modules/Verto/webrtc/interfaces.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,7 +1,53 @@
|
|
|
1
1
|
import BrowserSession from '../BrowserSession';
|
|
2
2
|
export declare function saveToFile(data: any, filename: string): void;
|
|
3
|
+
export interface ConnectionStateDetails {
|
|
4
|
+
connectionState: RTCPeerConnectionState;
|
|
5
|
+
previousConnectionState: RTCPeerConnectionState;
|
|
6
|
+
iceConnectionState: RTCIceConnectionState;
|
|
7
|
+
iceGatheringState: RTCIceGatheringState;
|
|
8
|
+
signalingState: RTCSignalingState;
|
|
9
|
+
dtlsState?: RTCDtlsTransportState;
|
|
10
|
+
dtlsCipher?: string;
|
|
11
|
+
srtpCipher?: string;
|
|
12
|
+
tlsVersion?: string;
|
|
13
|
+
sctpState?: RTCSctpTransportState;
|
|
14
|
+
localCandidateType?: string;
|
|
15
|
+
remoteCandidateType?: string;
|
|
16
|
+
candidatePairState?: RTCStatsIceCandidatePairState;
|
|
17
|
+
selectedCandidatePair?: {
|
|
18
|
+
local: {
|
|
19
|
+
address: string;
|
|
20
|
+
port: number;
|
|
21
|
+
protocol: string;
|
|
22
|
+
candidateType: string;
|
|
23
|
+
};
|
|
24
|
+
remote: {
|
|
25
|
+
address: string;
|
|
26
|
+
port: number;
|
|
27
|
+
protocol: string;
|
|
28
|
+
candidateType: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export declare function getConnectionStateDetails(pc: RTCPeerConnection, previousConnectionState: RTCPeerConnectionState): Promise<ConnectionStateDetails>;
|
|
33
|
+
export interface IceCandidateErrorDetails {
|
|
34
|
+
errorCode: number;
|
|
35
|
+
errorText: string;
|
|
36
|
+
url: string;
|
|
37
|
+
address: string | null;
|
|
38
|
+
port: number | null;
|
|
39
|
+
connectionState: RTCPeerConnectionState;
|
|
40
|
+
iceConnectionState: RTCIceConnectionState;
|
|
41
|
+
iceGatheringState: RTCIceGatheringState;
|
|
42
|
+
signalingState: RTCSignalingState;
|
|
43
|
+
localDescriptionType?: RTCSdpType;
|
|
44
|
+
remoteDescriptionType?: RTCSdpType;
|
|
45
|
+
}
|
|
46
|
+
export declare function getIceCandidateErrorDetails(event: RTCPeerConnectionIceErrorEvent, pc: RTCPeerConnection): IceCandidateErrorDetails;
|
|
3
47
|
export declare type WebRTCStatsReporter = {
|
|
4
48
|
start: (peerConnection: RTCPeerConnection, peerId: string, connectionId: string) => Promise<void>;
|
|
5
49
|
stop: (debugOutput: string) => Promise<void>;
|
|
50
|
+
reportConnectionStateChange: (details: ConnectionStateDetails) => void;
|
|
51
|
+
reportIceCandidateError: (details: IceCandidateErrorDetails) => void;
|
|
6
52
|
};
|
|
7
53
|
export declare function createWebRTCStatsReporter(session: BrowserSession, callID: string): WebRTCStatsReporter;
|
|
@@ -7,6 +7,7 @@ declare const enumerateDevicesByKind: (filterByKind?: string) => Promise<MediaDe
|
|
|
7
7
|
declare const getSupportedConstraints: () => MediaTrackSupportedConstraints;
|
|
8
8
|
declare const streamIsValid: (stream: MediaStream) => boolean;
|
|
9
9
|
declare const audioIsMediaTrackConstraints: (audio: boolean | MediaTrackConstraints) => boolean;
|
|
10
|
+
declare const videoIsMediaTrackConstraints: (video: boolean | MediaTrackConstraints) => boolean;
|
|
10
11
|
declare const attachMediaStream: (tag: any, stream: MediaStream) => void;
|
|
11
12
|
declare const detachMediaStream: (tag: any) => void;
|
|
12
13
|
declare const muteMediaElement: (tag: any) => void;
|
|
@@ -16,4 +17,4 @@ declare const setMediaElementSinkId: (tag: any, deviceId: string) => Promise<boo
|
|
|
16
17
|
declare const sdpToJsonHack: (sdp: any) => any;
|
|
17
18
|
declare const stopTrack: (track: MediaStreamTrack) => void;
|
|
18
19
|
declare const stopStream: (stream: MediaStream) => void;
|
|
19
|
-
export { RTCPeerConnection, getUserMedia, getDisplayMedia, enumerateDevices, enumerateDevicesByKind, getSupportedConstraints, streamIsValid, audioIsMediaTrackConstraints, attachMediaStream, detachMediaStream, sdpToJsonHack, stopStream, stopTrack, muteMediaElement, unmuteMediaElement, toggleMuteMediaElement, setMediaElementSinkId, };
|
|
20
|
+
export { RTCPeerConnection, getUserMedia, getDisplayMedia, enumerateDevices, enumerateDevicesByKind, getSupportedConstraints, streamIsValid, audioIsMediaTrackConstraints, videoIsMediaTrackConstraints, attachMediaStream, detachMediaStream, sdpToJsonHack, stopStream, stopTrack, muteMediaElement, unmuteMediaElement, toggleMuteMediaElement, setMediaElementSinkId, };
|
|
@@ -38,6 +38,7 @@ export default abstract class BaseCall implements IWebRTCCall {
|
|
|
38
38
|
private get performanceMetrics();
|
|
39
39
|
get nodeId(): string;
|
|
40
40
|
set nodeId(what: string);
|
|
41
|
+
get isVideoCall(): boolean;
|
|
41
42
|
get telnyxIDs(): {
|
|
42
43
|
telnyxCallControlId: string;
|
|
43
44
|
telnyxSessionId: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import BrowserSession from '../BrowserSession';
|
|
2
|
+
import { WebRTCStatsReporter } from '../util/debug';
|
|
2
3
|
import { PeerType } from './constants';
|
|
3
4
|
import { IVertoCallOptions } from './interfaces';
|
|
4
5
|
export default class Peer {
|
|
@@ -6,8 +7,8 @@ export default class Peer {
|
|
|
6
7
|
private options;
|
|
7
8
|
instance: RTCPeerConnection;
|
|
8
9
|
onSdpReadyTwice: Function;
|
|
10
|
+
statsReporter: WebRTCStatsReporter | null;
|
|
9
11
|
private _constraints;
|
|
10
|
-
private statsReporter;
|
|
11
12
|
private _session;
|
|
12
13
|
private _negotiating;
|
|
13
14
|
private _prevConnectionState;
|
|
@@ -38,7 +39,7 @@ export default class Peer {
|
|
|
38
39
|
private _setRemoteDescription;
|
|
39
40
|
private _createAnswer;
|
|
40
41
|
private _setLocalDescription;
|
|
41
|
-
private
|
|
42
|
+
private _setCodecs;
|
|
42
43
|
private _sdpReady;
|
|
43
44
|
private _retrieveLocalStream;
|
|
44
45
|
private _resetJitterBuffer;
|
|
@@ -3,6 +3,7 @@ declare const getUserMedia: (constraints: MediaStreamConstraints) => Promise<Med
|
|
|
3
3
|
declare const getDevices: (kind?: MediaDeviceKind | undefined, fullList?: boolean) => Promise<MediaDeviceInfo[]>;
|
|
4
4
|
declare const scanResolutions: (deviceId: string) => Promise<any[]>;
|
|
5
5
|
declare const getMediaConstraints: (options: IVertoCallOptions) => Promise<MediaStreamConstraints>;
|
|
6
|
+
declare function hasVideo(sdp: any): boolean;
|
|
6
7
|
declare const assureDeviceId: (id: string, label: string, kind: MediaDeviceInfo['kind']) => Promise<string>;
|
|
7
8
|
declare const removeUnsupportedConstraints: (constraints: MediaTrackConstraints) => void;
|
|
8
9
|
declare const checkDeviceIdConstraints: (id: string, label: string, kind: MediaDeviceInfo['kind'], constraints: MediaTrackConstraints) => Promise<MediaTrackConstraints>;
|
|
@@ -43,4 +44,8 @@ declare function getWebRTCSupportedBrowserList(): Array<IWebRTCSupportedBrowser>
|
|
|
43
44
|
declare function createAudio(file: any, id: any): IAudio | null;
|
|
44
45
|
declare function playAudio(audioElement: IAudio): void;
|
|
45
46
|
declare function stopAudio(audioElement: IAudio): void;
|
|
46
|
-
|
|
47
|
+
declare const getPreferredCodecs: (preferred_codecs?: RTCRtpCodecCapability[]) => {
|
|
48
|
+
audioCodecs: RTCRtpCodecCapability[];
|
|
49
|
+
videoCodecs: RTCRtpCodecCapability[];
|
|
50
|
+
};
|
|
51
|
+
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, };
|
|
@@ -16,6 +16,7 @@ export interface IVertoCallOptions {
|
|
|
16
16
|
remoteElement?: HTMLMediaElement | string | Function;
|
|
17
17
|
iceServers?: RTCIceServer[];
|
|
18
18
|
audio?: boolean | MediaTrackConstraints;
|
|
19
|
+
video?: boolean | MediaTrackConstraints;
|
|
19
20
|
attach?: boolean;
|
|
20
21
|
useStereo?: boolean;
|
|
21
22
|
micId?: string;
|