@whereby.com/media 2.5.2 → 2.5.4
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/dist/index.cjs +50 -21
- package/dist/index.d.cts +142 -136
- package/dist/index.d.mts +142 -136
- package/dist/index.d.ts +142 -136
- package/dist/index.mjs +50 -21
- package/dist/legacy-esm.js +50 -21
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -640,6 +640,7 @@ function rtcStatsConnection(wsURL, logger = console) {
|
|
|
640
640
|
let featureFlags;
|
|
641
641
|
const connection = {
|
|
642
642
|
connected: false,
|
|
643
|
+
attemptedConnectedAtLeastOnce: false,
|
|
643
644
|
trace: (...args) => {
|
|
644
645
|
args.push(Date.now());
|
|
645
646
|
if (args[0] === "customEvent" && args[2].type === "roomSessionId") {
|
|
@@ -712,6 +713,7 @@ function rtcStatsConnection(wsURL, logger = console) {
|
|
|
712
713
|
connectionAttempt += 1;
|
|
713
714
|
ws === null || ws === void 0 ? void 0 : ws.close();
|
|
714
715
|
connection.connected = true;
|
|
716
|
+
connection.attemptedConnectedAtLeastOnce = true;
|
|
715
717
|
ws = new WebSocket(wsURL + window.location.pathname, RTCSTATS_PROTOCOL_VERSION);
|
|
716
718
|
ws.onerror = (e) => {
|
|
717
719
|
connection.connected = false;
|
|
@@ -1568,6 +1570,7 @@ class ServerSocket {
|
|
|
1568
1570
|
this._wasConnectedUsingWebsocket = false;
|
|
1569
1571
|
this._reconnectManager = null;
|
|
1570
1572
|
this._socket = socket_ioClient.io(hostName, Object.assign({ path: DEFAULT_SOCKET_PATH, randomizationFactor: 0.5, reconnectionDelay: 250, reconnectionDelayMax: 5000, timeout: 5000, transports: ["websocket"], withCredentials: true }, optionsOverrides));
|
|
1573
|
+
this.joinRoomFinished = false;
|
|
1571
1574
|
this._socket.io.on("reconnect", () => {
|
|
1572
1575
|
this._socket.sendBuffer = [];
|
|
1573
1576
|
});
|
|
@@ -1585,6 +1588,12 @@ class ServerSocket {
|
|
|
1585
1588
|
});
|
|
1586
1589
|
if (glitchFree)
|
|
1587
1590
|
this._reconnectManager = new ReconnectManager(this._socket);
|
|
1591
|
+
this._socket.on("room_joined", (payload) => {
|
|
1592
|
+
const { error } = payload;
|
|
1593
|
+
if (!error) {
|
|
1594
|
+
this.joinRoomFinished = true;
|
|
1595
|
+
}
|
|
1596
|
+
});
|
|
1588
1597
|
this._socket.on("connect", () => {
|
|
1589
1598
|
const transport = this.getTransport();
|
|
1590
1599
|
if (transport === "websocket") {
|
|
@@ -1601,6 +1610,7 @@ class ServerSocket {
|
|
|
1601
1610
|
}
|
|
1602
1611
|
});
|
|
1603
1612
|
this._socket.on("disconnect", () => {
|
|
1613
|
+
this.joinRoomFinished = false;
|
|
1604
1614
|
this.disconnectTimestamp = Date.now();
|
|
1605
1615
|
if (this.noopKeepaliveInterval) {
|
|
1606
1616
|
clearInterval(this.noopKeepaliveInterval);
|
|
@@ -1622,26 +1632,12 @@ class ServerSocket {
|
|
|
1622
1632
|
disconnect() {
|
|
1623
1633
|
this._socket.disconnect();
|
|
1624
1634
|
}
|
|
1625
|
-
disconnectOnConnect() {
|
|
1626
|
-
this._socket.once("connect", () => {
|
|
1627
|
-
this._socket.disconnect();
|
|
1628
|
-
});
|
|
1629
|
-
}
|
|
1630
1635
|
emit(eventName, ...args) {
|
|
1631
1636
|
this._socket.emit.apply(this._socket, arguments);
|
|
1632
1637
|
}
|
|
1633
|
-
emitIfConnected(eventName, data) {
|
|
1634
|
-
if (!this.isConnected()) {
|
|
1635
|
-
return;
|
|
1636
|
-
}
|
|
1637
|
-
this.emit(eventName, data);
|
|
1638
|
-
}
|
|
1639
1638
|
getTransport() {
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
this._socket.io.engine &&
|
|
1643
|
-
this._socket.io.engine.transport &&
|
|
1644
|
-
this._socket.io.engine.transport.name);
|
|
1639
|
+
var _a, _b, _c, _d;
|
|
1640
|
+
return (_d = (_c = (_b = (_a = this._socket) === null || _a === void 0 ? void 0 : _a.io) === null || _b === void 0 ? void 0 : _b.engine) === null || _c === void 0 ? void 0 : _c.transport) === null || _d === void 0 ? void 0 : _d.name;
|
|
1645
1641
|
}
|
|
1646
1642
|
getManager() {
|
|
1647
1643
|
return this._socket.io;
|
|
@@ -2603,6 +2599,8 @@ class P2pRtcManager {
|
|
|
2603
2599
|
this._webrtcProvider = webrtcProvider;
|
|
2604
2600
|
this._features = features || {};
|
|
2605
2601
|
this._isAudioOnlyMode = false;
|
|
2602
|
+
this._closed = false;
|
|
2603
|
+
this.skipEmittingServerMessageCount = 0;
|
|
2606
2604
|
this.offerOptions = { offerToReceiveAudio: true, offerToReceiveVideo: true };
|
|
2607
2605
|
this._pendingActionsForConnectedPeerConnections = [];
|
|
2608
2606
|
this._audioTrackOnEnded = () => {
|
|
@@ -2684,6 +2682,10 @@ class P2pRtcManager {
|
|
|
2684
2682
|
}
|
|
2685
2683
|
return this._replaceTrackToPeerConnections(oldTrack, newTrack);
|
|
2686
2684
|
}
|
|
2685
|
+
close() {
|
|
2686
|
+
this._closed = true;
|
|
2687
|
+
this.disconnectAll();
|
|
2688
|
+
}
|
|
2687
2689
|
disconnectAll() {
|
|
2688
2690
|
Object.keys(this.peerConnections).forEach((peerConnectionId) => {
|
|
2689
2691
|
this.disconnect(peerConnectionId);
|
|
@@ -2809,11 +2811,16 @@ class P2pRtcManager {
|
|
|
2809
2811
|
sendStatsCustomEvent(eventName, data) {
|
|
2810
2812
|
rtcStats.sendEvent(eventName, data);
|
|
2811
2813
|
}
|
|
2814
|
+
rtcStatsConnect() {
|
|
2815
|
+
if (!rtcStats.server.connected) {
|
|
2816
|
+
rtcStats.server.connect();
|
|
2817
|
+
}
|
|
2818
|
+
}
|
|
2812
2819
|
rtcStatsDisconnect() {
|
|
2813
2820
|
rtcStats.server.close();
|
|
2814
2821
|
}
|
|
2815
2822
|
rtcStatsReconnect() {
|
|
2816
|
-
if (!rtcStats.server.connected) {
|
|
2823
|
+
if (!rtcStats.server.connected && rtcStats.server.attemptedConnectedAtLeastOnce) {
|
|
2817
2824
|
rtcStats.server.connect();
|
|
2818
2825
|
}
|
|
2819
2826
|
}
|
|
@@ -2869,8 +2876,18 @@ class P2pRtcManager {
|
|
|
2869
2876
|
logger$6.error("Error during setting jitter buffer target:", error);
|
|
2870
2877
|
}
|
|
2871
2878
|
}
|
|
2872
|
-
_emitServerEvent(eventName, data
|
|
2873
|
-
this.
|
|
2879
|
+
_emitServerEvent(eventName, data) {
|
|
2880
|
+
if (this._closed) {
|
|
2881
|
+
logger$6.warn("RtcManager closed. Will not send event", eventName, data);
|
|
2882
|
+
return;
|
|
2883
|
+
}
|
|
2884
|
+
if (this._features.awaitJoinRoomFinished && !this._serverSocket.joinRoomFinished) {
|
|
2885
|
+
rtcStats.sendEvent("skip_emitting_server_message", { eventName });
|
|
2886
|
+
this.skipEmittingServerMessageCount++;
|
|
2887
|
+
}
|
|
2888
|
+
else {
|
|
2889
|
+
this._serverSocket.emit(eventName, data);
|
|
2890
|
+
}
|
|
2874
2891
|
}
|
|
2875
2892
|
_emit(eventName, data) {
|
|
2876
2893
|
this._emitter.emit(eventName, data);
|
|
@@ -3193,6 +3210,10 @@ class P2pRtcManager {
|
|
|
3193
3210
|
this._videoTrackBeingMonitored = track;
|
|
3194
3211
|
}
|
|
3195
3212
|
_connect(clientId) {
|
|
3213
|
+
try {
|
|
3214
|
+
this.rtcStatsReconnect();
|
|
3215
|
+
}
|
|
3216
|
+
catch (_) { }
|
|
3196
3217
|
let session = this._getSession(clientId);
|
|
3197
3218
|
let initialBandwidth = (session && session.bandwidth) || 0;
|
|
3198
3219
|
if (session) {
|
|
@@ -5506,6 +5527,9 @@ class VegaRtcManager {
|
|
|
5506
5527
|
});
|
|
5507
5528
|
}
|
|
5508
5529
|
}
|
|
5530
|
+
close() {
|
|
5531
|
+
this.disconnectAll();
|
|
5532
|
+
}
|
|
5509
5533
|
disconnectAll() {
|
|
5510
5534
|
var _a, _b, _c, _d;
|
|
5511
5535
|
this._reconnect = false;
|
|
@@ -5541,11 +5565,16 @@ class VegaRtcManager {
|
|
|
5541
5565
|
sendStatsCustomEvent(eventName, data) {
|
|
5542
5566
|
rtcStats.sendEvent(eventName, data);
|
|
5543
5567
|
}
|
|
5568
|
+
rtcStatsConnect() {
|
|
5569
|
+
if (!rtcStats.server.connected) {
|
|
5570
|
+
rtcStats.server.connect();
|
|
5571
|
+
}
|
|
5572
|
+
}
|
|
5544
5573
|
rtcStatsDisconnect() {
|
|
5545
5574
|
rtcStats.server.close();
|
|
5546
5575
|
}
|
|
5547
5576
|
rtcStatsReconnect() {
|
|
5548
|
-
if (!rtcStats.server.connected) {
|
|
5577
|
+
if (!rtcStats.server.connected && rtcStats.server.attemptedConnectedAtLeastOnce) {
|
|
5549
5578
|
rtcStats.server.connect();
|
|
5550
5579
|
}
|
|
5551
5580
|
}
|
|
@@ -5871,7 +5900,7 @@ class RtcManagerDispatcher {
|
|
|
5871
5900
|
else {
|
|
5872
5901
|
rtcManager = new P2pRtcManager(config);
|
|
5873
5902
|
}
|
|
5874
|
-
rtcManager.
|
|
5903
|
+
rtcManager.rtcStatsConnect();
|
|
5875
5904
|
rtcManager.setupSocketListeners();
|
|
5876
5905
|
emitter.emit(EVENTS.RTC_MANAGER_CREATED, { rtcManager });
|
|
5877
5906
|
this.currentManager = rtcManager;
|
package/dist/index.d.cts
CHANGED
|
@@ -490,140 +490,6 @@ declare function getUpdatedDevices({ oldDevices, newDevices, currentAudioId, cur
|
|
|
490
490
|
currentSpeakerId?: string | undefined;
|
|
491
491
|
}): GetUpdatedDevicesResult;
|
|
492
492
|
|
|
493
|
-
declare class P2pRtcManager implements RtcManager {
|
|
494
|
-
_selfId: any;
|
|
495
|
-
_roomName: any;
|
|
496
|
-
_roomSessionId: any;
|
|
497
|
-
peerConnections: any;
|
|
498
|
-
localStreams: any;
|
|
499
|
-
enabledLocalStreamIds: any[];
|
|
500
|
-
_screenshareVideoTrackIds: any[];
|
|
501
|
-
_socketListenerDeregisterFunctions: any[];
|
|
502
|
-
_localStreamDeregisterFunction: any;
|
|
503
|
-
_emitter: any;
|
|
504
|
-
_serverSocket: any;
|
|
505
|
-
_webrtcProvider: any;
|
|
506
|
-
_features: any;
|
|
507
|
-
_isAudioOnlyMode: boolean;
|
|
508
|
-
offerOptions: {
|
|
509
|
-
offerToReceiveAudio: boolean;
|
|
510
|
-
offerToReceiveVideo: boolean;
|
|
511
|
-
};
|
|
512
|
-
_pendingActionsForConnectedPeerConnections: any[];
|
|
513
|
-
_audioTrackOnEnded: () => void;
|
|
514
|
-
_videoTrackOnEnded: () => void;
|
|
515
|
-
totalSessionsCreated: number;
|
|
516
|
-
_iceServers: any;
|
|
517
|
-
_turnServers: any;
|
|
518
|
-
_sfuServer: any;
|
|
519
|
-
_mediaserverConfigTtlSeconds: any;
|
|
520
|
-
_fetchMediaServersTimer: any;
|
|
521
|
-
_wasScreenSharing: any;
|
|
522
|
-
ipv6HostCandidateTeredoSeen: any;
|
|
523
|
-
ipv6HostCandidate6to4Seen: any;
|
|
524
|
-
mdnsHostCandidateSeen: any;
|
|
525
|
-
_stoppedVideoTrack: any;
|
|
526
|
-
icePublicIPGatheringTimeoutID: any;
|
|
527
|
-
_videoTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
528
|
-
_audioTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
529
|
-
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, }: {
|
|
530
|
-
selfId: any;
|
|
531
|
-
room: any;
|
|
532
|
-
emitter: any;
|
|
533
|
-
serverSocket: any;
|
|
534
|
-
webrtcProvider: any;
|
|
535
|
-
features: any;
|
|
536
|
-
});
|
|
537
|
-
numberOfPeerconnections(): number;
|
|
538
|
-
isInitializedWith({ selfId, roomName, isSfu }: {
|
|
539
|
-
selfId: any;
|
|
540
|
-
roomName: any;
|
|
541
|
-
isSfu: any;
|
|
542
|
-
}): boolean;
|
|
543
|
-
supportsScreenShareAudio(): boolean;
|
|
544
|
-
addNewStream(streamId: string, stream: MediaStream, audioPaused: boolean, videoPaused: boolean, beforeEffectTracks?: CustomMediaStreamTrack[]): void;
|
|
545
|
-
replaceTrack(oldTrack: CustomMediaStreamTrack | null, newTrack: CustomMediaStreamTrack): Promise<any[]>;
|
|
546
|
-
disconnectAll(): void;
|
|
547
|
-
fixChromeAudio(constraints: any): Promise<any[]> | undefined;
|
|
548
|
-
setupSocketListeners(): void;
|
|
549
|
-
sendAudioMutedStats(muted: boolean): void;
|
|
550
|
-
sendVideoMutedStats(muted: boolean): void;
|
|
551
|
-
sendStatsCustomEvent(eventName: string, data: any): void;
|
|
552
|
-
rtcStatsDisconnect(): void;
|
|
553
|
-
rtcStatsReconnect(): void;
|
|
554
|
-
setAudioOnly(audioOnly: any): void;
|
|
555
|
-
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: never[]): void;
|
|
556
|
-
setRoomSessionId(roomSessionId: string): void;
|
|
557
|
-
_setConnectionStatus(session: any, newStatus: any, clientId: string): void;
|
|
558
|
-
_setJitterBufferTarget(pc: any): void;
|
|
559
|
-
_emitServerEvent(eventName: string, data?: any, callback?: any): void;
|
|
560
|
-
_emit(eventName: string, data?: any): void;
|
|
561
|
-
_addEnabledLocalStreamId(streamId: string): void;
|
|
562
|
-
_deleteEnabledLocalStreamId(streamId: string): void;
|
|
563
|
-
_getSession(peerConnectionId: string): any;
|
|
564
|
-
_getOrCreateSession(peerConnectionId: string, initialBandwidth: any): any;
|
|
565
|
-
_getLocalCameraStream(): any;
|
|
566
|
-
_getNonLocalCameraStreamIds(): string[];
|
|
567
|
-
_isScreensharingLocally(): boolean;
|
|
568
|
-
_getFirstLocalNonCameraStream(): any;
|
|
569
|
-
_transformIncomingSdp(original: any, _: any): {
|
|
570
|
-
type: any;
|
|
571
|
-
sdp: any;
|
|
572
|
-
};
|
|
573
|
-
_transformOutgoingSdp(original: any): {
|
|
574
|
-
type: any;
|
|
575
|
-
sdpU: any;
|
|
576
|
-
};
|
|
577
|
-
_createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, shouldAddLocalVideo, }: {
|
|
578
|
-
clientId: string;
|
|
579
|
-
initialBandwidth: any;
|
|
580
|
-
isOfferer: any;
|
|
581
|
-
peerConnectionId: string;
|
|
582
|
-
shouldAddLocalVideo: boolean;
|
|
583
|
-
}): any;
|
|
584
|
-
_cleanup(peerConnectionId: string): void;
|
|
585
|
-
_forEachPeerConnection(func: any): void;
|
|
586
|
-
_addStreamToPeerConnections(stream: any): void;
|
|
587
|
-
_addTrackToPeerConnections(track: any, stream?: any): void;
|
|
588
|
-
_replaceTrackToPeerConnections(oldTrack: any, newTrack: any): Promise<any[]>;
|
|
589
|
-
_removeStreamFromPeerConnections(stream: any): void;
|
|
590
|
-
_removeTrackFromPeerConnections(track: any): void;
|
|
591
|
-
_addLocalStream(streamId: string, stream: any): void;
|
|
592
|
-
_removeLocalStream(streamId: string): void;
|
|
593
|
-
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds }: any): void;
|
|
594
|
-
_clearMediaServersRefresh(): void;
|
|
595
|
-
_monitorAudioTrack(track: any): void;
|
|
596
|
-
_monitorVideoTrack(track: CustomMediaStreamTrack): void;
|
|
597
|
-
_connect(clientId: string): Promise<any>;
|
|
598
|
-
_maybeRestartIce(clientId: string, session: any): void;
|
|
599
|
-
_setCodecPreferences(pc: RTCPeerConnection): Promise<void>;
|
|
600
|
-
_negotiatePeerConnection(clientId: string, session: any, constraints?: any): void;
|
|
601
|
-
_withForcedRenegotiation(session: any, action: any): void;
|
|
602
|
-
_changeBandwidthForAllClients(isJoining: boolean): number;
|
|
603
|
-
_createP2pSession({ clientId, initialBandwidth, shouldAddLocalVideo, isOfferer, }: {
|
|
604
|
-
clientId: string;
|
|
605
|
-
initialBandwidth: number;
|
|
606
|
-
shouldAddLocalVideo: boolean;
|
|
607
|
-
isOfferer: boolean;
|
|
608
|
-
}): any;
|
|
609
|
-
acceptNewStream({ streamId, clientId, shouldAddLocalVideo, }: {
|
|
610
|
-
streamId: string;
|
|
611
|
-
clientId: string;
|
|
612
|
-
shouldAddLocalVideo?: boolean;
|
|
613
|
-
}): any;
|
|
614
|
-
disconnect(clientId: string): void;
|
|
615
|
-
updateStreamResolution(): void;
|
|
616
|
-
stopOrResumeAudio(): void;
|
|
617
|
-
_handleStopOrResumeVideo({ enable, track }: {
|
|
618
|
-
enable: boolean;
|
|
619
|
-
track: any;
|
|
620
|
-
}): void;
|
|
621
|
-
stopOrResumeVideo(localStream: any, enable: boolean): void;
|
|
622
|
-
_shareScreen(streamId: string, stream: any): void;
|
|
623
|
-
removeStream(streamId: string, stream: any, requestedByClientId: any): void;
|
|
624
|
-
hasClient(clientId: string): boolean;
|
|
625
|
-
}
|
|
626
|
-
|
|
627
493
|
declare const assert: {
|
|
628
494
|
fail: (message?: string | Error) => void;
|
|
629
495
|
ok: (value: any, message?: string | Error) => void;
|
|
@@ -774,13 +640,12 @@ declare class ServerSocket {
|
|
|
774
640
|
noopKeepaliveInterval: any;
|
|
775
641
|
_wasConnectedUsingWebsocket?: boolean;
|
|
776
642
|
disconnectTimestamp: number | undefined;
|
|
643
|
+
joinRoomFinished: boolean;
|
|
777
644
|
constructor(hostName: string, optionsOverrides?: any, glitchFree?: boolean);
|
|
778
645
|
setRtcManager(rtcManager?: RtcManager): void;
|
|
779
646
|
connect(): void;
|
|
780
647
|
disconnect(): void;
|
|
781
|
-
disconnectOnConnect(): void;
|
|
782
648
|
emit(eventName: string, ...args: any[]): void;
|
|
783
|
-
emitIfConnected(eventName: string, data: any): void;
|
|
784
649
|
getTransport(): any;
|
|
785
650
|
getManager(): any;
|
|
786
651
|
isConnecting(): any;
|
|
@@ -1206,6 +1071,144 @@ declare function fromLocation({ host, protocol }?: {
|
|
|
1206
1071
|
subdomain: string;
|
|
1207
1072
|
};
|
|
1208
1073
|
|
|
1074
|
+
declare class P2pRtcManager implements RtcManager {
|
|
1075
|
+
_selfId: any;
|
|
1076
|
+
_roomName: any;
|
|
1077
|
+
_roomSessionId: any;
|
|
1078
|
+
peerConnections: any;
|
|
1079
|
+
localStreams: any;
|
|
1080
|
+
enabledLocalStreamIds: any[];
|
|
1081
|
+
_screenshareVideoTrackIds: any[];
|
|
1082
|
+
_socketListenerDeregisterFunctions: any[];
|
|
1083
|
+
_localStreamDeregisterFunction: any;
|
|
1084
|
+
_emitter: any;
|
|
1085
|
+
_serverSocket: ServerSocket;
|
|
1086
|
+
_webrtcProvider: any;
|
|
1087
|
+
_features: any;
|
|
1088
|
+
_isAudioOnlyMode: boolean;
|
|
1089
|
+
offerOptions: {
|
|
1090
|
+
offerToReceiveAudio: boolean;
|
|
1091
|
+
offerToReceiveVideo: boolean;
|
|
1092
|
+
};
|
|
1093
|
+
_pendingActionsForConnectedPeerConnections: any[];
|
|
1094
|
+
_audioTrackOnEnded: () => void;
|
|
1095
|
+
_videoTrackOnEnded: () => void;
|
|
1096
|
+
totalSessionsCreated: number;
|
|
1097
|
+
_iceServers: any;
|
|
1098
|
+
_turnServers: any;
|
|
1099
|
+
_sfuServer: any;
|
|
1100
|
+
_mediaserverConfigTtlSeconds: any;
|
|
1101
|
+
_fetchMediaServersTimer: any;
|
|
1102
|
+
_wasScreenSharing: any;
|
|
1103
|
+
ipv6HostCandidateTeredoSeen: any;
|
|
1104
|
+
ipv6HostCandidate6to4Seen: any;
|
|
1105
|
+
mdnsHostCandidateSeen: any;
|
|
1106
|
+
_stoppedVideoTrack: any;
|
|
1107
|
+
icePublicIPGatheringTimeoutID: any;
|
|
1108
|
+
_videoTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
1109
|
+
_audioTrackBeingMonitored?: CustomMediaStreamTrack;
|
|
1110
|
+
_closed: boolean;
|
|
1111
|
+
skipEmittingServerMessageCount: number;
|
|
1112
|
+
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, }: {
|
|
1113
|
+
selfId: any;
|
|
1114
|
+
room: any;
|
|
1115
|
+
emitter: any;
|
|
1116
|
+
serverSocket: ServerSocket;
|
|
1117
|
+
webrtcProvider: any;
|
|
1118
|
+
features: any;
|
|
1119
|
+
});
|
|
1120
|
+
numberOfPeerconnections(): number;
|
|
1121
|
+
isInitializedWith({ selfId, roomName, isSfu }: {
|
|
1122
|
+
selfId: any;
|
|
1123
|
+
roomName: any;
|
|
1124
|
+
isSfu: any;
|
|
1125
|
+
}): boolean;
|
|
1126
|
+
supportsScreenShareAudio(): boolean;
|
|
1127
|
+
addNewStream(streamId: string, stream: MediaStream, audioPaused: boolean, videoPaused: boolean, beforeEffectTracks?: CustomMediaStreamTrack[]): void;
|
|
1128
|
+
replaceTrack(oldTrack: CustomMediaStreamTrack | null, newTrack: CustomMediaStreamTrack): Promise<any[]>;
|
|
1129
|
+
close(): void;
|
|
1130
|
+
disconnectAll(): void;
|
|
1131
|
+
fixChromeAudio(constraints: any): Promise<any[]> | undefined;
|
|
1132
|
+
setupSocketListeners(): void;
|
|
1133
|
+
sendAudioMutedStats(muted: boolean): void;
|
|
1134
|
+
sendVideoMutedStats(muted: boolean): void;
|
|
1135
|
+
sendStatsCustomEvent(eventName: string, data: any): void;
|
|
1136
|
+
rtcStatsConnect(): void;
|
|
1137
|
+
rtcStatsDisconnect(): void;
|
|
1138
|
+
rtcStatsReconnect(): void;
|
|
1139
|
+
setAudioOnly(audioOnly: any): void;
|
|
1140
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: never[]): void;
|
|
1141
|
+
setRoomSessionId(roomSessionId: string): void;
|
|
1142
|
+
_setConnectionStatus(session: any, newStatus: any, clientId: string): void;
|
|
1143
|
+
_setJitterBufferTarget(pc: any): void;
|
|
1144
|
+
_emitServerEvent(eventName: string, data?: any): void;
|
|
1145
|
+
_emit(eventName: string, data?: any): void;
|
|
1146
|
+
_addEnabledLocalStreamId(streamId: string): void;
|
|
1147
|
+
_deleteEnabledLocalStreamId(streamId: string): void;
|
|
1148
|
+
_getSession(peerConnectionId: string): any;
|
|
1149
|
+
_getOrCreateSession(peerConnectionId: string, initialBandwidth: any): any;
|
|
1150
|
+
_getLocalCameraStream(): any;
|
|
1151
|
+
_getNonLocalCameraStreamIds(): string[];
|
|
1152
|
+
_isScreensharingLocally(): boolean;
|
|
1153
|
+
_getFirstLocalNonCameraStream(): any;
|
|
1154
|
+
_transformIncomingSdp(original: any, _: any): {
|
|
1155
|
+
type: any;
|
|
1156
|
+
sdp: any;
|
|
1157
|
+
};
|
|
1158
|
+
_transformOutgoingSdp(original: any): {
|
|
1159
|
+
type: any;
|
|
1160
|
+
sdpU: any;
|
|
1161
|
+
};
|
|
1162
|
+
_createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, shouldAddLocalVideo, }: {
|
|
1163
|
+
clientId: string;
|
|
1164
|
+
initialBandwidth: any;
|
|
1165
|
+
isOfferer: any;
|
|
1166
|
+
peerConnectionId: string;
|
|
1167
|
+
shouldAddLocalVideo: boolean;
|
|
1168
|
+
}): any;
|
|
1169
|
+
_cleanup(peerConnectionId: string): void;
|
|
1170
|
+
_forEachPeerConnection(func: any): void;
|
|
1171
|
+
_addStreamToPeerConnections(stream: any): void;
|
|
1172
|
+
_addTrackToPeerConnections(track: any, stream?: any): void;
|
|
1173
|
+
_replaceTrackToPeerConnections(oldTrack: any, newTrack: any): Promise<any[]>;
|
|
1174
|
+
_removeStreamFromPeerConnections(stream: any): void;
|
|
1175
|
+
_removeTrackFromPeerConnections(track: any): void;
|
|
1176
|
+
_addLocalStream(streamId: string, stream: any): void;
|
|
1177
|
+
_removeLocalStream(streamId: string): void;
|
|
1178
|
+
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds }: any): void;
|
|
1179
|
+
_clearMediaServersRefresh(): void;
|
|
1180
|
+
_monitorAudioTrack(track: any): void;
|
|
1181
|
+
_monitorVideoTrack(track: CustomMediaStreamTrack): void;
|
|
1182
|
+
_connect(clientId: string): Promise<any>;
|
|
1183
|
+
_maybeRestartIce(clientId: string, session: any): void;
|
|
1184
|
+
_setCodecPreferences(pc: RTCPeerConnection): Promise<void>;
|
|
1185
|
+
_negotiatePeerConnection(clientId: string, session: any, constraints?: any): void;
|
|
1186
|
+
_withForcedRenegotiation(session: any, action: any): void;
|
|
1187
|
+
_changeBandwidthForAllClients(isJoining: boolean): number;
|
|
1188
|
+
_createP2pSession({ clientId, initialBandwidth, shouldAddLocalVideo, isOfferer, }: {
|
|
1189
|
+
clientId: string;
|
|
1190
|
+
initialBandwidth: number;
|
|
1191
|
+
shouldAddLocalVideo: boolean;
|
|
1192
|
+
isOfferer: boolean;
|
|
1193
|
+
}): any;
|
|
1194
|
+
acceptNewStream({ streamId, clientId, shouldAddLocalVideo, }: {
|
|
1195
|
+
streamId: string;
|
|
1196
|
+
clientId: string;
|
|
1197
|
+
shouldAddLocalVideo?: boolean;
|
|
1198
|
+
}): any;
|
|
1199
|
+
disconnect(clientId: string): void;
|
|
1200
|
+
updateStreamResolution(): void;
|
|
1201
|
+
stopOrResumeAudio(): void;
|
|
1202
|
+
_handleStopOrResumeVideo({ enable, track }: {
|
|
1203
|
+
enable: boolean;
|
|
1204
|
+
track: any;
|
|
1205
|
+
}): void;
|
|
1206
|
+
stopOrResumeVideo(localStream: any, enable: boolean): void;
|
|
1207
|
+
_shareScreen(streamId: string, stream: any): void;
|
|
1208
|
+
removeStream(streamId: string, stream: any, requestedByClientId: any): void;
|
|
1209
|
+
hasClient(clientId: string): boolean;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1209
1212
|
declare class RtcManagerDispatcher {
|
|
1210
1213
|
emitter: {
|
|
1211
1214
|
emit: <K extends keyof RtcEvents>(eventName: K, args?: RtcEvents[K]) => void;
|
|
@@ -1252,6 +1255,7 @@ declare const rtcStats: {
|
|
|
1252
1255
|
sendVideoMuted: (muted: boolean) => void;
|
|
1253
1256
|
server: {
|
|
1254
1257
|
connected: boolean;
|
|
1258
|
+
attemptedConnectedAtLeastOnce: boolean;
|
|
1255
1259
|
trace: (...args: any) => void;
|
|
1256
1260
|
close: () => void;
|
|
1257
1261
|
connect: () => void;
|
|
@@ -1626,10 +1630,12 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1626
1630
|
width: number;
|
|
1627
1631
|
height: number;
|
|
1628
1632
|
}): void;
|
|
1633
|
+
close(): void;
|
|
1629
1634
|
disconnectAll(): void;
|
|
1630
1635
|
sendAudioMutedStats(muted: boolean): void;
|
|
1631
1636
|
sendVideoMutedStats(muted: boolean): void;
|
|
1632
1637
|
sendStatsCustomEvent(eventName: string, data?: any): void;
|
|
1638
|
+
rtcStatsConnect(): void;
|
|
1633
1639
|
rtcStatsDisconnect(): void;
|
|
1634
1640
|
rtcStatsReconnect(): void;
|
|
1635
1641
|
_monitorAudioTrack(track: any): void;
|