@whereby.com/media 11.4.3 → 11.5.1

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
@@ -545,6 +545,7 @@ class Session {
545
545
  this.signalingState = this.pc.signalingState;
546
546
  if (this.pc.signalingState === "stable") {
547
547
  this.isOperationPending = false;
548
+ this.isLocalOfferPending = false;
548
549
  const action = this.pending.shift();
549
550
  if (action) {
550
551
  action.apply();
@@ -556,6 +557,7 @@ class Session {
556
557
  this.bandwidth = bandwidth || 0;
557
558
  this.pending = [];
558
559
  this.isOperationPending = false;
560
+ this.isLocalOfferPending = false;
559
561
  this.streamIds = [];
560
562
  this.streams = [];
561
563
  this.earlyIceCandidates = [];
@@ -618,6 +620,13 @@ class Session {
618
620
  }
619
621
  handleOffer(offer) {
620
622
  if (!this.canModifyPeerConnection()) {
623
+ if (this.isLocalOfferPending) {
624
+ this._incrementAnalyticMetric("P2POfferGlare");
625
+ rtcStats.sendEvent("P2POfferGlare", {
626
+ clientId: this.clientId,
627
+ hasRemoteDescription: !!this.pc.remoteDescription,
628
+ });
629
+ }
621
630
  return new Promise((resolve) => {
622
631
  this.pending.push(() => this.handleOffer(offer).then(resolve));
623
632
  });
@@ -687,7 +696,6 @@ class Session {
687
696
  rtcStats.sendEvent("P2PAddIceCandidateFailure", {
688
697
  clientId: this.clientId,
689
698
  errorName: e === null || e === void 0 ? void 0 : e.name,
690
- errorMessage: e === null || e === void 0 ? void 0 : e.message,
691
699
  signalingState: this.pc.signalingState,
692
700
  iceConnectionState: this.pc.iceConnectionState,
693
701
  });
@@ -2553,10 +2561,14 @@ class P2pRtcManager {
2553
2561
  numPcOnOfferFailure: 0,
2554
2562
  numPcSldFailure: 0,
2555
2563
  P2PAddIceCandidateFailure: 0,
2564
+ P2PCreateOfferFailure: 0,
2556
2565
  P2PLocalNetworkFailed: 0,
2557
2566
  P2POffendingInitialOffer: 0,
2567
+ P2POfferGlare: 0,
2568
+ P2POfferWithoutSession: 0,
2558
2569
  P2POnTrackNoStream: 0,
2559
2570
  P2PRelayedIceCandidate: 0,
2571
+ P2PRenegotiationBeforeInitialOffer: 0,
2560
2572
  P2PReplaceTrackNewTrackNotInStream: 0,
2561
2573
  P2PReplaceTrackNoStream: 0,
2562
2574
  P2PStaleAnswerIgnored: 0,
@@ -2673,6 +2685,8 @@ class P2pRtcManager {
2673
2685
  const session = this._getSession(data.clientId);
2674
2686
  if (!session) {
2675
2687
  logger$7.warn("No RTCPeerConnection on SDP_OFFER", data);
2688
+ this.analytics.P2POfferWithoutSession++;
2689
+ rtcStats.sendEvent("P2POfferWithoutSession", { clientId: data.clientId });
2676
2690
  return;
2677
2691
  }
2678
2692
  const sdp = {
@@ -2700,6 +2714,7 @@ class P2pRtcManager {
2700
2714
  })).catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2701
2715
  logger$7.error(e);
2702
2716
  this.analytics.numPcOnOfferFailure++;
2717
+ rtcStats.sendEvent("numPcOnOfferFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
2703
2718
  });
2704
2719
  }),
2705
2720
  this._serverSocket.on(RELAY_MESSAGES.SDP_ANSWER, (data) => {
@@ -2717,6 +2732,7 @@ class P2pRtcManager {
2717
2732
  (_b = (_a = session.handleAnswer(sdp)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2718
2733
  logger$7.warn("Could not set remote description from remote answer: ", e);
2719
2734
  this.analytics.numPcOnAnswerFailure++;
2735
+ rtcStats.sendEvent("numPcOnAnswerFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
2720
2736
  });
2721
2737
  }),
2722
2738
  this._serverSocket.on(PROTOCOL_RESPONSES.SCREENSHARE_STOPPED, (payload) => {
@@ -3264,6 +3280,7 @@ class P2pRtcManager {
3264
3280
  return;
3265
3281
  }
3266
3282
  session.isOperationPending = true;
3283
+ session.isLocalOfferPending = true;
3267
3284
  const { redOn, rtpAbsCaptureTimeOn, cleanSdpOn } = this._features;
3268
3285
  this._setCodecPreferences(pc).then(() => pc
3269
3286
  .createOffer(constraints || this.offerOptions)
@@ -3285,6 +3302,8 @@ class P2pRtcManager {
3285
3302
  .catch((e) => {
3286
3303
  logger$7.warn("RTCPeerConnection.setLocalDescription() failed with local offer", e);
3287
3304
  this.analytics.numPcSldFailure++;
3305
+ session.isLocalOfferPending = false;
3306
+ rtcStats.sendEvent("numPcSldFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
3288
3307
  throw e;
3289
3308
  })
3290
3309
  .then(() => {
@@ -3304,10 +3323,17 @@ class P2pRtcManager {
3304
3323
  })
3305
3324
  .catch((e) => {
3306
3325
  logger$7.warn("RTCPeerConnection.createOffer() failed to create local offer", e);
3326
+ this.analytics.P2PCreateOfferFailure++;
3327
+ session.isLocalOfferPending = false;
3328
+ rtcStats.sendEvent("P2PCreateOfferFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
3307
3329
  }));
3308
3330
  }
3309
3331
  _withForcedRenegotiation(session, action) {
3310
3332
  const pc = session.pc;
3333
+ if (session.canModifyPeerConnection() && !pc.remoteDescription) {
3334
+ this.analytics.P2PRenegotiationBeforeInitialOffer++;
3335
+ rtcStats.sendEvent("P2PRenegotiationBeforeInitialOffer", { clientId: session.clientId });
3336
+ }
3311
3337
  const originalOnnegotationneeded = pc.onnegotiationneeded;
3312
3338
  pc.onnegotiationneeded = null;
3313
3339
  action();
package/dist/index.d.cts CHANGED
@@ -1248,6 +1248,14 @@ interface SpotlightRemovedEvent {
1248
1248
  streamId: string;
1249
1249
  requestedByClientId: string;
1250
1250
  }
1251
+ interface SpotlightOrderSwappedEvent {
1252
+ source: Spotlight;
1253
+ target: Spotlight;
1254
+ requestedByClientId: string;
1255
+ }
1256
+ interface SpotlightOrderSwappedError {
1257
+ error: string;
1258
+ }
1251
1259
  interface LiveCaptionsStartedEvent {
1252
1260
  error?: string;
1253
1261
  }
@@ -1303,6 +1311,7 @@ interface SignalEvents {
1303
1311
  screenshare_enable_requested: ScreenshareEnableRequestedEvent;
1304
1312
  spotlight_added: SpotlightAddedEvent;
1305
1313
  spotlight_removed: SpotlightRemovedEvent;
1314
+ spotlight_order_swapped: SpotlightOrderSwappedEvent | SpotlightOrderSwappedError;
1306
1315
  streaming_stopped: void;
1307
1316
  video_enabled: VideoEnabledEvent;
1308
1317
  video_enable_requested: VideoEnableRequestedEvent;
@@ -1382,6 +1391,10 @@ interface RemoveSpotlightRequest {
1382
1391
  clientId: string;
1383
1392
  streamId: string;
1384
1393
  }
1394
+ interface SwapSpotlightOrderRequest {
1395
+ source: Spotlight;
1396
+ target: Spotlight;
1397
+ }
1385
1398
  interface SignalRequests {
1386
1399
  add_spotlight: AddSpotlightRequest;
1387
1400
  chat_message: ChatMessageRequest;
@@ -1436,6 +1449,7 @@ interface SignalRequests {
1436
1449
  };
1437
1450
  stop_live_transcription: void;
1438
1451
  stop_recording: void;
1452
+ swap_spotlight_order: SwapSpotlightOrderRequest;
1439
1453
  }
1440
1454
  type TurnTransportProtocol = "onlyudp" | "onlytcp" | "onlytls";
1441
1455
 
@@ -1772,6 +1786,7 @@ declare class Session {
1772
1786
  bandwidth: any;
1773
1787
  pending: any[];
1774
1788
  isOperationPending: boolean;
1789
+ isLocalOfferPending: boolean;
1775
1790
  streamIds: string[];
1776
1791
  streams: MediaStream[];
1777
1792
  earlyIceCandidates: any[];
@@ -1831,10 +1846,14 @@ type P2PAnalytics = {
1831
1846
  numPcOnOfferFailure: number;
1832
1847
  numPcSldFailure: number;
1833
1848
  P2PAddIceCandidateFailure: number;
1849
+ P2PCreateOfferFailure: number;
1834
1850
  P2PLocalNetworkFailed: number;
1835
1851
  P2POffendingInitialOffer: number;
1852
+ P2POfferGlare: number;
1853
+ P2POfferWithoutSession: number;
1836
1854
  P2POnTrackNoStream: number;
1837
1855
  P2PRelayedIceCandidate: number;
1856
+ P2PRenegotiationBeforeInitialOffer: number;
1838
1857
  P2PReplaceTrackNewTrackNotInStream: number;
1839
1858
  P2PReplaceTrackNoStream: number;
1840
1859
  P2PStaleAnswerIgnored: number;
@@ -2502,4 +2521,4 @@ declare class VegaRtcManager implements RtcManager {
2502
2521
  }
2503
2522
 
2504
2523
  export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, CAM_SAMPLES_SKIPPED_AFTER_CANDIDATE_PAIR_CHANGE, CONGESTED_FRACTION_LOST, CONGESTED_RTT_INFLATION_MS, EVENTS, FILE_SHARE_ERROR_CODES, INITIAL_CONSUMER_SPATIAL_LAYER, INITIAL_HIGHEST_PREFERRED_LAYER, KNOCK_MESSAGES, KalmanFilter, LOWEST_SVC_LAYER_MAX_BITRATE, Logger, MAX_CONCURRENT_PREFERRED_LAYER_SWITCH_WATCHES, MEDIA_JITTER_BUFFER_TARGET, MIDDLE_SVC_LAYER_MAX_BITRATE, NoDevicesError, P2pRtcManager, PREFERRED_LAYER_SWITCH_POLL_INTERVAL_MS, PREFERRED_LAYER_SWITCH_WATCH_TIMEOUT_MS, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ROOM_INTEGRATION_ERROR_CODES, 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, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getInitialStream, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getSelectedCandidatePairId, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isFileShareError, isMobile, isRoomIntegrationErrorCode, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, updateRenderedDimensions, variance };
2505
- export type { AddCameraStreamOptions, AddSpotlightRequest, AggregatedIssues, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdateRequest, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetInitialStreamOptions, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssueData, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomIntegrationDisabledEvent, RoomIntegrationEnabledEvent, RoomIntegrationError, RoomIntegrationErrorCode, RoomIntegrationProps, RoomIntegrationPropsUpdatedEvent, RoomIntegrationPropsUpdatedSuccess, RoomIntegrationSessionEvent, RoomIntegrationSessionState, RoomIntegrationStartedEvent, RoomIntegrationStartedSuccess, RoomIntegrationStoppedEvent, RoomIntegrationStoppedSuccess, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcMediaQualityChangedPayload, RtcStreamAddedPayload, ScreenshareEnableRequest, ScreenshareEnableRequestedEvent, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StartRoomIntegrationRequest, StatsMonitorOptions, StatsMonitorState, StatsSubscription, StopRoomIntegrationRequest, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdateRoomIntegrationPropsRequest, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
2524
+ export type { AddCameraStreamOptions, AddSpotlightRequest, AggregatedIssues, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdateRequest, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetInitialStreamOptions, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssueData, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomIntegrationDisabledEvent, RoomIntegrationEnabledEvent, RoomIntegrationError, RoomIntegrationErrorCode, RoomIntegrationProps, RoomIntegrationPropsUpdatedEvent, RoomIntegrationPropsUpdatedSuccess, RoomIntegrationSessionEvent, RoomIntegrationSessionState, RoomIntegrationStartedEvent, RoomIntegrationStartedSuccess, RoomIntegrationStoppedEvent, RoomIntegrationStoppedSuccess, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcMediaQualityChangedPayload, RtcStreamAddedPayload, ScreenshareEnableRequest, ScreenshareEnableRequestedEvent, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightOrderSwappedError, SpotlightOrderSwappedEvent, SpotlightRemovedEvent, StartRoomIntegrationRequest, StatsMonitorOptions, StatsMonitorState, StatsSubscription, StopRoomIntegrationRequest, SwapSpotlightOrderRequest, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdateRoomIntegrationPropsRequest, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
package/dist/index.d.mts CHANGED
@@ -1248,6 +1248,14 @@ interface SpotlightRemovedEvent {
1248
1248
  streamId: string;
1249
1249
  requestedByClientId: string;
1250
1250
  }
1251
+ interface SpotlightOrderSwappedEvent {
1252
+ source: Spotlight;
1253
+ target: Spotlight;
1254
+ requestedByClientId: string;
1255
+ }
1256
+ interface SpotlightOrderSwappedError {
1257
+ error: string;
1258
+ }
1251
1259
  interface LiveCaptionsStartedEvent {
1252
1260
  error?: string;
1253
1261
  }
@@ -1303,6 +1311,7 @@ interface SignalEvents {
1303
1311
  screenshare_enable_requested: ScreenshareEnableRequestedEvent;
1304
1312
  spotlight_added: SpotlightAddedEvent;
1305
1313
  spotlight_removed: SpotlightRemovedEvent;
1314
+ spotlight_order_swapped: SpotlightOrderSwappedEvent | SpotlightOrderSwappedError;
1306
1315
  streaming_stopped: void;
1307
1316
  video_enabled: VideoEnabledEvent;
1308
1317
  video_enable_requested: VideoEnableRequestedEvent;
@@ -1382,6 +1391,10 @@ interface RemoveSpotlightRequest {
1382
1391
  clientId: string;
1383
1392
  streamId: string;
1384
1393
  }
1394
+ interface SwapSpotlightOrderRequest {
1395
+ source: Spotlight;
1396
+ target: Spotlight;
1397
+ }
1385
1398
  interface SignalRequests {
1386
1399
  add_spotlight: AddSpotlightRequest;
1387
1400
  chat_message: ChatMessageRequest;
@@ -1436,6 +1449,7 @@ interface SignalRequests {
1436
1449
  };
1437
1450
  stop_live_transcription: void;
1438
1451
  stop_recording: void;
1452
+ swap_spotlight_order: SwapSpotlightOrderRequest;
1439
1453
  }
1440
1454
  type TurnTransportProtocol = "onlyudp" | "onlytcp" | "onlytls";
1441
1455
 
@@ -1772,6 +1786,7 @@ declare class Session {
1772
1786
  bandwidth: any;
1773
1787
  pending: any[];
1774
1788
  isOperationPending: boolean;
1789
+ isLocalOfferPending: boolean;
1775
1790
  streamIds: string[];
1776
1791
  streams: MediaStream[];
1777
1792
  earlyIceCandidates: any[];
@@ -1831,10 +1846,14 @@ type P2PAnalytics = {
1831
1846
  numPcOnOfferFailure: number;
1832
1847
  numPcSldFailure: number;
1833
1848
  P2PAddIceCandidateFailure: number;
1849
+ P2PCreateOfferFailure: number;
1834
1850
  P2PLocalNetworkFailed: number;
1835
1851
  P2POffendingInitialOffer: number;
1852
+ P2POfferGlare: number;
1853
+ P2POfferWithoutSession: number;
1836
1854
  P2POnTrackNoStream: number;
1837
1855
  P2PRelayedIceCandidate: number;
1856
+ P2PRenegotiationBeforeInitialOffer: number;
1838
1857
  P2PReplaceTrackNewTrackNotInStream: number;
1839
1858
  P2PReplaceTrackNoStream: number;
1840
1859
  P2PStaleAnswerIgnored: number;
@@ -2502,4 +2521,4 @@ declare class VegaRtcManager implements RtcManager {
2502
2521
  }
2503
2522
 
2504
2523
  export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, CAM_SAMPLES_SKIPPED_AFTER_CANDIDATE_PAIR_CHANGE, CONGESTED_FRACTION_LOST, CONGESTED_RTT_INFLATION_MS, EVENTS, FILE_SHARE_ERROR_CODES, INITIAL_CONSUMER_SPATIAL_LAYER, INITIAL_HIGHEST_PREFERRED_LAYER, KNOCK_MESSAGES, KalmanFilter, LOWEST_SVC_LAYER_MAX_BITRATE, Logger, MAX_CONCURRENT_PREFERRED_LAYER_SWITCH_WATCHES, MEDIA_JITTER_BUFFER_TARGET, MIDDLE_SVC_LAYER_MAX_BITRATE, NoDevicesError, P2pRtcManager, PREFERRED_LAYER_SWITCH_POLL_INTERVAL_MS, PREFERRED_LAYER_SWITCH_WATCH_TIMEOUT_MS, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ROOM_INTEGRATION_ERROR_CODES, 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, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getInitialStream, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getSelectedCandidatePairId, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isFileShareError, isMobile, isRoomIntegrationErrorCode, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, updateRenderedDimensions, variance };
2505
- export type { AddCameraStreamOptions, AddSpotlightRequest, AggregatedIssues, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdateRequest, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetInitialStreamOptions, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssueData, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomIntegrationDisabledEvent, RoomIntegrationEnabledEvent, RoomIntegrationError, RoomIntegrationErrorCode, RoomIntegrationProps, RoomIntegrationPropsUpdatedEvent, RoomIntegrationPropsUpdatedSuccess, RoomIntegrationSessionEvent, RoomIntegrationSessionState, RoomIntegrationStartedEvent, RoomIntegrationStartedSuccess, RoomIntegrationStoppedEvent, RoomIntegrationStoppedSuccess, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcMediaQualityChangedPayload, RtcStreamAddedPayload, ScreenshareEnableRequest, ScreenshareEnableRequestedEvent, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StartRoomIntegrationRequest, StatsMonitorOptions, StatsMonitorState, StatsSubscription, StopRoomIntegrationRequest, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdateRoomIntegrationPropsRequest, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
2524
+ export type { AddCameraStreamOptions, AddSpotlightRequest, AggregatedIssues, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdateRequest, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetInitialStreamOptions, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssueData, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomIntegrationDisabledEvent, RoomIntegrationEnabledEvent, RoomIntegrationError, RoomIntegrationErrorCode, RoomIntegrationProps, RoomIntegrationPropsUpdatedEvent, RoomIntegrationPropsUpdatedSuccess, RoomIntegrationSessionEvent, RoomIntegrationSessionState, RoomIntegrationStartedEvent, RoomIntegrationStartedSuccess, RoomIntegrationStoppedEvent, RoomIntegrationStoppedSuccess, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcMediaQualityChangedPayload, RtcStreamAddedPayload, ScreenshareEnableRequest, ScreenshareEnableRequestedEvent, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightOrderSwappedError, SpotlightOrderSwappedEvent, SpotlightRemovedEvent, StartRoomIntegrationRequest, StatsMonitorOptions, StatsMonitorState, StatsSubscription, StopRoomIntegrationRequest, SwapSpotlightOrderRequest, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdateRoomIntegrationPropsRequest, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
package/dist/index.d.ts CHANGED
@@ -1248,6 +1248,14 @@ interface SpotlightRemovedEvent {
1248
1248
  streamId: string;
1249
1249
  requestedByClientId: string;
1250
1250
  }
1251
+ interface SpotlightOrderSwappedEvent {
1252
+ source: Spotlight;
1253
+ target: Spotlight;
1254
+ requestedByClientId: string;
1255
+ }
1256
+ interface SpotlightOrderSwappedError {
1257
+ error: string;
1258
+ }
1251
1259
  interface LiveCaptionsStartedEvent {
1252
1260
  error?: string;
1253
1261
  }
@@ -1303,6 +1311,7 @@ interface SignalEvents {
1303
1311
  screenshare_enable_requested: ScreenshareEnableRequestedEvent;
1304
1312
  spotlight_added: SpotlightAddedEvent;
1305
1313
  spotlight_removed: SpotlightRemovedEvent;
1314
+ spotlight_order_swapped: SpotlightOrderSwappedEvent | SpotlightOrderSwappedError;
1306
1315
  streaming_stopped: void;
1307
1316
  video_enabled: VideoEnabledEvent;
1308
1317
  video_enable_requested: VideoEnableRequestedEvent;
@@ -1382,6 +1391,10 @@ interface RemoveSpotlightRequest {
1382
1391
  clientId: string;
1383
1392
  streamId: string;
1384
1393
  }
1394
+ interface SwapSpotlightOrderRequest {
1395
+ source: Spotlight;
1396
+ target: Spotlight;
1397
+ }
1385
1398
  interface SignalRequests {
1386
1399
  add_spotlight: AddSpotlightRequest;
1387
1400
  chat_message: ChatMessageRequest;
@@ -1436,6 +1449,7 @@ interface SignalRequests {
1436
1449
  };
1437
1450
  stop_live_transcription: void;
1438
1451
  stop_recording: void;
1452
+ swap_spotlight_order: SwapSpotlightOrderRequest;
1439
1453
  }
1440
1454
  type TurnTransportProtocol = "onlyudp" | "onlytcp" | "onlytls";
1441
1455
 
@@ -1772,6 +1786,7 @@ declare class Session {
1772
1786
  bandwidth: any;
1773
1787
  pending: any[];
1774
1788
  isOperationPending: boolean;
1789
+ isLocalOfferPending: boolean;
1775
1790
  streamIds: string[];
1776
1791
  streams: MediaStream[];
1777
1792
  earlyIceCandidates: any[];
@@ -1831,10 +1846,14 @@ type P2PAnalytics = {
1831
1846
  numPcOnOfferFailure: number;
1832
1847
  numPcSldFailure: number;
1833
1848
  P2PAddIceCandidateFailure: number;
1849
+ P2PCreateOfferFailure: number;
1834
1850
  P2PLocalNetworkFailed: number;
1835
1851
  P2POffendingInitialOffer: number;
1852
+ P2POfferGlare: number;
1853
+ P2POfferWithoutSession: number;
1836
1854
  P2POnTrackNoStream: number;
1837
1855
  P2PRelayedIceCandidate: number;
1856
+ P2PRenegotiationBeforeInitialOffer: number;
1838
1857
  P2PReplaceTrackNewTrackNotInStream: number;
1839
1858
  P2PReplaceTrackNoStream: number;
1840
1859
  P2PStaleAnswerIgnored: number;
@@ -2502,4 +2521,4 @@ declare class VegaRtcManager implements RtcManager {
2502
2521
  }
2503
2522
 
2504
2523
  export { ADDITIONAL_SCREEN_SHARE_SETTINGS, AUDIO_SETTINGS, BandwidthTester, CAMERA_STREAM_ID, CAM_SAMPLES_SKIPPED_AFTER_CANDIDATE_PAIR_CHANGE, CONGESTED_FRACTION_LOST, CONGESTED_RTT_INFLATION_MS, EVENTS, FILE_SHARE_ERROR_CODES, INITIAL_CONSUMER_SPATIAL_LAYER, INITIAL_HIGHEST_PREFERRED_LAYER, KNOCK_MESSAGES, KalmanFilter, LOWEST_SVC_LAYER_MAX_BITRATE, Logger, MAX_CONCURRENT_PREFERRED_LAYER_SWITCH_WATCHES, MEDIA_JITTER_BUFFER_TARGET, MIDDLE_SVC_LAYER_MAX_BITRATE, NoDevicesError, P2pRtcManager, PREFERRED_LAYER_SWITCH_POLL_INTERVAL_MS, PREFERRED_LAYER_SWITCH_WATCH_TIMEOUT_MS, PROTOCOL_ERRORS, PROTOCOL_EVENTS, PROTOCOL_REQUESTS, PROTOCOL_RESPONSES, RELAY_MESSAGES, ROOM_INTEGRATION_ERROR_CODES, 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, enumerate, external_stun_servers, filterMidExtension, filterMsidSemantic, fromLocation, generateByteString, getConstraints, getCurrentPeerConnections, getDeviceData, getDisplayMedia, getInitialStream, getIssuesAndMetrics, getMediaConstraints, getMediaSettings, getMediasoupDeviceAsync, getNumFailedStatsReports, getNumFailedTrackSsrcLookups, getNumMissingTrackSsrcLookups, getPeerConnectionIndex, getSelectedCandidatePairId, getStats, getStream, getUpdatedDevices, getUpdatedStats, getUserMedia, hasGetDisplayMedia, ipRegex, isFileShareError, isMobile, isRoomIntegrationErrorCode, issueDetectorOrMetricEnabled, maybeTurnOnly, modifyMediaCapabilities, removePeerConnection, replaceTracksInStream, _default as rtcManagerEvents, rtcStats, setClientProvider, setCodecPreferenceSDP, setPeerConnectionsForTests, setVideoBandwidthUsingSetParameters, sortCodecs, standardDeviation, startPerformanceMonitor, stopStreamTracks, subscribeIssues, subscribeStats, trackAnnotations, turnServerOverride, updateRenderedDimensions, variance };
2505
- export type { AddCameraStreamOptions, AddSpotlightRequest, AggregatedIssues, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdateRequest, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetInitialStreamOptions, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssueData, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomIntegrationDisabledEvent, RoomIntegrationEnabledEvent, RoomIntegrationError, RoomIntegrationErrorCode, RoomIntegrationProps, RoomIntegrationPropsUpdatedEvent, RoomIntegrationPropsUpdatedSuccess, RoomIntegrationSessionEvent, RoomIntegrationSessionState, RoomIntegrationStartedEvent, RoomIntegrationStartedSuccess, RoomIntegrationStoppedEvent, RoomIntegrationStoppedSuccess, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcMediaQualityChangedPayload, RtcStreamAddedPayload, ScreenshareEnableRequest, ScreenshareEnableRequestedEvent, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightRemovedEvent, StartRoomIntegrationRequest, StatsMonitorOptions, StatsMonitorState, StatsSubscription, StopRoomIntegrationRequest, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdateRoomIntegrationPropsRequest, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
2524
+ export type { AddCameraStreamOptions, AddSpotlightRequest, AggregatedIssues, AudioEnableRequest, AudioEnableRequestedEvent, AudioEnabledEvent, BreakoutConfig, BreakoutGroupJoinedEvent, BreakoutSessionUpdateRequest, BreakoutSessionUpdatedEvent, BuildDeviceListOptions, CannotJoinUnclaimedRoomError, ChatFileShare, ChatMessage, ChatMessageError, ChatMessageRemoved, ChatMessageRequest, ClearableTimeout, ClientKickedEvent, ClientLeftEvent, ClientMetadataPayload, ClientMetadataReceivedEvent, ClientRole, ClientUnableToJoinEvent, CloudRecordingStartedEvent, Codec, ConnectionStatus, Credentials, FileShareErrorCode, FileUploadUrl, ForbiddenError, ForbiddenErrorNames, GetConstraintsOptions, GetDeviceDataResult, GetInitialStreamOptions, GetMediaConstraintsOptions, GetStreamOptions, GetStreamResult, GetUpdatedDevicesResult, GetUserMediaAttempt, GetUserMediaAttemptOutcome, HostPresenceControlsError, IdentifyDeviceRequest, InternalServerError, InvalidAssistantKeyError, IssueData, IssuesAndMetricsByView, JoinRoomRequest, KnockAcceptedEvent, KnockOnHoldEvent, KnockRejectedEvent, KnockResponse, KnockResponseSender, KnockRoomRequest, KnockerLeftEvent, LiveCaptionEvent, LiveCaptionsStartedEvent, LiveCaptionsStoppedEvent, LiveTranscriptionStartedEvent, LiveTranscriptionStoppedEvent, MaxViewerLimitReachedError, MediaPrefs, Metric, NewClientEvent, OrganizationAssistantNotEnabledError, OrganizationAssistantNotFoundError, OrganizationPlanExhaustedError, RemoveScreenshareStreamOptions, RemoveSpotlightRequest, RoleName, RoomConcurrencyControlsError, RoomEmptyError, RoomFullError, RoomIntegrationDisabledEvent, RoomIntegrationEnabledEvent, RoomIntegrationError, RoomIntegrationErrorCode, RoomIntegrationProps, RoomIntegrationPropsUpdatedEvent, RoomIntegrationPropsUpdatedSuccess, RoomIntegrationSessionEvent, RoomIntegrationSessionState, RoomIntegrationStartedEvent, RoomIntegrationStartedSuccess, RoomIntegrationStoppedEvent, RoomIntegrationStoppedSuccess, RoomJoinPermissionDeniedError, RoomJoinedErrors, RoomJoinedEvent, RoomJoinedSuccess, RoomKnockedEvent, RoomLockedError, RoomLockedEvent, RoomMeetingTimeExhaustedError, RoomMode, RoomSessionEndedEvent, RtcClientConnectionStatusChangedPayload, RtcEventEmitter, RtcEvents, RtcLocalStreamTrackAddedPayload, RtcLocalStreamTrackRemovedPayload, RtcManager, RtcManagerCreatedPayload, RtcManagerOptions, RtcMediaQualityChangedPayload, RtcStreamAddedPayload, ScreenshareEnableRequest, ScreenshareEnableRequestedEvent, ScreenshareStartedEvent, ScreenshareStoppedEvent, SendClientMetadataRequest, SignalClient, SignalEvents, SignalIceCandidateMessage, SignalIceEndOfCandidatesMessage, SignalIceServer, SignalKnocker, SignalMediaServerConfig, SignalRTCSessionDescription, SignalReadyToReceiveOfferMessage, SignalRequests, SignalRoom, SignalSDPMessage, SignalSFUServer, SignalTurnServer, SocketConf, SocketManager, Spotlight, SpotlightAddedEvent, SpotlightOrderSwappedError, SpotlightOrderSwappedEvent, SpotlightRemovedEvent, StartRoomIntegrationRequest, StatsMonitorOptions, StatsMonitorState, StatsSubscription, StopRoomIntegrationRequest, SwapSpotlightOrderRequest, TurnTransportProtocol, UniqueRoleAlreadyInRoomError, UpdateRoomIntegrationPropsRequest, UpdatedDeviceInfo, UpdatedDevicesInfo, VegaConnectionOptions, VegaRtcManagerOptions, VideoEnableRequest, VideoEnableRequestedEvent, VideoEnabledEvent, WebRTCProvider };
package/dist/index.mjs CHANGED
@@ -525,6 +525,7 @@ class Session {
525
525
  this.signalingState = this.pc.signalingState;
526
526
  if (this.pc.signalingState === "stable") {
527
527
  this.isOperationPending = false;
528
+ this.isLocalOfferPending = false;
528
529
  const action = this.pending.shift();
529
530
  if (action) {
530
531
  action.apply();
@@ -536,6 +537,7 @@ class Session {
536
537
  this.bandwidth = bandwidth || 0;
537
538
  this.pending = [];
538
539
  this.isOperationPending = false;
540
+ this.isLocalOfferPending = false;
539
541
  this.streamIds = [];
540
542
  this.streams = [];
541
543
  this.earlyIceCandidates = [];
@@ -598,6 +600,13 @@ class Session {
598
600
  }
599
601
  handleOffer(offer) {
600
602
  if (!this.canModifyPeerConnection()) {
603
+ if (this.isLocalOfferPending) {
604
+ this._incrementAnalyticMetric("P2POfferGlare");
605
+ rtcStats.sendEvent("P2POfferGlare", {
606
+ clientId: this.clientId,
607
+ hasRemoteDescription: !!this.pc.remoteDescription,
608
+ });
609
+ }
601
610
  return new Promise((resolve) => {
602
611
  this.pending.push(() => this.handleOffer(offer).then(resolve));
603
612
  });
@@ -667,7 +676,6 @@ class Session {
667
676
  rtcStats.sendEvent("P2PAddIceCandidateFailure", {
668
677
  clientId: this.clientId,
669
678
  errorName: e === null || e === void 0 ? void 0 : e.name,
670
- errorMessage: e === null || e === void 0 ? void 0 : e.message,
671
679
  signalingState: this.pc.signalingState,
672
680
  iceConnectionState: this.pc.iceConnectionState,
673
681
  });
@@ -2533,10 +2541,14 @@ class P2pRtcManager {
2533
2541
  numPcOnOfferFailure: 0,
2534
2542
  numPcSldFailure: 0,
2535
2543
  P2PAddIceCandidateFailure: 0,
2544
+ P2PCreateOfferFailure: 0,
2536
2545
  P2PLocalNetworkFailed: 0,
2537
2546
  P2POffendingInitialOffer: 0,
2547
+ P2POfferGlare: 0,
2548
+ P2POfferWithoutSession: 0,
2538
2549
  P2POnTrackNoStream: 0,
2539
2550
  P2PRelayedIceCandidate: 0,
2551
+ P2PRenegotiationBeforeInitialOffer: 0,
2540
2552
  P2PReplaceTrackNewTrackNotInStream: 0,
2541
2553
  P2PReplaceTrackNoStream: 0,
2542
2554
  P2PStaleAnswerIgnored: 0,
@@ -2653,6 +2665,8 @@ class P2pRtcManager {
2653
2665
  const session = this._getSession(data.clientId);
2654
2666
  if (!session) {
2655
2667
  logger$7.warn("No RTCPeerConnection on SDP_OFFER", data);
2668
+ this.analytics.P2POfferWithoutSession++;
2669
+ rtcStats.sendEvent("P2POfferWithoutSession", { clientId: data.clientId });
2656
2670
  return;
2657
2671
  }
2658
2672
  const sdp = {
@@ -2680,6 +2694,7 @@ class P2pRtcManager {
2680
2694
  })).catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2681
2695
  logger$7.error(e);
2682
2696
  this.analytics.numPcOnOfferFailure++;
2697
+ rtcStats.sendEvent("numPcOnOfferFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
2683
2698
  });
2684
2699
  }),
2685
2700
  this._serverSocket.on(RELAY_MESSAGES.SDP_ANSWER, (data) => {
@@ -2697,6 +2712,7 @@ class P2pRtcManager {
2697
2712
  (_b = (_a = session.handleAnswer(sdp)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2698
2713
  logger$7.warn("Could not set remote description from remote answer: ", e);
2699
2714
  this.analytics.numPcOnAnswerFailure++;
2715
+ rtcStats.sendEvent("numPcOnAnswerFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
2700
2716
  });
2701
2717
  }),
2702
2718
  this._serverSocket.on(PROTOCOL_RESPONSES.SCREENSHARE_STOPPED, (payload) => {
@@ -3244,6 +3260,7 @@ class P2pRtcManager {
3244
3260
  return;
3245
3261
  }
3246
3262
  session.isOperationPending = true;
3263
+ session.isLocalOfferPending = true;
3247
3264
  const { redOn, rtpAbsCaptureTimeOn, cleanSdpOn } = this._features;
3248
3265
  this._setCodecPreferences(pc).then(() => pc
3249
3266
  .createOffer(constraints || this.offerOptions)
@@ -3265,6 +3282,8 @@ class P2pRtcManager {
3265
3282
  .catch((e) => {
3266
3283
  logger$7.warn("RTCPeerConnection.setLocalDescription() failed with local offer", e);
3267
3284
  this.analytics.numPcSldFailure++;
3285
+ session.isLocalOfferPending = false;
3286
+ rtcStats.sendEvent("numPcSldFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
3268
3287
  throw e;
3269
3288
  })
3270
3289
  .then(() => {
@@ -3284,10 +3303,17 @@ class P2pRtcManager {
3284
3303
  })
3285
3304
  .catch((e) => {
3286
3305
  logger$7.warn("RTCPeerConnection.createOffer() failed to create local offer", e);
3306
+ this.analytics.P2PCreateOfferFailure++;
3307
+ session.isLocalOfferPending = false;
3308
+ rtcStats.sendEvent("P2PCreateOfferFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
3287
3309
  }));
3288
3310
  }
3289
3311
  _withForcedRenegotiation(session, action) {
3290
3312
  const pc = session.pc;
3313
+ if (session.canModifyPeerConnection() && !pc.remoteDescription) {
3314
+ this.analytics.P2PRenegotiationBeforeInitialOffer++;
3315
+ rtcStats.sendEvent("P2PRenegotiationBeforeInitialOffer", { clientId: session.clientId });
3316
+ }
3291
3317
  const originalOnnegotationneeded = pc.onnegotiationneeded;
3292
3318
  pc.onnegotiationneeded = null;
3293
3319
  action();
@@ -525,6 +525,7 @@ class Session {
525
525
  this.signalingState = this.pc.signalingState;
526
526
  if (this.pc.signalingState === "stable") {
527
527
  this.isOperationPending = false;
528
+ this.isLocalOfferPending = false;
528
529
  const action = this.pending.shift();
529
530
  if (action) {
530
531
  action.apply();
@@ -536,6 +537,7 @@ class Session {
536
537
  this.bandwidth = bandwidth || 0;
537
538
  this.pending = [];
538
539
  this.isOperationPending = false;
540
+ this.isLocalOfferPending = false;
539
541
  this.streamIds = [];
540
542
  this.streams = [];
541
543
  this.earlyIceCandidates = [];
@@ -598,6 +600,13 @@ class Session {
598
600
  }
599
601
  handleOffer(offer) {
600
602
  if (!this.canModifyPeerConnection()) {
603
+ if (this.isLocalOfferPending) {
604
+ this._incrementAnalyticMetric("P2POfferGlare");
605
+ rtcStats.sendEvent("P2POfferGlare", {
606
+ clientId: this.clientId,
607
+ hasRemoteDescription: !!this.pc.remoteDescription,
608
+ });
609
+ }
601
610
  return new Promise((resolve) => {
602
611
  this.pending.push(() => this.handleOffer(offer).then(resolve));
603
612
  });
@@ -667,7 +676,6 @@ class Session {
667
676
  rtcStats.sendEvent("P2PAddIceCandidateFailure", {
668
677
  clientId: this.clientId,
669
678
  errorName: e === null || e === void 0 ? void 0 : e.name,
670
- errorMessage: e === null || e === void 0 ? void 0 : e.message,
671
679
  signalingState: this.pc.signalingState,
672
680
  iceConnectionState: this.pc.iceConnectionState,
673
681
  });
@@ -2533,10 +2541,14 @@ class P2pRtcManager {
2533
2541
  numPcOnOfferFailure: 0,
2534
2542
  numPcSldFailure: 0,
2535
2543
  P2PAddIceCandidateFailure: 0,
2544
+ P2PCreateOfferFailure: 0,
2536
2545
  P2PLocalNetworkFailed: 0,
2537
2546
  P2POffendingInitialOffer: 0,
2547
+ P2POfferGlare: 0,
2548
+ P2POfferWithoutSession: 0,
2538
2549
  P2POnTrackNoStream: 0,
2539
2550
  P2PRelayedIceCandidate: 0,
2551
+ P2PRenegotiationBeforeInitialOffer: 0,
2540
2552
  P2PReplaceTrackNewTrackNotInStream: 0,
2541
2553
  P2PReplaceTrackNoStream: 0,
2542
2554
  P2PStaleAnswerIgnored: 0,
@@ -2653,6 +2665,8 @@ class P2pRtcManager {
2653
2665
  const session = this._getSession(data.clientId);
2654
2666
  if (!session) {
2655
2667
  logger$7.warn("No RTCPeerConnection on SDP_OFFER", data);
2668
+ this.analytics.P2POfferWithoutSession++;
2669
+ rtcStats.sendEvent("P2POfferWithoutSession", { clientId: data.clientId });
2656
2670
  return;
2657
2671
  }
2658
2672
  const sdp = {
@@ -2680,6 +2694,7 @@ class P2pRtcManager {
2680
2694
  })).catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2681
2695
  logger$7.error(e);
2682
2696
  this.analytics.numPcOnOfferFailure++;
2697
+ rtcStats.sendEvent("numPcOnOfferFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
2683
2698
  });
2684
2699
  }),
2685
2700
  this._serverSocket.on(RELAY_MESSAGES.SDP_ANSWER, (data) => {
@@ -2697,6 +2712,7 @@ class P2pRtcManager {
2697
2712
  (_b = (_a = session.handleAnswer(sdp)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2698
2713
  logger$7.warn("Could not set remote description from remote answer: ", e);
2699
2714
  this.analytics.numPcOnAnswerFailure++;
2715
+ rtcStats.sendEvent("numPcOnAnswerFailure", { clientId: data.clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
2700
2716
  });
2701
2717
  }),
2702
2718
  this._serverSocket.on(PROTOCOL_RESPONSES.SCREENSHARE_STOPPED, (payload) => {
@@ -3244,6 +3260,7 @@ class P2pRtcManager {
3244
3260
  return;
3245
3261
  }
3246
3262
  session.isOperationPending = true;
3263
+ session.isLocalOfferPending = true;
3247
3264
  const { redOn, rtpAbsCaptureTimeOn, cleanSdpOn } = this._features;
3248
3265
  this._setCodecPreferences(pc).then(() => pc
3249
3266
  .createOffer(constraints || this.offerOptions)
@@ -3265,6 +3282,8 @@ class P2pRtcManager {
3265
3282
  .catch((e) => {
3266
3283
  logger$7.warn("RTCPeerConnection.setLocalDescription() failed with local offer", e);
3267
3284
  this.analytics.numPcSldFailure++;
3285
+ session.isLocalOfferPending = false;
3286
+ rtcStats.sendEvent("numPcSldFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
3268
3287
  throw e;
3269
3288
  })
3270
3289
  .then(() => {
@@ -3284,10 +3303,17 @@ class P2pRtcManager {
3284
3303
  })
3285
3304
  .catch((e) => {
3286
3305
  logger$7.warn("RTCPeerConnection.createOffer() failed to create local offer", e);
3306
+ this.analytics.P2PCreateOfferFailure++;
3307
+ session.isLocalOfferPending = false;
3308
+ rtcStats.sendEvent("P2PCreateOfferFailure", { clientId, errorName: e === null || e === void 0 ? void 0 : e.name });
3287
3309
  }));
3288
3310
  }
3289
3311
  _withForcedRenegotiation(session, action) {
3290
3312
  const pc = session.pc;
3313
+ if (session.canModifyPeerConnection() && !pc.remoteDescription) {
3314
+ this.analytics.P2PRenegotiationBeforeInitialOffer++;
3315
+ rtcStats.sendEvent("P2PRenegotiationBeforeInitialOffer", { clientId: session.clientId });
3316
+ }
3291
3317
  const originalOnnegotationneeded = pc.onnegotiationneeded;
3292
3318
  pc.onnegotiationneeded = null;
3293
3319
  action();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whereby.com/media",
3
3
  "description": "Media library for Whereby",
4
- "version": "11.4.3",
4
+ "version": "11.5.1",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {