@livedigital/client 3.0.2 → 3.0.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/package.json
CHANGED
|
@@ -88,7 +88,10 @@ class DefaultAudioTrack extends DefaultBaseTrack implements AudioTrack {
|
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
if (this.isPublished) {
|
|
92
|
+
await this.replaceTrack(this.#originalTrack);
|
|
93
|
+
}
|
|
94
|
+
|
|
92
95
|
await this.#trackProcessor?.stopProcessing();
|
|
93
96
|
} catch (error) {
|
|
94
97
|
this.logger.warn('disableNoiseSuppression()', {
|
|
@@ -116,7 +116,10 @@ class DefaultVideoTrack extends DefaultBaseTrack implements VideoTrack {
|
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
if (this.isPublished) {
|
|
120
|
+
await this.replaceTrack(this.#originalTrack);
|
|
121
|
+
}
|
|
122
|
+
|
|
120
123
|
this.#trackProcessor.stopProcessing();
|
|
121
124
|
this.logger.info('disableBlur()', { track: this });
|
|
122
125
|
} catch (error) {
|
|
@@ -139,7 +139,7 @@ class Network {
|
|
|
139
139
|
dtlsRole: dtlsParameters.role,
|
|
140
140
|
});
|
|
141
141
|
|
|
142
|
-
setTimeout(() => this.logTransportDetails(transport),
|
|
142
|
+
setTimeout(() => this.logTransportDetails(transport), 1500);
|
|
143
143
|
} catch (error) {
|
|
144
144
|
this.logger.error('sendTransport.on(`connect`)', { dtlsParameters, sendTransportOptions, error });
|
|
145
145
|
errback(error);
|
|
@@ -233,7 +233,7 @@ class Network {
|
|
|
233
233
|
dtlsRole: dtlsParameters.role,
|
|
234
234
|
});
|
|
235
235
|
|
|
236
|
-
setTimeout(() => this.logTransportDetails(transport),
|
|
236
|
+
setTimeout(() => this.logTransportDetails(transport), 1500);
|
|
237
237
|
} catch (error) {
|
|
238
238
|
this.logger.error('receiveTransport.on(`connect`)', { error });
|
|
239
239
|
errback(error);
|
|
@@ -426,16 +426,30 @@ class Network {
|
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
private async logTransportDetails(transport: Transport): Promise<void> {
|
|
429
|
+
let stats: RTCStatsReport;
|
|
430
|
+
|
|
431
|
+
try {
|
|
432
|
+
stats = await transport.getStats();
|
|
433
|
+
} catch (error: unknown) {
|
|
434
|
+
this.logger.error('Failed to log detailed WebRTC transport stats', {
|
|
435
|
+
error: serializeError(error),
|
|
436
|
+
transportId: transport.id,
|
|
437
|
+
reason: 'failed to parse getStats',
|
|
438
|
+
});
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
|
|
429
442
|
try {
|
|
430
|
-
const
|
|
431
|
-
const
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
|
|
443
|
+
const statsArr = [...stats];
|
|
444
|
+
const [, transportStats] = statsArr.find(([, it]) => it?.type === 'transport') ?? [];
|
|
445
|
+
const [, pair] = statsArr.find(
|
|
446
|
+
([,it]) => it.type === 'candidate-pair' && it.state === 'succeeded' && it.nominated,
|
|
447
|
+
) ?? [];
|
|
435
448
|
const localCandidate: Record<string, unknown> | undefined = stats.get(String(pair?.localCandidateId || '-'));
|
|
436
449
|
const remoteCandidate: Record<string, unknown> | undefined = stats.get(String(pair?.remoteCandidateId || '-'));
|
|
437
450
|
|
|
438
|
-
this.logger.info('
|
|
451
|
+
this.logger.info('Detailed WebRTC transport stats', {
|
|
452
|
+
hasNominatedPair: !!pair,
|
|
439
453
|
totalRtt: pair?.totalRoundTripTime ?? '-',
|
|
440
454
|
iceRole: transportStats?.iceRole,
|
|
441
455
|
iceState: transportStats?.iceState,
|
|
@@ -464,9 +478,10 @@ class Network {
|
|
|
464
478
|
},
|
|
465
479
|
});
|
|
466
480
|
} catch (error: unknown) {
|
|
467
|
-
this.logger.error('Failed to log transport
|
|
481
|
+
this.logger.error('Failed to log detailed WebRTC transport stats', {
|
|
468
482
|
error: serializeError(error),
|
|
469
483
|
transportId: transport.id,
|
|
484
|
+
reason: '-',
|
|
470
485
|
});
|
|
471
486
|
}
|
|
472
487
|
}
|