@azure/communication-react 1.2.3-alpha-202205270013.0 → 1.3.1-alpha-202205310013.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/dist-cjs/communication-react/index.js +128 -62
  2. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  3. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  4. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.d.ts.map +1 -1
  5. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +10 -4
  6. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  7. package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.d.ts.map +1 -1
  8. package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js +21 -0
  9. package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js.map +1 -1
  10. package/dist/dist-esm/react-components/src/components/LocalVideoTile.d.ts +4 -3
  11. package/dist/dist-esm/react-components/src/components/LocalVideoTile.d.ts.map +1 -1
  12. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +4 -4
  13. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPicture.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPictureTile.d.ts +5 -6
  16. package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPictureTile.d.ts.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPictureTile.js +4 -5
  18. package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPictureTile.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +4 -2
  20. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts.map +1 -1
  21. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +3 -3
  22. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/StreamMedia.d.ts.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/StreamMedia.js +12 -3
  25. package/dist/dist-esm/react-components/src/components/StreamMedia.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/VideoGallery.js +4 -4
  27. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/index.d.ts +2 -0
  29. package/dist/dist-esm/react-components/src/components/index.d.ts.map +1 -1
  30. package/dist/dist-esm/react-components/src/components/index.js +2 -0
  31. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.d.ts +1 -1
  33. package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.d.ts.map +1 -1
  34. package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js +13 -2
  35. package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js.map +1 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.d.ts.map +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js +54 -37
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js.map +1 -1
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +5 -4
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +2 -2
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts.map +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +2 -2
  45. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.d.ts +1 -1
  47. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.d.ts.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js +4 -3
  49. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js.map +1 -1
  50. package/package.json +7 -7
