@whereby.com/media 8.0.11 → 8.2.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 +46 -2
- package/dist/index.d.cts +22 -3
- package/dist/index.d.mts +22 -3
- package/dist/index.d.ts +22 -3
- package/dist/index.mjs +46 -2
- package/dist/legacy-esm.js +46 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -489,7 +489,7 @@ var _a$5;
|
|
|
489
489
|
const adapter$5 = (_a$5 = adapterRaw.default) !== null && _a$5 !== void 0 ? _a$5 : adapterRaw;
|
|
490
490
|
const logger$a = new Logger();
|
|
491
491
|
class Session {
|
|
492
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }) {
|
|
492
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }) {
|
|
493
493
|
this.relayCandidateSeen = false;
|
|
494
494
|
this.serverReflexiveCandidateSeen = false;
|
|
495
495
|
this.publicHostCandidateSeen = false;
|
|
@@ -498,6 +498,7 @@ class Session {
|
|
|
498
498
|
this.ipv6HostCandidate6to4Seen = false;
|
|
499
499
|
this.mdnsHostCandidateSeen = false;
|
|
500
500
|
this.pendingReplaceTrackActions = [];
|
|
501
|
+
this._mediaPrefs = mediaPrefs;
|
|
501
502
|
this.peerConnectionConfig = peerConnectionConfig;
|
|
502
503
|
this.clientId = clientId;
|
|
503
504
|
this.pc = new RTCPeerConnection(this.peerConnectionConfig);
|
|
@@ -530,16 +531,24 @@ class Session {
|
|
|
530
531
|
this._incrementAnalyticMetric = incrementAnalyticMetric;
|
|
531
532
|
}
|
|
532
533
|
addStream(stream) {
|
|
534
|
+
var _a;
|
|
533
535
|
this.streamIds.push(stream.id);
|
|
534
536
|
this.streams.push(stream);
|
|
535
537
|
stream.getAudioTracks().forEach((track) => {
|
|
536
538
|
this.pc.addTrack(track, stream);
|
|
537
539
|
});
|
|
540
|
+
if (((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
538
543
|
stream.getVideoTracks().forEach((track) => {
|
|
539
544
|
this.pc.addTrack(track, stream);
|
|
540
545
|
});
|
|
541
546
|
}
|
|
542
547
|
addTrack(track, stream) {
|
|
548
|
+
var _a;
|
|
549
|
+
if (track.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
550
|
+
return;
|
|
551
|
+
}
|
|
543
552
|
if (!stream) {
|
|
544
553
|
stream = this.streams[0];
|
|
545
554
|
}
|
|
@@ -663,10 +672,14 @@ class Session {
|
|
|
663
672
|
}
|
|
664
673
|
replaceTrack(oldTrack, newTrack) {
|
|
665
674
|
return __awaiter(this, void 0, void 0, function* () {
|
|
675
|
+
var _a;
|
|
666
676
|
logger$a.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack.id);
|
|
667
677
|
if (newTrack.readyState === "ended") {
|
|
668
678
|
throw new Error(`refusing to use ended track with id: ${newTrack.id}, kind: ${newTrack.kind}`);
|
|
669
679
|
}
|
|
680
|
+
if (newTrack.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
681
|
+
return;
|
|
682
|
+
}
|
|
670
683
|
const pc = this.pc;
|
|
671
684
|
if (oldTrack) {
|
|
672
685
|
const sender = pc.getSenders().find((s) => { var _a; return ((_a = s.track) === null || _a === void 0 ? void 0 : _a.id) === oldTrack.id; });
|
|
@@ -2471,6 +2484,7 @@ if (browserName$1 === "chrome") {
|
|
|
2471
2484
|
}
|
|
2472
2485
|
class P2pRtcManager {
|
|
2473
2486
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features }) {
|
|
2487
|
+
this._remoteClientMediaPrefs = {};
|
|
2474
2488
|
const { name, session, iceServers, turnServers, mediaserverConfigTtlSeconds } = room;
|
|
2475
2489
|
this._selfId = selfId;
|
|
2476
2490
|
this._roomName = name;
|
|
@@ -2509,6 +2523,8 @@ class P2pRtcManager {
|
|
|
2509
2523
|
P2PNonErrorRejectionValueGUMError: 0,
|
|
2510
2524
|
numNewPc: 0,
|
|
2511
2525
|
numIceConnected: 0,
|
|
2526
|
+
numIceDisconnected: 0,
|
|
2527
|
+
numIceFailed: 0,
|
|
2512
2528
|
numIceRestart: 0,
|
|
2513
2529
|
numIceNoPublicIpGathered: 0,
|
|
2514
2530
|
numIceNoPublicIpGatheredIn3sec: 0,
|
|
@@ -2755,6 +2771,12 @@ class P2pRtcManager {
|
|
|
2755
2771
|
this._screenshareVideoTrackIds.push(localScreenShareTrack.id);
|
|
2756
2772
|
}
|
|
2757
2773
|
}
|
|
2774
|
+
setRemoteClientMediaPrefs(clientId, mediaPrefs) {
|
|
2775
|
+
this._remoteClientMediaPrefs[clientId] = mediaPrefs;
|
|
2776
|
+
}
|
|
2777
|
+
removeRemoteClientMediaPrefs(clientId) {
|
|
2778
|
+
delete this._remoteClientMediaPrefs[clientId];
|
|
2779
|
+
}
|
|
2758
2780
|
setRoomSessionId(roomSessionId) {
|
|
2759
2781
|
this._roomSessionId = roomSessionId;
|
|
2760
2782
|
}
|
|
@@ -2834,6 +2856,7 @@ class P2pRtcManager {
|
|
|
2834
2856
|
bandwidth: initialBandwidth,
|
|
2835
2857
|
deprioritizeH264Encoding,
|
|
2836
2858
|
incrementAnalyticMetric: (metric) => this.analytics[metric]++,
|
|
2859
|
+
mediaPrefs: this._remoteClientMediaPrefs[clientId],
|
|
2837
2860
|
});
|
|
2838
2861
|
this.peerConnections[clientId] = session;
|
|
2839
2862
|
setTimeout(() => this._emit(rtcManagerEvents.NEW_PC), 0);
|
|
@@ -2990,6 +3013,7 @@ class P2pRtcManager {
|
|
|
2990
3013
|
break;
|
|
2991
3014
|
case "disconnected":
|
|
2992
3015
|
newStatus = TYPES.CONNECTION_DISCONNECTED;
|
|
3016
|
+
this.analytics.numIceDisconnected++;
|
|
2993
3017
|
setTimeout(() => {
|
|
2994
3018
|
if (pc.iceConnectionState === "disconnected") {
|
|
2995
3019
|
this._maybeRestartIce(clientId, session);
|
|
@@ -2998,6 +3022,7 @@ class P2pRtcManager {
|
|
|
2998
3022
|
break;
|
|
2999
3023
|
case "failed":
|
|
3000
3024
|
newStatus = TYPES.CONNECTION_FAILED;
|
|
3025
|
+
this.analytics.numIceFailed++;
|
|
3001
3026
|
if (currentStatus !== newStatus) {
|
|
3002
3027
|
this._maybeRestartIce(clientId, session);
|
|
3003
3028
|
}
|
|
@@ -3075,7 +3100,7 @@ class P2pRtcManager {
|
|
|
3075
3100
|
this._setJitterBufferTarget(pc);
|
|
3076
3101
|
}
|
|
3077
3102
|
if (((_b = (_a = this._localCameraStream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()) === null || _b === void 0 ? void 0 : _b.length) && this._stoppedVideoTrack) {
|
|
3078
|
-
|
|
3103
|
+
session.addTrack(this._stoppedVideoTrack, this._localCameraStream);
|
|
3079
3104
|
}
|
|
3080
3105
|
return session;
|
|
3081
3106
|
}
|
|
@@ -3085,6 +3110,7 @@ class P2pRtcManager {
|
|
|
3085
3110
|
logger$6.warn("No RTCPeerConnection in RTCManager.disconnect()", clientId);
|
|
3086
3111
|
return;
|
|
3087
3112
|
}
|
|
3113
|
+
this.removeRemoteClientMediaPrefs(session.clientId);
|
|
3088
3114
|
session.close();
|
|
3089
3115
|
delete this.peerConnections[clientId];
|
|
3090
3116
|
}
|
|
@@ -4419,6 +4445,10 @@ class VegaRtcManager {
|
|
|
4419
4445
|
vegaScreenAudioProducerFailed: 0,
|
|
4420
4446
|
micTrackEndedCount: 0,
|
|
4421
4447
|
camTrackEndedCount: 0,
|
|
4448
|
+
numNewPc: 0,
|
|
4449
|
+
numIceConnected: 0,
|
|
4450
|
+
numIceDisconnected: 0,
|
|
4451
|
+
numIceFailed: 0,
|
|
4422
4452
|
};
|
|
4423
4453
|
}
|
|
4424
4454
|
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds, }) {
|
|
@@ -4634,8 +4664,20 @@ class VegaRtcManager {
|
|
|
4634
4664
|
transportOptions.iceServers = turnServerOverride(this._features.turnServersOn ? this._turnServers : this._iceServers, this._features.turnServerOverrideHost);
|
|
4635
4665
|
maybeTurnOnly(transportOptions, this._features);
|
|
4636
4666
|
const transport = (_a = (yield this._mediasoupDeviceInitializedAsync)) === null || _a === void 0 ? void 0 : _a[creator](transportOptions);
|
|
4667
|
+
this.analytics.numNewPc++;
|
|
4637
4668
|
const onConnectionStateListener = (connectionState) => __awaiter(this, void 0, void 0, function* () {
|
|
4638
4669
|
logger$2.info(`Transport ConnectionStateChanged ${connectionState}`);
|
|
4670
|
+
switch (connectionState) {
|
|
4671
|
+
case "connected":
|
|
4672
|
+
this.analytics.numIceConnected++;
|
|
4673
|
+
break;
|
|
4674
|
+
case "disconnected":
|
|
4675
|
+
this.analytics.numIceDisconnected++;
|
|
4676
|
+
break;
|
|
4677
|
+
case "failed":
|
|
4678
|
+
this.analytics.numIceFailed++;
|
|
4679
|
+
break;
|
|
4680
|
+
}
|
|
4639
4681
|
if (connectionState !== "disconnected" && connectionState !== "failed") {
|
|
4640
4682
|
return;
|
|
4641
4683
|
}
|
|
@@ -5268,6 +5310,8 @@ class VegaRtcManager {
|
|
|
5268
5310
|
(_a = this._vegaConnection) === null || _a === void 0 ? void 0 : _a.message(audioOnly ? "enableAudioOnly" : "disableAudioOnly");
|
|
5269
5311
|
}
|
|
5270
5312
|
setRemoteScreenshareVideoTrackIds() { }
|
|
5313
|
+
setRemoteClientMediaPrefs() { }
|
|
5314
|
+
removeRemoteClientMediaPrefs() { }
|
|
5271
5315
|
setRoomSessionId(roomSessionId) {
|
|
5272
5316
|
this._roomSessionId = roomSessionId;
|
|
5273
5317
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -403,6 +403,10 @@ type VegaAnalytics = {
|
|
|
403
403
|
vegaConsumerCreationFailed: number;
|
|
404
404
|
micTrackEndedCount: number;
|
|
405
405
|
camTrackEndedCount: number;
|
|
406
|
+
numNewPc: number;
|
|
407
|
+
numIceConnected: number;
|
|
408
|
+
numIceDisconnected: number;
|
|
409
|
+
numIceFailed: number;
|
|
406
410
|
};
|
|
407
411
|
|
|
408
412
|
type VegaAnalyticMetric = keyof VegaAnalytics;
|
|
@@ -444,6 +448,9 @@ interface VegaConnectionOptions {
|
|
|
444
448
|
protocol?: string;
|
|
445
449
|
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
446
450
|
}
|
|
451
|
+
type MediaPrefs = {
|
|
452
|
+
wantsVideo: boolean;
|
|
453
|
+
};
|
|
447
454
|
interface RtcManager {
|
|
448
455
|
acceptNewStream: ({ clientId, streamId }: {
|
|
449
456
|
clientId: string;
|
|
@@ -469,6 +476,9 @@ interface RtcManager {
|
|
|
469
476
|
isSfu: boolean;
|
|
470
477
|
}): boolean;
|
|
471
478
|
setEventClaim?(eventClaim: string): void;
|
|
479
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds: string[]): void;
|
|
480
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
481
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
472
482
|
hasClient(clientId: string): boolean;
|
|
473
483
|
}
|
|
474
484
|
interface RtcManagerCreatedPayload {
|
|
@@ -1253,6 +1263,7 @@ interface P2PSessionOptions {
|
|
|
1253
1263
|
peerConnectionConfig: RTCConfiguration;
|
|
1254
1264
|
deprioritizeH264Encoding: boolean;
|
|
1255
1265
|
incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1266
|
+
mediaPrefs?: MediaPrefs;
|
|
1256
1267
|
}
|
|
1257
1268
|
declare class Session {
|
|
1258
1269
|
relayCandidateSeen: boolean;
|
|
@@ -1274,13 +1285,14 @@ declare class Session {
|
|
|
1274
1285
|
afterConnected: Promise<unknown>;
|
|
1275
1286
|
registerConnected?: (value: unknown) => void;
|
|
1276
1287
|
_deprioritizeH264Encoding: boolean;
|
|
1288
|
+
_mediaPrefs?: MediaPrefs;
|
|
1277
1289
|
clientId: any;
|
|
1278
1290
|
peerConnectionConfig: RTCConfiguration;
|
|
1279
1291
|
signalingState: any;
|
|
1280
1292
|
srdComplete: any;
|
|
1281
1293
|
_incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1282
1294
|
pendingReplaceTrackActions: (() => Promise<void>)[];
|
|
1283
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }: P2PSessionOptions);
|
|
1295
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }: P2PSessionOptions);
|
|
1284
1296
|
addStream(stream: MediaStream): void;
|
|
1285
1297
|
addTrack(track: MediaStreamTrack, stream?: MediaStream): void;
|
|
1286
1298
|
removeTrack(track: MediaStreamTrack): void;
|
|
@@ -1313,6 +1325,8 @@ type P2PAnalytics = {
|
|
|
1313
1325
|
P2PNonErrorRejectionValueGUMError: number;
|
|
1314
1326
|
numNewPc: number;
|
|
1315
1327
|
numIceConnected: number;
|
|
1328
|
+
numIceDisconnected: number;
|
|
1329
|
+
numIceFailed: number;
|
|
1316
1330
|
numIceRestart: number;
|
|
1317
1331
|
numIceNoPublicIpGathered: number;
|
|
1318
1332
|
numIceNoPublicIpGatheredIn3sec: number;
|
|
@@ -1342,6 +1356,7 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1342
1356
|
_localCameraStream?: MediaStream;
|
|
1343
1357
|
_localScreenshareStream?: MediaStream;
|
|
1344
1358
|
_screenshareVideoTrackIds: string[];
|
|
1359
|
+
_remoteClientMediaPrefs: Record<string, MediaPrefs>;
|
|
1345
1360
|
_socketListenerDeregisterFunctions: any[];
|
|
1346
1361
|
_localStreamDeregisterFunction: any;
|
|
1347
1362
|
_emitter: any;
|
|
@@ -1388,7 +1403,9 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1388
1403
|
rtcStatsDisconnect(): void;
|
|
1389
1404
|
rtcStatsReconnect(): void;
|
|
1390
1405
|
setAudioOnly(audioOnly: boolean): void;
|
|
1391
|
-
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?:
|
|
1406
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: string[]): void;
|
|
1407
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
1408
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
1392
1409
|
setRoomSessionId(roomSessionId: string): void;
|
|
1393
1410
|
_setConnectionStatus(session: Session, newStatus: string, clientId: string): void;
|
|
1394
1411
|
_setJitterBufferTarget(pc: RTCPeerConnection): void;
|
|
@@ -1734,6 +1751,8 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1734
1751
|
setColocation(colocation: any): void;
|
|
1735
1752
|
setAudioOnly(audioOnly: boolean): void;
|
|
1736
1753
|
setRemoteScreenshareVideoTrackIds(): void;
|
|
1754
|
+
setRemoteClientMediaPrefs(): void;
|
|
1755
|
+
removeRemoteClientMediaPrefs(): void;
|
|
1737
1756
|
setRoomSessionId(roomSessionId: string): void;
|
|
1738
1757
|
disconnect(clientId: string, eventClaim?: string): void;
|
|
1739
1758
|
replaceTrack(_: MediaStreamTrack | null, track: MediaStreamTrack): void;
|
|
@@ -1964,4 +1983,4 @@ declare const STREAM_TYPES: {
|
|
|
1964
1983
|
};
|
|
1965
1984
|
|
|
1966
1985
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, 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, 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, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1967
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, 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, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
|
1986
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
package/dist/index.d.mts
CHANGED
|
@@ -403,6 +403,10 @@ type VegaAnalytics = {
|
|
|
403
403
|
vegaConsumerCreationFailed: number;
|
|
404
404
|
micTrackEndedCount: number;
|
|
405
405
|
camTrackEndedCount: number;
|
|
406
|
+
numNewPc: number;
|
|
407
|
+
numIceConnected: number;
|
|
408
|
+
numIceDisconnected: number;
|
|
409
|
+
numIceFailed: number;
|
|
406
410
|
};
|
|
407
411
|
|
|
408
412
|
type VegaAnalyticMetric = keyof VegaAnalytics;
|
|
@@ -444,6 +448,9 @@ interface VegaConnectionOptions {
|
|
|
444
448
|
protocol?: string;
|
|
445
449
|
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
446
450
|
}
|
|
451
|
+
type MediaPrefs = {
|
|
452
|
+
wantsVideo: boolean;
|
|
453
|
+
};
|
|
447
454
|
interface RtcManager {
|
|
448
455
|
acceptNewStream: ({ clientId, streamId }: {
|
|
449
456
|
clientId: string;
|
|
@@ -469,6 +476,9 @@ interface RtcManager {
|
|
|
469
476
|
isSfu: boolean;
|
|
470
477
|
}): boolean;
|
|
471
478
|
setEventClaim?(eventClaim: string): void;
|
|
479
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds: string[]): void;
|
|
480
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
481
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
472
482
|
hasClient(clientId: string): boolean;
|
|
473
483
|
}
|
|
474
484
|
interface RtcManagerCreatedPayload {
|
|
@@ -1253,6 +1263,7 @@ interface P2PSessionOptions {
|
|
|
1253
1263
|
peerConnectionConfig: RTCConfiguration;
|
|
1254
1264
|
deprioritizeH264Encoding: boolean;
|
|
1255
1265
|
incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1266
|
+
mediaPrefs?: MediaPrefs;
|
|
1256
1267
|
}
|
|
1257
1268
|
declare class Session {
|
|
1258
1269
|
relayCandidateSeen: boolean;
|
|
@@ -1274,13 +1285,14 @@ declare class Session {
|
|
|
1274
1285
|
afterConnected: Promise<unknown>;
|
|
1275
1286
|
registerConnected?: (value: unknown) => void;
|
|
1276
1287
|
_deprioritizeH264Encoding: boolean;
|
|
1288
|
+
_mediaPrefs?: MediaPrefs;
|
|
1277
1289
|
clientId: any;
|
|
1278
1290
|
peerConnectionConfig: RTCConfiguration;
|
|
1279
1291
|
signalingState: any;
|
|
1280
1292
|
srdComplete: any;
|
|
1281
1293
|
_incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1282
1294
|
pendingReplaceTrackActions: (() => Promise<void>)[];
|
|
1283
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }: P2PSessionOptions);
|
|
1295
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }: P2PSessionOptions);
|
|
1284
1296
|
addStream(stream: MediaStream): void;
|
|
1285
1297
|
addTrack(track: MediaStreamTrack, stream?: MediaStream): void;
|
|
1286
1298
|
removeTrack(track: MediaStreamTrack): void;
|
|
@@ -1313,6 +1325,8 @@ type P2PAnalytics = {
|
|
|
1313
1325
|
P2PNonErrorRejectionValueGUMError: number;
|
|
1314
1326
|
numNewPc: number;
|
|
1315
1327
|
numIceConnected: number;
|
|
1328
|
+
numIceDisconnected: number;
|
|
1329
|
+
numIceFailed: number;
|
|
1316
1330
|
numIceRestart: number;
|
|
1317
1331
|
numIceNoPublicIpGathered: number;
|
|
1318
1332
|
numIceNoPublicIpGatheredIn3sec: number;
|
|
@@ -1342,6 +1356,7 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1342
1356
|
_localCameraStream?: MediaStream;
|
|
1343
1357
|
_localScreenshareStream?: MediaStream;
|
|
1344
1358
|
_screenshareVideoTrackIds: string[];
|
|
1359
|
+
_remoteClientMediaPrefs: Record<string, MediaPrefs>;
|
|
1345
1360
|
_socketListenerDeregisterFunctions: any[];
|
|
1346
1361
|
_localStreamDeregisterFunction: any;
|
|
1347
1362
|
_emitter: any;
|
|
@@ -1388,7 +1403,9 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1388
1403
|
rtcStatsDisconnect(): void;
|
|
1389
1404
|
rtcStatsReconnect(): void;
|
|
1390
1405
|
setAudioOnly(audioOnly: boolean): void;
|
|
1391
|
-
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?:
|
|
1406
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: string[]): void;
|
|
1407
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
1408
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
1392
1409
|
setRoomSessionId(roomSessionId: string): void;
|
|
1393
1410
|
_setConnectionStatus(session: Session, newStatus: string, clientId: string): void;
|
|
1394
1411
|
_setJitterBufferTarget(pc: RTCPeerConnection): void;
|
|
@@ -1734,6 +1751,8 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1734
1751
|
setColocation(colocation: any): void;
|
|
1735
1752
|
setAudioOnly(audioOnly: boolean): void;
|
|
1736
1753
|
setRemoteScreenshareVideoTrackIds(): void;
|
|
1754
|
+
setRemoteClientMediaPrefs(): void;
|
|
1755
|
+
removeRemoteClientMediaPrefs(): void;
|
|
1737
1756
|
setRoomSessionId(roomSessionId: string): void;
|
|
1738
1757
|
disconnect(clientId: string, eventClaim?: string): void;
|
|
1739
1758
|
replaceTrack(_: MediaStreamTrack | null, track: MediaStreamTrack): void;
|
|
@@ -1964,4 +1983,4 @@ declare const STREAM_TYPES: {
|
|
|
1964
1983
|
};
|
|
1965
1984
|
|
|
1966
1985
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, 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, 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, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1967
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, 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, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
|
1986
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
package/dist/index.d.ts
CHANGED
|
@@ -403,6 +403,10 @@ type VegaAnalytics = {
|
|
|
403
403
|
vegaConsumerCreationFailed: number;
|
|
404
404
|
micTrackEndedCount: number;
|
|
405
405
|
camTrackEndedCount: number;
|
|
406
|
+
numNewPc: number;
|
|
407
|
+
numIceConnected: number;
|
|
408
|
+
numIceDisconnected: number;
|
|
409
|
+
numIceFailed: number;
|
|
406
410
|
};
|
|
407
411
|
|
|
408
412
|
type VegaAnalyticMetric = keyof VegaAnalytics;
|
|
@@ -444,6 +448,9 @@ interface VegaConnectionOptions {
|
|
|
444
448
|
protocol?: string;
|
|
445
449
|
incrementAnalyticMetric?: VegaIncrementAnalyticMetric;
|
|
446
450
|
}
|
|
451
|
+
type MediaPrefs = {
|
|
452
|
+
wantsVideo: boolean;
|
|
453
|
+
};
|
|
447
454
|
interface RtcManager {
|
|
448
455
|
acceptNewStream: ({ clientId, streamId }: {
|
|
449
456
|
clientId: string;
|
|
@@ -469,6 +476,9 @@ interface RtcManager {
|
|
|
469
476
|
isSfu: boolean;
|
|
470
477
|
}): boolean;
|
|
471
478
|
setEventClaim?(eventClaim: string): void;
|
|
479
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds: string[]): void;
|
|
480
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
481
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
472
482
|
hasClient(clientId: string): boolean;
|
|
473
483
|
}
|
|
474
484
|
interface RtcManagerCreatedPayload {
|
|
@@ -1253,6 +1263,7 @@ interface P2PSessionOptions {
|
|
|
1253
1263
|
peerConnectionConfig: RTCConfiguration;
|
|
1254
1264
|
deprioritizeH264Encoding: boolean;
|
|
1255
1265
|
incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1266
|
+
mediaPrefs?: MediaPrefs;
|
|
1256
1267
|
}
|
|
1257
1268
|
declare class Session {
|
|
1258
1269
|
relayCandidateSeen: boolean;
|
|
@@ -1274,13 +1285,14 @@ declare class Session {
|
|
|
1274
1285
|
afterConnected: Promise<unknown>;
|
|
1275
1286
|
registerConnected?: (value: unknown) => void;
|
|
1276
1287
|
_deprioritizeH264Encoding: boolean;
|
|
1288
|
+
_mediaPrefs?: MediaPrefs;
|
|
1277
1289
|
clientId: any;
|
|
1278
1290
|
peerConnectionConfig: RTCConfiguration;
|
|
1279
1291
|
signalingState: any;
|
|
1280
1292
|
srdComplete: any;
|
|
1281
1293
|
_incrementAnalyticMetric: P2PIncrementAnalyticMetric;
|
|
1282
1294
|
pendingReplaceTrackActions: (() => Promise<void>)[];
|
|
1283
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }: P2PSessionOptions);
|
|
1295
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }: P2PSessionOptions);
|
|
1284
1296
|
addStream(stream: MediaStream): void;
|
|
1285
1297
|
addTrack(track: MediaStreamTrack, stream?: MediaStream): void;
|
|
1286
1298
|
removeTrack(track: MediaStreamTrack): void;
|
|
@@ -1313,6 +1325,8 @@ type P2PAnalytics = {
|
|
|
1313
1325
|
P2PNonErrorRejectionValueGUMError: number;
|
|
1314
1326
|
numNewPc: number;
|
|
1315
1327
|
numIceConnected: number;
|
|
1328
|
+
numIceDisconnected: number;
|
|
1329
|
+
numIceFailed: number;
|
|
1316
1330
|
numIceRestart: number;
|
|
1317
1331
|
numIceNoPublicIpGathered: number;
|
|
1318
1332
|
numIceNoPublicIpGatheredIn3sec: number;
|
|
@@ -1342,6 +1356,7 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1342
1356
|
_localCameraStream?: MediaStream;
|
|
1343
1357
|
_localScreenshareStream?: MediaStream;
|
|
1344
1358
|
_screenshareVideoTrackIds: string[];
|
|
1359
|
+
_remoteClientMediaPrefs: Record<string, MediaPrefs>;
|
|
1345
1360
|
_socketListenerDeregisterFunctions: any[];
|
|
1346
1361
|
_localStreamDeregisterFunction: any;
|
|
1347
1362
|
_emitter: any;
|
|
@@ -1388,7 +1403,9 @@ declare class P2pRtcManager implements RtcManager {
|
|
|
1388
1403
|
rtcStatsDisconnect(): void;
|
|
1389
1404
|
rtcStatsReconnect(): void;
|
|
1390
1405
|
setAudioOnly(audioOnly: boolean): void;
|
|
1391
|
-
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?:
|
|
1406
|
+
setRemoteScreenshareVideoTrackIds(remoteScreenshareVideoTrackIds?: string[]): void;
|
|
1407
|
+
setRemoteClientMediaPrefs(clientId: string, mediaPrefs: MediaPrefs): void;
|
|
1408
|
+
removeRemoteClientMediaPrefs(clientId: string): void;
|
|
1392
1409
|
setRoomSessionId(roomSessionId: string): void;
|
|
1393
1410
|
_setConnectionStatus(session: Session, newStatus: string, clientId: string): void;
|
|
1394
1411
|
_setJitterBufferTarget(pc: RTCPeerConnection): void;
|
|
@@ -1734,6 +1751,8 @@ declare class VegaRtcManager implements RtcManager {
|
|
|
1734
1751
|
setColocation(colocation: any): void;
|
|
1735
1752
|
setAudioOnly(audioOnly: boolean): void;
|
|
1736
1753
|
setRemoteScreenshareVideoTrackIds(): void;
|
|
1754
|
+
setRemoteClientMediaPrefs(): void;
|
|
1755
|
+
removeRemoteClientMediaPrefs(): void;
|
|
1737
1756
|
setRoomSessionId(roomSessionId: string): void;
|
|
1738
1757
|
disconnect(clientId: string, eventClaim?: string): void;
|
|
1739
1758
|
replaceTrack(_: MediaStreamTrack | null, track: MediaStreamTrack): void;
|
|
@@ -1964,4 +1983,4 @@ declare const STREAM_TYPES: {
|
|
|
1964
1983
|
};
|
|
1965
1984
|
|
|
1966
1985
|
export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, EVENTS, KNOCK_MESSAGES, KalmanFilter, Logger, MEDIA_JITTER_BUFFER_TARGET, NoDevicesError, P2pRtcManager, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ReconnectManager, RtcEventNames, RtcManagerDispatcher, 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, 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, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
|
|
1967
|
-
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, 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, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
|
1986
|
+
export type { AddCameraStreamOptions, AddSpotlightRequest, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatMessage, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, Credentials, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockRejectedEvent, KnockRoomRequest, KnockerLeftEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcStreamAddedPayload, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StatsMonitorOptions, StatsMonitorState, StatsSubscription, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
|
package/dist/index.mjs
CHANGED
|
@@ -468,7 +468,7 @@ var _a$5;
|
|
|
468
468
|
const adapter$5 = (_a$5 = adapterRaw.default) !== null && _a$5 !== void 0 ? _a$5 : adapterRaw;
|
|
469
469
|
const logger$a = new Logger();
|
|
470
470
|
class Session {
|
|
471
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }) {
|
|
471
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }) {
|
|
472
472
|
this.relayCandidateSeen = false;
|
|
473
473
|
this.serverReflexiveCandidateSeen = false;
|
|
474
474
|
this.publicHostCandidateSeen = false;
|
|
@@ -477,6 +477,7 @@ class Session {
|
|
|
477
477
|
this.ipv6HostCandidate6to4Seen = false;
|
|
478
478
|
this.mdnsHostCandidateSeen = false;
|
|
479
479
|
this.pendingReplaceTrackActions = [];
|
|
480
|
+
this._mediaPrefs = mediaPrefs;
|
|
480
481
|
this.peerConnectionConfig = peerConnectionConfig;
|
|
481
482
|
this.clientId = clientId;
|
|
482
483
|
this.pc = new RTCPeerConnection(this.peerConnectionConfig);
|
|
@@ -509,16 +510,24 @@ class Session {
|
|
|
509
510
|
this._incrementAnalyticMetric = incrementAnalyticMetric;
|
|
510
511
|
}
|
|
511
512
|
addStream(stream) {
|
|
513
|
+
var _a;
|
|
512
514
|
this.streamIds.push(stream.id);
|
|
513
515
|
this.streams.push(stream);
|
|
514
516
|
stream.getAudioTracks().forEach((track) => {
|
|
515
517
|
this.pc.addTrack(track, stream);
|
|
516
518
|
});
|
|
519
|
+
if (((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
517
522
|
stream.getVideoTracks().forEach((track) => {
|
|
518
523
|
this.pc.addTrack(track, stream);
|
|
519
524
|
});
|
|
520
525
|
}
|
|
521
526
|
addTrack(track, stream) {
|
|
527
|
+
var _a;
|
|
528
|
+
if (track.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
522
531
|
if (!stream) {
|
|
523
532
|
stream = this.streams[0];
|
|
524
533
|
}
|
|
@@ -642,10 +651,14 @@ class Session {
|
|
|
642
651
|
}
|
|
643
652
|
replaceTrack(oldTrack, newTrack) {
|
|
644
653
|
return __awaiter(this, void 0, void 0, function* () {
|
|
654
|
+
var _a;
|
|
645
655
|
logger$a.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack.id);
|
|
646
656
|
if (newTrack.readyState === "ended") {
|
|
647
657
|
throw new Error(`refusing to use ended track with id: ${newTrack.id}, kind: ${newTrack.kind}`);
|
|
648
658
|
}
|
|
659
|
+
if (newTrack.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
649
662
|
const pc = this.pc;
|
|
650
663
|
if (oldTrack) {
|
|
651
664
|
const sender = pc.getSenders().find((s) => { var _a; return ((_a = s.track) === null || _a === void 0 ? void 0 : _a.id) === oldTrack.id; });
|
|
@@ -2450,6 +2463,7 @@ if (browserName$1 === "chrome") {
|
|
|
2450
2463
|
}
|
|
2451
2464
|
class P2pRtcManager {
|
|
2452
2465
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features }) {
|
|
2466
|
+
this._remoteClientMediaPrefs = {};
|
|
2453
2467
|
const { name, session, iceServers, turnServers, mediaserverConfigTtlSeconds } = room;
|
|
2454
2468
|
this._selfId = selfId;
|
|
2455
2469
|
this._roomName = name;
|
|
@@ -2488,6 +2502,8 @@ class P2pRtcManager {
|
|
|
2488
2502
|
P2PNonErrorRejectionValueGUMError: 0,
|
|
2489
2503
|
numNewPc: 0,
|
|
2490
2504
|
numIceConnected: 0,
|
|
2505
|
+
numIceDisconnected: 0,
|
|
2506
|
+
numIceFailed: 0,
|
|
2491
2507
|
numIceRestart: 0,
|
|
2492
2508
|
numIceNoPublicIpGathered: 0,
|
|
2493
2509
|
numIceNoPublicIpGatheredIn3sec: 0,
|
|
@@ -2734,6 +2750,12 @@ class P2pRtcManager {
|
|
|
2734
2750
|
this._screenshareVideoTrackIds.push(localScreenShareTrack.id);
|
|
2735
2751
|
}
|
|
2736
2752
|
}
|
|
2753
|
+
setRemoteClientMediaPrefs(clientId, mediaPrefs) {
|
|
2754
|
+
this._remoteClientMediaPrefs[clientId] = mediaPrefs;
|
|
2755
|
+
}
|
|
2756
|
+
removeRemoteClientMediaPrefs(clientId) {
|
|
2757
|
+
delete this._remoteClientMediaPrefs[clientId];
|
|
2758
|
+
}
|
|
2737
2759
|
setRoomSessionId(roomSessionId) {
|
|
2738
2760
|
this._roomSessionId = roomSessionId;
|
|
2739
2761
|
}
|
|
@@ -2813,6 +2835,7 @@ class P2pRtcManager {
|
|
|
2813
2835
|
bandwidth: initialBandwidth,
|
|
2814
2836
|
deprioritizeH264Encoding,
|
|
2815
2837
|
incrementAnalyticMetric: (metric) => this.analytics[metric]++,
|
|
2838
|
+
mediaPrefs: this._remoteClientMediaPrefs[clientId],
|
|
2816
2839
|
});
|
|
2817
2840
|
this.peerConnections[clientId] = session;
|
|
2818
2841
|
setTimeout(() => this._emit(rtcManagerEvents.NEW_PC), 0);
|
|
@@ -2969,6 +2992,7 @@ class P2pRtcManager {
|
|
|
2969
2992
|
break;
|
|
2970
2993
|
case "disconnected":
|
|
2971
2994
|
newStatus = TYPES.CONNECTION_DISCONNECTED;
|
|
2995
|
+
this.analytics.numIceDisconnected++;
|
|
2972
2996
|
setTimeout(() => {
|
|
2973
2997
|
if (pc.iceConnectionState === "disconnected") {
|
|
2974
2998
|
this._maybeRestartIce(clientId, session);
|
|
@@ -2977,6 +3001,7 @@ class P2pRtcManager {
|
|
|
2977
3001
|
break;
|
|
2978
3002
|
case "failed":
|
|
2979
3003
|
newStatus = TYPES.CONNECTION_FAILED;
|
|
3004
|
+
this.analytics.numIceFailed++;
|
|
2980
3005
|
if (currentStatus !== newStatus) {
|
|
2981
3006
|
this._maybeRestartIce(clientId, session);
|
|
2982
3007
|
}
|
|
@@ -3054,7 +3079,7 @@ class P2pRtcManager {
|
|
|
3054
3079
|
this._setJitterBufferTarget(pc);
|
|
3055
3080
|
}
|
|
3056
3081
|
if (((_b = (_a = this._localCameraStream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()) === null || _b === void 0 ? void 0 : _b.length) && this._stoppedVideoTrack) {
|
|
3057
|
-
|
|
3082
|
+
session.addTrack(this._stoppedVideoTrack, this._localCameraStream);
|
|
3058
3083
|
}
|
|
3059
3084
|
return session;
|
|
3060
3085
|
}
|
|
@@ -3064,6 +3089,7 @@ class P2pRtcManager {
|
|
|
3064
3089
|
logger$6.warn("No RTCPeerConnection in RTCManager.disconnect()", clientId);
|
|
3065
3090
|
return;
|
|
3066
3091
|
}
|
|
3092
|
+
this.removeRemoteClientMediaPrefs(session.clientId);
|
|
3067
3093
|
session.close();
|
|
3068
3094
|
delete this.peerConnections[clientId];
|
|
3069
3095
|
}
|
|
@@ -4398,6 +4424,10 @@ class VegaRtcManager {
|
|
|
4398
4424
|
vegaScreenAudioProducerFailed: 0,
|
|
4399
4425
|
micTrackEndedCount: 0,
|
|
4400
4426
|
camTrackEndedCount: 0,
|
|
4427
|
+
numNewPc: 0,
|
|
4428
|
+
numIceConnected: 0,
|
|
4429
|
+
numIceDisconnected: 0,
|
|
4430
|
+
numIceFailed: 0,
|
|
4401
4431
|
};
|
|
4402
4432
|
}
|
|
4403
4433
|
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds, }) {
|
|
@@ -4613,8 +4643,20 @@ class VegaRtcManager {
|
|
|
4613
4643
|
transportOptions.iceServers = turnServerOverride(this._features.turnServersOn ? this._turnServers : this._iceServers, this._features.turnServerOverrideHost);
|
|
4614
4644
|
maybeTurnOnly(transportOptions, this._features);
|
|
4615
4645
|
const transport = (_a = (yield this._mediasoupDeviceInitializedAsync)) === null || _a === void 0 ? void 0 : _a[creator](transportOptions);
|
|
4646
|
+
this.analytics.numNewPc++;
|
|
4616
4647
|
const onConnectionStateListener = (connectionState) => __awaiter(this, void 0, void 0, function* () {
|
|
4617
4648
|
logger$2.info(`Transport ConnectionStateChanged ${connectionState}`);
|
|
4649
|
+
switch (connectionState) {
|
|
4650
|
+
case "connected":
|
|
4651
|
+
this.analytics.numIceConnected++;
|
|
4652
|
+
break;
|
|
4653
|
+
case "disconnected":
|
|
4654
|
+
this.analytics.numIceDisconnected++;
|
|
4655
|
+
break;
|
|
4656
|
+
case "failed":
|
|
4657
|
+
this.analytics.numIceFailed++;
|
|
4658
|
+
break;
|
|
4659
|
+
}
|
|
4618
4660
|
if (connectionState !== "disconnected" && connectionState !== "failed") {
|
|
4619
4661
|
return;
|
|
4620
4662
|
}
|
|
@@ -5247,6 +5289,8 @@ class VegaRtcManager {
|
|
|
5247
5289
|
(_a = this._vegaConnection) === null || _a === void 0 ? void 0 : _a.message(audioOnly ? "enableAudioOnly" : "disableAudioOnly");
|
|
5248
5290
|
}
|
|
5249
5291
|
setRemoteScreenshareVideoTrackIds() { }
|
|
5292
|
+
setRemoteClientMediaPrefs() { }
|
|
5293
|
+
removeRemoteClientMediaPrefs() { }
|
|
5250
5294
|
setRoomSessionId(roomSessionId) {
|
|
5251
5295
|
this._roomSessionId = roomSessionId;
|
|
5252
5296
|
}
|
package/dist/legacy-esm.js
CHANGED
|
@@ -468,7 +468,7 @@ var _a$5;
|
|
|
468
468
|
const adapter$5 = (_a$5 = adapterRaw.default) !== null && _a$5 !== void 0 ? _a$5 : adapterRaw;
|
|
469
469
|
const logger$a = new Logger();
|
|
470
470
|
class Session {
|
|
471
|
-
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }) {
|
|
471
|
+
constructor({ clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, mediaPrefs, }) {
|
|
472
472
|
this.relayCandidateSeen = false;
|
|
473
473
|
this.serverReflexiveCandidateSeen = false;
|
|
474
474
|
this.publicHostCandidateSeen = false;
|
|
@@ -477,6 +477,7 @@ class Session {
|
|
|
477
477
|
this.ipv6HostCandidate6to4Seen = false;
|
|
478
478
|
this.mdnsHostCandidateSeen = false;
|
|
479
479
|
this.pendingReplaceTrackActions = [];
|
|
480
|
+
this._mediaPrefs = mediaPrefs;
|
|
480
481
|
this.peerConnectionConfig = peerConnectionConfig;
|
|
481
482
|
this.clientId = clientId;
|
|
482
483
|
this.pc = new RTCPeerConnection(this.peerConnectionConfig);
|
|
@@ -509,16 +510,24 @@ class Session {
|
|
|
509
510
|
this._incrementAnalyticMetric = incrementAnalyticMetric;
|
|
510
511
|
}
|
|
511
512
|
addStream(stream) {
|
|
513
|
+
var _a;
|
|
512
514
|
this.streamIds.push(stream.id);
|
|
513
515
|
this.streams.push(stream);
|
|
514
516
|
stream.getAudioTracks().forEach((track) => {
|
|
515
517
|
this.pc.addTrack(track, stream);
|
|
516
518
|
});
|
|
519
|
+
if (((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
517
522
|
stream.getVideoTracks().forEach((track) => {
|
|
518
523
|
this.pc.addTrack(track, stream);
|
|
519
524
|
});
|
|
520
525
|
}
|
|
521
526
|
addTrack(track, stream) {
|
|
527
|
+
var _a;
|
|
528
|
+
if (track.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
529
|
+
return;
|
|
530
|
+
}
|
|
522
531
|
if (!stream) {
|
|
523
532
|
stream = this.streams[0];
|
|
524
533
|
}
|
|
@@ -642,10 +651,14 @@ class Session {
|
|
|
642
651
|
}
|
|
643
652
|
replaceTrack(oldTrack, newTrack) {
|
|
644
653
|
return __awaiter(this, void 0, void 0, function* () {
|
|
654
|
+
var _a;
|
|
645
655
|
logger$a.info("replacetrack() [oldTrackId: %s, newTrackId: %s]", oldTrack === null || oldTrack === void 0 ? void 0 : oldTrack.id, newTrack.id);
|
|
646
656
|
if (newTrack.readyState === "ended") {
|
|
647
657
|
throw new Error(`refusing to use ended track with id: ${newTrack.id}, kind: ${newTrack.kind}`);
|
|
648
658
|
}
|
|
659
|
+
if (newTrack.kind === "video" && ((_a = this._mediaPrefs) === null || _a === void 0 ? void 0 : _a.wantsVideo) === false) {
|
|
660
|
+
return;
|
|
661
|
+
}
|
|
649
662
|
const pc = this.pc;
|
|
650
663
|
if (oldTrack) {
|
|
651
664
|
const sender = pc.getSenders().find((s) => { var _a; return ((_a = s.track) === null || _a === void 0 ? void 0 : _a.id) === oldTrack.id; });
|
|
@@ -2450,6 +2463,7 @@ if (browserName$1 === "chrome") {
|
|
|
2450
2463
|
}
|
|
2451
2464
|
class P2pRtcManager {
|
|
2452
2465
|
constructor({ selfId, room, emitter, serverSocket, webrtcProvider, features }) {
|
|
2466
|
+
this._remoteClientMediaPrefs = {};
|
|
2453
2467
|
const { name, session, iceServers, turnServers, mediaserverConfigTtlSeconds } = room;
|
|
2454
2468
|
this._selfId = selfId;
|
|
2455
2469
|
this._roomName = name;
|
|
@@ -2488,6 +2502,8 @@ class P2pRtcManager {
|
|
|
2488
2502
|
P2PNonErrorRejectionValueGUMError: 0,
|
|
2489
2503
|
numNewPc: 0,
|
|
2490
2504
|
numIceConnected: 0,
|
|
2505
|
+
numIceDisconnected: 0,
|
|
2506
|
+
numIceFailed: 0,
|
|
2491
2507
|
numIceRestart: 0,
|
|
2492
2508
|
numIceNoPublicIpGathered: 0,
|
|
2493
2509
|
numIceNoPublicIpGatheredIn3sec: 0,
|
|
@@ -2734,6 +2750,12 @@ class P2pRtcManager {
|
|
|
2734
2750
|
this._screenshareVideoTrackIds.push(localScreenShareTrack.id);
|
|
2735
2751
|
}
|
|
2736
2752
|
}
|
|
2753
|
+
setRemoteClientMediaPrefs(clientId, mediaPrefs) {
|
|
2754
|
+
this._remoteClientMediaPrefs[clientId] = mediaPrefs;
|
|
2755
|
+
}
|
|
2756
|
+
removeRemoteClientMediaPrefs(clientId) {
|
|
2757
|
+
delete this._remoteClientMediaPrefs[clientId];
|
|
2758
|
+
}
|
|
2737
2759
|
setRoomSessionId(roomSessionId) {
|
|
2738
2760
|
this._roomSessionId = roomSessionId;
|
|
2739
2761
|
}
|
|
@@ -2813,6 +2835,7 @@ class P2pRtcManager {
|
|
|
2813
2835
|
bandwidth: initialBandwidth,
|
|
2814
2836
|
deprioritizeH264Encoding,
|
|
2815
2837
|
incrementAnalyticMetric: (metric) => this.analytics[metric]++,
|
|
2838
|
+
mediaPrefs: this._remoteClientMediaPrefs[clientId],
|
|
2816
2839
|
});
|
|
2817
2840
|
this.peerConnections[clientId] = session;
|
|
2818
2841
|
setTimeout(() => this._emit(rtcManagerEvents.NEW_PC), 0);
|
|
@@ -2969,6 +2992,7 @@ class P2pRtcManager {
|
|
|
2969
2992
|
break;
|
|
2970
2993
|
case "disconnected":
|
|
2971
2994
|
newStatus = TYPES.CONNECTION_DISCONNECTED;
|
|
2995
|
+
this.analytics.numIceDisconnected++;
|
|
2972
2996
|
setTimeout(() => {
|
|
2973
2997
|
if (pc.iceConnectionState === "disconnected") {
|
|
2974
2998
|
this._maybeRestartIce(clientId, session);
|
|
@@ -2977,6 +3001,7 @@ class P2pRtcManager {
|
|
|
2977
3001
|
break;
|
|
2978
3002
|
case "failed":
|
|
2979
3003
|
newStatus = TYPES.CONNECTION_FAILED;
|
|
3004
|
+
this.analytics.numIceFailed++;
|
|
2980
3005
|
if (currentStatus !== newStatus) {
|
|
2981
3006
|
this._maybeRestartIce(clientId, session);
|
|
2982
3007
|
}
|
|
@@ -3054,7 +3079,7 @@ class P2pRtcManager {
|
|
|
3054
3079
|
this._setJitterBufferTarget(pc);
|
|
3055
3080
|
}
|
|
3056
3081
|
if (((_b = (_a = this._localCameraStream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()) === null || _b === void 0 ? void 0 : _b.length) && this._stoppedVideoTrack) {
|
|
3057
|
-
|
|
3082
|
+
session.addTrack(this._stoppedVideoTrack, this._localCameraStream);
|
|
3058
3083
|
}
|
|
3059
3084
|
return session;
|
|
3060
3085
|
}
|
|
@@ -3064,6 +3089,7 @@ class P2pRtcManager {
|
|
|
3064
3089
|
logger$6.warn("No RTCPeerConnection in RTCManager.disconnect()", clientId);
|
|
3065
3090
|
return;
|
|
3066
3091
|
}
|
|
3092
|
+
this.removeRemoteClientMediaPrefs(session.clientId);
|
|
3067
3093
|
session.close();
|
|
3068
3094
|
delete this.peerConnections[clientId];
|
|
3069
3095
|
}
|
|
@@ -4398,6 +4424,10 @@ class VegaRtcManager {
|
|
|
4398
4424
|
vegaScreenAudioProducerFailed: 0,
|
|
4399
4425
|
micTrackEndedCount: 0,
|
|
4400
4426
|
camTrackEndedCount: 0,
|
|
4427
|
+
numNewPc: 0,
|
|
4428
|
+
numIceConnected: 0,
|
|
4429
|
+
numIceDisconnected: 0,
|
|
4430
|
+
numIceFailed: 0,
|
|
4401
4431
|
};
|
|
4402
4432
|
}
|
|
4403
4433
|
_updateAndScheduleMediaServersRefresh({ iceServers, turnServers, sfuServer, mediaserverConfigTtlSeconds, }) {
|
|
@@ -4613,8 +4643,20 @@ class VegaRtcManager {
|
|
|
4613
4643
|
transportOptions.iceServers = turnServerOverride(this._features.turnServersOn ? this._turnServers : this._iceServers, this._features.turnServerOverrideHost);
|
|
4614
4644
|
maybeTurnOnly(transportOptions, this._features);
|
|
4615
4645
|
const transport = (_a = (yield this._mediasoupDeviceInitializedAsync)) === null || _a === void 0 ? void 0 : _a[creator](transportOptions);
|
|
4646
|
+
this.analytics.numNewPc++;
|
|
4616
4647
|
const onConnectionStateListener = (connectionState) => __awaiter(this, void 0, void 0, function* () {
|
|
4617
4648
|
logger$2.info(`Transport ConnectionStateChanged ${connectionState}`);
|
|
4649
|
+
switch (connectionState) {
|
|
4650
|
+
case "connected":
|
|
4651
|
+
this.analytics.numIceConnected++;
|
|
4652
|
+
break;
|
|
4653
|
+
case "disconnected":
|
|
4654
|
+
this.analytics.numIceDisconnected++;
|
|
4655
|
+
break;
|
|
4656
|
+
case "failed":
|
|
4657
|
+
this.analytics.numIceFailed++;
|
|
4658
|
+
break;
|
|
4659
|
+
}
|
|
4618
4660
|
if (connectionState !== "disconnected" && connectionState !== "failed") {
|
|
4619
4661
|
return;
|
|
4620
4662
|
}
|
|
@@ -5247,6 +5289,8 @@ class VegaRtcManager {
|
|
|
5247
5289
|
(_a = this._vegaConnection) === null || _a === void 0 ? void 0 : _a.message(audioOnly ? "enableAudioOnly" : "disableAudioOnly");
|
|
5248
5290
|
}
|
|
5249
5291
|
setRemoteScreenshareVideoTrackIds() { }
|
|
5292
|
+
setRemoteClientMediaPrefs() { }
|
|
5293
|
+
removeRemoteClientMediaPrefs() { }
|
|
5250
5294
|
setRoomSessionId(roomSessionId) {
|
|
5251
5295
|
this._roomSessionId = roomSessionId;
|
|
5252
5296
|
}
|