@whereby.com/media 2.6.9 → 2.7.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 +114 -71
- package/dist/index.d.cts +19 -5
- package/dist/index.d.mts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.mjs +114 -72
- package/dist/legacy-esm.js +114 -72
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1828,6 +1828,16 @@ function fromLocation({ host = "whereby.com", protocol = "https:" } = {}) {
|
|
|
1828
1828
|
}
|
|
1829
1829
|
fromLocation(window && window.location);
|
|
1830
1830
|
|
|
1831
|
+
const _trackAnnotations = new WeakMap();
|
|
1832
|
+
function trackAnnotations(o) {
|
|
1833
|
+
let props = _trackAnnotations.get(o);
|
|
1834
|
+
if (!props) {
|
|
1835
|
+
props = {};
|
|
1836
|
+
_trackAnnotations.set(o, props);
|
|
1837
|
+
}
|
|
1838
|
+
return props;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1831
1841
|
const logger$9 = new Logger();
|
|
1832
1842
|
const debugLogger = {
|
|
1833
1843
|
print: (...args) => console.debug(args[0], ...args.slice(1)),
|
|
@@ -2225,6 +2235,7 @@ class Session {
|
|
|
2225
2235
|
});
|
|
2226
2236
|
}
|
|
2227
2237
|
else {
|
|
2238
|
+
rtcStats.sendEvent("P2PNoAddTrackSupport", {});
|
|
2228
2239
|
this.pc.addStream(stream);
|
|
2229
2240
|
}
|
|
2230
2241
|
}
|
|
@@ -2263,6 +2274,10 @@ class Session {
|
|
|
2263
2274
|
this.pc.removeStream(stream);
|
|
2264
2275
|
}
|
|
2265
2276
|
}
|
|
2277
|
+
else {
|
|
2278
|
+
rtcStats.sendEvent("P2PRemoveStreamNoPC", {});
|
|
2279
|
+
this._incrementAnalyticMetric("P2PRemoveStreamNoPC");
|
|
2280
|
+
}
|
|
2266
2281
|
}
|
|
2267
2282
|
_setRemoteDescription(desc) {
|
|
2268
2283
|
if (this._deprioritizeH264Encoding)
|
|
@@ -2347,98 +2362,104 @@ class Session {
|
|
|
2347
2362
|
return this.pc && this.pc.connectionState === "connected";
|
|
2348
2363
|
}
|
|
2349
2364
|
replaceTrack(oldTrack, newTrack) {
|
|
2350
|
-
var _a, _b;
|
|
2351
|
-
|
|
2352
|
-
if (!
|
|
2353
|
-
rtcStats.sendEvent("
|
|
2365
|
+
var _a, _b, _c;
|
|
2366
|
+
logger$7.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack === null || newTrack === void 0 ? void 0 : newTrack.id);
|
|
2367
|
+
if (!newTrack) {
|
|
2368
|
+
rtcStats.sendEvent("P2PReplaceTrackNoNewTrack", {
|
|
2354
2369
|
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2355
|
-
|
|
2370
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2371
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2356
2372
|
});
|
|
2357
|
-
this._incrementAnalyticMetric("
|
|
2373
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNoNewTrack");
|
|
2358
2374
|
return false;
|
|
2359
2375
|
}
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
return null;
|
|
2377
|
-
};
|
|
2378
|
-
const result = process();
|
|
2379
|
-
if (result) {
|
|
2380
|
-
return result;
|
|
2376
|
+
if (newTrack.readyState === "ended") {
|
|
2377
|
+
rtcStats.sendEvent("P2PReplaceTrackNewTrackEnded", {
|
|
2378
|
+
newTrackId: newTrack.id,
|
|
2379
|
+
newTrackKind: newTrack.kind,
|
|
2380
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2381
|
+
});
|
|
2382
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNewTrackEnded");
|
|
2383
|
+
return false;
|
|
2384
|
+
}
|
|
2385
|
+
const pc = this.pc;
|
|
2386
|
+
if ((_b = (_a = window.RTCRtpSender) === null || _a === void 0 ? void 0 : _a.prototype) === null || _b === void 0 ? void 0 : _b.replaceTrack) {
|
|
2387
|
+
if (oldTrack) {
|
|
2388
|
+
const sender = pc.getSenders().find((s) => { var _a; return ((_a = s.track) === null || _a === void 0 ? void 0 : _a.id) === oldTrack.id; });
|
|
2389
|
+
if (sender) {
|
|
2390
|
+
sender.replaceTrack(newTrack);
|
|
2391
|
+
return Promise.resolve(newTrack);
|
|
2381
2392
|
}
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
const trackReplaced = yield trackReplacedPromise;
|
|
2415
|
-
resolve(trackReplaced);
|
|
2416
|
-
}), 1000);
|
|
2393
|
+
}
|
|
2394
|
+
const sender = pc.getSenders().find((s) => {
|
|
2395
|
+
const track = s.track;
|
|
2396
|
+
return (track === null || track === void 0 ? void 0 : track.kind) === newTrack.kind && !trackAnnotations(track).fromGetDisplayMedia;
|
|
2397
|
+
});
|
|
2398
|
+
if (sender) {
|
|
2399
|
+
this._incrementAnalyticMetric("P2PReplaceTrackOldTrackNotFound");
|
|
2400
|
+
const track = sender.track;
|
|
2401
|
+
rtcStats.sendEvent("P2PReplaceTrackOldTrackNotFound", {
|
|
2402
|
+
targetTrackId: track === null || track === void 0 ? void 0 : track.id,
|
|
2403
|
+
targetTrackKind: track === null || track === void 0 ? void 0 : track.kind,
|
|
2404
|
+
targetTrackIsEffect: track === null || track === void 0 ? void 0 : track.effectTrack,
|
|
2405
|
+
targetTrackReadyState: track === null || track === void 0 ? void 0 : track.readyState,
|
|
2406
|
+
newTrackId: newTrack.id,
|
|
2407
|
+
newTrackKind: newTrack.kind,
|
|
2408
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2409
|
+
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2410
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2411
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2412
|
+
});
|
|
2413
|
+
sender.replaceTrack(newTrack);
|
|
2414
|
+
return Promise.resolve(newTrack);
|
|
2415
|
+
}
|
|
2416
|
+
let stream = this.streams.find((s) => s.getTracks().find((t) => t.id === newTrack.id));
|
|
2417
|
+
if (!stream) {
|
|
2418
|
+
rtcStats.sendEvent("P2PReplaceTrackNewTrackNotInStream", {
|
|
2419
|
+
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2420
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2421
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2422
|
+
newTrackId: newTrack.id,
|
|
2423
|
+
newTrackKind: newTrack.kind,
|
|
2424
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2417
2425
|
});
|
|
2426
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNewTrackNotInStream");
|
|
2418
2427
|
}
|
|
2419
|
-
|
|
2428
|
+
stream = this.streams[0];
|
|
2420
2429
|
if (!stream) {
|
|
2430
|
+
rtcStats.sendEvent("P2PReplaceTrackNoStream", {});
|
|
2431
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNoStream");
|
|
2421
2432
|
return Promise.reject(new Error("replaceTrack: No stream?"));
|
|
2422
2433
|
}
|
|
2434
|
+
rtcStats.sendEvent("P2PReplaceTrackSourceKindNotFound", {
|
|
2435
|
+
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2436
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2437
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2438
|
+
newTrackId: newTrack.id,
|
|
2439
|
+
newTrackKind: newTrack.kind,
|
|
2440
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2441
|
+
});
|
|
2442
|
+
this._incrementAnalyticMetric("P2PReplaceTrackSourceKindNotFound");
|
|
2423
2443
|
return pc.addTrack(newTrack, stream);
|
|
2424
2444
|
}
|
|
2445
|
+
rtcStats.sendEvent("P2PNoReplaceTrackSupport", {});
|
|
2425
2446
|
if (!this.canModifyPeerConnection()) {
|
|
2426
2447
|
this.pending.push(() => {
|
|
2427
|
-
this.replaceTrack(
|
|
2448
|
+
this.replaceTrack(oldTrack, newTrack);
|
|
2428
2449
|
});
|
|
2429
2450
|
return;
|
|
2430
2451
|
}
|
|
2431
2452
|
this.isOperationPending = true;
|
|
2432
2453
|
const onn = pc.onnegotiationneeded;
|
|
2433
2454
|
pc.onnegotiationneeded = null;
|
|
2434
|
-
if (
|
|
2435
|
-
this.removeTrack(
|
|
2455
|
+
if (oldTrack) {
|
|
2456
|
+
this.removeTrack(oldTrack);
|
|
2436
2457
|
}
|
|
2437
2458
|
this.addTrack(newTrack);
|
|
2438
2459
|
setTimeout(() => {
|
|
2439
2460
|
pc.onnegotiationneeded = onn;
|
|
2440
2461
|
}, 0);
|
|
2441
|
-
if (((
|
|
2462
|
+
if (((_c = pc.localDescription) === null || _c === void 0 ? void 0 : _c.type) === "offer") {
|
|
2442
2463
|
return pc
|
|
2443
2464
|
.createOffer()
|
|
2444
2465
|
.then((offer) => {
|
|
@@ -2665,9 +2686,7 @@ class P2pRtcManager {
|
|
|
2665
2686
|
turnServers: turnServers || [],
|
|
2666
2687
|
mediaserverConfigTtlSeconds,
|
|
2667
2688
|
});
|
|
2668
|
-
this.totalSessionsCreated = 0;
|
|
2669
2689
|
this.analytics = {
|
|
2670
|
-
P2PReplaceTrackNoPC: 0,
|
|
2671
2690
|
P2PNonErrorRejectionValueGUMError: 0,
|
|
2672
2691
|
numNewPc: 0,
|
|
2673
2692
|
numIceConnected: 0,
|
|
@@ -2686,6 +2705,16 @@ class P2pRtcManager {
|
|
|
2686
2705
|
P2PChangeBandwidthEmptySDPType: 0,
|
|
2687
2706
|
P2PNegotiationNeeded: 0,
|
|
2688
2707
|
P2PSessionAlreadyCreated: 0,
|
|
2708
|
+
P2PReplaceTrackNoStream: 0,
|
|
2709
|
+
P2PReplaceTrackNoNewTrack: 0,
|
|
2710
|
+
P2PReplaceTrackNewTrackEnded: 0,
|
|
2711
|
+
P2PReplaceTrackNewTrackNotInStream: 0,
|
|
2712
|
+
P2PReplaceTrackOldTrackNotFound: 0,
|
|
2713
|
+
P2PReplaceTrackToPCsPendingActionsNull: 0,
|
|
2714
|
+
P2PReplaceTrackReturnedFalse: 0,
|
|
2715
|
+
P2PReplaceTrackWithoutPC: 0,
|
|
2716
|
+
P2PReplaceTrackSourceKindNotFound: 0,
|
|
2717
|
+
P2PRemoveStreamNoPC: 0,
|
|
2689
2718
|
};
|
|
2690
2719
|
}
|
|
2691
2720
|
numberOfPeerconnections() {
|
|
@@ -2768,6 +2797,7 @@ class P2pRtcManager {
|
|
|
2768
2797
|
this._localStreamDeregisterFunction();
|
|
2769
2798
|
this._localStreamDeregisterFunction = null;
|
|
2770
2799
|
}
|
|
2800
|
+
this.rtcStatsDisconnect();
|
|
2771
2801
|
}
|
|
2772
2802
|
setupSocketListeners() {
|
|
2773
2803
|
this._socketListenerDeregisterFunctions = [
|
|
@@ -2870,6 +2900,7 @@ class P2pRtcManager {
|
|
|
2870
2900
|
}
|
|
2871
2901
|
}
|
|
2872
2902
|
rtcStatsDisconnect() {
|
|
2903
|
+
clearTimeout(this._rtcStatsDisconnectTimeout);
|
|
2873
2904
|
rtcStats.server.close();
|
|
2874
2905
|
}
|
|
2875
2906
|
rtcStatsReconnect() {
|
|
@@ -2979,7 +3010,6 @@ class P2pRtcManager {
|
|
|
2979
3010
|
shouldAddLocalVideo,
|
|
2980
3011
|
incrementAnalyticMetric: (metric) => this.analytics[metric]++,
|
|
2981
3012
|
});
|
|
2982
|
-
this.totalSessionsCreated++;
|
|
2983
3013
|
}
|
|
2984
3014
|
else {
|
|
2985
3015
|
this.analytics.P2PSessionAlreadyCreated++;
|
|
@@ -3195,9 +3225,13 @@ class P2pRtcManager {
|
|
|
3195
3225
|
const promises = [];
|
|
3196
3226
|
this._forEachPeerConnection((session) => {
|
|
3197
3227
|
if (!session.hasConnectedPeerConnection()) {
|
|
3228
|
+
rtcStats.sendEvent("P2PReplaceTrackWithoutPC", {});
|
|
3229
|
+
this.analytics.P2PReplaceTrackWithoutPC++;
|
|
3198
3230
|
logger$6.info("Session doesn't have a connected PeerConnection, adding pending action!");
|
|
3199
3231
|
const pendingActions = this._pendingActionsForConnectedPeerConnections;
|
|
3200
3232
|
if (!pendingActions) {
|
|
3233
|
+
rtcStats.sendEvent("P2PReplaceTrackToPCsPendingActionsNull", {});
|
|
3234
|
+
this.analytics.P2PReplaceTrackToPCsPendingActionsNull++;
|
|
3201
3235
|
logger$6.warn(`No pending action is created to replace track, because the pending actions array is null`);
|
|
3202
3236
|
return;
|
|
3203
3237
|
}
|
|
@@ -3205,6 +3239,8 @@ class P2pRtcManager {
|
|
|
3205
3239
|
const action = () => {
|
|
3206
3240
|
const replacedTrackPromise = session.replaceTrack(oldTrack, newTrack);
|
|
3207
3241
|
if (!replacedTrackPromise) {
|
|
3242
|
+
rtcStats.sendEvent("P2PReplaceTrackReturnedFalse", {});
|
|
3243
|
+
this.analytics.P2PReplaceTrackReturnedFalse++;
|
|
3208
3244
|
logger$6.error("replaceTrack returned false!");
|
|
3209
3245
|
reject(`ReplaceTrack returned false`);
|
|
3210
3246
|
return;
|
|
@@ -3218,6 +3254,8 @@ class P2pRtcManager {
|
|
|
3218
3254
|
}
|
|
3219
3255
|
const replacedTrackResult = session.replaceTrack(oldTrack, newTrack);
|
|
3220
3256
|
if (!replacedTrackResult) {
|
|
3257
|
+
rtcStats.sendEvent("P2PReplaceTrackReturnedFalse", {});
|
|
3258
|
+
this.analytics.P2PReplaceTrackReturnedFalse++;
|
|
3221
3259
|
logger$6.error("replaceTrack returned false!");
|
|
3222
3260
|
return;
|
|
3223
3261
|
}
|
|
@@ -3588,7 +3626,7 @@ class P2pRtcManager {
|
|
|
3588
3626
|
this._changeBandwidthForAllClients(false);
|
|
3589
3627
|
const numPeers = this.numberOfPeerconnections();
|
|
3590
3628
|
if (numPeers === 0) {
|
|
3591
|
-
setTimeout(() => {
|
|
3629
|
+
this._rtcStatsDisconnectTimeout = setTimeout(() => {
|
|
3592
3630
|
const numPeers = this.numberOfPeerconnections();
|
|
3593
3631
|
if (numPeers === 0) {
|
|
3594
3632
|
this.rtcStatsDisconnect();
|
|
@@ -5687,6 +5725,7 @@ class VegaRtcManager {
|
|
|
5687
5725
|
this._screenAudioTrack = null;
|
|
5688
5726
|
this._streamIdToVideoConsumerId.clear();
|
|
5689
5727
|
this._mediasoupDeviceInitializedAsync = Promise.resolve(null);
|
|
5728
|
+
this._qualityMonitor.close();
|
|
5690
5729
|
}
|
|
5691
5730
|
sendAudioMutedStats(muted) {
|
|
5692
5731
|
rtcStats.sendEvent("audio_muted", { muted });
|
|
@@ -7446,6 +7485,9 @@ function getDisplayMedia(constraints = defaultDisplayMediaConstraints, contentHi
|
|
|
7446
7485
|
t.contentHint = contentHint;
|
|
7447
7486
|
}
|
|
7448
7487
|
});
|
|
7488
|
+
stream.getTracks().forEach((t) => {
|
|
7489
|
+
trackAnnotations(t).fromGetDisplayMedia = true;
|
|
7490
|
+
});
|
|
7449
7491
|
return stream;
|
|
7450
7492
|
});
|
|
7451
7493
|
}
|
|
@@ -7619,6 +7661,7 @@ exports.startPerformanceMonitor = startPerformanceMonitor;
|
|
|
7619
7661
|
exports.stopStreamTracks = stopStreamTracks;
|
|
7620
7662
|
exports.subscribeIssues = subscribeIssues;
|
|
7621
7663
|
exports.subscribeStats = subscribeStats;
|
|
7664
|
+
exports.trackAnnotations = trackAnnotations;
|
|
7622
7665
|
exports.turnServerOverride = turnServerOverride;
|
|
7623
7666
|
exports.variance = variance;
|
|
7624
7667
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -555,7 +555,7 @@ declare class Session {
|
|
|
555
555
|
canModifyPeerConnection(): boolean;
|
|
556
556
|
close(): void;
|
|
557
557
|
hasConnectedPeerConnection(): boolean;
|
|
558
|
-
replaceTrack(oldTrack: CustomMediaStreamTrack | undefined
|
|
558
|
+
replaceTrack(oldTrack: CustomMediaStreamTrack | undefined, newTrack: CustomMediaStreamTrack | undefined): any;
|
|
559
559
|
changeBandwidth(bandwidth: any): void;
|
|
560
560
|
setAudioOnly(enable: boolean, excludedTrackIds?: string[]): void;
|
|
561
561
|
}
|
|
@@ -1147,6 +1147,11 @@ declare function fromLocation({ host, protocol }?: {
|
|
|
1147
1147
|
subdomain: string;
|
|
1148
1148
|
};
|
|
1149
1149
|
|
|
1150
|
+
type TrackAnnotation = {
|
|
1151
|
+
fromGetDisplayMedia: boolean;
|
|
1152
|
+
};
|
|
1153
|
+
declare function trackAnnotations(o: MediaStreamTrack): TrackAnnotation;
|
|
1154
|
+
|
|
1150
1155
|
interface GetOrCreateSessionOptions {
|
|
1151
1156
|
peerConnectionId: string;
|
|
1152
1157
|
clientId: string;
|
|
@@ -1155,7 +1160,6 @@ interface GetOrCreateSessionOptions {
|
|
|
1155
1160
|
peerConnectionConfig: RTCConfiguration;
|
|
1156
1161
|
}
|
|
1157
1162
|
type P2PAnalytics = {
|
|
1158
|
-
P2PReplaceTrackNoPC: number;
|
|
1159
1163
|
P2PNonErrorRejectionValueGUMError: number;
|
|
1160
1164
|
numNewPc: number;
|
|
1161
1165
|
numIceConnected: number;
|
|
@@ -1174,6 +1178,16 @@ type P2PAnalytics = {
|
|
|
1174
1178
|
P2PChangeBandwidthEmptySDPType: number;
|
|
1175
1179
|
P2PNegotiationNeeded: number;
|
|
1176
1180
|
P2PSessionAlreadyCreated: number;
|
|
1181
|
+
P2PReplaceTrackNoStream: number;
|
|
1182
|
+
P2PReplaceTrackNewTrackEnded: number;
|
|
1183
|
+
P2PReplaceTrackNoNewTrack: number;
|
|
1184
|
+
P2PReplaceTrackNewTrackNotInStream: number;
|
|
1185
|
+
P2PReplaceTrackOldTrackNotFound: number;
|
|
1186
|
+
P2PReplaceTrackToPCsPendingActionsNull: number;
|
|
1187
|
+
P2PReplaceTrackReturnedFalse: number;
|
|
1188
|
+
P2PReplaceTrackWithoutPC: number;
|
|
1189
|
+
P2PReplaceTrackSourceKindNotFound: number;
|
|
1190
|
+
P2PRemoveStreamNoPC: number;
|
|
1177
1191
|
};
|
|
1178
1192
|
type P2PAnalyticMetric = keyof P2PAnalytics;
|
|
1179
1193
|
type P2PIncrementAnalyticMetric = (metric: P2PAnalyticMetric) => void;
|
|
@@ -1199,7 +1213,6 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1199
1213
|
_pendingActionsForConnectedPeerConnections: any[];
|
|
1200
1214
|
_audioTrackOnEnded: () => void;
|
|
1201
1215
|
_videoTrackOnEnded: () => void;
|
|
1202
|
-
totalSessionsCreated: number;
|
|
1203
1216
|
_iceServers: any;
|
|
1204
1217
|
_turnServers: any;
|
|
1205
1218
|
_sfuServer: any;
|
|
@@ -1213,6 +1226,7 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1213
1226
|
_closed: boolean;
|
|
1214
1227
|
skipEmittingServerMessageCount: number;
|
|
1215
1228
|
analytics: P2PAnalytics;
|
|
1229
|
+
_rtcStatsDisconnectTimeout?: ReturnType<typeof setTimeout>;
|
|
1216
1230
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, }: {
|
|
1217
1231
|
selfId: any;
|
|
1218
1232
|
room: any;
|
|
@@ -1582,7 +1596,7 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1582
1596
|
_socketListenerDeregisterFunctions: any;
|
|
1583
1597
|
_reconnect: any;
|
|
1584
1598
|
_reconnectTimeOut: any;
|
|
1585
|
-
_qualityMonitor:
|
|
1599
|
+
_qualityMonitor: VegaMediaQualityMonitor;
|
|
1586
1600
|
_fetchMediaServersTimer: any;
|
|
1587
1601
|
_iceServers: any;
|
|
1588
1602
|
_turnServers: any;
|
|
@@ -1888,5 +1902,5 @@ declare class RtcStream {
|
|
|
1888
1902
|
static getCameraId(): string;
|
|
1889
1903
|
}
|
|
1890
1904
|
|
|
1891
|
-
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
|
|
1905
|
+
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1892
1906
|
export type { AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, CannotJoinUnclaimedRoomError, ChatMessage, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, CustomMediaStreamTrack, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomFullError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcStreamAddedPayload, SDPRelayMessage, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalKnocker, SignalRequests, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UnifiedPlanSDP, UpdatedDeviceInfo, UpdatedDevicesInfo, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent };
|
package/dist/index.d.mts
CHANGED
|
@@ -555,7 +555,7 @@ declare class Session {
|
|
|
555
555
|
canModifyPeerConnection(): boolean;
|
|
556
556
|
close(): void;
|
|
557
557
|
hasConnectedPeerConnection(): boolean;
|
|
558
|
-
replaceTrack(oldTrack: CustomMediaStreamTrack | undefined
|
|
558
|
+
replaceTrack(oldTrack: CustomMediaStreamTrack | undefined, newTrack: CustomMediaStreamTrack | undefined): any;
|
|
559
559
|
changeBandwidth(bandwidth: any): void;
|
|
560
560
|
setAudioOnly(enable: boolean, excludedTrackIds?: string[]): void;
|
|
561
561
|
}
|
|
@@ -1147,6 +1147,11 @@ declare function fromLocation({ host, protocol }?: {
|
|
|
1147
1147
|
subdomain: string;
|
|
1148
1148
|
};
|
|
1149
1149
|
|
|
1150
|
+
type TrackAnnotation = {
|
|
1151
|
+
fromGetDisplayMedia: boolean;
|
|
1152
|
+
};
|
|
1153
|
+
declare function trackAnnotations(o: MediaStreamTrack): TrackAnnotation;
|
|
1154
|
+
|
|
1150
1155
|
interface GetOrCreateSessionOptions {
|
|
1151
1156
|
peerConnectionId: string;
|
|
1152
1157
|
clientId: string;
|
|
@@ -1155,7 +1160,6 @@ interface GetOrCreateSessionOptions {
|
|
|
1155
1160
|
peerConnectionConfig: RTCConfiguration;
|
|
1156
1161
|
}
|
|
1157
1162
|
type P2PAnalytics = {
|
|
1158
|
-
P2PReplaceTrackNoPC: number;
|
|
1159
1163
|
P2PNonErrorRejectionValueGUMError: number;
|
|
1160
1164
|
numNewPc: number;
|
|
1161
1165
|
numIceConnected: number;
|
|
@@ -1174,6 +1178,16 @@ type P2PAnalytics = {
|
|
|
1174
1178
|
P2PChangeBandwidthEmptySDPType: number;
|
|
1175
1179
|
P2PNegotiationNeeded: number;
|
|
1176
1180
|
P2PSessionAlreadyCreated: number;
|
|
1181
|
+
P2PReplaceTrackNoStream: number;
|
|
1182
|
+
P2PReplaceTrackNewTrackEnded: number;
|
|
1183
|
+
P2PReplaceTrackNoNewTrack: number;
|
|
1184
|
+
P2PReplaceTrackNewTrackNotInStream: number;
|
|
1185
|
+
P2PReplaceTrackOldTrackNotFound: number;
|
|
1186
|
+
P2PReplaceTrackToPCsPendingActionsNull: number;
|
|
1187
|
+
P2PReplaceTrackReturnedFalse: number;
|
|
1188
|
+
P2PReplaceTrackWithoutPC: number;
|
|
1189
|
+
P2PReplaceTrackSourceKindNotFound: number;
|
|
1190
|
+
P2PRemoveStreamNoPC: number;
|
|
1177
1191
|
};
|
|
1178
1192
|
type P2PAnalyticMetric = keyof P2PAnalytics;
|
|
1179
1193
|
type P2PIncrementAnalyticMetric = (metric: P2PAnalyticMetric) => void;
|
|
@@ -1199,7 +1213,6 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1199
1213
|
_pendingActionsForConnectedPeerConnections: any[];
|
|
1200
1214
|
_audioTrackOnEnded: () => void;
|
|
1201
1215
|
_videoTrackOnEnded: () => void;
|
|
1202
|
-
totalSessionsCreated: number;
|
|
1203
1216
|
_iceServers: any;
|
|
1204
1217
|
_turnServers: any;
|
|
1205
1218
|
_sfuServer: any;
|
|
@@ -1213,6 +1226,7 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1213
1226
|
_closed: boolean;
|
|
1214
1227
|
skipEmittingServerMessageCount: number;
|
|
1215
1228
|
analytics: P2PAnalytics;
|
|
1229
|
+
_rtcStatsDisconnectTimeout?: ReturnType<typeof setTimeout>;
|
|
1216
1230
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, }: {
|
|
1217
1231
|
selfId: any;
|
|
1218
1232
|
room: any;
|
|
@@ -1582,7 +1596,7 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1582
1596
|
_socketListenerDeregisterFunctions: any;
|
|
1583
1597
|
_reconnect: any;
|
|
1584
1598
|
_reconnectTimeOut: any;
|
|
1585
|
-
_qualityMonitor:
|
|
1599
|
+
_qualityMonitor: VegaMediaQualityMonitor;
|
|
1586
1600
|
_fetchMediaServersTimer: any;
|
|
1587
1601
|
_iceServers: any;
|
|
1588
1602
|
_turnServers: any;
|
|
@@ -1888,5 +1902,5 @@ declare class RtcStream {
|
|
|
1888
1902
|
static getCameraId(): string;
|
|
1889
1903
|
}
|
|
1890
1904
|
|
|
1891
|
-
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
|
|
1905
|
+
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1892
1906
|
export type { AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, CannotJoinUnclaimedRoomError, ChatMessage, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, CustomMediaStreamTrack, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomFullError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcStreamAddedPayload, SDPRelayMessage, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalKnocker, SignalRequests, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UnifiedPlanSDP, UpdatedDeviceInfo, UpdatedDevicesInfo, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent };
|
package/dist/index.d.ts
CHANGED
|
@@ -555,7 +555,7 @@ declare class Session {
|
|
|
555
555
|
canModifyPeerConnection(): boolean;
|
|
556
556
|
close(): void;
|
|
557
557
|
hasConnectedPeerConnection(): boolean;
|
|
558
|
-
replaceTrack(oldTrack: CustomMediaStreamTrack | undefined
|
|
558
|
+
replaceTrack(oldTrack: CustomMediaStreamTrack | undefined, newTrack: CustomMediaStreamTrack | undefined): any;
|
|
559
559
|
changeBandwidth(bandwidth: any): void;
|
|
560
560
|
setAudioOnly(enable: boolean, excludedTrackIds?: string[]): void;
|
|
561
561
|
}
|
|
@@ -1147,6 +1147,11 @@ declare function fromLocation({ host, protocol }?: {
|
|
|
1147
1147
|
subdomain: string;
|
|
1148
1148
|
};
|
|
1149
1149
|
|
|
1150
|
+
type TrackAnnotation = {
|
|
1151
|
+
fromGetDisplayMedia: boolean;
|
|
1152
|
+
};
|
|
1153
|
+
declare function trackAnnotations(o: MediaStreamTrack): TrackAnnotation;
|
|
1154
|
+
|
|
1150
1155
|
interface GetOrCreateSessionOptions {
|
|
1151
1156
|
peerConnectionId: string;
|
|
1152
1157
|
clientId: string;
|
|
@@ -1155,7 +1160,6 @@ interface GetOrCreateSessionOptions {
|
|
|
1155
1160
|
peerConnectionConfig: RTCConfiguration;
|
|
1156
1161
|
}
|
|
1157
1162
|
type P2PAnalytics = {
|
|
1158
|
-
P2PReplaceTrackNoPC: number;
|
|
1159
1163
|
P2PNonErrorRejectionValueGUMError: number;
|
|
1160
1164
|
numNewPc: number;
|
|
1161
1165
|
numIceConnected: number;
|
|
@@ -1174,6 +1178,16 @@ type P2PAnalytics = {
|
|
|
1174
1178
|
P2PChangeBandwidthEmptySDPType: number;
|
|
1175
1179
|
P2PNegotiationNeeded: number;
|
|
1176
1180
|
P2PSessionAlreadyCreated: number;
|
|
1181
|
+
P2PReplaceTrackNoStream: number;
|
|
1182
|
+
P2PReplaceTrackNewTrackEnded: number;
|
|
1183
|
+
P2PReplaceTrackNoNewTrack: number;
|
|
1184
|
+
P2PReplaceTrackNewTrackNotInStream: number;
|
|
1185
|
+
P2PReplaceTrackOldTrackNotFound: number;
|
|
1186
|
+
P2PReplaceTrackToPCsPendingActionsNull: number;
|
|
1187
|
+
P2PReplaceTrackReturnedFalse: number;
|
|
1188
|
+
P2PReplaceTrackWithoutPC: number;
|
|
1189
|
+
P2PReplaceTrackSourceKindNotFound: number;
|
|
1190
|
+
P2PRemoveStreamNoPC: number;
|
|
1177
1191
|
};
|
|
1178
1192
|
type P2PAnalyticMetric = keyof P2PAnalytics;
|
|
1179
1193
|
type P2PIncrementAnalyticMetric = (metric: P2PAnalyticMetric) => void;
|
|
@@ -1199,7 +1213,6 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1199
1213
|
_pendingActionsForConnectedPeerConnections: any[];
|
|
1200
1214
|
_audioTrackOnEnded: () => void;
|
|
1201
1215
|
_videoTrackOnEnded: () => void;
|
|
1202
|
-
totalSessionsCreated: number;
|
|
1203
1216
|
_iceServers: any;
|
|
1204
1217
|
_turnServers: any;
|
|
1205
1218
|
_sfuServer: any;
|
|
@@ -1213,6 +1226,7 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1213
1226
|
_closed: boolean;
|
|
1214
1227
|
skipEmittingServerMessageCount: number;
|
|
1215
1228
|
analytics: P2PAnalytics;
|
|
1229
|
+
_rtcStatsDisconnectTimeout?: ReturnType<typeof setTimeout>;
|
|
1216
1230
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features, }: {
|
|
1217
1231
|
selfId: any;
|
|
1218
1232
|
room: any;
|
|
@@ -1582,7 +1596,7 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1582
1596
|
_socketListenerDeregisterFunctions: any;
|
|
1583
1597
|
_reconnect: any;
|
|
1584
1598
|
_reconnectTimeOut: any;
|
|
1585
|
-
_qualityMonitor:
|
|
1599
|
+
_qualityMonitor: VegaMediaQualityMonitor;
|
|
1586
1600
|
_fetchMediaServersTimer: any;
|
|
1587
1601
|
_iceServers: any;
|
|
1588
1602
|
_turnServers: any;
|
|
@@ -1888,5 +1902,5 @@ declare class RtcStream {
|
|
|
1888
1902
|
static getCameraId(): string;
|
|
1889
1903
|
}
|
|
1890
1904
|
|
|
1891
|
-
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
|
|
1905
|
+
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1892
1906
|
export type { AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, CannotJoinUnclaimedRoomError, ChatMessage, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, CustomMediaStreamTrack, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomFullError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcStreamAddedPayload, SDPRelayMessage, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalKnocker, SignalRequests, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UnifiedPlanSDP, UpdatedDeviceInfo, UpdatedDevicesInfo, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent };
|
package/dist/index.mjs
CHANGED
|
@@ -1807,6 +1807,16 @@ function fromLocation({ host = "whereby.com", protocol = "https:" } = {}) {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
fromLocation(window && window.location);
|
|
1809
1809
|
|
|
1810
|
+
const _trackAnnotations = new WeakMap();
|
|
1811
|
+
function trackAnnotations(o) {
|
|
1812
|
+
let props = _trackAnnotations.get(o);
|
|
1813
|
+
if (!props) {
|
|
1814
|
+
props = {};
|
|
1815
|
+
_trackAnnotations.set(o, props);
|
|
1816
|
+
}
|
|
1817
|
+
return props;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1810
1820
|
const logger$9 = new Logger();
|
|
1811
1821
|
const debugLogger = {
|
|
1812
1822
|
print: (...args) => console.debug(args[0], ...args.slice(1)),
|
|
@@ -2204,6 +2214,7 @@ class Session {
|
|
|
2204
2214
|
});
|
|
2205
2215
|
}
|
|
2206
2216
|
else {
|
|
2217
|
+
rtcStats.sendEvent("P2PNoAddTrackSupport", {});
|
|
2207
2218
|
this.pc.addStream(stream);
|
|
2208
2219
|
}
|
|
2209
2220
|
}
|
|
@@ -2242,6 +2253,10 @@ class Session {
|
|
|
2242
2253
|
this.pc.removeStream(stream);
|
|
2243
2254
|
}
|
|
2244
2255
|
}
|
|
2256
|
+
else {
|
|
2257
|
+
rtcStats.sendEvent("P2PRemoveStreamNoPC", {});
|
|
2258
|
+
this._incrementAnalyticMetric("P2PRemoveStreamNoPC");
|
|
2259
|
+
}
|
|
2245
2260
|
}
|
|
2246
2261
|
_setRemoteDescription(desc) {
|
|
2247
2262
|
if (this._deprioritizeH264Encoding)
|
|
@@ -2326,98 +2341,104 @@ class Session {
|
|
|
2326
2341
|
return this.pc && this.pc.connectionState === "connected";
|
|
2327
2342
|
}
|
|
2328
2343
|
replaceTrack(oldTrack, newTrack) {
|
|
2329
|
-
var _a, _b;
|
|
2330
|
-
|
|
2331
|
-
if (!
|
|
2332
|
-
rtcStats.sendEvent("
|
|
2344
|
+
var _a, _b, _c;
|
|
2345
|
+
logger$7.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack === null || newTrack === void 0 ? void 0 : newTrack.id);
|
|
2346
|
+
if (!newTrack) {
|
|
2347
|
+
rtcStats.sendEvent("P2PReplaceTrackNoNewTrack", {
|
|
2333
2348
|
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2334
|
-
|
|
2349
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2350
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2335
2351
|
});
|
|
2336
|
-
this._incrementAnalyticMetric("
|
|
2352
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNoNewTrack");
|
|
2337
2353
|
return false;
|
|
2338
2354
|
}
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
return null;
|
|
2356
|
-
};
|
|
2357
|
-
const result = process();
|
|
2358
|
-
if (result) {
|
|
2359
|
-
return result;
|
|
2355
|
+
if (newTrack.readyState === "ended") {
|
|
2356
|
+
rtcStats.sendEvent("P2PReplaceTrackNewTrackEnded", {
|
|
2357
|
+
newTrackId: newTrack.id,
|
|
2358
|
+
newTrackKind: newTrack.kind,
|
|
2359
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2360
|
+
});
|
|
2361
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNewTrackEnded");
|
|
2362
|
+
return false;
|
|
2363
|
+
}
|
|
2364
|
+
const pc = this.pc;
|
|
2365
|
+
if ((_b = (_a = window.RTCRtpSender) === null || _a === void 0 ? void 0 : _a.prototype) === null || _b === void 0 ? void 0 : _b.replaceTrack) {
|
|
2366
|
+
if (oldTrack) {
|
|
2367
|
+
const sender = pc.getSenders().find((s) => { var _a; return ((_a = s.track) === null || _a === void 0 ? void 0 : _a.id) === oldTrack.id; });
|
|
2368
|
+
if (sender) {
|
|
2369
|
+
sender.replaceTrack(newTrack);
|
|
2370
|
+
return Promise.resolve(newTrack);
|
|
2360
2371
|
}
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
const trackReplaced = yield trackReplacedPromise;
|
|
2394
|
-
resolve(trackReplaced);
|
|
2395
|
-
}), 1000);
|
|
2372
|
+
}
|
|
2373
|
+
const sender = pc.getSenders().find((s) => {
|
|
2374
|
+
const track = s.track;
|
|
2375
|
+
return (track === null || track === void 0 ? void 0 : track.kind) === newTrack.kind && !trackAnnotations(track).fromGetDisplayMedia;
|
|
2376
|
+
});
|
|
2377
|
+
if (sender) {
|
|
2378
|
+
this._incrementAnalyticMetric("P2PReplaceTrackOldTrackNotFound");
|
|
2379
|
+
const track = sender.track;
|
|
2380
|
+
rtcStats.sendEvent("P2PReplaceTrackOldTrackNotFound", {
|
|
2381
|
+
targetTrackId: track === null || track === void 0 ? void 0 : track.id,
|
|
2382
|
+
targetTrackKind: track === null || track === void 0 ? void 0 : track.kind,
|
|
2383
|
+
targetTrackIsEffect: track === null || track === void 0 ? void 0 : track.effectTrack,
|
|
2384
|
+
targetTrackReadyState: track === null || track === void 0 ? void 0 : track.readyState,
|
|
2385
|
+
newTrackId: newTrack.id,
|
|
2386
|
+
newTrackKind: newTrack.kind,
|
|
2387
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2388
|
+
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2389
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2390
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2391
|
+
});
|
|
2392
|
+
sender.replaceTrack(newTrack);
|
|
2393
|
+
return Promise.resolve(newTrack);
|
|
2394
|
+
}
|
|
2395
|
+
let stream = this.streams.find((s) => s.getTracks().find((t) => t.id === newTrack.id));
|
|
2396
|
+
if (!stream) {
|
|
2397
|
+
rtcStats.sendEvent("P2PReplaceTrackNewTrackNotInStream", {
|
|
2398
|
+
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2399
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2400
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2401
|
+
newTrackId: newTrack.id,
|
|
2402
|
+
newTrackKind: newTrack.kind,
|
|
2403
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2396
2404
|
});
|
|
2405
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNewTrackNotInStream");
|
|
2397
2406
|
}
|
|
2398
|
-
|
|
2407
|
+
stream = this.streams[0];
|
|
2399
2408
|
if (!stream) {
|
|
2409
|
+
rtcStats.sendEvent("P2PReplaceTrackNoStream", {});
|
|
2410
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNoStream");
|
|
2400
2411
|
return Promise.reject(new Error("replaceTrack: No stream?"));
|
|
2401
2412
|
}
|
|
2413
|
+
rtcStats.sendEvent("P2PReplaceTrackSourceKindNotFound", {
|
|
2414
|
+
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2415
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2416
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2417
|
+
newTrackId: newTrack.id,
|
|
2418
|
+
newTrackKind: newTrack.kind,
|
|
2419
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2420
|
+
});
|
|
2421
|
+
this._incrementAnalyticMetric("P2PReplaceTrackSourceKindNotFound");
|
|
2402
2422
|
return pc.addTrack(newTrack, stream);
|
|
2403
2423
|
}
|
|
2424
|
+
rtcStats.sendEvent("P2PNoReplaceTrackSupport", {});
|
|
2404
2425
|
if (!this.canModifyPeerConnection()) {
|
|
2405
2426
|
this.pending.push(() => {
|
|
2406
|
-
this.replaceTrack(
|
|
2427
|
+
this.replaceTrack(oldTrack, newTrack);
|
|
2407
2428
|
});
|
|
2408
2429
|
return;
|
|
2409
2430
|
}
|
|
2410
2431
|
this.isOperationPending = true;
|
|
2411
2432
|
const onn = pc.onnegotiationneeded;
|
|
2412
2433
|
pc.onnegotiationneeded = null;
|
|
2413
|
-
if (
|
|
2414
|
-
this.removeTrack(
|
|
2434
|
+
if (oldTrack) {
|
|
2435
|
+
this.removeTrack(oldTrack);
|
|
2415
2436
|
}
|
|
2416
2437
|
this.addTrack(newTrack);
|
|
2417
2438
|
setTimeout(() => {
|
|
2418
2439
|
pc.onnegotiationneeded = onn;
|
|
2419
2440
|
}, 0);
|
|
2420
|
-
if (((
|
|
2441
|
+
if (((_c = pc.localDescription) === null || _c === void 0 ? void 0 : _c.type) === "offer") {
|
|
2421
2442
|
return pc
|
|
2422
2443
|
.createOffer()
|
|
2423
2444
|
.then((offer) => {
|
|
@@ -2644,9 +2665,7 @@ class P2pRtcManager {
|
|
|
2644
2665
|
turnServers: turnServers || [],
|
|
2645
2666
|
mediaserverConfigTtlSeconds,
|
|
2646
2667
|
});
|
|
2647
|
-
this.totalSessionsCreated = 0;
|
|
2648
2668
|
this.analytics = {
|
|
2649
|
-
P2PReplaceTrackNoPC: 0,
|
|
2650
2669
|
P2PNonErrorRejectionValueGUMError: 0,
|
|
2651
2670
|
numNewPc: 0,
|
|
2652
2671
|
numIceConnected: 0,
|
|
@@ -2665,6 +2684,16 @@ class P2pRtcManager {
|
|
|
2665
2684
|
P2PChangeBandwidthEmptySDPType: 0,
|
|
2666
2685
|
P2PNegotiationNeeded: 0,
|
|
2667
2686
|
P2PSessionAlreadyCreated: 0,
|
|
2687
|
+
P2PReplaceTrackNoStream: 0,
|
|
2688
|
+
P2PReplaceTrackNoNewTrack: 0,
|
|
2689
|
+
P2PReplaceTrackNewTrackEnded: 0,
|
|
2690
|
+
P2PReplaceTrackNewTrackNotInStream: 0,
|
|
2691
|
+
P2PReplaceTrackOldTrackNotFound: 0,
|
|
2692
|
+
P2PReplaceTrackToPCsPendingActionsNull: 0,
|
|
2693
|
+
P2PReplaceTrackReturnedFalse: 0,
|
|
2694
|
+
P2PReplaceTrackWithoutPC: 0,
|
|
2695
|
+
P2PReplaceTrackSourceKindNotFound: 0,
|
|
2696
|
+
P2PRemoveStreamNoPC: 0,
|
|
2668
2697
|
};
|
|
2669
2698
|
}
|
|
2670
2699
|
numberOfPeerconnections() {
|
|
@@ -2747,6 +2776,7 @@ class P2pRtcManager {
|
|
|
2747
2776
|
this._localStreamDeregisterFunction();
|
|
2748
2777
|
this._localStreamDeregisterFunction = null;
|
|
2749
2778
|
}
|
|
2779
|
+
this.rtcStatsDisconnect();
|
|
2750
2780
|
}
|
|
2751
2781
|
setupSocketListeners() {
|
|
2752
2782
|
this._socketListenerDeregisterFunctions = [
|
|
@@ -2849,6 +2879,7 @@ class P2pRtcManager {
|
|
|
2849
2879
|
}
|
|
2850
2880
|
}
|
|
2851
2881
|
rtcStatsDisconnect() {
|
|
2882
|
+
clearTimeout(this._rtcStatsDisconnectTimeout);
|
|
2852
2883
|
rtcStats.server.close();
|
|
2853
2884
|
}
|
|
2854
2885
|
rtcStatsReconnect() {
|
|
@@ -2958,7 +2989,6 @@ class P2pRtcManager {
|
|
|
2958
2989
|
shouldAddLocalVideo,
|
|
2959
2990
|
incrementAnalyticMetric: (metric) => this.analytics[metric]++,
|
|
2960
2991
|
});
|
|
2961
|
-
this.totalSessionsCreated++;
|
|
2962
2992
|
}
|
|
2963
2993
|
else {
|
|
2964
2994
|
this.analytics.P2PSessionAlreadyCreated++;
|
|
@@ -3174,9 +3204,13 @@ class P2pRtcManager {
|
|
|
3174
3204
|
const promises = [];
|
|
3175
3205
|
this._forEachPeerConnection((session) => {
|
|
3176
3206
|
if (!session.hasConnectedPeerConnection()) {
|
|
3207
|
+
rtcStats.sendEvent("P2PReplaceTrackWithoutPC", {});
|
|
3208
|
+
this.analytics.P2PReplaceTrackWithoutPC++;
|
|
3177
3209
|
logger$6.info("Session doesn't have a connected PeerConnection, adding pending action!");
|
|
3178
3210
|
const pendingActions = this._pendingActionsForConnectedPeerConnections;
|
|
3179
3211
|
if (!pendingActions) {
|
|
3212
|
+
rtcStats.sendEvent("P2PReplaceTrackToPCsPendingActionsNull", {});
|
|
3213
|
+
this.analytics.P2PReplaceTrackToPCsPendingActionsNull++;
|
|
3180
3214
|
logger$6.warn(`No pending action is created to replace track, because the pending actions array is null`);
|
|
3181
3215
|
return;
|
|
3182
3216
|
}
|
|
@@ -3184,6 +3218,8 @@ class P2pRtcManager {
|
|
|
3184
3218
|
const action = () => {
|
|
3185
3219
|
const replacedTrackPromise = session.replaceTrack(oldTrack, newTrack);
|
|
3186
3220
|
if (!replacedTrackPromise) {
|
|
3221
|
+
rtcStats.sendEvent("P2PReplaceTrackReturnedFalse", {});
|
|
3222
|
+
this.analytics.P2PReplaceTrackReturnedFalse++;
|
|
3187
3223
|
logger$6.error("replaceTrack returned false!");
|
|
3188
3224
|
reject(`ReplaceTrack returned false`);
|
|
3189
3225
|
return;
|
|
@@ -3197,6 +3233,8 @@ class P2pRtcManager {
|
|
|
3197
3233
|
}
|
|
3198
3234
|
const replacedTrackResult = session.replaceTrack(oldTrack, newTrack);
|
|
3199
3235
|
if (!replacedTrackResult) {
|
|
3236
|
+
rtcStats.sendEvent("P2PReplaceTrackReturnedFalse", {});
|
|
3237
|
+
this.analytics.P2PReplaceTrackReturnedFalse++;
|
|
3200
3238
|
logger$6.error("replaceTrack returned false!");
|
|
3201
3239
|
return;
|
|
3202
3240
|
}
|
|
@@ -3567,7 +3605,7 @@ class P2pRtcManager {
|
|
|
3567
3605
|
this._changeBandwidthForAllClients(false);
|
|
3568
3606
|
const numPeers = this.numberOfPeerconnections();
|
|
3569
3607
|
if (numPeers === 0) {
|
|
3570
|
-
setTimeout(() => {
|
|
3608
|
+
this._rtcStatsDisconnectTimeout = setTimeout(() => {
|
|
3571
3609
|
const numPeers = this.numberOfPeerconnections();
|
|
3572
3610
|
if (numPeers === 0) {
|
|
3573
3611
|
this.rtcStatsDisconnect();
|
|
@@ -5666,6 +5704,7 @@ class VegaRtcManager {
|
|
|
5666
5704
|
this._screenAudioTrack = null;
|
|
5667
5705
|
this._streamIdToVideoConsumerId.clear();
|
|
5668
5706
|
this._mediasoupDeviceInitializedAsync = Promise.resolve(null);
|
|
5707
|
+
this._qualityMonitor.close();
|
|
5669
5708
|
}
|
|
5670
5709
|
sendAudioMutedStats(muted) {
|
|
5671
5710
|
rtcStats.sendEvent("audio_muted", { muted });
|
|
@@ -7425,6 +7464,9 @@ function getDisplayMedia(constraints = defaultDisplayMediaConstraints, contentHi
|
|
|
7425
7464
|
t.contentHint = contentHint;
|
|
7426
7465
|
}
|
|
7427
7466
|
});
|
|
7467
|
+
stream.getTracks().forEach((t) => {
|
|
7468
|
+
trackAnnotations(t).fromGetDisplayMedia = true;
|
|
7469
|
+
});
|
|
7428
7470
|
return stream;
|
|
7429
7471
|
});
|
|
7430
7472
|
}
|
|
@@ -7503,4 +7545,4 @@ var RtcEventNames;
|
|
|
7503
7545
|
RtcEventNames["stream_added"] = "stream_added";
|
|
7504
7546
|
})(RtcEventNames || (RtcEventNames = {}));
|
|
7505
7547
|
|
|
7506
|
-
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
|
|
7548
|
+
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
package/dist/legacy-esm.js
CHANGED
|
@@ -1807,6 +1807,16 @@ function fromLocation({ host = "whereby.com", protocol = "https:" } = {}) {
|
|
|
1807
1807
|
}
|
|
1808
1808
|
fromLocation(window && window.location);
|
|
1809
1809
|
|
|
1810
|
+
const _trackAnnotations = new WeakMap();
|
|
1811
|
+
function trackAnnotations(o) {
|
|
1812
|
+
let props = _trackAnnotations.get(o);
|
|
1813
|
+
if (!props) {
|
|
1814
|
+
props = {};
|
|
1815
|
+
_trackAnnotations.set(o, props);
|
|
1816
|
+
}
|
|
1817
|
+
return props;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1810
1820
|
const logger$9 = new Logger();
|
|
1811
1821
|
const debugLogger = {
|
|
1812
1822
|
print: (...args) => console.debug(args[0], ...args.slice(1)),
|
|
@@ -2204,6 +2214,7 @@ class Session {
|
|
|
2204
2214
|
});
|
|
2205
2215
|
}
|
|
2206
2216
|
else {
|
|
2217
|
+
rtcStats.sendEvent("P2PNoAddTrackSupport", {});
|
|
2207
2218
|
this.pc.addStream(stream);
|
|
2208
2219
|
}
|
|
2209
2220
|
}
|
|
@@ -2242,6 +2253,10 @@ class Session {
|
|
|
2242
2253
|
this.pc.removeStream(stream);
|
|
2243
2254
|
}
|
|
2244
2255
|
}
|
|
2256
|
+
else {
|
|
2257
|
+
rtcStats.sendEvent("P2PRemoveStreamNoPC", {});
|
|
2258
|
+
this._incrementAnalyticMetric("P2PRemoveStreamNoPC");
|
|
2259
|
+
}
|
|
2245
2260
|
}
|
|
2246
2261
|
_setRemoteDescription(desc) {
|
|
2247
2262
|
if (this._deprioritizeH264Encoding)
|
|
@@ -2326,98 +2341,104 @@ class Session {
|
|
|
2326
2341
|
return this.pc && this.pc.connectionState === "connected";
|
|
2327
2342
|
}
|
|
2328
2343
|
replaceTrack(oldTrack, newTrack) {
|
|
2329
|
-
var _a, _b;
|
|
2330
|
-
|
|
2331
|
-
if (!
|
|
2332
|
-
rtcStats.sendEvent("
|
|
2344
|
+
var _a, _b, _c;
|
|
2345
|
+
logger$7.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack === null || newTrack === void 0 ? void 0 : newTrack.id);
|
|
2346
|
+
if (!newTrack) {
|
|
2347
|
+
rtcStats.sendEvent("P2PReplaceTrackNoNewTrack", {
|
|
2333
2348
|
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2334
|
-
|
|
2349
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2350
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2335
2351
|
});
|
|
2336
|
-
this._incrementAnalyticMetric("
|
|
2352
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNoNewTrack");
|
|
2337
2353
|
return false;
|
|
2338
2354
|
}
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
return null;
|
|
2356
|
-
};
|
|
2357
|
-
const result = process();
|
|
2358
|
-
if (result) {
|
|
2359
|
-
return result;
|
|
2355
|
+
if (newTrack.readyState === "ended") {
|
|
2356
|
+
rtcStats.sendEvent("P2PReplaceTrackNewTrackEnded", {
|
|
2357
|
+
newTrackId: newTrack.id,
|
|
2358
|
+
newTrackKind: newTrack.kind,
|
|
2359
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2360
|
+
});
|
|
2361
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNewTrackEnded");
|
|
2362
|
+
return false;
|
|
2363
|
+
}
|
|
2364
|
+
const pc = this.pc;
|
|
2365
|
+
if ((_b = (_a = window.RTCRtpSender) === null || _a === void 0 ? void 0 : _a.prototype) === null || _b === void 0 ? void 0 : _b.replaceTrack) {
|
|
2366
|
+
if (oldTrack) {
|
|
2367
|
+
const sender = pc.getSenders().find((s) => { var _a; return ((_a = s.track) === null || _a === void 0 ? void 0 : _a.id) === oldTrack.id; });
|
|
2368
|
+
if (sender) {
|
|
2369
|
+
sender.replaceTrack(newTrack);
|
|
2370
|
+
return Promise.resolve(newTrack);
|
|
2360
2371
|
}
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
const trackReplaced = yield trackReplacedPromise;
|
|
2394
|
-
resolve(trackReplaced);
|
|
2395
|
-
}), 1000);
|
|
2372
|
+
}
|
|
2373
|
+
const sender = pc.getSenders().find((s) => {
|
|
2374
|
+
const track = s.track;
|
|
2375
|
+
return (track === null || track === void 0 ? void 0 : track.kind) === newTrack.kind && !trackAnnotations(track).fromGetDisplayMedia;
|
|
2376
|
+
});
|
|
2377
|
+
if (sender) {
|
|
2378
|
+
this._incrementAnalyticMetric("P2PReplaceTrackOldTrackNotFound");
|
|
2379
|
+
const track = sender.track;
|
|
2380
|
+
rtcStats.sendEvent("P2PReplaceTrackOldTrackNotFound", {
|
|
2381
|
+
targetTrackId: track === null || track === void 0 ? void 0 : track.id,
|
|
2382
|
+
targetTrackKind: track === null || track === void 0 ? void 0 : track.kind,
|
|
2383
|
+
targetTrackIsEffect: track === null || track === void 0 ? void 0 : track.effectTrack,
|
|
2384
|
+
targetTrackReadyState: track === null || track === void 0 ? void 0 : track.readyState,
|
|
2385
|
+
newTrackId: newTrack.id,
|
|
2386
|
+
newTrackKind: newTrack.kind,
|
|
2387
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2388
|
+
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2389
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2390
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2391
|
+
});
|
|
2392
|
+
sender.replaceTrack(newTrack);
|
|
2393
|
+
return Promise.resolve(newTrack);
|
|
2394
|
+
}
|
|
2395
|
+
let stream = this.streams.find((s) => s.getTracks().find((t) => t.id === newTrack.id));
|
|
2396
|
+
if (!stream) {
|
|
2397
|
+
rtcStats.sendEvent("P2PReplaceTrackNewTrackNotInStream", {
|
|
2398
|
+
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2399
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2400
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2401
|
+
newTrackId: newTrack.id,
|
|
2402
|
+
newTrackKind: newTrack.kind,
|
|
2403
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2396
2404
|
});
|
|
2405
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNewTrackNotInStream");
|
|
2397
2406
|
}
|
|
2398
|
-
|
|
2407
|
+
stream = this.streams[0];
|
|
2399
2408
|
if (!stream) {
|
|
2409
|
+
rtcStats.sendEvent("P2PReplaceTrackNoStream", {});
|
|
2410
|
+
this._incrementAnalyticMetric("P2PReplaceTrackNoStream");
|
|
2400
2411
|
return Promise.reject(new Error("replaceTrack: No stream?"));
|
|
2401
2412
|
}
|
|
2413
|
+
rtcStats.sendEvent("P2PReplaceTrackSourceKindNotFound", {
|
|
2414
|
+
oldTrackId: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id,
|
|
2415
|
+
oldTrackKind: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.kind,
|
|
2416
|
+
oldTrackIsEffect: oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.effectTrack,
|
|
2417
|
+
newTrackId: newTrack.id,
|
|
2418
|
+
newTrackKind: newTrack.kind,
|
|
2419
|
+
newTrackIsEffect: newTrack.effectTrack,
|
|
2420
|
+
});
|
|
2421
|
+
this._incrementAnalyticMetric("P2PReplaceTrackSourceKindNotFound");
|
|
2402
2422
|
return pc.addTrack(newTrack, stream);
|
|
2403
2423
|
}
|
|
2424
|
+
rtcStats.sendEvent("P2PNoReplaceTrackSupport", {});
|
|
2404
2425
|
if (!this.canModifyPeerConnection()) {
|
|
2405
2426
|
this.pending.push(() => {
|
|
2406
|
-
this.replaceTrack(
|
|
2427
|
+
this.replaceTrack(oldTrack, newTrack);
|
|
2407
2428
|
});
|
|
2408
2429
|
return;
|
|
2409
2430
|
}
|
|
2410
2431
|
this.isOperationPending = true;
|
|
2411
2432
|
const onn = pc.onnegotiationneeded;
|
|
2412
2433
|
pc.onnegotiationneeded = null;
|
|
2413
|
-
if (
|
|
2414
|
-
this.removeTrack(
|
|
2434
|
+
if (oldTrack) {
|
|
2435
|
+
this.removeTrack(oldTrack);
|
|
2415
2436
|
}
|
|
2416
2437
|
this.addTrack(newTrack);
|
|
2417
2438
|
setTimeout(() => {
|
|
2418
2439
|
pc.onnegotiationneeded = onn;
|
|
2419
2440
|
}, 0);
|
|
2420
|
-
if (((
|
|
2441
|
+
if (((_c = pc.localDescription) === null || _c === void 0 ? void 0 : _c.type) === "offer") {
|
|
2421
2442
|
return pc
|
|
2422
2443
|
.createOffer()
|
|
2423
2444
|
.then((offer) => {
|
|
@@ -2644,9 +2665,7 @@ class P2pRtcManager {
|
|
|
2644
2665
|
turnServers: turnServers || [],
|
|
2645
2666
|
mediaserverConfigTtlSeconds,
|
|
2646
2667
|
});
|
|
2647
|
-
this.totalSessionsCreated = 0;
|
|
2648
2668
|
this.analytics = {
|
|
2649
|
-
P2PReplaceTrackNoPC: 0,
|
|
2650
2669
|
P2PNonErrorRejectionValueGUMError: 0,
|
|
2651
2670
|
numNewPc: 0,
|
|
2652
2671
|
numIceConnected: 0,
|
|
@@ -2665,6 +2684,16 @@ class P2pRtcManager {
|
|
|
2665
2684
|
P2PChangeBandwidthEmptySDPType: 0,
|
|
2666
2685
|
P2PNegotiationNeeded: 0,
|
|
2667
2686
|
P2PSessionAlreadyCreated: 0,
|
|
2687
|
+
P2PReplaceTrackNoStream: 0,
|
|
2688
|
+
P2PReplaceTrackNoNewTrack: 0,
|
|
2689
|
+
P2PReplaceTrackNewTrackEnded: 0,
|
|
2690
|
+
P2PReplaceTrackNewTrackNotInStream: 0,
|
|
2691
|
+
P2PReplaceTrackOldTrackNotFound: 0,
|
|
2692
|
+
P2PReplaceTrackToPCsPendingActionsNull: 0,
|
|
2693
|
+
P2PReplaceTrackReturnedFalse: 0,
|
|
2694
|
+
P2PReplaceTrackWithoutPC: 0,
|
|
2695
|
+
P2PReplaceTrackSourceKindNotFound: 0,
|
|
2696
|
+
P2PRemoveStreamNoPC: 0,
|
|
2668
2697
|
};
|
|
2669
2698
|
}
|
|
2670
2699
|
numberOfPeerconnections() {
|
|
@@ -2747,6 +2776,7 @@ class P2pRtcManager {
|
|
|
2747
2776
|
this._localStreamDeregisterFunction();
|
|
2748
2777
|
this._localStreamDeregisterFunction = null;
|
|
2749
2778
|
}
|
|
2779
|
+
this.rtcStatsDisconnect();
|
|
2750
2780
|
}
|
|
2751
2781
|
setupSocketListeners() {
|
|
2752
2782
|
this._socketListenerDeregisterFunctions = [
|
|
@@ -2849,6 +2879,7 @@ class P2pRtcManager {
|
|
|
2849
2879
|
}
|
|
2850
2880
|
}
|
|
2851
2881
|
rtcStatsDisconnect() {
|
|
2882
|
+
clearTimeout(this._rtcStatsDisconnectTimeout);
|
|
2852
2883
|
rtcStats.server.close();
|
|
2853
2884
|
}
|
|
2854
2885
|
rtcStatsReconnect() {
|
|
@@ -2958,7 +2989,6 @@ class P2pRtcManager {
|
|
|
2958
2989
|
shouldAddLocalVideo,
|
|
2959
2990
|
incrementAnalyticMetric: (metric) => this.analytics[metric]++,
|
|
2960
2991
|
});
|
|
2961
|
-
this.totalSessionsCreated++;
|
|
2962
2992
|
}
|
|
2963
2993
|
else {
|
|
2964
2994
|
this.analytics.P2PSessionAlreadyCreated++;
|
|
@@ -3174,9 +3204,13 @@ class P2pRtcManager {
|
|
|
3174
3204
|
const promises = [];
|
|
3175
3205
|
this._forEachPeerConnection((session) => {
|
|
3176
3206
|
if (!session.hasConnectedPeerConnection()) {
|
|
3207
|
+
rtcStats.sendEvent("P2PReplaceTrackWithoutPC", {});
|
|
3208
|
+
this.analytics.P2PReplaceTrackWithoutPC++;
|
|
3177
3209
|
logger$6.info("Session doesn't have a connected PeerConnection, adding pending action!");
|
|
3178
3210
|
const pendingActions = this._pendingActionsForConnectedPeerConnections;
|
|
3179
3211
|
if (!pendingActions) {
|
|
3212
|
+
rtcStats.sendEvent("P2PReplaceTrackToPCsPendingActionsNull", {});
|
|
3213
|
+
this.analytics.P2PReplaceTrackToPCsPendingActionsNull++;
|
|
3180
3214
|
logger$6.warn(`No pending action is created to replace track, because the pending actions array is null`);
|
|
3181
3215
|
return;
|
|
3182
3216
|
}
|
|
@@ -3184,6 +3218,8 @@ class P2pRtcManager {
|
|
|
3184
3218
|
const action = () => {
|
|
3185
3219
|
const replacedTrackPromise = session.replaceTrack(oldTrack, newTrack);
|
|
3186
3220
|
if (!replacedTrackPromise) {
|
|
3221
|
+
rtcStats.sendEvent("P2PReplaceTrackReturnedFalse", {});
|
|
3222
|
+
this.analytics.P2PReplaceTrackReturnedFalse++;
|
|
3187
3223
|
logger$6.error("replaceTrack returned false!");
|
|
3188
3224
|
reject(`ReplaceTrack returned false`);
|
|
3189
3225
|
return;
|
|
@@ -3197,6 +3233,8 @@ class P2pRtcManager {
|
|
|
3197
3233
|
}
|
|
3198
3234
|
const replacedTrackResult = session.replaceTrack(oldTrack, newTrack);
|
|
3199
3235
|
if (!replacedTrackResult) {
|
|
3236
|
+
rtcStats.sendEvent("P2PReplaceTrackReturnedFalse", {});
|
|
3237
|
+
this.analytics.P2PReplaceTrackReturnedFalse++;
|
|
3200
3238
|
logger$6.error("replaceTrack returned false!");
|
|
3201
3239
|
return;
|
|
3202
3240
|
}
|
|
@@ -3567,7 +3605,7 @@ class P2pRtcManager {
|
|
|
3567
3605
|
this._changeBandwidthForAllClients(false);
|
|
3568
3606
|
const numPeers = this.numberOfPeerconnections();
|
|
3569
3607
|
if (numPeers === 0) {
|
|
3570
|
-
setTimeout(() => {
|
|
3608
|
+
this._rtcStatsDisconnectTimeout = setTimeout(() => {
|
|
3571
3609
|
const numPeers = this.numberOfPeerconnections();
|
|
3572
3610
|
if (numPeers === 0) {
|
|
3573
3611
|
this.rtcStatsDisconnect();
|
|
@@ -5666,6 +5704,7 @@ class VegaRtcManager {
|
|
|
5666
5704
|
this._screenAudioTrack = null;
|
|
5667
5705
|
this._streamIdToVideoConsumerId.clear();
|
|
5668
5706
|
this._mediasoupDeviceInitializedAsync = Promise.resolve(null);
|
|
5707
|
+
this._qualityMonitor.close();
|
|
5669
5708
|
}
|
|
5670
5709
|
sendAudioMutedStats(muted) {
|
|
5671
5710
|
rtcStats.sendEvent("audio_muted", { muted });
|
|
@@ -7425,6 +7464,9 @@ function getDisplayMedia(constraints = defaultDisplayMediaConstraints, contentHi
|
|
|
7425
7464
|
t.contentHint = contentHint;
|
|
7426
7465
|
}
|
|
7427
7466
|
});
|
|
7467
|
+
stream.getTracks().forEach((t) => {
|
|
7468
|
+
trackAnnotations(t).fromGetDisplayMedia = true;
|
|
7469
|
+
});
|
|
7428
7470
|
return stream;
|
|
7429
7471
|
});
|
|
7430
7472
|
}
|
|
@@ -7503,5 +7545,5 @@ var RtcEventNames;
|
|
|
7503
7545
|
RtcEventNames["stream_added"] = "stream_added";
|
|
7504
7546
|
})(RtcEventNames || (RtcEventNames = {}));
|
|
7505
7547
|
|
|
7506
|
-
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, turnServerOverride, variance };
|
|
7548
|
+
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, RtcStream, SCREEN_SHARE_SETTINGS, SCREEN_SHARE_SIMULCAST_SETTINGS, STREAM_TYPES, ServerSocket, Session, SfuV2Parser, TYPES, VIDEO_SETTINGS_HD, VIDEO_SETTINGS_SD, VIDEO_SETTINGS_VP9, VIDEO_SETTINGS_VP9_LOW_BANDWIDTH, VegaConnection, VegaMediaQualityMonitor, VegaRtcManager, addAbsCaptureTimeExtMap, addExtMap, assert, buildDeviceList, calculateStd, captureAudioSsrcMetrics, captureCandidatePairInfoMetrics, captureCommonSsrcMetrics, captureSsrcInfo, captureVideoSsrcMetrics, changeMediaDirection, cleanSdp, compareLocalDevices, createACFCalculator, createMicAnalyser, createWorker, deprioritizeH264, detectMicrophoneNotWorking, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isMobile, issueDetectorOrMetricEnabled, maybeRejectNoH264, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceSSRCs, replaceTracksInStream, rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
7507
7549
|
//# sourceMappingURL=legacy-esm.js.map
|