@azure/communication-react 1.5.1-alpha-202306160013 → 1.5.1-alpha-202306170013

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.
Files changed (33) hide show
  1. package/dist/communication-react.d.ts +17 -0
  2. package/dist/dist-cjs/communication-react/index.js +67 -12
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +4 -0
  7. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +5 -0
  8. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.d.ts +1 -0
  10. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +11 -3
  11. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  12. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +15 -0
  13. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  14. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +1 -0
  15. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +11 -0
  16. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  17. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
  18. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +10 -0
  19. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  20. package/dist/dist-esm/calling-stateful-client/src/Converter.js +4 -0
  21. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  22. package/dist/dist-esm/calling-stateful-client/src/OptimalVideoCountSubscriber.d.ts +24 -0
  23. package/dist/dist-esm/calling-stateful-client/src/OptimalVideoCountSubscriber.js +28 -0
  24. package/dist/dist-esm/calling-stateful-client/src/OptimalVideoCountSubscriber.js.map +1 -0
  25. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  26. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  27. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +1 -3
  28. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +1 -3
  30. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  31. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +1 -2
  32. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  33. package/package.json +8 -8
@@ -2200,6 +2200,10 @@ export declare interface CallState {
2200
2200
  * Proxy of {@link @azure/communication-calling#TranscriptionCallFeature}.
2201
2201
  */
2202
2202
  captionsFeature: CaptionsCallFeatureState;
2203
+ /**
2204
+ * Proxy of {@link @azure/communication-calling#OptimalVideoCountCallFeature}.
2205
+ */
2206
+ optimalVideoCount: OptimalVideoCountFeatureState;
2203
2207
  /**
2204
2208
  * Proxy of {@link @azure/communication-calling#RecordingCallFeature}.
2205
2209
  */
@@ -7410,6 +7414,18 @@ userId?: string, options?: CustomAvatarOptions,
7410
7414
  */
7411
7415
  defaultOnRender?: (props: CustomAvatarOptions) => JSX.Element) => JSX.Element;
7412
7416
 
7417
+ /**
7418
+ * State only version of Optimal Video Count Feature {@link @azure/communication-calling#OptimalVideoCountCallFeature}.
7419
+ *
7420
+ * @beta
7421
+ */
7422
+ export declare interface OptimalVideoCountFeatureState {
7423
+ /**
7424
+ * State of the current optimal video count.
7425
+ */
7426
+ maxRemoteVideoStreams: number;
7427
+ }
7428
+
7413
7429
  /**
7414
7430
  * A device, e.g. camera, microphone, or speaker, in the {@link DevicesButton} flyout.
7415
7431
  *
@@ -9360,6 +9376,7 @@ export declare type VideoGallerySelector = (state: CallClientState, props: Calli
9360
9376
  localParticipant: VideoGalleryLocalParticipant;
9361
9377
  remoteParticipants: VideoGalleryRemoteParticipant[];
9362
9378
  dominantSpeakers?: string[];
9379
+ optimalVideoCount?: number;
9363
9380
  };
9364
9381
 
9365
9382
  /**
@@ -167,7 +167,7 @@ const _toCommunicationIdentifier = (id) => {
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  // Licensed under the MIT license.
169
169
  // GENERATED FILE. DO NOT EDIT MANUALLY.
170
- var telemetryVersion = '1.5.1-alpha-202306160013';
170
+ var telemetryVersion = '1.5.1-alpha-202306170013';
171
171
 
172
172
  // Copyright (c) Microsoft Corporation.
173
173
  /**
@@ -344,6 +344,11 @@ const getIsScreenSharingOn = (state, props) => { var _a; return (_a = state.call
344
344
  * @private
345
345
  */
346
346
  const getIsMuted = (state, props) => { var _a; return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.isMuted; };
347
+ /* @conditional-compile-remove(optimal-video-count) */
348
+ /**
349
+ * @private
350
+ */
351
+ const getOptimalVideoCount = (state, props) => { var _a; return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.optimalVideoCount.maxRemoteVideoStreams; };
347
352
  /**
348
353
  * @private
349
354
  */
@@ -1500,6 +1505,10 @@ function convertSdkCallToDeclarativeCall(call) {
1500
1505
  /* @conditional-compile-remove(call-transfer) */
1501
1506
  transfer: {
1502
1507
  acceptedTransfers: {}
1508
+ },
1509
+ /* @conditional-compile-remove(optimal-video-count) */
1510
+ optimalVideoCount: {
1511
+ maxRemoteVideoStreams: call.feature(communicationCalling.Features.OptimalVideoCount).optimalVideoCount
1503
1512
  }
1504
1513
  };
1505
1514
  }
