@whereby.com/media 1.14.2 → 1.15.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/dist/index.cjs +5 -18
- package/dist/index.d.cts +575 -580
- package/dist/index.d.mts +575 -580
- package/dist/index.d.ts +575 -580
- package/dist/index.mjs +5 -18
- package/dist/legacy-esm.js +5 -18
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -3540,7 +3540,6 @@ class P2pRtcManager {
|
|
|
3540
3540
|
this._isAudioOnlyMode = false;
|
|
3541
3541
|
this.offerOptions = { offerToReceiveAudio: true, offerToReceiveVideo: true };
|
|
3542
3542
|
this._pendingActionsForConnectedPeerConnections = [];
|
|
3543
|
-
this._nodeJsClients = [];
|
|
3544
3543
|
this._audioTrackOnEnded = () => {
|
|
3545
3544
|
rtcStats.sendEvent("audio_ended", { unloading: unloading$1 });
|
|
3546
3545
|
this._emit(rtcManagerEvents.MICROPHONE_STOPPED_WORKING, {});
|
|
@@ -3656,11 +3655,6 @@ class P2pRtcManager {
|
|
|
3656
3655
|
setupSocketListeners() {
|
|
3657
3656
|
this._socketListenerDeregisterFunctions = [
|
|
3658
3657
|
() => this._clearMediaServersRefresh(),
|
|
3659
|
-
this._serverSocket.on(PROTOCOL_RESPONSES.NEW_CLIENT, (data) => {
|
|
3660
|
-
if (data.client.isDialIn && !this._nodeJsClients.includes(data.client.id)) {
|
|
3661
|
-
this._nodeJsClients.push(data.client.id);
|
|
3662
|
-
}
|
|
3663
|
-
}),
|
|
3664
3658
|
this._serverSocket.on(PROTOCOL_RESPONSES.MEDIASERVER_CONFIG, (data) => {
|
|
3665
3659
|
if (data.error) {
|
|
3666
3660
|
logger$4.warn("FETCH_MEDIASERVER_CONFIG failed:", data.error);
|
|
@@ -3858,7 +3852,7 @@ class P2pRtcManager {
|
|
|
3858
3852
|
_transformOutgoingSdp(original) {
|
|
3859
3853
|
return { type: original.type, sdpU: original.sdp };
|
|
3860
3854
|
}
|
|
3861
|
-
_createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, shouldAddLocalVideo,
|
|
3855
|
+
_createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, shouldAddLocalVideo, }) {
|
|
3862
3856
|
if (!peerConnectionId) {
|
|
3863
3857
|
throw new Error("peerConnectionId is missing");
|
|
3864
3858
|
}
|
|
@@ -3894,13 +3888,13 @@ class P2pRtcManager {
|
|
|
3894
3888
|
return entry;
|
|
3895
3889
|
});
|
|
3896
3890
|
}
|
|
3897
|
-
if (
|
|
3891
|
+
if (this._features.useOnlyTURN) {
|
|
3898
3892
|
peerConnectionConfig.iceTransportPolicy = "relay";
|
|
3899
3893
|
const filter = {
|
|
3900
3894
|
onlyudp: /^turn:.*transport=udp$/,
|
|
3901
3895
|
onlytcp: /^turn:.*transport=tcp$/,
|
|
3902
3896
|
onlytls: /^turns:.*transport=tcp$/,
|
|
3903
|
-
}[
|
|
3897
|
+
}[this._features.useOnlyTURN];
|
|
3904
3898
|
if (filter) {
|
|
3905
3899
|
peerConnectionConfig.iceServers = peerConnectionConfig.iceServers.filter((entry) => entry.url && entry.url.match(filter));
|
|
3906
3900
|
}
|
|
@@ -4160,16 +4154,11 @@ class P2pRtcManager {
|
|
|
4160
4154
|
else {
|
|
4161
4155
|
initialBandwidth = this._changeBandwidthForAllClients(true);
|
|
4162
4156
|
}
|
|
4163
|
-
let enforceTurnProtocol;
|
|
4164
|
-
if (this._nodeJsClients.includes(clientId)) {
|
|
4165
|
-
enforceTurnProtocol = this._features.isNodeSdk ? "onlyudp" : "onlytls";
|
|
4166
|
-
}
|
|
4167
4157
|
session = this._createP2pSession({
|
|
4168
4158
|
clientId,
|
|
4169
4159
|
initialBandwidth,
|
|
4170
4160
|
shouldAddLocalVideo: true,
|
|
4171
4161
|
isOfferer: true,
|
|
4172
|
-
enforceTurnProtocol,
|
|
4173
4162
|
});
|
|
4174
4163
|
this._negotiatePeerConnection(clientId, session);
|
|
4175
4164
|
return Promise.resolve(session);
|
|
@@ -4341,14 +4330,13 @@ class P2pRtcManager {
|
|
|
4341
4330
|
});
|
|
4342
4331
|
return bandwidth;
|
|
4343
4332
|
}
|
|
4344
|
-
_createP2pSession({ clientId, initialBandwidth, shouldAddLocalVideo = false, isOfferer = false,
|
|
4333
|
+
_createP2pSession({ clientId, initialBandwidth, shouldAddLocalVideo = false, isOfferer = false, }) {
|
|
4345
4334
|
const session = this._createSession({
|
|
4346
4335
|
peerConnectionId: clientId,
|
|
4347
4336
|
clientId,
|
|
4348
4337
|
initialBandwidth,
|
|
4349
4338
|
shouldAddLocalVideo,
|
|
4350
4339
|
isOfferer,
|
|
4351
|
-
enforceTurnProtocol,
|
|
4352
4340
|
});
|
|
4353
4341
|
const pc = session.pc;
|
|
4354
4342
|
if (this._features.increaseIncomingMediaBufferOn) {
|
|
@@ -4462,7 +4450,7 @@ class P2pRtcManager {
|
|
|
4462
4450
|
};
|
|
4463
4451
|
return session;
|
|
4464
4452
|
}
|
|
4465
|
-
acceptNewStream({ streamId, clientId, shouldAddLocalVideo,
|
|
4453
|
+
acceptNewStream({ streamId, clientId, shouldAddLocalVideo, }) {
|
|
4466
4454
|
let session = this._getSession(clientId);
|
|
4467
4455
|
if (session && streamId !== clientId) {
|
|
4468
4456
|
return session;
|
|
@@ -4479,7 +4467,6 @@ class P2pRtcManager {
|
|
|
4479
4467
|
clientId,
|
|
4480
4468
|
initialBandwidth,
|
|
4481
4469
|
shouldAddLocalVideo: !!shouldAddLocalVideo,
|
|
4482
|
-
enforceTurnProtocol,
|
|
4483
4470
|
isOfferer: false,
|
|
4484
4471
|
});
|
|
4485
4472
|
this._emitServerEvent(RELAY_MESSAGES.READY_TO_RECEIVE_OFFER, {
|