@whereby.com/media 2.8.2 → 2.8.3

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 CHANGED
@@ -1427,7 +1427,7 @@ class ReconnectManager extends EventEmitter {
1427
1427
  clearTimeout(client.timeout);
1428
1428
  delete this._clients[clientId];
1429
1429
  }
1430
- (_a = this.rtcManager) === null || _a === void 0 ? void 0 : _a.disconnect(clientId, null, payload.eventClaim);
1430
+ (_a = this.rtcManager) === null || _a === void 0 ? void 0 : _a.disconnect(clientId, payload.eventClaim);
1431
1431
  this.emit(PROTOCOL_RESPONSES.CLIENT_LEFT, payload);
1432
1432
  }
1433
1433
  _onPendingClientLeft(payload) {
@@ -2234,7 +2234,7 @@ var _a$4;
2234
2234
  const adapter$4 = (_a$4 = adapterRaw.default) !== null && _a$4 !== void 0 ? _a$4 : adapterRaw;
2235
2235
  const logger$7 = new Logger();
2236
2236
  class Session {
2237
- constructor({ peerConnectionId, clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, shouldAddLocalVideo, incrementAnalyticMetric, }) {
2237
+ constructor({ peerConnectionId, clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }) {
2238
2238
  this.peerConnectionId = peerConnectionId;
2239
2239
  this.relayCandidateSeen = false;
2240
2240
  this.serverReflexiveCandidateSeen = false;
@@ -2244,7 +2244,6 @@ class Session {
2244
2244
  this.ipv6HostCandidate6to4Seen = false;
2245
2245
  this.mdnsHostCandidateSeen = false;
2246
2246
  this.peerConnectionConfig = peerConnectionConfig;
2247
- this.shouldAddLocalVideo = shouldAddLocalVideo;
2248
2247
  this.clientId = clientId;
2249
2248
  this.pc = new RTCPeerConnection(this.peerConnectionConfig);
2250
2249
  this.signalingState = this.pc.signalingState;
@@ -2312,11 +2311,13 @@ class Session {
2312
2311
  }
2313
2312
  }
2314
2313
  removeStream(stream) {
2315
- for (let i = 0; i < this.streamIds.length; i++) {
2316
- if (this.streamIds[i] === stream.id) {
2317
- this.streamIds.splice(i, 1);
2318
- this.streams.splice(i, 1);
2319
- }
2314
+ const streamIdIndex = this.streamIds.indexOf(stream.id);
2315
+ if (streamIdIndex !== -1) {
2316
+ this.streamIds.splice(streamIdIndex, 1);
2317
+ }
2318
+ const streamIndex = this.streams.indexOf(stream);
2319
+ if (streamIndex !== -1) {
2320
+ this.streams.splice(streamIndex, 1);
2320
2321
  }
2321
2322
  if (this.pc) {
2322
2323
  if (this.pc.removeTrack) {
@@ -2582,57 +2583,6 @@ const TYPES = {
2582
2583
  CONNECTION_DISCONNECTED: "connection_disconnected",
2583
2584
  };
2584
2585
 
2585
- const CAMERA_STREAM_ID$1 = "0";
2586
- const STREAM_TYPES = {
2587
- CAMERA: "camera",
2588
- SCREEN_SHARE: "screen_share",
2589
- };
2590
- class RtcStream {
2591
- constructor(id, type) {
2592
- this.id = "" + id;
2593
- this.type = type;
2594
- this.isEnabled = true;
2595
- this.hasSupportForAutoSuperSize = false;
2596
- this.isAudioEnabled = true;
2597
- this.isVideoEnabled = true;
2598
- this.status = TYPES.CONNECTING;
2599
- this.stream = null;
2600
- this.streamId = null;
2601
- }
2602
- setup(stream) {
2603
- this.stream = stream;
2604
- this.streamId = stream.id;
2605
- this.setVideoEnabled(this.isVideoEnabled && stream.getVideoTracks().length > 0);
2606
- this.setAudioEnabled(this.isAudioEnabled && stream.getAudioTracks().length > 0);
2607
- return this;
2608
- }
2609
- setStatus(status) {
2610
- this.status = status;
2611
- return this;
2612
- }
2613
- setVideoEnabled(isEnabled) {
2614
- this.isVideoEnabled = isEnabled;
2615
- if (!this.stream) {
2616
- return;
2617
- }
2618
- this.stream.getVideoTracks().forEach((track) => {
2619
- track.enabled = isEnabled;
2620
- });
2621
- }
2622
- setAudioEnabled(isEnabled) {
2623
- this.isAudioEnabled = isEnabled;
2624
- if (!this.stream) {
2625
- return;
2626
- }
2627
- this.stream.getAudioTracks().forEach((track) => {
2628
- track.enabled = isEnabled;
2629
- });
2630
- }
2631
- static getCameraId() {
2632
- return CAMERA_STREAM_ID$1;
2633
- }
2634
- }
2635
-
2636
2586
  var rtcManagerEvents = {
2637
2587
  CAMERA_NOT_WORKING: "camera_not_working",
2638
2588
  CONNECTION_BLOCKED_BY_NETWORK: "connection_blocked_by_network",
@@ -2647,11 +2597,16 @@ var rtcManagerEvents = {
2647
2597
  DOMINANT_SPEAKER: "dominant_speaker",
2648
2598
  };
2649
2599
 
2600
+ const CAMERA_STREAM_ID = "0";
2601
+ const STREAM_TYPES = {
2602
+ webcam: "webcam",
2603
+ screenshare: "screenshare",
2604
+ };
2605
+
2650
2606
  var _a$2, _b$1, _c;
2651
2607
  const adapter$2 = (_a$2 = adapterRaw.default) !== null && _a$2 !== void 0 ? _a$2 : adapterRaw;
2652
2608
  const logger$6 = new Logger();
2653
2609
  const ICE_PUBLIC_IP_GATHERING_TIMEOUT = 3 * 1000;
2654
- const CAMERA_STREAM_ID = RtcStream.getCameraId();
2655
2610
  const browserName$1 = (_b$1 = adapter$2.browserDetails) === null || _b$1 === void 0 ? void 0 : _b$1.browser;
2656
2611
  const browserVersion = adapter$2.browserDetails.version;
2657
2612
  if (browserName$1 === "firefox" && adapter$2.browserShim && "shimGetDisplayMedia" in adapter$2.browserShim) {
@@ -2876,13 +2831,10 @@ class P2pRtcManager {
2876
2831
  });
2877
2832
  }),
2878
2833
  this._serverSocket.on(PROTOCOL_RESPONSES.ROOM_JOINED, (payload) => {
2879
- var _a, _b;
2880
- if (payload === null || payload === void 0 ? void 0 : payload.error) {
2834
+ const { error } = payload;
2835
+ if (error || !this._wasScreenSharing) {
2881
2836
  return;
2882
2837
  }
2883
- const isSfu = (_b = (_a = payload === null || payload === void 0 ? void 0 : payload.room) === null || _a === void 0 ? void 0 : _a.sfuServer) !== null && _b !== void 0 ? _b : false;
2884
- if (isSfu || !this._wasScreenSharing)
2885
- return;
2886
2838
  const screenShareStreamId = Object.keys(this.localStreams).find((id) => id !== CAMERA_STREAM_ID);
2887
2839
  if (!screenShareStreamId) {
2888
2840
  return;
@@ -2898,6 +2850,15 @@ class P2pRtcManager {
2898
2850
  hasAudioTrack,
2899
2851
  });
2900
2852
  }),
2853
+ this._serverSocket.on(PROTOCOL_RESPONSES.SCREENSHARE_STOPPED, (payload) => {
2854
+ const session = this._getSession(payload.clientId);
2855
+ if (session) {
2856
+ const streamIdIndex = session.streamIds.indexOf(payload.streamId);
2857
+ if (streamIdIndex !== -1) {
2858
+ session.streamIds.splice(streamIdIndex, 1);
2859
+ }
2860
+ }
2861
+ }),
2901
2862
  ];
2902
2863
  }
2903
2864
  sendAudioMutedStats(muted) {
@@ -3009,7 +2970,7 @@ class P2pRtcManager {
3009
2970
  }
3010
2971
  return this.peerConnections[peerConnectionId];
3011
2972
  }
3012
- _getOrCreateSession({ peerConnectionId, clientId, initialBandwidth, peerConnectionConfig, shouldAddLocalVideo, }) {
2973
+ _getOrCreateSession({ peerConnectionId, clientId, initialBandwidth, peerConnectionConfig, }) {
3013
2974
  let session = this.peerConnections[peerConnectionId];
3014
2975
  if (session === undefined) {
3015
2976
  const deprioritizeH264Encoding = browserName$1 === "safari" &&
@@ -3022,7 +2983,6 @@ class P2pRtcManager {
3022
2983
  peerConnectionConfig,
3023
2984
  bandwidth: initialBandwidth,
3024
2985
  deprioritizeH264Encoding,
3025
- shouldAddLocalVideo,
3026
2986
  incrementAnalyticMetric: (metric) => this.analytics[metric]++,
3027
2987
  });
3028
2988
  }
@@ -3055,7 +3015,7 @@ class P2pRtcManager {
3055
3015
  _transformOutgoingSdp(original) {
3056
3016
  return { type: original.type, sdpU: original.sdp, sdp: original.sdp };
3057
3017
  }
3058
- _createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, shouldAddLocalVideo, }) {
3018
+ _createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, }) {
3059
3019
  if (!peerConnectionId) {
3060
3020
  throw new Error("peerConnectionId is missing");
3061
3021
  }
@@ -3084,7 +3044,6 @@ class P2pRtcManager {
3084
3044
  clientId,
3085
3045
  initialBandwidth,
3086
3046
  peerConnectionConfig,
3087
- shouldAddLocalVideo,
3088
3047
  });
3089
3048
  setTimeout(() => this._emit(rtcManagerEvents.NEW_PC), 0);
3090
3049
  this.analytics.numNewPc++;
@@ -3095,7 +3054,7 @@ class P2pRtcManager {
3095
3054
  this.analytics.P2POnTrackNoStream++;
3096
3055
  rtcStats.sendEvent("P2POnTrackNoStream", {
3097
3056
  trackKind: event.track.kind,
3098
- trackId: event.track.id
3057
+ trackId: event.track.id,
3099
3058
  });
3100
3059
  return;
3101
3060
  }
@@ -3182,30 +3141,28 @@ class P2pRtcManager {
3182
3141
  }
3183
3142
  };
3184
3143
  const localCameraStream = this.localStreams[CAMERA_STREAM_ID];
3185
- if (shouldAddLocalVideo && localCameraStream) {
3144
+ if (localCameraStream) {
3186
3145
  session.addStream(localCameraStream);
3187
3146
  }
3188
- if (shouldAddLocalVideo) {
3189
- Object.keys(this.localStreams).forEach((id) => {
3190
- if (id === CAMERA_STREAM_ID) {
3191
- return;
3192
- }
3193
- const screenshareStream = this.localStreams[id];
3194
- if (isOfferer) {
3195
- session.addStream(screenshareStream);
3196
- }
3197
- else {
3198
- session.afterConnected.then(() => {
3199
- this._emitServerEvent(PROTOCOL_REQUESTS.START_SCREENSHARE, {
3200
- receiverId: session.clientId,
3201
- streamId: screenshareStream.id,
3202
- hasAudioTrack: !!screenshareStream.getAudioTracks().length,
3203
- });
3204
- this._withForcedRenegotiation(session, () => session.addStream(screenshareStream));
3147
+ Object.keys(this.localStreams).forEach((id) => {
3148
+ if (id === CAMERA_STREAM_ID) {
3149
+ return;
3150
+ }
3151
+ const screenshareStream = this.localStreams[id];
3152
+ if (isOfferer) {
3153
+ session.addStream(screenshareStream);
3154
+ }
3155
+ else {
3156
+ session.afterConnected.then(() => {
3157
+ this._emitServerEvent(PROTOCOL_REQUESTS.START_SCREENSHARE, {
3158
+ receiverId: session.clientId,
3159
+ streamId: screenshareStream.id,
3160
+ hasAudioTrack: !!screenshareStream.getAudioTracks().length,
3205
3161
  });
3206
- }
3207
- });
3208
- }
3162
+ this._withForcedRenegotiation(session, () => session.addStream(screenshareStream));
3163
+ });
3164
+ }
3165
+ });
3209
3166
  return session;
3210
3167
  }
3211
3168
  _cleanup(peerConnectionId) {
@@ -3342,7 +3299,6 @@ class P2pRtcManager {
3342
3299
  session = this._createP2pSession({
3343
3300
  clientId,
3344
3301
  initialBandwidth,
3345
- shouldAddLocalVideo: true,
3346
3302
  isOfferer: true,
3347
3303
  });
3348
3304
  this._negotiatePeerConnection(clientId, session);
@@ -3486,12 +3442,11 @@ class P2pRtcManager {
3486
3442
  });
3487
3443
  return bandwidth;
3488
3444
  }
3489
- _createP2pSession({ clientId, initialBandwidth, shouldAddLocalVideo = false, isOfferer = false, }) {
3445
+ _createP2pSession({ clientId, initialBandwidth, isOfferer = false, }) {
3490
3446
  const session = this._createSession({
3491
3447
  peerConnectionId: clientId,
3492
3448
  clientId,
3493
3449
  initialBandwidth,
3494
- shouldAddLocalVideo,
3495
3450
  isOfferer,
3496
3451
  });
3497
3452
  const pc = session.pc;
@@ -3499,10 +3454,7 @@ class P2pRtcManager {
3499
3454
  this._setJitterBufferTarget(pc);
3500
3455
  }
3501
3456
  const localCameraStream = this.localStreams[CAMERA_STREAM_ID];
3502
- if (shouldAddLocalVideo &&
3503
- localCameraStream &&
3504
- !localCameraStream.getVideoTracks().length &&
3505
- this._stoppedVideoTrack) {
3457
+ if (localCameraStream && !localCameraStream.getVideoTracks().length && this._stoppedVideoTrack) {
3506
3458
  pc.addTrack(this._stoppedVideoTrack, localCameraStream);
3507
3459
  }
3508
3460
  pc.onicegatheringstatechange = (event) => {
@@ -3608,7 +3560,7 @@ class P2pRtcManager {
3608
3560
  };
3609
3561
  return session;
3610
3562
  }
3611
- acceptNewStream({ streamId, clientId, shouldAddLocalVideo, }) {
3563
+ acceptNewStream({ streamId, clientId }) {
3612
3564
  let session = this._getSession(clientId);
3613
3565
  if (session && streamId !== clientId) {
3614
3566
  return session;
@@ -3624,7 +3576,6 @@ class P2pRtcManager {
3624
3576
  session = this._createP2pSession({
3625
3577
  clientId,
3626
3578
  initialBandwidth,
3627
- shouldAddLocalVideo: !!shouldAddLocalVideo,
3628
3579
  isOfferer: false,
3629
3580
  });
3630
3581
  this._emitServerEvent(RELAY_MESSAGES.READY_TO_RECEIVE_OFFER, {
@@ -3731,6 +3682,9 @@ class P2pRtcManager {
3731
3682
  hasClient(clientId) {
3732
3683
  return Object.keys(this.peerConnections).includes(clientId);
3733
3684
  }
3685
+ shouldAcceptStreamsFromBothSides() {
3686
+ return false;
3687
+ }
3734
3688
  }
3735
3689
 
3736
3690
  class KalmanFilter {
@@ -5483,14 +5437,14 @@ class VegaRtcManager {
5483
5437
  setRoomSessionId(roomSessionId) {
5484
5438
  this._roomSessionId = roomSessionId;
5485
5439
  }
5486
- disconnect(clientIdOrStreamId, _activeBreakout, eventClaim) {
5440
+ disconnect(clientId, eventClaim) {
5487
5441
  var _a;
5488
- logger$2.info("disconnect() [clientIdOrStreamId:%s, eventClaim:%s]", clientIdOrStreamId, eventClaim);
5489
- const clientState = this._clientStates.get(clientIdOrStreamId);
5442
+ logger$2.info("disconnect() [clientId:%s, eventClaim:%s]", clientId, eventClaim);
5443
+ const clientState = this._clientStates.get(clientId);
5490
5444
  if (clientState) {
5491
5445
  clientState.hasAcceptedWebcamStream = false;
5492
5446
  clientState.hasAcceptedScreenStream = false;
5493
- this._syncIncomingStreamsWithPWA(clientIdOrStreamId);
5447
+ this._syncIncomingStreamsWithPWA(clientId);
5494
5448
  }
5495
5449
  if (eventClaim) {
5496
5450
  this._eventClaim = eventClaim;
@@ -5532,7 +5486,7 @@ class VegaRtcManager {
5532
5486
  this._sendMicScore(this._micPaused ? 0 : data.out);
5533
5487
  }
5534
5488
  addNewStream(streamId, stream, audioPaused, videoPaused, beforeEffectTracks = []) {
5535
- if (streamId === "0") {
5489
+ if (streamId === CAMERA_STREAM_ID) {
5536
5490
  this._micPaused = audioPaused;
5537
5491
  this._webcamPaused = videoPaused;
5538
5492
  const videoTrack = stream.getVideoTracks()[0];
@@ -5999,7 +5953,7 @@ class VegaRtcManager {
5999
5953
  clientId,
6000
5954
  stream: webcamStream,
6001
5955
  streamId: camStreamId,
6002
- streamType: "webcam",
5956
+ streamType: STREAM_TYPES.webcam,
6003
5957
  });
6004
5958
  clientState.hasEmittedWebcamStream = true;
6005
5959
  }
@@ -6008,7 +5962,7 @@ class VegaRtcManager {
6008
5962
  clientId,
6009
5963
  stream: screenStream,
6010
5964
  streamId: screenShareStreamId,
6011
- streamType: "screenshare",
5965
+ streamType: STREAM_TYPES.screenshare,
6012
5966
  });
6013
5967
  clientState.hasEmittedScreenStream = true;
6014
5968
  }
@@ -7580,6 +7534,7 @@ exports.RtcEventNames = void 0;
7580
7534
  exports.ADDITIONAL_SCREEN_SHARE_SETTINGS = ADDITIONAL_SCREEN_SHARE_SETTINGS;
7581
7535
  exports.AUDIO_SETTINGS = AUDIO_SETTINGS;
7582
7536
  exports.BandwidthTester = BandwidthTester;
7537
+ exports.CAMERA_STREAM_ID = CAMERA_STREAM_ID;
7583
7538
  exports.EVENTS = EVENTS;
7584
7539
  exports.KNOCK_MESSAGES = KNOCK_MESSAGES;
7585
7540
  exports.KalmanFilter = KalmanFilter;
@@ -7594,7 +7549,6 @@ exports.PROTOCOL_RESPONSES = PROTOCOL_RESPONSES;
7594
7549
  exports.RELAY_MESSAGES = RELAY_MESSAGES;
7595
7550
  exports.ReconnectManager = ReconnectManager;
7596
7551
  exports.RtcManagerDispatcher = RtcManagerDispatcher;
7597
- exports.RtcStream = RtcStream;
7598
7552
  exports.SCREEN_SHARE_SETTINGS = SCREEN_SHARE_SETTINGS;
7599
7553
  exports.SCREEN_SHARE_SIMULCAST_SETTINGS = SCREEN_SHARE_SIMULCAST_SETTINGS;
7600
7554
  exports.STREAM_TYPES = STREAM_TYPES;
package/dist/index.d.cts CHANGED
@@ -320,20 +320,18 @@ declare enum RtcEventNames {
320
320
  stream_added = "stream_added"
321
321
  }
322
322
  interface RtcManager {
323
- acceptNewStream: ({ activeBreakout, clientId, shouldAddLocalVideo, streamId, }: {
324
- activeBreakout: boolean;
323
+ acceptNewStream: ({ clientId, streamId, }: {
325
324
  clientId: string;
326
- shouldAddLocalVideo: boolean;
327
325
  streamId: string;
328
326
  }) => void;
329
327
  addNewStream(streamId: string, stream: MediaStream, isAudioEnabled: boolean, isVideoEnabled: boolean): void;
330
- disconnect(streamId: string, activeBreakout: boolean | null, eventClaim?: string): void;
328
+ disconnect(streamId: string, eventClaim?: string): void;
331
329
  disconnectAll(): void;
332
330
  rtcStatsDisconnect(): void;
333
331
  rtcStatsReconnect(): void;
334
332
  replaceTrack(oldTrack: CustomMediaStreamTrack, newTrack: CustomMediaStreamTrack): void;
335
333
  removeStream(streamId: string, _stream: MediaStream, requestedByClientId: string | null): void;
336
- shouldAcceptStreamsFromBothSides?: () => boolean;
334
+ shouldAcceptStreamsFromBothSides: () => boolean;
337
335
  updateStreamResolution(streamId: string, ignored: null, resolution: {
338
336
  width: number;
339
337
  height: number;
@@ -506,7 +504,6 @@ interface P2PSessionOptions {
506
504
  bandwidth: number;
507
505
  peerConnectionConfig: RTCConfiguration;
508
506
  deprioritizeH264Encoding: boolean;
509
- shouldAddLocalVideo: boolean;
510
507
  incrementAnalyticMetric: P2PIncrementAnalyticMetric;
511
508
  }
512
509
  declare class Session {
@@ -528,7 +525,7 @@ declare class Session {
528
525
  bandwidth: any;
529
526
  pending: any[];
530
527
  isOperationPending: boolean;
531
- streamIds: any[];
528
+ streamIds: string[];
532
529
  streams: MediaStream[];
533
530
  earlyIceCandidates: any[];
534
531
  afterConnected: Promise<unknown>;
@@ -540,11 +537,10 @@ declare class Session {
540
537
  _deprioritizeH264Encoding: any;
541
538
  clientId: any;
542
539
  peerConnectionConfig: RTCConfiguration;
543
- shouldAddLocalVideo: boolean;
544
540
  signalingState: any;
545
541
  srdComplete: any;
546
542
  _incrementAnalyticMetric: P2PIncrementAnalyticMetric;
547
- constructor({ peerConnectionId, clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, shouldAddLocalVideo, incrementAnalyticMetric, }: P2PSessionOptions);
543
+ constructor({ peerConnectionId, clientId, bandwidth, peerConnectionConfig, deprioritizeH264Encoding, incrementAnalyticMetric, }: P2PSessionOptions);
548
544
  addStream(stream: MediaStream): void;
549
545
  addTrack(track: MediaStreamTrack, stream?: MediaStream): void;
550
546
  removeTrack(track: MediaStreamTrack): void;
@@ -1176,7 +1172,6 @@ declare function trackAnnotations(o: MediaStreamTrack): TrackAnnotation;
1176
1172
  interface GetOrCreateSessionOptions {
1177
1173
  peerConnectionId: string;
1178
1174
  clientId: string;
1179
- shouldAddLocalVideo: boolean;
1180
1175
  initialBandwidth: number;
1181
1176
  peerConnectionConfig: RTCConfiguration;
1182
1177
  }
@@ -1285,19 +1280,18 @@ declare class P2pRtcManager implements RtcManager {
1285
1280
  _addEnabledLocalStreamId(streamId: string): void;
1286
1281
  _deleteEnabledLocalStreamId(streamId: string): void;
1287
1282
  _getSession(peerConnectionId: string): Session | null;
1288
- _getOrCreateSession({ peerConnectionId, clientId, initialBandwidth, peerConnectionConfig, shouldAddLocalVideo, }: GetOrCreateSessionOptions): Session;
1283
+ _getOrCreateSession({ peerConnectionId, clientId, initialBandwidth, peerConnectionConfig, }: GetOrCreateSessionOptions): Session;
1289
1284
  _getLocalCameraStream(): any;
1290
1285
  _getNonLocalCameraStreamIds(): string[];
1291
1286
  _isScreensharingLocally(): boolean;
1292
1287
  _getFirstLocalNonCameraStream(): any;
1293
1288
  _transformIncomingSdp(original: UnifiedPlanSDP): RTCSessionDescription;
1294
1289
  _transformOutgoingSdp(original: RTCSessionDescription): UnifiedPlanSDP;
1295
- _createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, shouldAddLocalVideo, }: {
1290
+ _createSession({ clientId, initialBandwidth, isOfferer, peerConnectionId, }: {
1296
1291
  clientId: string;
1297
1292
  initialBandwidth: any;
1298
1293
  isOfferer: any;
1299
1294
  peerConnectionId: string;
1300
- shouldAddLocalVideo: boolean;
1301
1295
  }): Session;
1302
1296
  _cleanup(peerConnectionId: string): void;
1303
1297
  _forEachPeerConnection(func: any): void;
@@ -1318,16 +1312,14 @@ declare class P2pRtcManager implements RtcManager {
1318
1312
  _negotiatePeerConnection(clientId: string, session: any, constraints?: any): void;
1319
1313
  _withForcedRenegotiation(session: Session, action: any): void;
1320
1314
  _changeBandwidthForAllClients(isJoining: boolean): number;
1321
- _createP2pSession({ clientId, initialBandwidth, shouldAddLocalVideo, isOfferer, }: {
1315
+ _createP2pSession({ clientId, initialBandwidth, isOfferer, }: {
1322
1316
  clientId: string;
1323
1317
  initialBandwidth: number;
1324
- shouldAddLocalVideo: boolean;
1325
1318
  isOfferer: boolean;
1326
1319
  }): Session;
1327
- acceptNewStream({ streamId, clientId, shouldAddLocalVideo, }: {
1320
+ acceptNewStream({ streamId, clientId }: {
1328
1321
  streamId: string;
1329
1322
  clientId: string;
1330
- shouldAddLocalVideo?: boolean;
1331
1323
  }): Session;
1332
1324
  disconnect(clientId: string): void;
1333
1325
  updateStreamResolution(): void;
@@ -1340,6 +1332,7 @@ declare class P2pRtcManager implements RtcManager {
1340
1332
  _shareScreen(streamId: string, stream: any): void;
1341
1333
  removeStream(streamId: string, stream: any, requestedByClientId: any): void;
1342
1334
  hasClient(clientId: string): boolean;
1335
+ shouldAcceptStreamsFromBothSides(): boolean;
1343
1336
  }
1344
1337
 
1345
1338
  declare class RtcManagerDispatcher {
@@ -1687,7 +1680,7 @@ declare class VegaRtcManager implements RtcManager {
1687
1680
  setAudioOnly(audioOnly: boolean): void;
1688
1681
  setRemoteScreenshareVideoTrackIds(): void;
1689
1682
  setRoomSessionId(roomSessionId: string): void;
1690
- disconnect(clientIdOrStreamId: string, _activeBreakout: any, eventClaim?: string): void;
1683
+ disconnect(clientId: string, eventClaim?: string): void;
1691
1684
  replaceTrack(oldTrack: CustomMediaStreamTrack | null, track: CustomMediaStreamTrack): void;
1692
1685
  removeStream(streamId: string, _stream: MediaStream, requestedByClientId: string): void;
1693
1686
  _onMicAnalyserScoreUpdated(data: any): void;
@@ -1901,27 +1894,11 @@ declare const PROTOCOL_EVENTS: {
1901
1894
  MEDIA_QUALITY_CHANGED: string;
1902
1895
  };
1903
1896
 
1897
+ declare const CAMERA_STREAM_ID = "0";
1904
1898
  declare const STREAM_TYPES: {
1905
- CAMERA: string;
1906
- SCREEN_SHARE: string;
1899
+ webcam: string;
1900
+ screenshare: string;
1907
1901
  };
1908
- declare class RtcStream {
1909
- id: string;
1910
- type: string;
1911
- isEnabled: boolean;
1912
- hasSupportForAutoSuperSize: boolean;
1913
- isAudioEnabled: boolean;
1914
- isVideoEnabled: boolean;
1915
- status: string;
1916
- stream: MediaStream | null;
1917
- streamId: string | null;
1918
- constructor(id: string | number, type: string);
1919
- setup(stream: MediaStream): this;
1920
- setStatus(status: string): this;
1921
- setVideoEnabled(isEnabled: boolean): void;
1922
- setAudioEnabled(isEnabled: boolean): void;
1923
- static getCameraId(): string;
1924
- }
1925
1902
 
1926
- 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, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
1903
+ 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, 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, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, variance };
1927
1904
  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 };