@@ -1653,6 +1662,8 @@ class CallContext$2 {
1653
1662
  existingCall.localVideoStreams = call.localVideoStreams;
1654
1663
  existingCall.remoteParticipants = call.remoteParticipants;
1655
1664
  existingCall.transcription.isTranscriptionActive = call.transcription.isTranscriptionActive;
1665
+ /* @conditional-compile-remove(optimal-video-count) */
1666
+ existingCall.optimalVideoCount.maxRemoteVideoStreams = call.optimalVideoCount.maxRemoteVideoStreams;
1656
1667
  existingCall.recording.isRecordingActive = call.recording.isRecordingActive;
1657
1668
  /* @conditional-compile-remove(rooms) */
1658
1669
  existingCall.role = call.role;
@@ -1861,6 +1872,15 @@ class CallContext$2 {
1861
1872
  }
1862
1873
  });
1863
1874
  }
1875
+ /* @conditional-compile-remove(optimal-video-count) */
1876
+ setOptimalVideoCount(callId, optimalVideoCount) {
1877
+ this.modifyState((draft) => {
1878
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1879
+ if (call) {
1880
+ call.optimalVideoCount.maxRemoteVideoStreams = optimalVideoCount;
1881
+ }
1882
+ });
1883
+ }
1864
1884
  /* @conditional-compile-remove(rooms) */
1865
1885
  setParticipantRole(callId, participantKey, role) {
1866
1886
  this.modifyState((draft) => {
@@ -3207,6 +3227,32 @@ const latestFromEvent = (args) => ({
3207
3227
  valueType: args.valueType
3208
3228
  });
3209
3229
 
3230
+ /* @conditional-compile-remove(optimal-video-count) */
3231
+ /**
3232
+ * Subscribes to a Optimal Video Count Feature events and updates the call context appropriately.
3233
+ * @private
3234
+ */
3235
+ class OptimalVideoCountSubscriber {
3236
+ constructor(args) {
3237
+ this.subscribe = () => {
3238
+ this._localOptimalVideoCountFeature.on('optimalVideoCountChanged', this.optimalVideoCountChanged);
3239
+ };
3240
+ this.unsubscribe = () => {
3241
+ this._localOptimalVideoCountFeature.off('optimalVideoCountChanged', this.optimalVideoCountChanged);
3242
+ };
3243
+ this.optimalVideoCountChanged = () => {
3244
+ this.updateOptimalVideoCountState({ maxRemoteVideoStreams: this._localOptimalVideoCountFeature.optimalVideoCount });
3245
+ };
3246
+ this.updateOptimalVideoCountState = (newOptimalVideoCountState) => {
3247
+ this._context.setOptimalVideoCount(this._callIdRef.callId, newOptimalVideoCountState.maxRemoteVideoStreams);
3248
+ };
3249
+ this._callIdRef = args.callIdRef;
3250
+ this._context = args.context;
3251
+ this._localOptimalVideoCountFeature = args.localOptimalVideoCountFeature;
3252
+ this.subscribe();
3253
+ }
3254
+ }
3255
+
3210
3256
  // Copyright (c) Microsoft Corporation.
3211
3257
  /**
3212
3258
  * Keeps track of the listeners assigned to a particular call because when we get an event from SDK, it doesn't tell us
@@ -3267,6 +3313,8 @@ class CallSubscriber {
3267
3313
  this._diagnosticsSubscriber.unsubscribe();
3268
3314
  this._recordingSubscriber.unsubscribe();
3269
3315
  this._transcriptionSubscriber.unsubscribe();
3316
+ /* @conditional-compile-remove(optimal-video-count) */
3317
+ this._optimalVideoCountSubscriber.unsubscribe();
3270
3318
  /* @conditional-compile-remove(close-captions) */
3271
3319
  (_a = this._captionsSubscriber) === null || _a === void 0 ? void 0 : _a.unsubscribe();
3272
3320
  };
@@ -3362,6 +3410,12 @@ class CallSubscriber {
3362
3410
  this._participantSubscribers = new Map();
3363
3411
  this._recordingSubscriber = new RecordingSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.Recording));
3364
3412
  this._transcriptionSubscriber = new TranscriptionSubscriber(this._callIdRef, this._context, this._call.feature(communicationCalling.Features.Transcription));
3413
+ /* @conditional-compile-remove(optimal-video-count) */
3414
+ this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({
3415
+ callIdRef: this._callIdRef,
3416
+ context: this._context,
3417
+ localOptimalVideoCountFeature: this._call.feature(communicationCalling.Features.OptimalVideoCount)
3418
+ });
3365
3419
  /* @conditional-compile-remove(video-background-effects) */
3366
3420
  this._localVideoStreamVideoEffectsSubscribers = new Map();
3367
3421
  this.subscribe();
@@ -11713,12 +11767,11 @@ const participantsById = (participants) => {
11713
11767
  };
11714
11768
 
11715
11769
  // Copyright (c) Microsoft Corporation.
11716
- const DEFAULT_MAX_REMOTE_VIDEOSTREAMS = 4;
11717
11770
  const DEFAULT_MAX_OVERFLOW_GALLERY_DOMINANT_SPEAKERS = 6;
11718
11771
  const _useOrganizedParticipants = (props) => {
11719
11772
  const visibleGridParticipants = React.useRef([]);
11720
11773
  const visibleOverflowGalleryParticipants = React.useRef([]);
11721
- const { remoteParticipants = [], dominantSpeakers = [], maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEOSTREAMS, maxOverflowGalleryDominantSpeakers = DEFAULT_MAX_OVERFLOW_GALLERY_DOMINANT_SPEAKERS, isScreenShareActive = false, pinnedParticipantUserIds = [] } = props;
11774
+ const { remoteParticipants = [], dominantSpeakers = [], maxRemoteVideoStreams, maxOverflowGalleryDominantSpeakers = DEFAULT_MAX_OVERFLOW_GALLERY_DOMINANT_SPEAKERS, isScreenShareActive = false, pinnedParticipantUserIds = [] } = props;
11722
11775
  const videoParticipants = remoteParticipants.filter((p) => { var _a; return (_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
11723
11776
  visibleGridParticipants.current =
11724
11777
  pinnedParticipantUserIds.length > 0 || isScreenShareActive
@@ -12621,9 +12674,7 @@ const DefaultLayout = (props) => {
12621
12674
  * re-render the initial tiles -> dispose them -> create new tiles, we need to take care of
12622
12675
  * this case when those components are here
12623
12676
  */
12624
- const [indexesToRender, setIndexesToRender] = React.useState([
12625
- ...Array(maxRemoteVideoStreams - activeVideoStreams).keys()
12626
- ]);
12677
+ const [indexesToRender, setIndexesToRender] = React.useState([]);
12627
12678
  const overflowGalleryTiles = overflowGalleryParticipants.map((p, i) => {
12628
12679
  var _a, _b;
12629
12680
  return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
@@ -13446,9 +13497,7 @@ const FloatingLocalVideoLayout = (props) => {
13446
13497
  * re-render the initial tiles -> dispose them -> create new tiles, we need to take care of
13447
13498
  * this case when those components are here
13448
13499
  */
13449
- const [indexesToRender, setIndexesToRender] = React.useState([
13450
- ...Array(maxRemoteVideoStreams - activeVideoStreams).keys()
13451
- ]);
13500
+ const [indexesToRender, setIndexesToRender] = React.useState([]);
13452
13501
  const overflowGalleryTiles = overflowGalleryParticipants.map((p, i) => {
13453
13502
  var _a, _b;
13454
13503
  return onRenderRemoteParticipant(p, maxRemoteVideoStreams && maxRemoteVideoStreams >= 0
@@ -16313,8 +16362,12 @@ const videoGallerySelector = reselect.createSelector([
16313
16362
  getIsScreenSharingOn,
16314
16363
  getDisplayName$2,
16315
16364
  getIdentifier,
16316
- getDominantSpeakers
16317
- ], (screenShareRemoteParticipantId, remoteParticipants, localVideoStreams, isMuted, isScreenSharingOn, displayName, identifier, dominantSpeakers) => {
16365
+ getDominantSpeakers,
16366
+ /* @conditional-compile-remove(optimal-video-count) */
16367
+ getOptimalVideoCount
16368
+ ], (screenShareRemoteParticipantId, remoteParticipants, localVideoStreams, isMuted, isScreenSharingOn, displayName, identifier, dominantSpeakers,
16369
+ /* @conditional-compile-remove(optimal-video-count) */
16370
+ optimalVideoCount) => {
16318
16371
  const screenShareRemoteParticipant = screenShareRemoteParticipantId && remoteParticipants
16319
16372
  ? remoteParticipants[screenShareRemoteParticipantId]
16320
16373
  : undefined;
@@ -16328,7 +16381,9 @@ const videoGallerySelector = reselect.createSelector([
16328
16381
  : undefined,
16329
16382
  localParticipant: memoizeLocalParticipant(identifier, displayName, isMuted, isScreenSharingOn, localVideoStream),
16330
16383
  remoteParticipants: _videoGalleryRemoteParticipantsMemo(updateUserDisplayNamesTrampoline$2(remoteParticipants ? Object.values(remoteParticipants) : noRemoteParticipants)),
16331
- dominantSpeakers: dominantSpeakerIds
16384
+ dominantSpeakers: dominantSpeakerIds,
16385
+ /* @conditional-compile-remove(optimal-video-count) */
16386
+ maxRemoteVideoStreams: optimalVideoCount
16332
16387
  };
16333
16388
  });
16334
16389
  const updateUserDisplayNamesTrampoline$2 = (remoteParticipants) => {