@whereby.com/media 1.16.3 → 1.17.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 +21 -3
- package/dist/index.mjs +21 -3
- package/dist/legacy-esm.js +21 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -4337,7 +4337,9 @@ class P2pRtcManager {
|
|
|
4337
4337
|
return;
|
|
4338
4338
|
}
|
|
4339
4339
|
const offer = this._transformIncomingSdp(data.message, session.pc);
|
|
4340
|
-
(_b = (_a = session
|
|
4340
|
+
(_b = (_a = session
|
|
4341
|
+
.handleOffer(offer)
|
|
4342
|
+
.then((answer) => {
|
|
4341
4343
|
this._emitServerEvent(RELAY_MESSAGES.SDP_ANSWER, {
|
|
4342
4344
|
receiverId: data.clientId,
|
|
4343
4345
|
message: this._transformOutgoingSdp(answer),
|
|
@@ -4542,6 +4544,20 @@ class P2pRtcManager {
|
|
|
4542
4544
|
return entry;
|
|
4543
4545
|
});
|
|
4544
4546
|
}
|
|
4547
|
+
if (this._features.addGoogleStunServers) {
|
|
4548
|
+
peerConnectionConfig.iceServers = [
|
|
4549
|
+
...peerConnectionConfig.iceServers,
|
|
4550
|
+
{ urls: "stun:stun.l.google.com:19302" },
|
|
4551
|
+
{ urls: "stun:stun2.l.google.com:19302" },
|
|
4552
|
+
];
|
|
4553
|
+
}
|
|
4554
|
+
if (this._features.addCloudflareStunServers) {
|
|
4555
|
+
peerConnectionConfig.iceServers = [
|
|
4556
|
+
...peerConnectionConfig.iceServers,
|
|
4557
|
+
{ urls: "stun:stun.cloudflare.com:3478" },
|
|
4558
|
+
{ urls: "stun:stun.cloudflare.com:53" },
|
|
4559
|
+
];
|
|
4560
|
+
}
|
|
4545
4561
|
if (this._features.useOnlyTURN) {
|
|
4546
4562
|
peerConnectionConfig.iceTransportPolicy = "relay";
|
|
4547
4563
|
const filter = {
|
|
@@ -4906,11 +4922,13 @@ class P2pRtcManager {
|
|
|
4906
4922
|
}
|
|
4907
4923
|
if (cleanSdpOn)
|
|
4908
4924
|
offer.sdp = cleanSdp(offer.sdp);
|
|
4909
|
-
pc.setLocalDescription(offer)
|
|
4925
|
+
pc.setLocalDescription(offer)
|
|
4926
|
+
.catch((e) => {
|
|
4910
4927
|
logger$3.warn("RTCPeerConnection.setLocalDescription() failed with local offer", e);
|
|
4911
4928
|
this._emit(rtcManagerEvents.PC_SLD_FAILURE, e);
|
|
4912
4929
|
throw e;
|
|
4913
|
-
})
|
|
4930
|
+
})
|
|
4931
|
+
.then(() => {
|
|
4914
4932
|
this._emitServerEvent(RELAY_MESSAGES.SDP_OFFER, {
|
|
4915
4933
|
receiverId: clientId,
|
|
4916
4934
|
message: this._transformOutgoingSdp(offer),
|
package/dist/index.mjs
CHANGED
|
@@ -4316,7 +4316,9 @@ class P2pRtcManager {
|
|
|
4316
4316
|
return;
|
|
4317
4317
|
}
|
|
4318
4318
|
const offer = this._transformIncomingSdp(data.message, session.pc);
|
|
4319
|
-
(_b = (_a = session
|
|
4319
|
+
(_b = (_a = session
|
|
4320
|
+
.handleOffer(offer)
|
|
4321
|
+
.then((answer) => {
|
|
4320
4322
|
this._emitServerEvent(RELAY_MESSAGES.SDP_ANSWER, {
|
|
4321
4323
|
receiverId: data.clientId,
|
|
4322
4324
|
message: this._transformOutgoingSdp(answer),
|
|
@@ -4521,6 +4523,20 @@ class P2pRtcManager {
|
|
|
4521
4523
|
return entry;
|
|
4522
4524
|
});
|
|
4523
4525
|
}
|
|
4526
|
+
if (this._features.addGoogleStunServers) {
|
|
4527
|
+
peerConnectionConfig.iceServers = [
|
|
4528
|
+
...peerConnectionConfig.iceServers,
|
|
4529
|
+
{ urls: "stun:stun.l.google.com:19302" },
|
|
4530
|
+
{ urls: "stun:stun2.l.google.com:19302" },
|
|
4531
|
+
];
|
|
4532
|
+
}
|
|
4533
|
+
if (this._features.addCloudflareStunServers) {
|
|
4534
|
+
peerConnectionConfig.iceServers = [
|
|
4535
|
+
...peerConnectionConfig.iceServers,
|
|
4536
|
+
{ urls: "stun:stun.cloudflare.com:3478" },
|
|
4537
|
+
{ urls: "stun:stun.cloudflare.com:53" },
|
|
4538
|
+
];
|
|
4539
|
+
}
|
|
4524
4540
|
if (this._features.useOnlyTURN) {
|
|
4525
4541
|
peerConnectionConfig.iceTransportPolicy = "relay";
|
|
4526
4542
|
const filter = {
|
|
@@ -4885,11 +4901,13 @@ class P2pRtcManager {
|
|
|
4885
4901
|
}
|
|
4886
4902
|
if (cleanSdpOn)
|
|
4887
4903
|
offer.sdp = cleanSdp(offer.sdp);
|
|
4888
|
-
pc.setLocalDescription(offer)
|
|
4904
|
+
pc.setLocalDescription(offer)
|
|
4905
|
+
.catch((e) => {
|
|
4889
4906
|
logger$3.warn("RTCPeerConnection.setLocalDescription() failed with local offer", e);
|
|
4890
4907
|
this._emit(rtcManagerEvents.PC_SLD_FAILURE, e);
|
|
4891
4908
|
throw e;
|
|
4892
|
-
})
|
|
4909
|
+
})
|
|
4910
|
+
.then(() => {
|
|
4893
4911
|
this._emitServerEvent(RELAY_MESSAGES.SDP_OFFER, {
|
|
4894
4912
|
receiverId: clientId,
|
|
4895
4913
|
message: this._transformOutgoingSdp(offer),
|
package/dist/legacy-esm.js
CHANGED
|
@@ -4316,7 +4316,9 @@ class P2pRtcManager {
|
|
|
4316
4316
|
return;
|
|
4317
4317
|
}
|
|
4318
4318
|
const offer = this._transformIncomingSdp(data.message, session.pc);
|
|
4319
|
-
(_b = (_a = session
|
|
4319
|
+
(_b = (_a = session
|
|
4320
|
+
.handleOffer(offer)
|
|
4321
|
+
.then((answer) => {
|
|
4320
4322
|
this._emitServerEvent(RELAY_MESSAGES.SDP_ANSWER, {
|
|
4321
4323
|
receiverId: data.clientId,
|
|
4322
4324
|
message: this._transformOutgoingSdp(answer),
|
|
@@ -4521,6 +4523,20 @@ class P2pRtcManager {
|
|
|
4521
4523
|
return entry;
|
|
4522
4524
|
});
|
|
4523
4525
|
}
|
|
4526
|
+
if (this._features.addGoogleStunServers) {
|
|
4527
|
+
peerConnectionConfig.iceServers = [
|
|
4528
|
+
...peerConnectionConfig.iceServers,
|
|
4529
|
+
{ urls: "stun:stun.l.google.com:19302" },
|
|
4530
|
+
{ urls: "stun:stun2.l.google.com:19302" },
|
|
4531
|
+
];
|
|
4532
|
+
}
|
|
4533
|
+
if (this._features.addCloudflareStunServers) {
|
|
4534
|
+
peerConnectionConfig.iceServers = [
|
|
4535
|
+
...peerConnectionConfig.iceServers,
|
|
4536
|
+
{ urls: "stun:stun.cloudflare.com:3478" },
|
|
4537
|
+
{ urls: "stun:stun.cloudflare.com:53" },
|
|
4538
|
+
];
|
|
4539
|
+
}
|
|
4524
4540
|
if (this._features.useOnlyTURN) {
|
|
4525
4541
|
peerConnectionConfig.iceTransportPolicy = "relay";
|
|
4526
4542
|
const filter = {
|
|
@@ -4885,11 +4901,13 @@ class P2pRtcManager {
|
|
|
4885
4901
|
}
|
|
4886
4902
|
if (cleanSdpOn)
|
|
4887
4903
|
offer.sdp = cleanSdp(offer.sdp);
|
|
4888
|
-
pc.setLocalDescription(offer)
|
|
4904
|
+
pc.setLocalDescription(offer)
|
|
4905
|
+
.catch((e) => {
|
|
4889
4906
|
logger$3.warn("RTCPeerConnection.setLocalDescription() failed with local offer", e);
|
|
4890
4907
|
this._emit(rtcManagerEvents.PC_SLD_FAILURE, e);
|
|
4891
4908
|
throw e;
|
|
4892
|
-
})
|
|
4909
|
+
})
|
|
4910
|
+
.then(() => {
|
|
4893
4911
|
this._emitServerEvent(RELAY_MESSAGES.SDP_OFFER, {
|
|
4894
4912
|
receiverId: clientId,
|
|
4895
4913
|
message: this._transformOutgoingSdp(offer),
|