@@ -191,7 +191,7 @@ const fromFlatCommunicationIdentifier = (id) => {
191
191
  // Copyright (c) Microsoft Corporation.
192
192
  // Licensed under the MIT license.
193
193
  // GENERATED FILE. DO NOT EDIT MANUALLY.
194
- var telemetryVersion = '1.2.3-alpha-202205270013.0';
194
+ var telemetryVersion = '1.3.1-alpha-202205310013.0';
195
195
 
196
196
  // Copyright (c) Microsoft Corporation.
197
197
  /**
@@ -291,7 +291,7 @@ const getCallExists = (state, props) => !!state.calls[props.callId];
291
291
  /**
292
292
  * @private
293
293
  */
294
- const getDominantSpeakers$1 = (state, props) => { var _a; return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.dominantSpeakers; };
294
+ const getDominantSpeakers = (state, props) => { var _a; return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.dominantSpeakers; };
295
295
  /**
296
296
  * @private
297
297
  */
@@ -465,7 +465,7 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
465
465
  // Before the call object creates a stream, dispose of any local preview streams.
466
466
  // @TODO: is there any way to parent the unparented view to the call object instead
467
467
  // of disposing and creating a new stream?
468
- yield onDisposeLocalStreamView();
468
+ yield disposeAllLocalPreviewViews(callClient);
469
469
  const callId = call === null || call === void 0 ? void 0 : call.id;
470
470
  let videoDeviceInfo = callClient.getState().deviceManager.selectedCamera;
471
471
  if (!videoDeviceInfo) {
@@ -637,9 +637,15 @@ const createDefaultCallingHandlers = memoizeOne__default['default']((callClient,
637
637
  }
638
638
  });
639
639
  const onDisposeLocalStreamView = () => __awaiter$r(void 0, void 0, void 0, function* () {
640
- // TODO: we need to remember which LocalVideoStream was used for LocalPreview and dispose that one. For now
641
- // assume any unparented view is a LocalPreview and stop all since those are only used for LocalPreview
642
- // currently.
640
+ // If the user is currently in a call, dispose of the local stream view attached to that call.
641
+ const callState = call && callClient.getState().calls[call.id];
642
+ const localStream = callState === null || callState === void 0 ? void 0 : callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');
643
+ if (call && callState && localStream) {
644
+ callClient.disposeView(call.id, undefined, localStream);
645
+ }
646
+ // If the user is not in a call we currently assume any unparented view is a LocalPreview and stop all
647
+ // since those are only used for LocalPreview currently.
648
+ // TODO: we need to remember which LocalVideoStream was used for LocalPreview and dispose that one.
643
649
  yield disposeAllLocalPreviewViews(callClient);
644
650
  });
645
651
  const onRemoveParticipant = (userId) => __awaiter$r(void 0, void 0, void 0, function* () {
@@ -3936,8 +3942,19 @@ const mediaContainer = (theme) => react.mergeStyles({
3936
3942
  /**
3937
3943
  * @private
3938
3944
  */
3939
- const invertedVideoStyle = (theme) => react.mergeStyles(mediaContainer(theme), {
3940
- transform: 'rotateY(180deg)'
3945
+ const invertedVideoInPipStyle = (theme) => react.mergeStyles(mediaContainer(theme), {
3946
+ // The HTMLElement returned by the headless SDK is already inverted.
3947
+ // But in picture-in-picture mode, we do not want to invert the host HTMLElement.
3948
+ // Instead, we need to target the :picture-in-picture pseudoclass.
3949
+ //
3950
+ // First reset the host HTMLElement.
3951
+ transform: 'rotateY(180deg)',
3952
+ // This doesn't work yet on latest Edge.
3953
+ // Probably just not implemented yet.
3954
+ // picture-in-picture API is not yet stable: https://www.w3.org/TR/picture-in-picture/#css-pseudo-class
3955
+ '& video:picture-in-picture': {
3956
+ transform: 'rotateY(180deg)'
3957
+ }
3941
3958
  });
3942
3959
 
3943
3960
  // Copyright (c) Microsoft Corporation.
@@ -3952,6 +3969,7 @@ const StreamMedia = (props) => {
3952
3969
  const containerEl = React.useRef(null);
3953
3970
  const theme = useTheme();
3954
3971
  const { isMirrored, videoStreamElement, styles } = props;
3972
+ const [pipEnabled, setPipEnabled] = React.useState(false);
3955
3973
  React.useEffect(() => {
3956
3974
  const container = containerEl.current;
3957
3975
  if (!container) {
@@ -3961,14 +3979,22 @@ const StreamMedia = (props) => {
3961
3979
  // the new videoStreamElement. If videoStreamElement is undefined nothing is appended and container should be empty
3962
3980
  // and we don't render anyting.
3963
3981
  container.innerHTML = '';
3982
+ setPipEnabled(false);
3964
3983
  if (videoStreamElement) {
3984
+ videoStreamElement.addEventListener('enterpictureinpicture', () => {
3985
+ setPipEnabled(true);
3986
+ });
3987
+ videoStreamElement.addEventListener('leavepictureinpicture', () => {
3988
+ setPipEnabled(false);
3989
+ });
3965
3990
  container.appendChild(videoStreamElement);
3966
3991
  }
3967
3992
  return () => {
3968
3993
  container.innerHTML = '';
3994
+ setPipEnabled(false);
3969
3995
  };
3970
3996
  }, [videoStreamElement]);
3971
- return (React__default['default'].createElement("div", { className: react.mergeStyles(isMirrored ? invertedVideoStyle(theme) : mediaContainer(theme), styles === null || styles === void 0 ? void 0 : styles.root), ref: containerEl }));
3997
+ return (React__default['default'].createElement("div", { className: react.mergeStyles(isMirrored && pipEnabled ? invertedVideoInPipStyle(theme) : mediaContainer(theme), styles === null || styles === void 0 ? void 0 : styles.root), ref: containerEl }));
3972
3998
  };
3973
3999
 
3974
4000
  // Copyright (c) Microsoft Corporation.
@@ -4634,9 +4660,9 @@ const VideoTile = (props) => {
4634
4660
  * boost by memoizing the same rendered component to avoid rerendering a VideoTile when its position in the
4635
4661
  * array changes causing a rerender in the parent component. https://reactjs.org/docs/react-api.html#reactmemo
4636
4662
  *
4637
- * @private
4663
+ * @internal
4638
4664
  */
4639
- const RemoteVideoTile = React__default['default'].memo((props) => {
4665
+ const _RemoteVideoTile = React__default['default'].memo((props) => {
4640
4666
  const { isAvailable, isMuted, isSpeaking, isScreenSharingOn, onCreateRemoteStreamView, onDisposeRemoteStreamView, remoteVideoViewOptions, renderElement, userId, displayName, onRenderAvatar, showMuteIndicator } = props;
4641
4667
  const remoteVideoStreamProps = React.useMemo(() => ({
4642
4668
  isMirrored: remoteVideoViewOptions === null || remoteVideoViewOptions === void 0 ? void 0 : remoteVideoViewOptions.isMirrored,
@@ -4668,7 +4694,7 @@ const RemoteVideoTile = React__default['default'].memo((props) => {
4668
4694
  }
4669
4695
  return React__default['default'].createElement(StreamMedia, { videoStreamElement: renderElement });
4670
4696
  }, [renderElement]);
4671
- return (React__default['default'].createElement(VideoTile, { key: userId, userId: userId, renderElement: renderVideoStreamElement, displayName: displayName, onRenderPlaceholder: onRenderAvatar, isMuted: isMuted, isSpeaking: isSpeaking, showMuteIndicator: showMuteIndicator }));
4697
+ return (React__default['default'].createElement(VideoTile, { key: userId, userId: userId, renderElement: renderVideoStreamElement, displayName: displayName, onRenderPlaceholder: onRenderAvatar, isMuted: isMuted, isSpeaking: isSpeaking, showMuteIndicator: showMuteIndicator, showLabel: props.showLabel, personaMinSize: props.personaMinSize }));
4672
4698
  });
4673
4699
 
4674
4700
  // Copyright (c) Microsoft Corporation.
@@ -5795,9 +5821,9 @@ const LocalVideoCameraCycleButton = (props) => {
5795
5821
  /**
5796
5822
  * A memoized version of VideoTile for rendering local participant.
5797
5823
  *
5798
- * @private
5824
+ * @internal
5799
5825
  */
5800
- const LocalVideoTile = React__default['default'].memo((props) => {
5826
+ const _LocalVideoTile = React__default['default'].memo((props) => {
5801
5827
  const { isAvailable, isMuted, onCreateLocalStreamView, onDisposeLocalStreamView, localVideoViewOptions, renderElement, userId, showLabel, displayName, initialsName, onRenderAvatar, showMuteIndicator, styles, showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel, localVideoSelectedDescription } = props;
5802
5828
  const localVideoStreamProps = React.useMemo(() => ({
5803
5829
  isMirrored: localVideoViewOptions === null || localVideoViewOptions === void 0 ? void 0 : localVideoViewOptions.isMirrored,
@@ -5825,7 +5851,7 @@ const LocalVideoTile = React__default['default'].memo((props) => {
5825
5851
  }
5826
5852
  return (React__default['default'].createElement(React__default['default'].Fragment, null,
5827
5853
  React__default['default'].createElement(FloatingLocalCameraCycleButton, { showCameraSwitcherInLocalPreview: showCameraSwitcherInLocalPreview !== null && showCameraSwitcherInLocalPreview !== void 0 ? showCameraSwitcherInLocalPreview : false, localVideoCameraCycleButtonProps: localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel: localVideoCameraSwitcherLabel, localVideoSelectedDescription: localVideoSelectedDescription }),
5828
- React__default['default'].createElement(StreamMedia, { videoStreamElement: renderElement })));
5854
+ React__default['default'].createElement(StreamMedia, { videoStreamElement: renderElement, isMirrored: true })));
5829
5855
  }, [
5830
5856
  localVideoCameraCycleButtonProps,
5831
5857
  localVideoCameraSwitcherLabel,
@@ -5833,7 +5859,7 @@ const LocalVideoTile = React__default['default'].memo((props) => {
5833
5859
  renderElement,
5834
5860
  showCameraSwitcherInLocalPreview
5835
5861
  ]);
5836
- return (React__default['default'].createElement(VideoTile, { key: userId, userId: userId, renderElement: renderVideoStreamElement, showLabel: showLabel, displayName: displayName, initialsName: initialsName, styles: styles, onRenderPlaceholder: onRenderAvatar, isMuted: isMuted, showMuteIndicator: showMuteIndicator }));
5862
+ return (React__default['default'].createElement(VideoTile, { key: userId !== null && userId !== void 0 ? userId : 'local-video-tile', userId: userId, renderElement: renderVideoStreamElement, showLabel: showLabel, displayName: displayName, initialsName: initialsName, styles: styles, onRenderPlaceholder: onRenderAvatar, isMuted: isMuted, showMuteIndicator: showMuteIndicator, personaMinSize: props.personaMinSize }));
5837
5863
  });
5838
5864
  const FloatingLocalCameraCycleButton = (props) => {
5839
5865
  const { showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel, localVideoSelectedDescription } = props;
@@ -5923,7 +5949,7 @@ const VideoGallery = (props) => {
5923
5949
  root: { borderRadius: theme.effects.roundedCorner4 }
5924
5950
  }, styles === null || styles === void 0 ? void 0 : styles.localVideo);
5925
5951
  return (React__default['default'].createElement(react.Stack, { key: "local-video-tile-key", tabIndex: 0, "aria-label": strings.localVideoMovementLabel, role: 'dialog' },
5926
- React__default['default'].createElement(LocalVideoTile, { userId: localParticipant.userId, onCreateLocalStreamView: onCreateLocalStreamView, onDisposeLocalStreamView: onDisposeLocalStreamView, isAvailable: (_a = localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable, isMuted: localParticipant.isMuted, renderElement: (_b = localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.videoStream) === null || _b === void 0 ? void 0 : _b.renderElement, displayName: isNarrow ? '' : strings.localVideoLabel, initialsName: localParticipant.displayName, localVideoViewOptions: localVideoViewOptions, onRenderAvatar: onRenderAvatar, showLabel: !(shouldFloatLocalVideo && isNarrow), showMuteIndicator: showMuteIndicator, showCameraSwitcherInLocalPreview: showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps: localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel: strings.localVideoCameraSwitcherLabel, localVideoSelectedDescription: strings.localVideoSelectedDescription, styles: localVideoTileStyles })));
5952
+ React__default['default'].createElement(_LocalVideoTile, { userId: localParticipant.userId, onCreateLocalStreamView: onCreateLocalStreamView, onDisposeLocalStreamView: onDisposeLocalStreamView, isAvailable: (_a = localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable, isMuted: localParticipant.isMuted, renderElement: (_b = localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.videoStream) === null || _b === void 0 ? void 0 : _b.renderElement, displayName: isNarrow ? '' : strings.localVideoLabel, initialsName: localParticipant.displayName, localVideoViewOptions: localVideoViewOptions, onRenderAvatar: onRenderAvatar, showLabel: !(shouldFloatLocalVideo && isNarrow), showMuteIndicator: showMuteIndicator, showCameraSwitcherInLocalPreview: showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps: localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel: strings.localVideoCameraSwitcherLabel, localVideoSelectedDescription: strings.localVideoSelectedDescription, styles: localVideoTileStyles })));
5927
5953
  }, [
5928
5954
  isNarrow,
5929
5955
  localParticipant,
@@ -5945,7 +5971,7 @@ const VideoGallery = (props) => {
5945
5971
  ]);
5946
5972
  const defaultOnRenderVideoTile = React.useCallback((participant, isVideoParticipant) => {
5947
5973
  const remoteVideoStream = participant.videoStream;
5948
- return (React__default['default'].createElement(RemoteVideoTile, Object.assign({ key: participant.userId }, participant, { onCreateRemoteStreamView: isVideoParticipant ? onCreateRemoteStreamView : undefined, onDisposeRemoteStreamView: isVideoParticipant ? onDisposeRemoteStreamView : undefined, isAvailable: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isAvailable : false, renderElement: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.renderElement : undefined, remoteVideoViewOptions: isVideoParticipant ? remoteVideoViewOptions : undefined, onRenderAvatar: onRenderAvatar, showMuteIndicator: showMuteIndicator })));
5974
+ return (React__default['default'].createElement(_RemoteVideoTile, Object.assign({ key: participant.userId }, participant, { onCreateRemoteStreamView: isVideoParticipant ? onCreateRemoteStreamView : undefined, onDisposeRemoteStreamView: isVideoParticipant ? onDisposeRemoteStreamView : undefined, isAvailable: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isAvailable : false, renderElement: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.renderElement : undefined, remoteVideoViewOptions: isVideoParticipant ? remoteVideoViewOptions : undefined, onRenderAvatar: onRenderAvatar, showMuteIndicator: showMuteIndicator })));
5949
5975
  }, [onCreateRemoteStreamView, onDisposeRemoteStreamView, remoteVideoViewOptions, onRenderAvatar, showMuteIndicator]);
5950
5976
  const videoTiles = onRenderRemoteVideoTile
5951
5977
  ? visibleVideoParticipants.current.map((participant) => onRenderRemoteVideoTile(participant))
@@ -6828,11 +6854,11 @@ const submitWithKeyboard = (e, onSubmit) => {
6828
6854
  /** @private */
6829
6855
  const PictureInPictureInPicturePrimaryTile = (props) => {
6830
6856
  const boxShadow = useTheme().effects.elevation8;
6831
- return React__default['default'].createElement(PictureInPictureInPictureTile, Object.assign({}, props, { styles: primaryTileStyles(props.orientation, boxShadow) }));
6857
+ return (React__default['default'].createElement(PictureInPictureInPictureTile, { styles: primaryTileStyles(props.orientation, boxShadow) }, props.children));
6832
6858
  };
6833
6859
  /** @private */
6834
- const PictureInPictureInPictureSecondaryTile = (props) => (React__default['default'].createElement(PictureInPictureInPictureTile, Object.assign({}, props, { personaMinSize: 20, styles: secondaryTileStyles(props.orientation) })));
6835
- const PictureInPictureInPictureTile = (props) => (React__default['default'].createElement(VideoTile, Object.assign({}, props, { showLabel: false })));
6860
+ const PictureInPictureInPictureSecondaryTile = (props) => (React__default['default'].createElement(PictureInPictureInPictureTile, { styles: secondaryTileStyles(props.orientation) }, props.children));
6861
+ const PictureInPictureInPictureTile = (props) => (React__default['default'].createElement(react.Stack, { styles: props.styles }, props.children));
6836
6862
  const primaryTileStyles = react.memoizeFunction((orientation, themeElevation) => ({
6837
6863
  root: {
6838
6864
  borderRadius: '0.25rem',
@@ -7377,7 +7403,7 @@ const videoGallerySelector = reselect.createSelector([
7377
7403
  getIsScreenSharingOn,
7378
7404
  getDisplayName$2,
7379
7405
  getIdentifier,
7380
- getDominantSpeakers$1
7406
+ getDominantSpeakers
7381
7407
  ], (screenShareRemoteParticipantId, remoteParticipants, localVideoStreams, isMuted, isScreenSharingOn, displayName, identifier, dominantSpeakers) => {
7382
7408
  var _a, _b;
7383
7409
  const screenShareRemoteParticipant = screenShareRemoteParticipantId && remoteParticipants
@@ -9220,6 +9246,27 @@ class ProxyCall {
9220
9246
  });
9221
9247
  }, 'Call.stopScreenSharing');
9222
9248
  }
9249
+ case 'hold': {
9250
+ return this._context.withAsyncErrorTeedToState(function (...args) {
9251
+ return __awaiter$h(this, void 0, void 0, function* () {
9252
+ return yield target.hold(...args);
9253
+ });
9254
+ }, 'Call.hold');
9255
+ }
9256
+ case 'resume': {
9257
+ return this._context.withAsyncErrorTeedToState(function (...args) {
9258
+ return __awaiter$h(this, void 0, void 0, function* () {
9259
+ return yield target.resume(...args);
9260
+ });
9261
+ }, 'Call.resume');
9262
+ }
9263
+ case 'addParticipant': {
9264
+ return this._context.withAsyncErrorTeedToState(function (...args) {
9265
+ return __awaiter$h(this, void 0, void 0, function* () {
9266
+ return yield target.addParticipant(...args);
9267
+ });
9268
+ }, 'Call.addParticipant');
9269
+ }
9223
9270
  default:
9224
9271
  return Reflect.get(target, prop);
9225
9272
  }
@@ -13657,7 +13704,7 @@ const getUserFacingDiagnostics = (state) => { var _a; return (_a = state.call) =
13657
13704
  /**
13658
13705
  * @private
13659
13706
  */
13660
- const getDominantSpeakers = (state) => { var _a; return _dominantSpeakersWithFlatId((_a = state.call) === null || _a === void 0 ? void 0 : _a.dominantSpeakers); };
13707
+ const getDominantSpeakerInfo = (state) => { var _a; return (_a = state.call) === null || _a === void 0 ? void 0 : _a.dominantSpeakers; };
13661
13708
  /**
13662
13709
  * @private
13663
13710
  */
@@ -13945,11 +13992,12 @@ const MediaGallery = (props) => {
13945
13992
  return Object.assign(Object.assign({}, cameraSwitcherCallback), cameraSwitcherCameras);
13946
13993
  }, [cameraSwitcherCallback, cameraSwitcherCameras]);
13947
13994
  const remoteParticipants = useRemoteParticipantsWithCustomDisplayNames(videoGalleryProps.remoteParticipants, props.onFetchAvatarPersonaData);
13995
+ const onRenderAvatar = React.useCallback((userId, options) => (React__default['default'].createElement(react.Stack, { className: react.mergeStyles({ position: 'absolute', height: '100%', width: '100%' }) },
13996
+ React__default['default'].createElement(AvatarPersona, Object.assign({ userId: userId }, options, { dataProvider: props.onFetchAvatarPersonaData })))), [props.onFetchAvatarPersonaData]);
13948
13997
  useLocalVideoStartTrigger(!!props.isVideoStreamOn);
13949
13998
  const VideoGalleryMemoized = React.useMemo(() => {
13950
- return (React__default['default'].createElement(VideoGallery, Object.assign({}, videoGalleryProps, { remoteParticipants: remoteParticipants, localVideoViewOptions: localVideoViewOptions$3, remoteVideoViewOptions: remoteVideoViewOptions$1, styles: VideoGalleryStyles, layout: "floatingLocalVideo", showCameraSwitcherInLocalPreview: props.isMobile, localVideoCameraCycleButtonProps: cameraSwitcherProps, onRenderAvatar: (userId, options) => (React__default['default'].createElement(react.Stack, { className: react.mergeStyles({ position: 'absolute', height: '100%', width: '100%' }) },
13951
- React__default['default'].createElement(AvatarPersona, Object.assign({ userId: userId }, options, { dataProvider: props.onFetchAvatarPersonaData })))) })));
13952
- }, [videoGalleryProps, props.isMobile, props.onFetchAvatarPersonaData, remoteParticipants, cameraSwitcherProps]);
13999
+ return (React__default['default'].createElement(VideoGallery, Object.assign({}, videoGalleryProps, { remoteParticipants: remoteParticipants, localVideoViewOptions: localVideoViewOptions$3, remoteVideoViewOptions: remoteVideoViewOptions$1, styles: VideoGalleryStyles, layout: "floatingLocalVideo", showCameraSwitcherInLocalPreview: props.isMobile, localVideoCameraCycleButtonProps: cameraSwitcherProps, onRenderAvatar: onRenderAvatar })));
14000
+ }, [videoGalleryProps, props.isMobile, onRenderAvatar, remoteParticipants, cameraSwitcherProps]);
13953
14001
  return VideoGalleryMemoized;
13954
14002
  };
13955
14003
  /**
@@ -16261,41 +16309,65 @@ const SidePaneHeader = (props) => {
16261
16309
  * @private
16262
16310
  */
16263
16311
  const LocalAndRemotePIP = (props) => {
16312
+ var _a, _b;
16264
16313
  const { localParticipant, dominantRemoteParticipant, onCreateLocalStreamView, onDisposeLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteStreamView } = props;
16265
- React.useEffect(() => {
16266
- var _a;
16267
- if (((_a = localParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && !localParticipant.videoStream.renderElement) {
16268
- onCreateLocalStreamView && onCreateLocalStreamView(localVideoViewOptions);
16269
- }
16270
- return () => {
16271
- onDisposeLocalStreamView && onDisposeLocalStreamView();
16272
- };
16273
- }, [localParticipant, onCreateLocalStreamView, onDisposeLocalStreamView]);
16274
- const localVideoTile = React.useMemo(() => createVideoTile(localParticipant.displayName, localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.videoStream), [localParticipant.displayName, localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.videoStream]);
16275
- React.useEffect(() => {
16276
- var _a;
16277
- if (((_a = dominantRemoteParticipant === null || dominantRemoteParticipant === void 0 ? void 0 : dominantRemoteParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) && !dominantRemoteParticipant.videoStream.renderElement) {
16278
- onCreateRemoteStreamView && onCreateRemoteStreamView(dominantRemoteParticipant.userId, remoteVideoViewOptions);
16279
- }
16280
- return () => {
16281
- var _a;
16282
- onDisposeRemoteStreamView &&
16283
- ((_a = dominantRemoteParticipant === null || dominantRemoteParticipant === void 0 ? void 0 : dominantRemoteParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.renderElement) &&
16284
- onDisposeRemoteStreamView(dominantRemoteParticipant.userId);
16285
- };
16314
+ const localVideoTileProps = React.useMemo(() => {
16315
+ var _a, _b;
16316
+ return ({
16317
+ onCreateLocalStreamView,
16318
+ onDisposeLocalStreamView,
16319
+ localVideoViewOptions,
16320
+ displayName: localParticipant.displayName,
16321
+ showLabel: false,
16322
+ showMuteIndicator: false,
16323
+ showCameraSwitcherInLocalPreview: false,
16324
+ isAvailable: (_a = localParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable,
16325
+ renderElement: (_b = localParticipant.videoStream) === null || _b === void 0 ? void 0 : _b.renderElement
16326
+ });
16327
+ }, [
16328
+ localParticipant.displayName,
16329
+ (_a = localParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable,
16330
+ (_b = localParticipant.videoStream) === null || _b === void 0 ? void 0 : _b.renderElement,
16331
+ onCreateLocalStreamView,
16332
+ onDisposeLocalStreamView
16333
+ ]);
16334
+ const remoteVideoTileProps = React.useMemo(() => {
16335
+ var _a, _b;
16336
+ return !dominantRemoteParticipant
16337
+ ? undefined
16338
+ : {
16339
+ onCreateRemoteStreamView,
16340
+ onDisposeRemoteStreamView,
16341
+ remoteVideoViewOptions,
16342
+ displayName: dominantRemoteParticipant === null || dominantRemoteParticipant === void 0 ? void 0 : dominantRemoteParticipant.displayName,
16343
+ showLabel: false,
16344
+ showMuteIndicator: false,
16345
+ isAvailable: (_a = dominantRemoteParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable,
16346
+ renderElement: (_b = dominantRemoteParticipant.videoStream) === null || _b === void 0 ? void 0 : _b.renderElement,
16347
+ userId: dominantRemoteParticipant.userId,
16348
+ key: dominantRemoteParticipant.userId
16349
+ };
16286
16350
  }, [dominantRemoteParticipant, onCreateRemoteStreamView, onDisposeRemoteStreamView]);
16287
- const remoteVideoTile = React.useMemo(() => props.dominantRemoteParticipant &&
16288
- createVideoTile(props.dominantRemoteParticipant.displayName, props.dominantRemoteParticipant.videoStream), [props.dominantRemoteParticipant]);
16289
16351
  const locale = useLocale();
16290
16352
  const ariaLabel = locale.strings.callWithChat.pictureInPictureTileAriaLabel;
16291
16353
  const strings = React.useMemo(() => ({
16292
16354
  rootAriaLabel: ariaLabel
16293
16355
  }), [ariaLabel]);
16294
- return (React__default['default'].createElement(_PictureInPictureInPicture, { onClick: props.onClick, strings: strings,
16295
- // If there are no remote participants, show the local participant as the primary tile
16296
- primaryTile: remoteVideoTile !== null && remoteVideoTile !== void 0 ? remoteVideoTile : localVideoTile,
16297
- // If we are showing the local participant as the primary tile, show nothing for the secondary tile
16298
- secondaryTile: remoteVideoTile ? localVideoTile : undefined }));
16356
+ // If there are no remote participants, show the local participant as the primary tile
16357
+ const primaryTileProps = React.useMemo(() => ({
16358
+ children: remoteVideoTileProps ? (React__default['default'].createElement(_RemoteVideoTile, Object.assign({}, remoteVideoTileProps))) : (React__default['default'].createElement(_LocalVideoTile, Object.assign({}, localVideoTileProps))),
16359
+ // TODO: when the calling SDK provides height/width stream information - update this to reflect the stream orientation.
16360
+ orientation: 'portrait'
16361
+ }), [localVideoTileProps, remoteVideoTileProps]);
16362
+ // If we are showing the local participant as the primary tile, show nothing for the secondary tile
16363
+ const secondaryTileProps = React.useMemo(() => remoteVideoTileProps
16364
+ ? {
16365
+ children: React__default['default'].createElement(_LocalVideoTile, Object.assign({}, localVideoTileProps, { personaMinSize: 20 })),
16366
+ // TODO: when the calling SDK provides height/width stream information - update this to reflect the stream orientation.
16367
+ orientation: 'portrait'
16368
+ }
16369
+ : undefined, [localVideoTileProps, remoteVideoTileProps]);
16370
+ return (React__default['default'].createElement(_PictureInPictureInPicture, { onClick: props.onClick, strings: strings, primaryTile: primaryTileProps, secondaryTile: secondaryTileProps }));
16299
16371
  };
16300
16372
  const localVideoViewOptions = {
16301
16373
  scalingMode: 'Crop',
@@ -16305,13 +16377,6 @@ const remoteVideoViewOptions = {
16305
16377
  scalingMode: 'Crop',
16306
16378
  isMirrored: false
16307
16379
  };
16308
- const createVideoTile = (displayName, videoStream) => {
16309
- return {
16310
- orientation: 'portrait',
16311
- renderElement: (videoStream === null || videoStream === void 0 ? void 0 : videoStream.renderElement) ? (React__default['default'].createElement(StreamMedia, { videoStreamElement: videoStream.renderElement })) : undefined,
16312
- displayName: displayName
16313
- };
16314
- };
16315
16380
 
16316
16381
  // Copyright (c) Microsoft Corporation.
16317
16382
  /**
@@ -16320,7 +16385,8 @@ const createVideoTile = (displayName, videoStream) => {
16320
16385
  *
16321
16386
  * @private
16322
16387
  */
16323
- const dominantRemoteParticipantSelector = reselect__namespace.createSelector([getRemoteParticipants, getDominantSpeakers], (remoteParticipants, dominantSpeakers) => {
16388
+ const dominantRemoteParticipantSelector = reselect__namespace.createSelector([getRemoteParticipants, getDominantSpeakerInfo], (remoteParticipants, dominantSpeakerInfo) => {
16389
+ const dominantSpeakers = _dominantSpeakersWithFlatId(dominantSpeakerInfo);
16324
16390
  const dominantRemoteParticipant = remoteParticipants && Object.keys(remoteParticipants).length > 0
16325
16391
  ? findDominantRemoteParticipant(remoteParticipants, dominantSpeakers !== null && dominantSpeakers !== void 0 ? dominantSpeakers : [])
16326
16392
  : undefined;