@whereby.com/media 11.5.0 → 11.5.2
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 +28 -3
- package/dist/index.d.cts +5 -0
- package/dist/index.d.mts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.mjs +28 -3
- package/dist/legacy-esm.js +28 -3
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -545,6 +545,7 @@ class Session {
|
|
|
545
545
|
this.signalingState = this.pc.signalingState;
|
|
546
546
|
if (this.pc.signalingState === "stable") {
|
|
547
547
|
this.isOperationPending = false;
|
|
548
|
+
this.isLocalOfferPending = false;
|
|
548
549
|
const action = this.pending.shift();
|
|
549
550
|
if (action) {
|
|
550
551
|
action.apply();
|
|
@@ -556,6 +557,7 @@ class Session {
|
|
|
556
557
|
this.bandwidth = bandwidth || 0;
|
|
557
558
|
this.pending = [];
|
|
558
559
|
this.isOperationPending = false;
|
|
560
|
+
this.isLocalOfferPending = false;
|
|
559
561
|
this.streamIds = [];
|
|
560
562
|
this.streams = [];
|
|
561
563
|
this.earlyIceCandidates = [];
|
|
@@ -618,6 +620,13 @@ class Session {
|
|
|
618
620
|
}
|
|
619
621
|
handleOffer(offer) {
|
|
620
622
|
if (!this.canModifyPeerConnection()) {
|
|
623
|
+
if (this.isLocalOfferPending) {
|
|
624
|
+
this._incrementAnalyticMetric("P2POfferGlare");
|
|
625
|
+
rtcStats.sendEvent("P2POfferGlare", {
|
|
626
|
+
clientId: this.clientId,
|
|
627
|
+
hasRemoteDescription: !!this.pc.remoteDescription,
|
|
628
|
+
});
|
|
629
|
+
}
|
|
621
630
|
return new Promise((resolve) => {
|
|
622
631
|
this.pending.push(() => this.handleOffer(offer).then(resolve));
|
|
623
632
|
});
|
|
@@ -687,7 +696,6 @@ class Session {
|
|
|
687
696
|
rtcStats.sendEvent("P2PAddIceCandidateFailure", {
|
|
688
697
|
clientId: this.clientId,
|
|
689
698
|
errorName: e === null || e === void 0 ? void 0 : e.name,
|
|
690
|
-
errorMessage: e === null || e === void 0 ? void 0 : e.message,
|
|
691
699
|
signalingState: this.pc.signalingState,
|
|
692
700
|
iceConnectionState: this.pc.iceConnectionState,
|
|
693
701
|
});
|
|
@@ -2553,10 +2561,14 @@ class P2pRtcManager {
|
|
|
2553
2561
|
numPcOnOfferFailure: 0,
|
|
2554
2562
|
numPcSldFailure: 0,
|
|
2555
2563
|
P2PAddIceCandidateFailure: 0,
|
|
2564
|
+
P2PCreateOfferFailure: 0,
|
|
2556
2565
|
P2PLocalNetworkFailed: 0,
|
|
2557
2566
|
P2POffendingInitialOffer: 0,
|
|
2567
|
+
P2POfferGlare: 0,
|
|
2568
|
+
P2POfferWithoutSession: 0,
|
|
2558
2569
|
P2POnTrackNoStream: 0,
|
|
2559
2570
|
P2PRelayedIceCandidate: 0,
|
|
2571
|
+
P2PRenegotiationBeforeInitialOffer: 0,
|
|
2560
2572
|
P2PReplaceTrackNewTrackNotInStream: 0,
|
|
2561
2573
|
P2PReplaceTrackNoStream: 0,
|
|
2562
2574
|
P2PStaleAnswerIgnored: 0,
|
|
@@ -2673,6 +2685,8 @@ class P2pRtcManager {
|
|
|
2673
2685
|
const session = this._getSession(data.clientId);
|
|
2674
2686
|
if (!session) {
|
|
2675
2687
|
logger$7.warn("No RTCPeerConnection on SDP_OFFER", data);
|
|
2688
|
+
this.analytics.P2POfferWithoutSession++;
|
|
2689
|
+
rtcStats.sendEvent("P2POfferWithoutSession", { clientId: data.clientId });
|
|
2676
2690
|
return;
|
|
2677
2691
|
}
|
|
2678
2692
|
const sdp = {
|
|
@@ -2700,6 +2714,7 @@ class P2pRtcManager {
|
|
|
2700
2714
|
})).catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
|
|
2701
2715
|
logger$7.error(e);
|
|
2702
2716
|
this.analytics.numPcOnOfferFailure++;
|
|
2717
|
+
rtcStats.sendEvent("numPcOnOfferFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
2703
2718
|
});
|
|
2704
2719
|
}),
|
|
2705
2720
|
this._serverSocket.on(RELAY_MESSAGES.SDP_ANSWER, (data) => {
|
|
@@ -2717,6 +2732,7 @@ class P2pRtcManager {
|
|
|
2717
2732
|
(_b = (_a = session.handleAnswer(sdp)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
|
|
2718
2733
|
logger$7.warn("Could not set remote description from remote answer: ", e);
|
|
2719
2734
|
this.analytics.numPcOnAnswerFailure++;
|
|
2735
|
+
rtcStats.sendEvent("numPcOnAnswerFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
2720
2736
|
});
|
|
2721
2737
|
}),
|
|
2722
2738
|
this._serverSocket.on(PROTOCOL_RESPONSES.SCREENSHARE_STOPPED, (payload) => {
|
|
@@ -3264,6 +3280,7 @@ class P2pRtcManager {
|
|
|
3264
3280
|
return;
|
|
3265
3281
|
}
|
|
3266
3282
|
session.isOperationPending = true;
|
|
3283
|
+
session.isLocalOfferPending = true;
|
|
3267
3284
|
const { redOn, rtpAbsCaptureTimeOn, cleanSdpOn } = this._features;
|
|
3268
3285
|
this._setCodecPreferences(pc).then(() => pc
|
|
3269
3286
|
.createOffer(constraints || this.offerOptions)
|
|
@@ -3285,6 +3302,8 @@ class P2pRtcManager {
|
|
|
3285
3302
|
.catch((e) => {
|
|
3286
3303
|
logger$7.warn("RTCPeerConnection.setLocalDescription() failed with local offer", e);
|
|
3287
3304
|
this.analytics.numPcSldFailure++;
|
|
3305
|
+
session.isLocalOfferPending = false;
|
|
3306
|
+
rtcStats.sendEvent("numPcSldFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
3288
3307
|
throw e;
|
|
3289
3308
|
})
|
|
3290
3309
|
.then(() => {
|
|
@@ -3304,10 +3323,17 @@ class P2pRtcManager {
|
|
|
3304
3323
|
})
|
|
3305
3324
|
.catch((e) => {
|
|
3306
3325
|
logger$7.warn("RTCPeerConnection.createOffer() failed to create local offer", e);
|
|
3326
|
+
this.analytics.P2PCreateOfferFailure++;
|
|
3327
|
+
session.isLocalOfferPending = false;
|
|
3328
|
+
rtcStats.sendEvent("P2PCreateOfferFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
3307
3329
|
}));
|
|
3308
3330
|
}
|
|
3309
3331
|
_withForcedRenegotiation(session, action) {
|
|
3310
3332
|
const pc = session.pc;
|
|
3333
|
+
if (session.canModifyPeerConnection() && !pc.remoteDescription) {
|
|
3334
|
+
this.analytics.P2PRenegotiationBeforeInitialOffer++;
|
|
3335
|
+
rtcStats.sendEvent("P2PRenegotiationBeforeInitialOffer", { clientId: session.clientId });
|
|
3336
|
+
}
|
|
3311
3337
|
const originalOnnegotationneeded = pc.onnegotiationneeded;
|
|
3312
3338
|
pc.onnegotiationneeded = null;
|
|
3313
3339
|
action();
|
|
@@ -5443,8 +5469,7 @@ class VegaRtcManager {
|
|
|
5443
5469
|
if (!trackAnnotations(track).isEffectTrack) {
|
|
5444
5470
|
this._monitorAudioTrack(track);
|
|
5445
5471
|
}
|
|
5446
|
-
this.
|
|
5447
|
-
this._replaceMicTrack();
|
|
5472
|
+
this._sendMic(track);
|
|
5448
5473
|
}
|
|
5449
5474
|
if (track.kind === "video") {
|
|
5450
5475
|
if (!trackAnnotations(track).isEffectTrack) {
|
package/dist/index.d.cts
CHANGED
|
@@ -1786,6 +1786,7 @@ declare class Session {
|
|
|
1786
1786
|
bandwidth: any;
|
|
1787
1787
|
pending: any[];
|
|
1788
1788
|
isOperationPending: boolean;
|
|
1789
|
+
isLocalOfferPending: boolean;
|
|
1789
1790
|
streamIds: string[];
|
|
1790
1791
|
streams: MediaStream[];
|
|
1791
1792
|
earlyIceCandidates: any[];
|
|
@@ -1845,10 +1846,14 @@ type P2PAnalytics = {
|
|
|
1845
1846
|
numPcOnOfferFailure: number;
|
|
1846
1847
|
numPcSldFailure: number;
|
|
1847
1848
|
P2PAddIceCandidateFailure: number;
|
|
1849
|
+
P2PCreateOfferFailure: number;
|
|
1848
1850
|
P2PLocalNetworkFailed: number;
|
|
1849
1851
|
P2POffendingInitialOffer: number;
|
|
1852
|
+
P2POfferGlare: number;
|
|
1853
|
+
P2POfferWithoutSession: number;
|
|
1850
1854
|
P2POnTrackNoStream: number;
|
|
1851
1855
|
P2PRelayedIceCandidate: number;
|
|
1856
|
+
P2PRenegotiationBeforeInitialOffer: number;
|
|
1852
1857
|
P2PReplaceTrackNewTrackNotInStream: number;
|
|
1853
1858
|
P2PReplaceTrackNoStream: number;
|
|
1854
1859
|
P2PStaleAnswerIgnored: number;
|
package/dist/index.d.mts
CHANGED
|
@@ -1786,6 +1786,7 @@ declare class Session {
|
|
|
1786
1786
|
bandwidth: any;
|
|
1787
1787
|
pending: any[];
|
|
1788
1788
|
isOperationPending: boolean;
|
|
1789
|
+
isLocalOfferPending: boolean;
|
|
1789
1790
|
streamIds: string[];
|
|
1790
1791
|
streams: MediaStream[];
|
|
1791
1792
|
earlyIceCandidates: any[];
|
|
@@ -1845,10 +1846,14 @@ type P2PAnalytics = {
|
|
|
1845
1846
|
numPcOnOfferFailure: number;
|
|
1846
1847
|
numPcSldFailure: number;
|
|
1847
1848
|
P2PAddIceCandidateFailure: number;
|
|
1849
|
+
P2PCreateOfferFailure: number;
|
|
1848
1850
|
P2PLocalNetworkFailed: number;
|
|
1849
1851
|
P2POffendingInitialOffer: number;
|
|
1852
|
+
P2POfferGlare: number;
|
|
1853
|
+
P2POfferWithoutSession: number;
|
|
1850
1854
|
P2POnTrackNoStream: number;
|
|
1851
1855
|
P2PRelayedIceCandidate: number;
|
|
1856
|
+
P2PRenegotiationBeforeInitialOffer: number;
|
|
1852
1857
|
P2PReplaceTrackNewTrackNotInStream: number;
|
|
1853
1858
|
P2PReplaceTrackNoStream: number;
|
|
1854
1859
|
P2PStaleAnswerIgnored: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -1786,6 +1786,7 @@ declare class Session {
|
|
|
1786
1786
|
bandwidth: any;
|
|
1787
1787
|
pending: any[];
|
|
1788
1788
|
isOperationPending: boolean;
|
|
1789
|
+
isLocalOfferPending: boolean;
|
|
1789
1790
|
streamIds: string[];
|
|
1790
1791
|
streams: MediaStream[];
|
|
1791
1792
|
earlyIceCandidates: any[];
|
|
@@ -1845,10 +1846,14 @@ type P2PAnalytics = {
|
|
|
1845
1846
|
numPcOnOfferFailure: number;
|
|
1846
1847
|
numPcSldFailure: number;
|
|
1847
1848
|
P2PAddIceCandidateFailure: number;
|
|
1849
|
+
P2PCreateOfferFailure: number;
|
|
1848
1850
|
P2PLocalNetworkFailed: number;
|
|
1849
1851
|
P2POffendingInitialOffer: number;
|
|
1852
|
+
P2POfferGlare: number;
|
|
1853
|
+
P2POfferWithoutSession: number;
|
|
1850
1854
|
P2POnTrackNoStream: number;
|
|
1851
1855
|
P2PRelayedIceCandidate: number;
|
|
1856
|
+
P2PRenegotiationBeforeInitialOffer: number;
|
|
1852
1857
|
P2PReplaceTrackNewTrackNotInStream: number;
|
|
1853
1858
|
P2PReplaceTrackNoStream: number;
|
|
1854
1859
|
P2PStaleAnswerIgnored: number;
|
package/dist/index.mjs
CHANGED
|
@@ -525,6 +525,7 @@ class Session {
|
|
|
525
525
|
this.signalingState = this.pc.signalingState;
|
|
526
526
|
if (this.pc.signalingState === "stable") {
|
|
527
527
|
this.isOperationPending = false;
|
|
528
|
+
this.isLocalOfferPending = false;
|
|
528
529
|
const action = this.pending.shift();
|
|
529
530
|
if (action) {
|
|
530
531
|
action.apply();
|
|
@@ -536,6 +537,7 @@ class Session {
|
|
|
536
537
|
this.bandwidth = bandwidth || 0;
|
|
537
538
|
this.pending = [];
|
|
538
539
|
this.isOperationPending = false;
|
|
540
|
+
this.isLocalOfferPending = false;
|
|
539
541
|
this.streamIds = [];
|
|
540
542
|
this.streams = [];
|
|
541
543
|
this.earlyIceCandidates = [];
|
|
@@ -598,6 +600,13 @@ class Session {
|
|
|
598
600
|
}
|
|
599
601
|
handleOffer(offer) {
|
|
600
602
|
if (!this.canModifyPeerConnection()) {
|
|
603
|
+
if (this.isLocalOfferPending) {
|
|
604
|
+
this._incrementAnalyticMetric("P2POfferGlare");
|
|
605
|
+
rtcStats.sendEvent("P2POfferGlare", {
|
|
606
|
+
clientId: this.clientId,
|
|
607
|
+
hasRemoteDescription: !!this.pc.remoteDescription,
|
|
608
|
+
});
|
|
609
|
+
}
|
|
601
610
|
return new Promise((resolve) => {
|
|
602
611
|
this.pending.push(() => this.handleOffer(offer).then(resolve));
|
|
603
612
|
});
|
|
@@ -667,7 +676,6 @@ class Session {
|
|
|
667
676
|
rtcStats.sendEvent("P2PAddIceCandidateFailure", {
|
|
668
677
|
clientId: this.clientId,
|
|
669
678
|
errorName: e === null || e === void 0 ? void 0 : e.name,
|
|
670
|
-
errorMessage: e === null || e === void 0 ? void 0 : e.message,
|
|
671
679
|
signalingState: this.pc.signalingState,
|
|
672
680
|
iceConnectionState: this.pc.iceConnectionState,
|
|
673
681
|
});
|
|
@@ -2533,10 +2541,14 @@ class P2pRtcManager {
|
|
|
2533
2541
|
numPcOnOfferFailure: 0,
|
|
2534
2542
|
numPcSldFailure: 0,
|
|
2535
2543
|
P2PAddIceCandidateFailure: 0,
|
|
2544
|
+
P2PCreateOfferFailure: 0,
|
|
2536
2545
|
P2PLocalNetworkFailed: 0,
|
|
2537
2546
|
P2POffendingInitialOffer: 0,
|
|
2547
|
+
P2POfferGlare: 0,
|
|
2548
|
+
P2POfferWithoutSession: 0,
|
|
2538
2549
|
P2POnTrackNoStream: 0,
|
|
2539
2550
|
P2PRelayedIceCandidate: 0,
|
|
2551
|
+
P2PRenegotiationBeforeInitialOffer: 0,
|
|
2540
2552
|
P2PReplaceTrackNewTrackNotInStream: 0,
|
|
2541
2553
|
P2PReplaceTrackNoStream: 0,
|
|
2542
2554
|
P2PStaleAnswerIgnored: 0,
|
|
@@ -2653,6 +2665,8 @@ class P2pRtcManager {
|
|
|
2653
2665
|
const session = this._getSession(data.clientId);
|
|
2654
2666
|
if (!session) {
|
|
2655
2667
|
logger$7.warn("No RTCPeerConnection on SDP_OFFER", data);
|
|
2668
|
+
this.analytics.P2POfferWithoutSession++;
|
|
2669
|
+
rtcStats.sendEvent("P2POfferWithoutSession", { clientId: data.clientId });
|
|
2656
2670
|
return;
|
|
2657
2671
|
}
|
|
2658
2672
|
const sdp = {
|
|
@@ -2680,6 +2694,7 @@ class P2pRtcManager {
|
|
|
2680
2694
|
})).catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
|
|
2681
2695
|
logger$7.error(e);
|
|
2682
2696
|
this.analytics.numPcOnOfferFailure++;
|
|
2697
|
+
rtcStats.sendEvent("numPcOnOfferFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
2683
2698
|
});
|
|
2684
2699
|
}),
|
|
2685
2700
|
this._serverSocket.on(RELAY_MESSAGES.SDP_ANSWER, (data) => {
|
|
@@ -2697,6 +2712,7 @@ class P2pRtcManager {
|
|
|
2697
2712
|
(_b = (_a = session.handleAnswer(sdp)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
|
|
2698
2713
|
logger$7.warn("Could not set remote description from remote answer: ", e);
|
|
2699
2714
|
this.analytics.numPcOnAnswerFailure++;
|
|
2715
|
+
rtcStats.sendEvent("numPcOnAnswerFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
2700
2716
|
});
|
|
2701
2717
|
}),
|
|
2702
2718
|
this._serverSocket.on(PROTOCOL_RESPONSES.SCREENSHARE_STOPPED, (payload) => {
|
|
@@ -3244,6 +3260,7 @@ class P2pRtcManager {
|
|
|
3244
3260
|
return;
|
|
3245
3261
|
}
|
|
3246
3262
|
session.isOperationPending = true;
|
|
3263
|
+
session.isLocalOfferPending = true;
|
|
3247
3264
|
const { redOn, rtpAbsCaptureTimeOn, cleanSdpOn } = this._features;
|
|
3248
3265
|
this._setCodecPreferences(pc).then(() => pc
|
|
3249
3266
|
.createOffer(constraints || this.offerOptions)
|
|
@@ -3265,6 +3282,8 @@ class P2pRtcManager {
|
|
|
3265
3282
|
.catch((e) => {
|
|
3266
3283
|
logger$7.warn("RTCPeerConnection.setLocalDescription() failed with local offer", e);
|
|
3267
3284
|
this.analytics.numPcSldFailure++;
|
|
3285
|
+
session.isLocalOfferPending = false;
|
|
3286
|
+
rtcStats.sendEvent("numPcSldFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
3268
3287
|
throw e;
|
|
3269
3288
|
})
|
|
3270
3289
|
.then(() => {
|
|
@@ -3284,10 +3303,17 @@ class P2pRtcManager {
|
|
|
3284
3303
|
})
|
|
3285
3304
|
.catch((e) => {
|
|
3286
3305
|
logger$7.warn("RTCPeerConnection.createOffer() failed to create local offer", e);
|
|
3306
|
+
this.analytics.P2PCreateOfferFailure++;
|
|
3307
|
+
session.isLocalOfferPending = false;
|
|
3308
|
+
rtcStats.sendEvent("P2PCreateOfferFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
3287
3309
|
}));
|
|
3288
3310
|
}
|
|
3289
3311
|
_withForcedRenegotiation(session, action) {
|
|
3290
3312
|
const pc = session.pc;
|
|
3313
|
+
if (session.canModifyPeerConnection() && !pc.remoteDescription) {
|
|
3314
|
+
this.analytics.P2PRenegotiationBeforeInitialOffer++;
|
|
3315
|
+
rtcStats.sendEvent("P2PRenegotiationBeforeInitialOffer", { clientId: session.clientId });
|
|
3316
|
+
}
|
|
3291
3317
|
const originalOnnegotationneeded = pc.onnegotiationneeded;
|
|
3292
3318
|
pc.onnegotiationneeded = null;
|
|
3293
3319
|
action();
|
|
@@ -5423,8 +5449,7 @@ class VegaRtcManager {
|
|
|
5423
5449
|
if (!trackAnnotations(track).isEffectTrack) {
|
|
5424
5450
|
this._monitorAudioTrack(track);
|
|
5425
5451
|
}
|
|
5426
|
-
this.
|
|
5427
|
-
this._replaceMicTrack();
|
|
5452
|
+
this._sendMic(track);
|
|
5428
5453
|
}
|
|
5429
5454
|
if (track.kind === "video") {
|
|
5430
5455
|
if (!trackAnnotations(track).isEffectTrack) {
|
package/dist/legacy-esm.js
CHANGED
|
@@ -525,6 +525,7 @@ class Session {
|
|
|
525
525
|
this.signalingState = this.pc.signalingState;
|
|
526
526
|
if (this.pc.signalingState === "stable") {
|
|
527
527
|
this.isOperationPending = false;
|
|
528
|
+
this.isLocalOfferPending = false;
|
|
528
529
|
const action = this.pending.shift();
|
|
529
530
|
if (action) {
|
|
530
531
|
action.apply();
|
|
@@ -536,6 +537,7 @@ class Session {
|
|
|
536
537
|
this.bandwidth = bandwidth || 0;
|
|
537
538
|
this.pending = [];
|
|
538
539
|
this.isOperationPending = false;
|
|
540
|
+
this.isLocalOfferPending = false;
|
|
539
541
|
this.streamIds = [];
|
|
540
542
|
this.streams = [];
|
|
541
543
|
this.earlyIceCandidates = [];
|
|
@@ -598,6 +600,13 @@ class Session {
|
|
|
598
600
|
}
|
|
599
601
|
handleOffer(offer) {
|
|
600
602
|
if (!this.canModifyPeerConnection()) {
|
|
603
|
+
if (this.isLocalOfferPending) {
|
|
604
|
+
this._incrementAnalyticMetric("P2POfferGlare");
|
|
605
|
+
rtcStats.sendEvent("P2POfferGlare", {
|
|
606
|
+
clientId: this.clientId,
|
|
607
|
+
hasRemoteDescription: !!this.pc.remoteDescription,
|
|
608
|
+
});
|
|
609
|
+
}
|
|
601
610
|
return new Promise((resolve) => {
|
|
602
611
|
this.pending.push(() => this.handleOffer(offer).then(resolve));
|
|
603
612
|
});
|
|
@@ -667,7 +676,6 @@ class Session {
|
|
|
667
676
|
rtcStats.sendEvent("P2PAddIceCandidateFailure", {
|
|
668
677
|
clientId: this.clientId,
|
|
669
678
|
errorName: e === null || e === void 0 ? void 0 : e.name,
|
|
670
|
-
errorMessage: e === null || e === void 0 ? void 0 : e.message,
|
|
671
679
|
signalingState: this.pc.signalingState,
|
|
672
680
|
iceConnectionState: this.pc.iceConnectionState,
|
|
673
681
|
});
|
|
@@ -2533,10 +2541,14 @@ class P2pRtcManager {
|
|
|
2533
2541
|
numPcOnOfferFailure: 0,
|
|
2534
2542
|
numPcSldFailure: 0,
|
|
2535
2543
|
P2PAddIceCandidateFailure: 0,
|
|
2544
|
+
P2PCreateOfferFailure: 0,
|
|
2536
2545
|
P2PLocalNetworkFailed: 0,
|
|
2537
2546
|
P2POffendingInitialOffer: 0,
|
|
2547
|
+
P2POfferGlare: 0,
|
|
2548
|
+
P2POfferWithoutSession: 0,
|
|
2538
2549
|
P2POnTrackNoStream: 0,
|
|
2539
2550
|
P2PRelayedIceCandidate: 0,
|
|
2551
|
+
P2PRenegotiationBeforeInitialOffer: 0,
|
|
2540
2552
|
P2PReplaceTrackNewTrackNotInStream: 0,
|
|
2541
2553
|
P2PReplaceTrackNoStream: 0,
|
|
2542
2554
|
P2PStaleAnswerIgnored: 0,
|
|
@@ -2653,6 +2665,8 @@ class P2pRtcManager {
|
|
|
2653
2665
|
const session = this._getSession(data.clientId);
|
|
2654
2666
|
if (!session) {
|
|
2655
2667
|
logger$7.warn("No RTCPeerConnection on SDP_OFFER", data);
|
|
2668
|
+
this.analytics.P2POfferWithoutSession++;
|
|
2669
|
+
rtcStats.sendEvent("P2POfferWithoutSession", { clientId: data.clientId });
|
|
2656
2670
|
return;
|
|
2657
2671
|
}
|
|
2658
2672
|
const sdp = {
|
|
@@ -2680,6 +2694,7 @@ class P2pRtcManager {
|
|
|
2680
2694
|
})).catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
|
|
2681
2695
|
logger$7.error(e);
|
|
2682
2696
|
this.analytics.numPcOnOfferFailure++;
|
|
2697
|
+
rtcStats.sendEvent("numPcOnOfferFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
2683
2698
|
});
|
|
2684
2699
|
}),
|
|
2685
2700
|
this._serverSocket.on(RELAY_MESSAGES.SDP_ANSWER, (data) => {
|
|
@@ -2697,6 +2712,7 @@ class P2pRtcManager {
|
|
|
2697
2712
|
(_b = (_a = session.handleAnswer(sdp)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
|
|
2698
2713
|
logger$7.warn("Could not set remote description from remote answer: ", e);
|
|
2699
2714
|
this.analytics.numPcOnAnswerFailure++;
|
|
2715
|
+
rtcStats.sendEvent("numPcOnAnswerFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
2700
2716
|
});
|
|
2701
2717
|
}),
|
|
2702
2718
|
this._serverSocket.on(PROTOCOL_RESPONSES.SCREENSHARE_STOPPED, (payload) => {
|
|
@@ -3244,6 +3260,7 @@ class P2pRtcManager {
|
|
|
3244
3260
|
return;
|
|
3245
3261
|
}
|
|
3246
3262
|
session.isOperationPending = true;
|
|
3263
|
+
session.isLocalOfferPending = true;
|
|
3247
3264
|
const { redOn, rtpAbsCaptureTimeOn, cleanSdpOn } = this._features;
|
|
3248
3265
|
this._setCodecPreferences(pc).then(() => pc
|
|
3249
3266
|
.createOffer(constraints || this.offerOptions)
|
|
@@ -3265,6 +3282,8 @@ class P2pRtcManager {
|
|
|
3265
3282
|
.catch((e) => {
|
|
3266
3283
|
logger$7.warn("RTCPeerConnection.setLocalDescription() failed with local offer", e);
|
|
3267
3284
|
this.analytics.numPcSldFailure++;
|
|
3285
|
+
session.isLocalOfferPending = false;
|
|
3286
|
+
rtcStats.sendEvent("numPcSldFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
3268
3287
|
throw e;
|
|
3269
3288
|
})
|
|
3270
3289
|
.then(() => {
|
|
@@ -3284,10 +3303,17 @@ class P2pRtcManager {
|
|
|
3284
3303
|
})
|
|
3285
3304
|
.catch((e) => {
|
|
3286
3305
|
logger$7.warn("RTCPeerConnection.createOffer() failed to create local offer", e);
|
|
3306
|
+
this.analytics.P2PCreateOfferFailure++;
|
|
3307
|
+
session.isLocalOfferPending = false;
|
|
3308
|
+
rtcStats.sendEvent("P2PCreateOfferFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
|
|
3287
3309
|
}));
|
|
3288
3310
|
}
|
|
3289
3311
|
_withForcedRenegotiation(session, action) {
|
|
3290
3312
|
const pc = session.pc;
|
|
3313
|
+
if (session.canModifyPeerConnection() && !pc.remoteDescription) {
|
|
3314
|
+
this.analytics.P2PRenegotiationBeforeInitialOffer++;
|
|
3315
|
+
rtcStats.sendEvent("P2PRenegotiationBeforeInitialOffer", { clientId: session.clientId });
|
|
3316
|
+
}
|
|
3291
3317
|
const originalOnnegotationneeded = pc.onnegotiationneeded;
|
|
3292
3318
|
pc.onnegotiationneeded = null;
|
|
3293
3319
|
action();
|
|
@@ -5423,8 +5449,7 @@ class VegaRtcManager {
|
|
|
5423
5449
|
if (!trackAnnotations(track).isEffectTrack) {
|
|
5424
5450
|
this._monitorAudioTrack(track);
|
|
5425
5451
|
}
|
|
5426
|
-
this.
|
|
5427
|
-
this._replaceMicTrack();
|
|
5452
|
+
this._sendMic(track);
|
|
5428
5453
|
}
|
|
5429
5454
|
if (track.kind === "video") {
|
|
5430
5455
|
if (!trackAnnotations(track).isEffectTrack) {
|