@whereby.com/media 2.5.1 → 2.5.3
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 +48 -27
- package/dist/index.d.cts +139 -136
- package/dist/index.d.mts +139 -136
- package/dist/index.d.ts +139 -136
- package/dist/index.mjs +48 -27
- package/dist/legacy-esm.js +48 -27
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1568,6 +1568,7 @@ class ServerSocket {
|
|
|
1568
1568
|
this._wasConnectedUsingWebsocket = false;
|
|
1569
1569
|
this._reconnectManager = null;
|
|
1570
1570
|
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));
|
|
1571
|
+
this.joinRoomFinished = false;
|
|
1571
1572
|
this._socket.io.on("reconnect", () => {
|
|
1572
1573
|
this._socket.sendBuffer = [];
|
|
1573
1574
|
});
|
|
@@ -1585,6 +1586,12 @@ class ServerSocket {
|
|
|
1585
1586
|
});
|
|
1586
1587
|
if (glitchFree)
|
|
1587
1588
|
this._reconnectManager = new ReconnectManager(this._socket);
|
|
1589
|
+
this._socket.on("room_joined", (payload) => {
|
|
1590
|
+
const { error } = payload;
|
|
1591
|
+
if (!error) {
|
|
1592
|
+
this.joinRoomFinished = true;
|
|
1593
|
+
}
|
|
1594
|
+
});
|
|
1588
1595
|
this._socket.on("connect", () => {
|
|
1589
1596
|
const transport = this.getTransport();
|
|
1590
1597
|
if (transport === "websocket") {
|
|
@@ -1601,6 +1608,7 @@ class ServerSocket {
|
|
|
1601
1608
|
}
|
|
1602
1609
|
});
|
|
1603
1610
|
this._socket.on("disconnect", () => {
|
|
1611
|
+
this.joinRoomFinished = false;
|
|
1604
1612
|
this.disconnectTimestamp = Date.now();
|
|
1605
1613
|
if (this.noopKeepaliveInterval) {
|
|
1606
1614
|
clearInterval(this.noopKeepaliveInterval);
|
|
@@ -1622,26 +1630,12 @@ class ServerSocket {
|
|
|
1622
1630
|
disconnect() {
|
|
1623
1631
|
this._socket.disconnect();
|
|
1624
1632
|
}
|
|
1625
|
-
disconnectOnConnect() {
|
|
1626
|
-
this._socket.once("connect", () => {
|
|
1627
|
-
this._socket.disconnect();
|
|
1628
|
-
});
|
|
1629
|
-
}
|
|
1630
1633
|
emit(eventName, ...args) {
|
|
1631
1634
|
this._socket.emit.apply(this._socket, arguments);
|
|
1632
1635
|
}
|
|
1633
|
-
emitIfConnected(eventName, data) {
|
|
1634
|
-
if (!this.isConnected()) {
|
|
1635
|
-
return;
|
|
1636
|
-
}
|
|
1637
|
-
this.emit(eventName, data);
|
|
1638
|
-
}
|
|
1639
1636
|
getTransport() {
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
this._socket.io.engine &&
|
|
1643
|
-
this._socket.io.engine.transport &&
|
|
1644
|
-
this._socket.io.engine.transport.name);
|
|
1637
|
+
var _a, _b, _c, _d;
|
|
1638
|
+
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
1639
|
}
|
|
1646
1640
|
getManager() {
|
|
1647
1641
|
return this._socket.io;
|
|
@@ -2603,6 +2597,8 @@ class P2pRtcManager {
|
|
|
2603
2597
|
this._webrtcProvider = webrtcProvider;
|
|
2604
2598
|
this._features = features || {};
|
|
2605
2599
|
this._isAudioOnlyMode = false;
|
|
2600
|
+
this._closed = false;
|
|
2601
|
+
this.skipEmittingServerMessageCount = 0;
|
|
2606
2602
|
this.offerOptions = { offerToReceiveAudio: true, offerToReceiveVideo: true };
|
|
2607
2603
|
this._pendingActionsForConnectedPeerConnections = [];
|
|
2608
2604
|
this._audioTrackOnEnded = () => {
|
|
@@ -2684,6 +2680,10 @@ class P2pRtcManager {
|
|
|
2684
2680
|
}
|
|
2685
2681
|
return this._replaceTrackToPeerConnections(oldTrack, newTrack);
|
|
2686
2682
|
}
|
|
2683
|
+
close() {
|
|
2684
|
+
this._closed = true;
|
|
2685
|
+
this.disconnectAll();
|
|
2686
|
+
}
|
|
2687
2687
|
disconnectAll() {
|
|
2688
2688
|
Object.keys(this.peerConnections).forEach((peerConnectionId) => {
|
|
2689
2689
|
this.disconnect(peerConnectionId);
|
|
@@ -2869,8 +2869,18 @@ class P2pRtcManager {
|
|
|
2869
2869
|
logger$6.error("Error during setting jitter buffer target:", error);
|
|
2870
2870
|
}
|
|
2871
2871
|
}
|
|
2872
|
-
_emitServerEvent(eventName, data
|
|
2873
|
-
this.
|
|
2872
|
+
_emitServerEvent(eventName, data) {
|
|
2873
|
+
if (this._closed) {
|
|
2874
|
+
logger$6.warn("RtcManager closed. Will not send event", eventName, data);
|
|
2875
|
+
return;
|
|
2876
|
+
}
|
|
2877
|
+
if (this._features.awaitJoinRoomFinished && !this._serverSocket.joinRoomFinished) {
|
|
2878
|
+
rtcStats.sendEvent("skip_emitting_server_message", { eventName });
|
|
2879
|
+
this.skipEmittingServerMessageCount++;
|
|
2880
|
+
}
|
|
2881
|
+
else {
|
|
2882
|
+
this._serverSocket.emit(eventName, data);
|
|
2883
|
+
}
|
|
2874
2884
|
}
|
|
2875
2885
|
_emit(eventName, data) {
|
|
2876
2886
|
this._emitter.emit(eventName, data);
|
|
@@ -5506,6 +5516,9 @@ class VegaRtcManager {
|
|
|
5506
5516
|
});
|
|
5507
5517
|
}
|
|
5508
5518
|
}
|
|
5519
|
+
close() {
|
|
5520
|
+
this.disconnectAll();
|
|
5521
|
+
}
|
|
5509
5522
|
disconnectAll() {
|
|
5510
5523
|
var _a, _b, _c, _d;
|
|
5511
5524
|
this._reconnect = false;
|
|
@@ -7144,10 +7157,15 @@ function getStream(constraintOpt_1) {
|
|
|
7144
7157
|
const stopTracks = isMobile || only !== "video";
|
|
7145
7158
|
const constraints = getConstraints(constraintOpt);
|
|
7146
7159
|
const addDetails = (err, orgErr) => {
|
|
7147
|
-
|
|
7148
|
-
|
|
7149
|
-
|
|
7150
|
-
|
|
7160
|
+
if (err) {
|
|
7161
|
+
err.details = Object.assign({ constraints, constraint: err.constraint || (orgErr === null || orgErr === void 0 ? void 0 : orgErr.constraint), newConstraints,
|
|
7162
|
+
fallback,
|
|
7163
|
+
stopTracks }, (err !== error && { error: String(error) }));
|
|
7164
|
+
return err;
|
|
7165
|
+
}
|
|
7166
|
+
else {
|
|
7167
|
+
return new Error("Unknown error");
|
|
7168
|
+
}
|
|
7151
7169
|
};
|
|
7152
7170
|
const getSingleStream = (e) => __awaiter(this, void 0, void 0, function* () {
|
|
7153
7171
|
if (constraints.audio && constraints.video) {
|
|
@@ -7155,7 +7173,7 @@ function getStream(constraintOpt_1) {
|
|
|
7155
7173
|
stream = yield getUserMedia(getConstraints(Object.assign(Object.assign({}, constraintOpt), { audioId: false })));
|
|
7156
7174
|
}
|
|
7157
7175
|
catch (e2) {
|
|
7158
|
-
if (e2.name !== "NotFoundError") {
|
|
7176
|
+
if ((e2 === null || e2 === void 0 ? void 0 : e2.name) !== "NotFoundError") {
|
|
7159
7177
|
addDetails(e2, e);
|
|
7160
7178
|
}
|
|
7161
7179
|
}
|
|
@@ -7178,7 +7196,7 @@ function getStream(constraintOpt_1) {
|
|
|
7178
7196
|
if (!fallback) {
|
|
7179
7197
|
throw addDetails(e);
|
|
7180
7198
|
}
|
|
7181
|
-
if (e.name === "OverconstrainedError") {
|
|
7199
|
+
if ((e === null || e === void 0 ? void 0 : e.name) === "OverconstrainedError") {
|
|
7182
7200
|
const laxConstraints = {
|
|
7183
7201
|
deviceId: { videoId: null, audioId: null },
|
|
7184
7202
|
width: { lax: true },
|
|
@@ -7187,15 +7205,15 @@ function getStream(constraintOpt_1) {
|
|
|
7187
7205
|
};
|
|
7188
7206
|
retryConstraintOpt = laxConstraints[e.constraint || ""];
|
|
7189
7207
|
}
|
|
7190
|
-
else if (e.name === "NotFoundError") {
|
|
7208
|
+
else if ((e === null || e === void 0 ? void 0 : e.name) === "NotFoundError") {
|
|
7191
7209
|
yield getSingleStream(e);
|
|
7192
7210
|
}
|
|
7193
|
-
else if (e.name === "NotAllowedError" || e.name === "NotReadableError" || e.name === "AbortError") {
|
|
7211
|
+
else if ((e === null || e === void 0 ? void 0 : e.name) === "NotAllowedError" || (e === null || e === void 0 ? void 0 : e.name) === "NotReadableError" || (e === null || e === void 0 ? void 0 : e.name) === "AbortError") {
|
|
7194
7212
|
if (replaceStream && !stopTracks) {
|
|
7195
7213
|
stopStreamTracks(replaceStream, only);
|
|
7196
7214
|
retryConstraintOpt = constraintOpt;
|
|
7197
7215
|
}
|
|
7198
|
-
if (e.name === "NotAllowedError") {
|
|
7216
|
+
if ((e === null || e === void 0 ? void 0 : e.name) === "NotAllowedError") {
|
|
7199
7217
|
yield getSingleStream(e);
|
|
7200
7218
|
}
|
|
7201
7219
|
else if (e.name !== "NotAllowedError") {
|
|
@@ -7230,6 +7248,9 @@ function getStream(constraintOpt_1) {
|
|
|
7230
7248
|
}
|
|
7231
7249
|
}
|
|
7232
7250
|
}
|
|
7251
|
+
else if (!e) {
|
|
7252
|
+
yield getSingleStream(e);
|
|
7253
|
+
}
|
|
7233
7254
|
}
|
|
7234
7255
|
if (retryConstraintOpt) {
|
|
7235
7256
|
const onlyConstraints = only ? { audio: { videoId: false }, video: { audioId: false } }[only] : {};
|
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,143 @@ 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
|
+
rtcStatsDisconnect(): void;
|
|
1137
|
+
rtcStatsReconnect(): void;
|
|
1138
|
+
setAudioOnly(audioOnly: any): void;
|
|
1139
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: never[]): void;
|
|
1140
|
+
setRoomSessionId(roomSessionId: string): void;
|
|
1141
|
+
_setConnectionStatus(session: any, newStatus: any, clientId: string): void;
|
|
1142
|
+
_setJitterBufferTarget(pc: any): void;
|
|
1143
|
+
_emitServerEvent(eventName: string, data?: any): void;
|
|
1144
|
+
_emit(eventName: string, data?: any): void;
|
|
1145
|
+
_addEnabledLocalStreamId(streamId: string): void;
|
|
1146
|
+
_deleteEnabledLocalStreamId(streamId: string): void;
|
|
1147
|
+
_getSession(peerConnectionId: string): any;
|
|
1148
|
+
_getOrCreateSession(peerConnectionId: string, initialBandwidth: any): any;
|
|
1149
|
+
_getLocalCameraStream(): any;
|
|
1150
|
+
_getNonLocalCameraStreamIds(): string[];
|
|
1151
|
+
_isScreensharingLocally(): boolean;
|
|
1152
|
+
_getFirstLocalNonCameraStream(): any;
|
|
1153
|
+
_transformIncomingSdp(original: any, _: any): {
|
|
1154
|
+
type: any;
|
|
1155
|
+
sdp: any;
|
|
1156
|
+
};
|
|
1157
|
+
_transformOutgoingSdp(original: any): {
|
|
1158
|
+
type: any;
|
|
1159
|
+
sdpU: any;
|
|
1160
|
+
};
|
|
1161
|
+
_createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, shouldAddLocalVideo, }: {
|
|
1162
|
+
clientId: string;
|
|
1163
|
+
initialBandwidth: any;
|
|
1164
|
+
isOfferer: any;
|
|
1165
|
+
peerConnectionId: string;
|
|
1166
|
+
shouldAddLocalVideo: boolean;
|
|
1167
|
+
}): any;
|
|
1168
|
+
_cleanup(peerConnectionId: string): void;
|
|
1169
|
+
_forEachPeerConnection(func: any): void;
|
|
1170
|
+
_addStreamToPeerConnections(stream: any): void;
|
|
1171
|
+
_addTrackToPeerConnections(track: any, stream?: any): void;
|
|
1172
|
+
_replaceTrackToPeerConnections(oldTrack: any, newTrack: any): Promise<any[]>;
|
|
1173
|
+
_removeStreamFromPeerConnections(stream: any): void;
|
|
1174
|
+
_removeTrackFromPeerConnections(track: any): void;
|
|
1175
|
+
_addLocalStream(streamId: string, stream: any): void;
|
|
1176
|
+
_removeLocalStream(streamId: string): void;
|
|
1177
|
+
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds }: any): void;
|
|
1178
|
+
_clearMediaServersRefresh(): void;
|
|
1179
|
+
_monitorAudioTrack(track: any): void;
|
|
1180
|
+
_monitorVideoTrack(track: CustomMediaStreamTrack): void;
|
|
1181
|
+
_connect(clientId: string): Promise<any>;
|
|
1182
|
+
_maybeRestartIce(clientId: string, session: any): void;
|
|
1183
|
+
_setCodecPreferences(pc: RTCPeerConnection): Promise<void>;
|
|
1184
|
+
_negotiatePeerConnection(clientId: string, session: any, constraints?: any): void;
|
|
1185
|
+
_withForcedRenegotiation(session: any, action: any): void;
|
|
1186
|
+
_changeBandwidthForAllClients(isJoining: boolean): number;
|
|
1187
|
+
_createP2pSession({ clientId, initialBandwidth, shouldAddLocalVideo, isOfferer, }: {
|
|
1188
|
+
clientId: string;
|
|
1189
|
+
initialBandwidth: number;
|
|
1190
|
+
shouldAddLocalVideo: boolean;
|
|
1191
|
+
isOfferer: boolean;
|
|
1192
|
+
}): any;
|
|
1193
|
+
acceptNewStream({ streamId, clientId, shouldAddLocalVideo, }: {
|
|
1194
|
+
streamId: string;
|
|
1195
|
+
clientId: string;
|
|
1196
|
+
shouldAddLocalVideo?: boolean;
|
|
1197
|
+
}): any;
|
|
1198
|
+
disconnect(clientId: string): void;
|
|
1199
|
+
updateStreamResolution(): void;
|
|
1200
|
+
stopOrResumeAudio(): void;
|
|
1201
|
+
_handleStopOrResumeVideo({ enable, track }: {
|
|
1202
|
+
enable: boolean;
|
|
1203
|
+
track: any;
|
|
1204
|
+
}): void;
|
|
1205
|
+
stopOrResumeVideo(localStream: any, enable: boolean): void;
|
|
1206
|
+
_shareScreen(streamId: string, stream: any): void;
|
|
1207
|
+
removeStream(streamId: string, stream: any, requestedByClientId: any): void;
|
|
1208
|
+
hasClient(clientId: string): boolean;
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1209
1211
|
declare class RtcManagerDispatcher {
|
|
1210
1212
|
emitter: {
|
|
1211
1213
|
emit: <K extends keyof RtcEvents>(eventName: K, args?: RtcEvents[K]) => void;
|
|
@@ -1626,6 +1628,7 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1626
1628
|
width: number;
|
|
1627
1629
|
height: number;
|
|
1628
1630
|
}): void;
|
|
1631
|
+
close(): void;
|
|
1629
1632
|
disconnectAll(): void;
|
|
1630
1633
|
sendAudioMutedStats(muted: boolean): void;
|
|
1631
1634
|
sendVideoMutedStats(muted: boolean): void;
|