@azure/communication-react 1.24.0-alpha-202501310016 → 1.24.0-alpha-202502010017

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 (81) hide show
  1. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CAFpQ8Yk.js → ChatMessageComponentAsRichTextEditBox-B69n5di0.js} +2 -2
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CAFpQ8Yk.js.map → ChatMessageComponentAsRichTextEditBox-B69n5di0.js.map} +1 -1
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DTWPl1yi.js → RichTextSendBoxWrapper-CAzmoL1D.js} +2 -2
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DTWPl1yi.js.map → RichTextSendBoxWrapper-CAzmoL1D.js.map} +1 -1
  5. package/dist/dist-cjs/communication-react/{index-B8uYcMR8.js → index--34qf-o2.js} +232 -477
  6. package/dist/dist-cjs/communication-react/index--34qf-o2.js.map +1 -0
  7. package/dist/dist-cjs/communication-react/index.js +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  10. package/dist/dist-esm/communication-react/src/index.d.ts +1 -2
  11. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  12. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +2 -7
  13. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
  15. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  16. package/dist/dist-esm/react-components/src/components/ParticipantList.js +11 -23
  17. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  18. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +6 -18
  19. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.js +24 -40
  21. package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.js.map +1 -1
  22. package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js +1 -3
  23. package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.d.ts +3 -2
  25. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js +4 -72
  26. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js.map +1 -1
  27. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.d.ts +0 -1
  28. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js +4 -17
  30. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js.map +1 -1
  31. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +1 -20
  32. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/VideoGallery.js +11 -36
  34. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  35. package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +1 -2
  36. package/dist/dist-esm/react-components/src/components/VideoTile.js +6 -39
  37. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  38. package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.d.ts +10 -1
  39. package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.js +34 -5
  40. package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.js.map +1 -1
  41. package/dist/dist-esm/react-components/src/components/utils.js +1 -13
  42. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/index.d.ts +1 -1
  44. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  45. package/dist/dist-esm/react-components/src/theming/icons.js +0 -6
  46. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  47. package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
  49. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  50. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -3
  51. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +0 -21
  52. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  53. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  54. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +24 -38
  55. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  56. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js +5 -23
  57. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js.map +1 -1
  58. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +1 -2
  59. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +1 -85
  60. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  61. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +0 -1
  62. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
  63. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +0 -8
  64. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  65. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +16 -2
  66. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +16 -1
  67. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  68. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +2 -2
  69. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +0 -8
  70. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  71. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  72. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -2
  73. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -8
  74. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  75. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +39 -5
  76. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
  77. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +38 -8
  78. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  79. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  80. package/package.json +4 -4
  81. package/dist/dist-cjs/communication-react/index-B8uYcMR8.js.map +0 -1
@@ -1,23 +1,9 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  /* @conditional-compile-remove(together-mode) */
4
- import React, { useMemo, useRef, useState } from 'react';
4
+ import React from 'react';
5
5
  /* @conditional-compile-remove(together-mode) */
6
- import { useId } from '@fluentui/react-hooks';
7
- /* @conditional-compile-remove(together-mode) */
8
- import { LayerHost, mergeStyles, Stack } from '@fluentui/react';
9
- /* @conditional-compile-remove(together-mode) */
10
- import { renderTiles, useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';
11
- /* @conditional-compile-remove(together-mode) */
12
- import { OverflowGallery } from './OverflowGallery';
13
- /* @conditional-compile-remove(together-mode) */
14
- import { rootLayoutStyle } from './styles/DefaultLayout.styles';
15
- /* @conditional-compile-remove(together-mode) */
16
- import { isNarrowWidth, isShortHeight } from '../utils/responsive';
17
- /* @conditional-compile-remove(together-mode) */
18
- import { innerLayoutStyle, layerHostStyle } from './styles/FloatingLocalVideoLayout.styles';
19
- /* @conditional-compile-remove(together-mode) */
20
- import { videoGalleryLayoutGap } from './styles/Layout.styles';
6
+ import { Stack } from '@fluentui/react';
21
7
  /* @conditional-compile-remove(together-mode) */
22
8
  /**
23
9
  * A memoized version of local screen share component. React.memo is used for a performance
@@ -25,61 +11,7 @@ import { videoGalleryLayoutGap } from './styles/Layout.styles';
25
11
  * https://reactjs.org/docs/react-api.html#reactmemo
26
12
  */
27
13
  export const TogetherModeLayout = (props) => {
28
- const { remoteParticipants = [], dominantSpeakers, screenShareComponent, onRenderRemoteParticipant, styles, maxRemoteVideoStreams, parentWidth, parentHeight, overflowGalleryPosition = 'horizontalBottom', pinnedParticipantUserIds = [], togetherModeStreamComponent } = props;
29
- const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;
30
- const isShort = parentHeight ? isShortHeight(parentHeight) : false;
31
- const [indexesToRender, setIndexesToRender] = useState([]);
32
- const childrenPerPage = useRef(4);
33
- const { gridParticipants, overflowGalleryParticipants } = useOrganizedParticipants({
34
- remoteParticipants,
35
- dominantSpeakers,
36
- maxGridParticipants: maxRemoteVideoStreams,
37
- isScreenShareActive: !!screenShareComponent,
38
- maxOverflowGalleryDominantSpeakers: screenShareComponent
39
- ? childrenPerPage.current - (pinnedParticipantUserIds.length % childrenPerPage.current)
40
- : childrenPerPage.current,
41
- pinnedParticipantUserIds,
42
- layout: 'floatingLocalVideo'
43
- });
44
- const { gridTiles, overflowGalleryTiles } = renderTiles(gridParticipants, onRenderRemoteParticipant, maxRemoteVideoStreams, indexesToRender, overflowGalleryParticipants, dominantSpeakers);
45
- const layerHostId = useId('layerhost');
46
- const togetherModeOverFlowGalleryTiles = useMemo(() => {
47
- let newTiles = overflowGalleryTiles;
48
- if (togetherModeStreamComponent) {
49
- if (screenShareComponent) {
50
- newTiles = gridTiles.concat(overflowGalleryTiles);
51
- }
52
- }
53
- return newTiles;
54
- }, [gridTiles, overflowGalleryTiles, screenShareComponent, togetherModeStreamComponent]);
55
- const overflowGallery = useMemo(() => {
56
- if (overflowGalleryTiles.length === 0 && !props.screenShareComponent) {
57
- return null;
58
- }
59
- return (React.createElement(OverflowGallery, { isShort: isShort, onFetchTilesToRender: setIndexesToRender, isNarrow: isNarrow, shouldFloatLocalVideo: false, overflowGalleryElements: togetherModeOverFlowGalleryTiles, horizontalGalleryStyles: styles === null || styles === void 0 ? void 0 : styles.horizontalGallery, verticalGalleryStyles: styles === null || styles === void 0 ? void 0 : styles.verticalGallery, overflowGalleryPosition: overflowGalleryPosition, onChildrenPerPageChange: (n) => {
60
- childrenPerPage.current = n;
61
- }, parentWidth: parentWidth }));
62
- }, [
63
- overflowGalleryTiles.length,
64
- props.screenShareComponent,
65
- isShort,
66
- isNarrow,
67
- togetherModeOverFlowGalleryTiles,
68
- styles === null || styles === void 0 ? void 0 : styles.horizontalGallery,
69
- styles === null || styles === void 0 ? void 0 : styles.verticalGallery,
70
- overflowGalleryPosition,
71
- parentWidth
72
- ]);
73
- return screenShareComponent ? (React.createElement(Stack, { styles: rootLayoutStyle },
74
- React.createElement(LayerHost, { id: layerHostId, className: mergeStyles(layerHostStyle) }),
75
- React.createElement(Stack, { horizontal: overflowGalleryPosition === 'verticalRight', styles: innerLayoutStyle, tokens: videoGalleryLayoutGap },
76
- props.overflowGalleryPosition === 'horizontalTop' ? overflowGallery : React.createElement(React.Fragment, null),
77
- screenShareComponent,
78
- overflowGalleryTrampoline(overflowGallery, props.overflowGalleryPosition)))) : (React.createElement(Stack, null, props.togetherModeStreamComponent));
79
- };
80
- /* @conditional-compile-remove(together-mode) */
81
- const overflowGalleryTrampoline = (gallery, galleryPosition) => {
82
- return galleryPosition !== 'horizontalTop' ? gallery : React.createElement(React.Fragment, null);
83
- return gallery;
14
+ const { togetherModeStreamComponent } = props;
15
+ return React.createElement(Stack, null, togetherModeStreamComponent);
84
16
  };
85
17
  //# sourceMappingURL=TogetherModeLayout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TogetherModeLayout.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/TogetherModeLayout.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,gDAAgD;AAChD,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,gDAAgD;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAK9C,gDAAgD;AAChD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAChE,gDAAgD;AAChD,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,iCAAiC,CAAC;AACxF,gDAAgD;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,gDAAgD;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACnE,gDAAgD;AAChD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC5F,gDAAgD;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB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CAAE,eAAe;QACvB,uBAAuB;QACvB,WAAW;KACZ,CAAC,CAAC;IAEH,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAC5B,oBAAC,KAAK,IAAC,MAAM,EAAE,eAAe;QAC5B,oBAAC,SAAS,IAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,CAAC,cAAc,CAAC,GAAI;QACtE,oBAAC,KAAK,IACJ,UAAU,EAAE,uBAAuB,KAAK,eAAe,EACvD,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE,qBAAqB;YAE5B,KAAK,CAAC,uBAAuB,KAAK,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,yCAAK;YAC3E,oBAAoB;YACpB,yBAAyB,CAAC,eAAe,EAAE,KAAK,CAAC,uBAAuB,CAAC,CACpE,CACF,CACT,CAAC,CAAC,CAAC,CACF,oBAAC,KAAK,QAAE,KAAK,CAAC,2BAA2B,CAAS,CACnD,CAAC;AACJ,CAAC,CAAC;AAEF,gDAAgD;AAChD,MAAM,yBAAyB,GAAG,CAChC,OAA2B,EAC3B,eAAwE,EACpD,EAAE;IACtB,OAAO,eAAe,KAAK,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,yCAAK,CAAC;IAC7D,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(together-mode) */\nimport React, { useMemo, useRef, useState } from 'react';\n/* @conditional-compile-remove(together-mode) */\nimport { useId } from '@fluentui/react-hooks';\n/* @conditional-compile-remove(together-mode) */\nimport { _formatString } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(together-mode) */\nimport { LayoutProps } from './Layout';\n/* @conditional-compile-remove(together-mode) */\nimport { LayerHost, mergeStyles, Stack } from '@fluentui/react';\n/* @conditional-compile-remove(together-mode) */\nimport { renderTiles, useOrganizedParticipants } from './utils/videoGalleryLayoutUtils';\n/* @conditional-compile-remove(together-mode) */\nimport { OverflowGallery } from './OverflowGallery';\n/* @conditional-compile-remove(together-mode) */\nimport { rootLayoutStyle } from './styles/DefaultLayout.styles';\n/* @conditional-compile-remove(together-mode) */\nimport { isNarrowWidth, isShortHeight } from '../utils/responsive';\n/* @conditional-compile-remove(together-mode) */\nimport { innerLayoutStyle, layerHostStyle } from './styles/FloatingLocalVideoLayout.styles';\n/* @conditional-compile-remove(together-mode) */\nimport { videoGalleryLayoutGap } from './styles/Layout.styles';\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * A memoized version of local screen share component. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering this when the parent component rerenders.\n * https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport const TogetherModeLayout = (props: LayoutProps): JSX.Element => {\n const {\n remoteParticipants = [],\n dominantSpeakers,\n screenShareComponent,\n onRenderRemoteParticipant,\n styles,\n maxRemoteVideoStreams,\n parentWidth,\n parentHeight,\n overflowGalleryPosition = 'horizontalBottom',\n pinnedParticipantUserIds = [],\n togetherModeStreamComponent\n } = props;\n const isNarrow = parentWidth ? isNarrowWidth(parentWidth) : false;\n\n const isShort = parentHeight ? isShortHeight(parentHeight) : false;\n\n const [indexesToRender, setIndexesToRender] = useState<number[]>([]);\n const childrenPerPage = useRef(4);\n\n const { gridParticipants, overflowGalleryParticipants } = useOrganizedParticipants({\n remoteParticipants,\n dominantSpeakers,\n maxGridParticipants: maxRemoteVideoStreams,\n isScreenShareActive: !!screenShareComponent,\n maxOverflowGalleryDominantSpeakers: screenShareComponent\n ? childrenPerPage.current - (pinnedParticipantUserIds.length % childrenPerPage.current)\n : childrenPerPage.current,\n pinnedParticipantUserIds,\n layout: 'floatingLocalVideo'\n });\n const { gridTiles, overflowGalleryTiles } = renderTiles(\n gridParticipants,\n onRenderRemoteParticipant,\n maxRemoteVideoStreams,\n indexesToRender,\n overflowGalleryParticipants,\n dominantSpeakers\n );\n\n const layerHostId = useId('layerhost');\n const togetherModeOverFlowGalleryTiles = useMemo(() => {\n let newTiles = overflowGalleryTiles;\n if (togetherModeStreamComponent) {\n if (screenShareComponent) {\n newTiles = gridTiles.concat(overflowGalleryTiles);\n }\n }\n return newTiles;\n }, [gridTiles, overflowGalleryTiles, screenShareComponent, togetherModeStreamComponent]);\n\n const overflowGallery = useMemo(() => {\n if (overflowGalleryTiles.length === 0 && !props.screenShareComponent) {\n return null;\n }\n return (\n <OverflowGallery\n isShort={isShort}\n onFetchTilesToRender={setIndexesToRender}\n isNarrow={isNarrow}\n shouldFloatLocalVideo={false}\n overflowGalleryElements={togetherModeOverFlowGalleryTiles}\n horizontalGalleryStyles={styles?.horizontalGallery}\n verticalGalleryStyles={styles?.verticalGallery}\n overflowGalleryPosition={overflowGalleryPosition}\n onChildrenPerPageChange={(n: number) => {\n childrenPerPage.current = n;\n }}\n parentWidth={parentWidth}\n />\n );\n }, [\n overflowGalleryTiles.length,\n props.screenShareComponent,\n isShort,\n isNarrow,\n togetherModeOverFlowGalleryTiles,\n styles?.horizontalGallery,\n styles?.verticalGallery,\n overflowGalleryPosition,\n parentWidth\n ]);\n\n return screenShareComponent ? (\n <Stack styles={rootLayoutStyle}>\n <LayerHost id={layerHostId} className={mergeStyles(layerHostStyle)} />\n <Stack\n horizontal={overflowGalleryPosition === 'verticalRight'}\n styles={innerLayoutStyle}\n tokens={videoGalleryLayoutGap}\n >\n {props.overflowGalleryPosition === 'horizontalTop' ? overflowGallery : <></>}\n {screenShareComponent}\n {overflowGalleryTrampoline(overflowGallery, props.overflowGalleryPosition)}\n </Stack>\n </Stack>\n ) : (\n <Stack>{props.togetherModeStreamComponent}</Stack>\n );\n};\n\n/* @conditional-compile-remove(together-mode) */\nconst overflowGalleryTrampoline = (\n gallery: JSX.Element | null,\n galleryPosition?: 'horizontalBottom' | 'verticalRight' | 'horizontalTop'\n): JSX.Element | null => {\n return galleryPosition !== 'horizontalTop' ? gallery : <></>;\n return gallery;\n};\n"]}
1
+ {"version":3,"file":"TogetherModeLayout.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/TogetherModeLayout.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,gDAAgD;AAChD,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,gDAAgD;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAExC,gDAAgD;AAChD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAmD,EAAe,EAAE;IACrG,MAAM,EAAE,2BAA2B,EAAE,GAAG,KAAK,CAAC;IAC9C,OAAO,oBAAC,KAAK,QAAE,2BAA2B,CAAS,CAAC;AACtD,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(together-mode) */\nimport React from 'react';\n/* @conditional-compile-remove(together-mode) */\nimport { _formatString } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(together-mode) */\nimport { Stack } from '@fluentui/react';\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * A memoized version of local screen share component. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering this when the parent component rerenders.\n * https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport const TogetherModeLayout = (props: { togetherModeStreamComponent: JSX.Element }): JSX.Element => {\n const { togetherModeStreamComponent } = props;\n return <Stack>{togetherModeStreamComponent}</Stack>;\n};\n"]}
@@ -17,7 +17,6 @@ export declare const TogetherModeStream: React.MemoExoticComponent<(props: {
17
17
  reactionResources?: ReactionResources;
18
18
  localParticipant?: VideoGalleryLocalParticipant;
19
19
  remoteParticipants?: VideoGalleryRemoteParticipant[];
20
- screenShareComponent?: JSX.Element;
21
20
  containerWidth?: number;
22
21
  containerHeight?: number;
23
22
  }) => JSX.Element>;
@@ -1 +1 @@
1
- {"version":3,"file":"TogetherModeStream.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/TogetherModeStream.tsx"],"names":[],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C,CAAC,CAAC,CACF,yCAAK,CACN,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(together-mode) */\nimport React, { useEffect, useMemo, memo } from 'react';\n/* @conditional-compile-remove(together-mode) */\nimport { _formatString, _pxToRem } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(together-mode) */\nimport {\n ReactionResources,\n VideoGalleryTogetherModeParticipantPosition,\n VideoGalleryTogetherModeStreams,\n TogetherModeStreamViewResult,\n VideoGalleryLocalParticipant,\n VideoGalleryRemoteParticipant,\n VideoStreamOptions\n} from '../../types';\n/* @conditional-compile-remove(together-mode) */\nimport { StreamMedia } from '../StreamMedia';\n/* @conditional-compile-remove(together-mode) */\nimport { MeetingReactionOverlay } from '../MeetingReactionOverlay';\n/* @conditional-compile-remove(together-mode) */\nimport { Stack } from '@fluentui/react';\n/* @conditional-compile-remove(together-mode) */\nimport { togetherModeStreamRootStyle } from '../styles/TogetherMode.styles';\n/* @conditional-compile-remove(together-mode) */\n/**\n * A memoized version of local screen share component. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering this when the parent component rerenders.\n * https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport const TogetherModeStream = memo(\n (props: {\n startTogetherModeEnabled?: boolean;\n isTogetherModeActive?: boolean;\n onCreateTogetherModeStreamView?: (options?: VideoStreamOptions) => Promise<void | TogetherModeStreamViewResult>;\n onStartTogetherMode?: (options?: VideoStreamOptions) => Promise<void | TogetherModeStreamViewResult>;\n onDisposeTogetherModeStreamView?: () => Promise<void>;\n onSetTogetherModeSceneSize?: (width: number, height: number) => void;\n togetherModeStreams?: VideoGalleryTogetherModeStreams;\n seatingCoordinates?: VideoGalleryTogetherModeParticipantPosition;\n reactionResources?: ReactionResources;\n localParticipant?: VideoGalleryLocalParticipant;\n remoteParticipants?: VideoGalleryRemoteParticipant[];\n screenShareComponent?: JSX.Element;\n containerWidth?: number;\n containerHeight?: number;\n }): JSX.Element => {\n const {\n startTogetherModeEnabled,\n isTogetherModeActive,\n onCreateTogetherModeStreamView,\n onStartTogetherMode,\n onSetTogetherModeSceneSize,\n onDisposeTogetherModeStreamView,\n togetherModeStreams,\n containerWidth,\n containerHeight\n } = props;\n\n useEffect(() => {\n return () => {\n // TODO: Isolate disposing behaviors for screenShare and videoStream\n onDisposeTogetherModeStreamView && onDisposeTogetherModeStreamView();\n };\n }, [onDisposeTogetherModeStreamView]);\n\n // Trigger startTogetherMode only when needed\n useEffect(() => {\n if (startTogetherModeEnabled && !isTogetherModeActive) {\n onStartTogetherMode?.();\n }\n }, [startTogetherModeEnabled, isTogetherModeActive, onStartTogetherMode]);\n\n // Create stream view if not already created\n useEffect(() => {\n if (!togetherModeStreams?.mainVideoStream?.renderElement) {\n onCreateTogetherModeStreamView?.();\n }\n }, [togetherModeStreams?.mainVideoStream?.renderElement, onCreateTogetherModeStreamView]);\n\n // Update scene size only when container dimensions change\n useMemo(() => {\n if (onSetTogetherModeSceneSize && containerWidth && containerHeight) {\n onSetTogetherModeSceneSize(containerWidth, containerHeight);\n }\n }, [onSetTogetherModeSceneSize, containerWidth, containerHeight]);\n\n const stream = props.togetherModeStreams?.mainVideoStream;\n const showLoadingIndicator = !(stream && stream.isAvailable && stream.isReceiving);\n\n return containerWidth && containerHeight ? (\n <Stack styles={togetherModeStreamRootStyle} horizontalAlign=\"center\" verticalAlign=\"center\">\n <StreamMedia\n videoStreamElement={stream?.renderElement || null}\n isMirrored={true}\n loadingState={showLoadingIndicator ? 'loading' : 'none'}\n />\n <MeetingReactionOverlay\n reactionResources={props.reactionResources || ({} as ReactionResources)}\n localParticipant={props.localParticipant}\n remoteParticipants={props.remoteParticipants}\n togetherModeSeatPositions={props.seatingCoordinates}\n overlayMode=\"together-mode\"\n />\n </Stack>\n ) : (\n <></>\n );\n }\n);\n"]}
1
+ {"version":3,"file":"TogetherModeStream.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/V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AC,eAAe,GAC3B,CACI,CACT,CAAC,CAAC,CAAC,CACF,yCAAK,CACN,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(together-mode) */\nimport React, { useEffect, useMemo, memo } from 'react';\n/* @conditional-compile-remove(together-mode) */\nimport { _formatString, _pxToRem } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(together-mode) */\nimport {\n ReactionResources,\n VideoGalleryTogetherModeParticipantPosition,\n VideoGalleryTogetherModeStreams,\n TogetherModeStreamViewResult,\n VideoGalleryLocalParticipant,\n VideoGalleryRemoteParticipant,\n VideoStreamOptions\n} from '../../types';\n/* @conditional-compile-remove(together-mode) */\nimport { StreamMedia } from '../StreamMedia';\n/* @conditional-compile-remove(together-mode) */\nimport { MeetingReactionOverlay } from '../MeetingReactionOverlay';\n/* @conditional-compile-remove(together-mode) */\nimport { Stack } from '@fluentui/react';\n/* @conditional-compile-remove(together-mode) */\nimport { togetherModeStreamRootStyle } from '../styles/TogetherMode.styles';\n/* @conditional-compile-remove(together-mode) */\n/**\n * A memoized version of local screen share component. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering this when the parent component rerenders.\n * https://reactjs.org/docs/react-api.html#reactmemo\n */\nexport const TogetherModeStream = memo(\n (props: {\n startTogetherModeEnabled?: boolean;\n isTogetherModeActive?: boolean;\n onCreateTogetherModeStreamView?: (options?: VideoStreamOptions) => Promise<void | TogetherModeStreamViewResult>;\n onStartTogetherMode?: (options?: VideoStreamOptions) => Promise<void | TogetherModeStreamViewResult>;\n onDisposeTogetherModeStreamView?: () => Promise<void>;\n onSetTogetherModeSceneSize?: (width: number, height: number) => void;\n togetherModeStreams?: VideoGalleryTogetherModeStreams;\n seatingCoordinates?: VideoGalleryTogetherModeParticipantPosition;\n reactionResources?: ReactionResources;\n localParticipant?: VideoGalleryLocalParticipant;\n remoteParticipants?: VideoGalleryRemoteParticipant[];\n containerWidth?: number;\n containerHeight?: number;\n }): JSX.Element => {\n const {\n startTogetherModeEnabled,\n isTogetherModeActive,\n onCreateTogetherModeStreamView,\n onStartTogetherMode,\n onSetTogetherModeSceneSize,\n onDisposeTogetherModeStreamView,\n togetherModeStreams,\n containerWidth,\n containerHeight\n } = props;\n\n useEffect(() => {\n return () => {\n // TODO: Isolate disposing behaviors for screenShare and videoStream\n onDisposeTogetherModeStreamView && onDisposeTogetherModeStreamView();\n };\n }, [onDisposeTogetherModeStreamView]);\n\n // Trigger startTogetherMode only when needed\n useEffect(() => {\n if (startTogetherModeEnabled && !isTogetherModeActive) {\n onStartTogetherMode?.();\n }\n }, [startTogetherModeEnabled, isTogetherModeActive, onStartTogetherMode]);\n\n // Create stream view if not already created\n useEffect(() => {\n if (!togetherModeStreams?.mainVideoStream?.renderElement) {\n onCreateTogetherModeStreamView?.();\n }\n }, [togetherModeStreams?.mainVideoStream?.renderElement, onCreateTogetherModeStreamView]);\n\n // Update scene size only when container dimensions change\n useMemo(() => {\n if (onSetTogetherModeSceneSize && containerWidth && containerHeight) {\n onSetTogetherModeSceneSize(containerWidth, containerHeight);\n }\n }, [onSetTogetherModeSceneSize, containerWidth, containerHeight]);\n\n const stream = props.togetherModeStreams?.mainVideoStream;\n const showLoadingIndicator = !(stream && stream.isAvailable && stream.isReceiving);\n\n return containerWidth && containerHeight ? (\n <Stack styles={togetherModeStreamRootStyle} horizontalAlign=\"center\" verticalAlign=\"center\">\n <StreamMedia\n videoStreamElement={stream?.renderElement || null}\n isMirrored={true}\n loadingState={showLoadingIndicator ? 'loading' : 'none'}\n />\n <MeetingReactionOverlay\n reactionResources={props.reactionResources || ({} as ReactionResources)}\n localParticipant={props.localParticipant}\n remoteParticipants={props.remoteParticipants}\n togetherModeSeatPositions={props.seatingCoordinates}\n overlayMode=\"together-mode\"\n />\n </Stack>\n ) : (\n <></>\n );\n }\n);\n"]}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { useCallback, useEffect, useMemo, useState } from 'react';
3
+ import { useEffect, useMemo, useState } from 'react';
4
4
  import { callingComponentLogger } from '../utils/Logger';
5
5
  /**
6
6
  * Helper hook to maintain the video stream lifecycle. This calls onCreateStreamView and onDisposeStreamView
@@ -21,26 +21,15 @@ import { callingComponentLogger } from '../utils/Logger';
21
21
  * @private
22
22
  */
23
23
  const useVideoStreamLifecycleMaintainer = (props) => {
24
- const { isMirrored, isScreenSharingOn, isStreamAvailable, onCreateStreamView, onDisposeStreamView, renderElementExists, scalingMode, streamId,
25
- /* @conditional-compile-remove(media-access) */
26
- isVideoPermitted } = props;
24
+ const { isMirrored, isScreenSharingOn, isStreamAvailable, onCreateStreamView, onDisposeStreamView, renderElementExists, scalingMode, streamId, isVideoPermitted } = props;
27
25
  const [videoStreamViewResult, setVideoStreamViewResult] = useState();
28
- const createStreamViewTrampoline = useCallback((isStreamAvailable, renderElementExists,
29
- /* @conditional-compile-remove(media-access) */ isVideoPermitted) => {
26
+ useEffect(() => {
30
27
  var _a;
31
- /* @conditional-compile-remove(media-access) */
32
- if (isVideoPermitted === false) {
33
- return;
34
- }
35
- if (isStreamAvailable && !renderElementExists) {
28
+ if (isVideoPermitted !== false && isStreamAvailable && !renderElementExists) {
36
29
  (_a = onCreateStreamView === null || onCreateStreamView === void 0 ? void 0 : onCreateStreamView({ isMirrored, scalingMode })) === null || _a === void 0 ? void 0 : _a.then((result) => {
37
30
  result && setVideoStreamViewResult(result);
38
31
  });
39
32
  }
40
- }, [isMirrored, onCreateStreamView, scalingMode]);
41
- useEffect(() => {
42
- createStreamViewTrampoline(isStreamAvailable, renderElementExists,
43
- /* @conditional-compile-remove(media-access) */ isVideoPermitted);
44
33
  // Always clean up element to make tile up to date and be able to dispose correctly
45
34
  return () => {
46
35
  if (renderElementExists) {
@@ -62,8 +51,6 @@ const useVideoStreamLifecycleMaintainer = (props) => {
62
51
  renderElementExists,
63
52
  scalingMode,
64
53
  streamId,
65
- createStreamViewTrampoline,
66
- /* @conditional-compile-remove(media-access) */
67
54
  isVideoPermitted
68
55
  ]);
69
56
  // The execution order for above useEffect is onCreateRemoteStreamView =>(async time gap) RenderElement generated => element disposed => onDisposeRemoteStreamView
@@ -1 +1 @@
1
- {"version":3,"file":"useVideoStreamLifecycleMaintainer.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAkBzD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,iCAAiC,GAAG,CACxC,KAA0C,EACD,EAAE;IAC3C,MAAM,EACJ,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,QAAQ;IACR,+CAA+C;IAC/C,gBAAgB,EACjB,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,QAAQ,EAA2C,CAAC;IAE9G,MAAM,0BAA0B,GAAG,WAAW,CAC5C,CACE,iBAA2B,EAC3B,mBAA6B;IAC7B,+CAA+C,CAAC,gBAA0B,EAC1E,EAAE;;QACF,+CAA+C;QAC/C,IAAI,gBAAgB,KAAK,KAAK,EAAE,CAAC;YAC/B,OAAO;QACT,CAAC;QAED,IAAI,iBAAiB,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC9C,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAG,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,0CAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;gBACjE,MAAM,IAAI,wBAAwB,CAAC,MAAM,CAAC,CAAC;YAC7C,CAAC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ChC,GAAG,EAAE,CAAC,CAAC,OAA4B,EAAE,EAAE;QACrC,OAAO,uBAAuB,aAAvB,uBAAuB,uBAAvB,uBAAuB,CAAG,OAAO,CAAC,CAAC;IAC5C,CAAC,EACD,CAAC,uBAAuB,CAAC,CAC1B,CAAC;IACF,MAAM,mBAAmB,GAAG,OAAO,CACjC,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,EAAI,CAAC;IAC/B,CAAC,EACD,CAAC,wBAAwB,CAAC,CAC3B,CAAC;IACF,OAAO,iCAAiC,iCACnC,KAAK,KACR,kBAAkB;QAClB,mBAAmB,IACnB,CAAC;AACL,CAAC,CAAC;AAYF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,CACrD,KAAgD,EACP,EAAE;IAC3C,MAAM,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,GAAG,KAAK,CAAC;IAC3F,MAAM,kBAAkB,GAAG,OAAO,CAChC,GAAG,EAAE,CAAC,CAAC,OAA4B,EAAE,EAAE;QACrC,OAAO,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,CAAG,mBAAmB,EAAE,OAAO,CAAC,CAAC;IAClE,CAAC,EACD,CAAC,wBAAwB,EAAE,mBAAmB,CAAC,CAChD,CAAC;IACF,MAAM,mBAAmB,GAAG,OAAO,CACjC,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAG,mBAAmB,CAAC,CAAC;IACnD,CAAC,EACD,CAAC,yBAAyB,EAAE,mBAAmB,CAAC,CACjD,CAAC;IAEF,OAAO,iCAAiC,iCACnC,KAAK,KACR,kBAAkB;QAClB,mBAAmB,IACnB,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { VideoStreamOptions, CreateVideoStreamViewResult, ViewScalingMode } from '../../types';\nimport { callingComponentLogger } from '../utils/Logger';\n\n/** @private */\nexport interface VideoStreamLifecycleMaintainerExtendableProps {\n isStreamAvailable?: boolean;\n renderElementExists?: boolean;\n isMirrored?: boolean;\n scalingMode?: ViewScalingMode;\n isScreenSharingOn?: boolean;\n streamId?: number;\n isVideoPermitted?: boolean;\n}\n\ninterface VideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateStreamView: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult> | undefined;\n onDisposeStreamView: () => void | undefined;\n}\n\n/**\n * Helper hook to maintain the video stream lifecycle. This calls onCreateStreamView and onDisposeStreamView\n * appropriately based on react lifecycle events and prop changes.\n *\n * @remarks\n *\n * Notes on handling changes to scaling mode:\n *\n * Ideally we have access to the original StreamRenderView and can call view.updateScalingMode() and do not need to recreate the stream view.\n * However, to support backwards compat we cannot guarantee this. If we don't have access to the original StreamRenderView we need to dispose\n * the old view and create a new one.\n *\n * Supporting both of these scenarios became too complex and fragile. When we introduce a breaking change this should be update to ensure that\n * onCreateStreamView _must_ return a view object with updateScalingMode and update logic in this hook to call view.updateScalingMode instead\n * of recreating the stream.\n *\n * @private\n */\nconst useVideoStreamLifecycleMaintainer = (\n props: VideoStreamLifecycleMaintainerProps\n): CreateVideoStreamViewResult | undefined => {\n const {\n isMirrored,\n isScreenSharingOn,\n isStreamAvailable,\n onCreateStreamView,\n onDisposeStreamView,\n renderElementExists,\n scalingMode,\n streamId,\n /* @conditional-compile-remove(media-access) */\n isVideoPermitted\n } = props;\n\n const [videoStreamViewResult, setVideoStreamViewResult] = useState<CreateVideoStreamViewResult | undefined>();\n\n const createStreamViewTrampoline = useCallback(\n (\n isStreamAvailable?: boolean,\n renderElementExists?: boolean,\n /* @conditional-compile-remove(media-access) */ isVideoPermitted?: boolean\n ) => {\n /* @conditional-compile-remove(media-access) */\n if (isVideoPermitted === false) {\n return;\n }\n\n if (isStreamAvailable && !renderElementExists) {\n onCreateStreamView?.({ isMirrored, scalingMode })?.then((result) => {\n result && setVideoStreamViewResult(result);\n });\n }\n },\n [isMirrored, onCreateStreamView, scalingMode]\n );\n\n useEffect(() => {\n createStreamViewTrampoline(\n isStreamAvailable,\n renderElementExists,\n /* @conditional-compile-remove(media-access) */ isVideoPermitted\n );\n\n // Always clean up element to make tile up to date and be able to dispose correctly\n return () => {\n if (renderElementExists) {\n // TODO: Remove `if isScreenSharingOn` when we isolate dispose behavior for screen share\n if (!isScreenSharingOn) {\n onDisposeStreamView?.();\n }\n } else {\n callingComponentLogger.warning('Stream view element does not exist when disposing stream view');\n }\n };\n }, [\n isMirrored,\n isScreenSharingOn,\n isStreamAvailable,\n onCreateStreamView,\n onDisposeStreamView,\n renderElementExists,\n scalingMode,\n streamId,\n createStreamViewTrampoline,\n /* @conditional-compile-remove(media-access) */\n isVideoPermitted\n ]);\n\n // The execution order for above useEffect is onCreateRemoteStreamView =>(async time gap) RenderElement generated => element disposed => onDisposeRemoteStreamView\n // Element disposed could happen during async time gap, which still cause leaks for unused renderElement.\n // Need to do an entire cleanup when remoteTile gets disposed and make sure element gets correctly disposed\n useEffect(() => {\n return () => {\n // TODO: Remove `if isScreenSharingOn` when we isolate dispose behavior for screen share\n if (!isScreenSharingOn) {\n onDisposeStreamView?.();\n }\n };\n }, [isScreenSharingOn, onDisposeStreamView]);\n\n return videoStreamViewResult;\n};\n\n/** @private */\nexport interface LocalVideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateLocalStreamView?: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeLocalStreamView?: () => void;\n}\n\n/**\n * Extension of {@link useVideoStreamLifecycleMaintainer} specifically for local video streams\n *\n * @private\n */\nexport const useLocalVideoStreamLifecycleMaintainer = (\n props: LocalVideoStreamLifecycleMaintainerProps\n): CreateVideoStreamViewResult | undefined => {\n const { onCreateLocalStreamView, onDisposeLocalStreamView } = props;\n const onCreateStreamView = useMemo(\n () => (options?: VideoStreamOptions) => {\n return onCreateLocalStreamView?.(options);\n },\n [onCreateLocalStreamView]\n );\n const onDisposeStreamView = useMemo(\n () => () => {\n onDisposeLocalStreamView?.();\n },\n [onDisposeLocalStreamView]\n );\n return useVideoStreamLifecycleMaintainer({\n ...props,\n onCreateStreamView,\n onDisposeStreamView\n });\n};\n\n/** @private */\nexport interface RemoteVideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n remoteParticipantId: string;\n}\n\n/**\n * Extension of {@link useVideoStreamLifecycleMaintainer} specifically for remote video streams\n *\n * @private\n */\nexport const useRemoteVideoStreamLifecycleMaintainer = (\n props: RemoteVideoStreamLifecycleMaintainerProps\n): CreateVideoStreamViewResult | undefined => {\n const { remoteParticipantId, onCreateRemoteStreamView, onDisposeRemoteStreamView } = props;\n const onCreateStreamView = useMemo(\n () => (options?: VideoStreamOptions) => {\n return onCreateRemoteStreamView?.(remoteParticipantId, options);\n },\n [onCreateRemoteStreamView, remoteParticipantId]\n );\n const onDisposeStreamView = useMemo(\n () => () => {\n onDisposeRemoteStreamView?.(remoteParticipantId);\n },\n [onDisposeRemoteStreamView, remoteParticipantId]\n );\n\n return useVideoStreamLifecycleMaintainer({\n ...props,\n onCreateStreamView,\n onDisposeStreamView\n });\n};\n"]}
1
+ {"version":3,"file":"useVideoStreamLifecycleMaintainer.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;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AC,CAChD,CAAC;IACF,MAAM,mBAAmB,GAAG,OAAO,CACjC,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,yBAAyB,aAAzB,yBAAyB,uBAAzB,yBAAyB,CAAG,mBAAmB,CAAC,CAAC;IACnD,CAAC,EACD,CAAC,yBAAyB,EAAE,mBAAmB,CAAC,CACjD,CAAC;IAEF,OAAO,iCAAiC,iCACnC,KAAK,KACR,kBAAkB;QAClB,mBAAmB,IACnB,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { useEffect, useMemo, useState } from 'react';\nimport { VideoStreamOptions, CreateVideoStreamViewResult, ViewScalingMode } from '../../types';\nimport { callingComponentLogger } from '../utils/Logger';\n\n/** @private */\nexport interface VideoStreamLifecycleMaintainerExtendableProps {\n isStreamAvailable?: boolean;\n renderElementExists?: boolean;\n isMirrored?: boolean;\n scalingMode?: ViewScalingMode;\n isScreenSharingOn?: boolean;\n streamId?: number;\n isVideoPermitted?: boolean;\n}\n\ninterface VideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateStreamView: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult> | undefined;\n onDisposeStreamView: () => void | undefined;\n}\n\n/**\n * Helper hook to maintain the video stream lifecycle. This calls onCreateStreamView and onDisposeStreamView\n * appropriately based on react lifecycle events and prop changes.\n *\n * @remarks\n *\n * Notes on handling changes to scaling mode:\n *\n * Ideally we have access to the original StreamRenderView and can call view.updateScalingMode() and do not need to recreate the stream view.\n * However, to support backwards compat we cannot guarantee this. If we don't have access to the original StreamRenderView we need to dispose\n * the old view and create a new one.\n *\n * Supporting both of these scenarios became too complex and fragile. When we introduce a breaking change this should be update to ensure that\n * onCreateStreamView _must_ return a view object with updateScalingMode and update logic in this hook to call view.updateScalingMode instead\n * of recreating the stream.\n *\n * @private\n */\nconst useVideoStreamLifecycleMaintainer = (\n props: VideoStreamLifecycleMaintainerProps\n): CreateVideoStreamViewResult | undefined => {\n const {\n isMirrored,\n isScreenSharingOn,\n isStreamAvailable,\n onCreateStreamView,\n onDisposeStreamView,\n renderElementExists,\n scalingMode,\n streamId,\n isVideoPermitted\n } = props;\n\n const [videoStreamViewResult, setVideoStreamViewResult] = useState<CreateVideoStreamViewResult | undefined>();\n\n useEffect(() => {\n if (isVideoPermitted !== false && isStreamAvailable && !renderElementExists) {\n onCreateStreamView?.({ isMirrored, scalingMode })?.then((result) => {\n result && setVideoStreamViewResult(result);\n });\n }\n\n // Always clean up element to make tile up to date and be able to dispose correctly\n return () => {\n if (renderElementExists) {\n // TODO: Remove `if isScreenSharingOn` when we isolate dispose behavior for screen share\n if (!isScreenSharingOn) {\n onDisposeStreamView?.();\n }\n } else {\n callingComponentLogger.warning('Stream view element does not exist when disposing stream view');\n }\n };\n }, [\n isMirrored,\n isScreenSharingOn,\n isStreamAvailable,\n onCreateStreamView,\n onDisposeStreamView,\n renderElementExists,\n scalingMode,\n streamId,\n isVideoPermitted\n ]);\n\n // The execution order for above useEffect is onCreateRemoteStreamView =>(async time gap) RenderElement generated => element disposed => onDisposeRemoteStreamView\n // Element disposed could happen during async time gap, which still cause leaks for unused renderElement.\n // Need to do an entire cleanup when remoteTile gets disposed and make sure element gets correctly disposed\n useEffect(() => {\n return () => {\n // TODO: Remove `if isScreenSharingOn` when we isolate dispose behavior for screen share\n if (!isScreenSharingOn) {\n onDisposeStreamView?.();\n }\n };\n }, [isScreenSharingOn, onDisposeStreamView]);\n\n return videoStreamViewResult;\n};\n\n/** @private */\nexport interface LocalVideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateLocalStreamView?: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeLocalStreamView?: () => void;\n}\n\n/**\n * Extension of {@link useVideoStreamLifecycleMaintainer} specifically for local video streams\n *\n * @private\n */\nexport const useLocalVideoStreamLifecycleMaintainer = (\n props: LocalVideoStreamLifecycleMaintainerProps\n): CreateVideoStreamViewResult | undefined => {\n const { onCreateLocalStreamView, onDisposeLocalStreamView } = props;\n const onCreateStreamView = useMemo(\n () => (options?: VideoStreamOptions) => {\n return onCreateLocalStreamView?.(options);\n },\n [onCreateLocalStreamView]\n );\n const onDisposeStreamView = useMemo(\n () => () => {\n onDisposeLocalStreamView?.();\n },\n [onDisposeLocalStreamView]\n );\n return useVideoStreamLifecycleMaintainer({\n ...props,\n onCreateStreamView,\n onDisposeStreamView\n });\n};\n\n/** @private */\nexport interface RemoteVideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n remoteParticipantId: string;\n}\n\n/**\n * Extension of {@link useVideoStreamLifecycleMaintainer} specifically for remote video streams\n *\n * @private\n */\nexport const useRemoteVideoStreamLifecycleMaintainer = (\n props: RemoteVideoStreamLifecycleMaintainerProps\n): CreateVideoStreamViewResult | undefined => {\n const { remoteParticipantId, onCreateRemoteStreamView, onDisposeRemoteStreamView } = props;\n const onCreateStreamView = useMemo(\n () => (options?: VideoStreamOptions) => {\n return onCreateRemoteStreamView?.(remoteParticipantId, options);\n },\n [onCreateRemoteStreamView, remoteParticipantId]\n );\n const onDisposeStreamView = useMemo(\n () => () => {\n onDisposeRemoteStreamView?.(remoteParticipantId);\n },\n [onDisposeRemoteStreamView, remoteParticipantId]\n );\n\n return useVideoStreamLifecycleMaintainer({\n ...props,\n onCreateStreamView,\n onDisposeStreamView\n });\n};\n"]}
@@ -8,15 +8,7 @@ import { _preventDismissOnEvent as preventDismissOnEvent } from "../../../../acs
8
8
  */
9
9
  export const useVideoTileContextualMenuProps = (props) => {
10
10
  var _a;
11
- const { participant, view, strings, isPinned, onPinParticipant, onUnpinParticipant, onUpdateScalingMode, disablePinMenuItem, toggleAnnouncerString, spotlightedParticipantUserIds = [], isSpotlighted, onStartSpotlight, onStopSpotlight, maxParticipantsToSpotlight, myUserId, onMuteParticipant,
12
- /* @conditional-compile-remove(media-access) */
13
- onForbidAudio,
14
- /* @conditional-compile-remove(media-access) */
15
- onPermitAudio,
16
- /* @conditional-compile-remove(media-access) */
17
- onForbidVideo,
18
- /* @conditional-compile-remove(media-access) */
19
- onPermitVideo } = props;
11
+ const { participant, view, strings, isPinned, onPinParticipant, onUnpinParticipant, onUpdateScalingMode, disablePinMenuItem, toggleAnnouncerString, spotlightedParticipantUserIds = [], isSpotlighted, onStartSpotlight, onStopSpotlight, maxParticipantsToSpotlight, myUserId, onMuteParticipant, onForbidAudio, onPermitAudio, onForbidVideo, onPermitVideo } = props;
20
12
  const scalingMode = useMemo(() => {
21
13
  var _a;
22
14
  return (_a = props.participant.videoStream) === null || _a === void 0 ? void 0 : _a.scalingMode;
@@ -38,7 +30,6 @@ export const useVideoTileContextualMenuProps = (props) => {
38
30
  disabled: participant.isMuted
39
31
  });
40
32
  }
41
- /* @conditional-compile-remove(media-access) */
42
33
  if (participant.canAudioBeForbidden &&
43
34
  participant.mediaAccess &&
44
35
  !participant.mediaAccess.isAudioPermitted &&
@@ -55,7 +46,6 @@ export const useVideoTileContextualMenuProps = (props) => {
55
46
  ariaLabel: strings === null || strings === void 0 ? void 0 : strings.permitAudioTileMenuLabel
56
47
  });
57
48
  }
58
- /* @conditional-compile-remove(media-access) */
59
49
  if (participant.canAudioBeForbidden && ((_a = participant.mediaAccess) === null || _a === void 0 ? void 0 : _a.isAudioPermitted) && onForbidAudio) {
60
50
  items.push({
61
51
  key: 'forbidAudio',
@@ -69,7 +59,6 @@ export const useVideoTileContextualMenuProps = (props) => {
69
59
  ariaLabel: strings === null || strings === void 0 ? void 0 : strings.forbidAudioTileMenuLabel
70
60
  });
71
61
  }
72
- /* @conditional-compile-remove(media-access) */
73
62
  if (participant.canVideoBeForbidden &&
74
63
  participant.mediaAccess &&
75
64
  !participant.mediaAccess.isVideoPermitted &&
@@ -86,7 +75,6 @@ export const useVideoTileContextualMenuProps = (props) => {
86
75
  ariaLabel: strings === null || strings === void 0 ? void 0 : strings.permitVideoTileMenuLabel
87
76
  });
88
77
  }
89
- /* @conditional-compile-remove(media-access) */
90
78
  if (participant.canVideoBeForbidden && ((_b = participant.mediaAccess) === null || _b === void 0 ? void 0 : _b.isVideoPermitted) && onForbidVideo) {
91
79
  items.push({
92
80
  key: 'forbidVideo',
@@ -244,19 +232,12 @@ export const useVideoTileContextualMenuProps = (props) => {
244
232
  onStartSpotlight,
245
233
  onUpdateScalingMode,
246
234
  view,
247
- /* @conditional-compile-remove(media-access) */
248
235
  participant.canAudioBeForbidden,
249
- /* @conditional-compile-remove(media-access) */
250
236
  participant.canVideoBeForbidden,
251
- /* @conditional-compile-remove(media-access) */
252
237
  participant.mediaAccess,
253
- /* @conditional-compile-remove(media-access) */
254
238
  onPermitAudio,
255
- /* @conditional-compile-remove(media-access) */
256
239
  onForbidAudio,
257
- /* @conditional-compile-remove(media-access) */
258
240
  onPermitVideo,
259
- /* @conditional-compile-remove(media-access) */
260
241
  onForbidVideo
261
242
  ]);
262
243
  return contextualMenuProps;
@@ -1 +1 @@
1
- {"version":3,"file":"useVideoTileContextualMenuProps.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,aAAa,EAAE,sCAAgC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,sBAAsB,IAAI,qBAAqB,EAAE,sCAAgC;AAE1F;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,KAiD/C,EAAoC,EAAE;;IACrC,MAAM,EACJ,WAAW,EACX,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAq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EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAC;IACvG,CAAC,EAAE;QACD,iBAAiB;QACjB,OAAO;QACP,WAAW,CAAC,OAAO;QACnB,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,WAAW;QACvB,QAAQ;QACR,aAAa;QACb,WAAW;QACX,kBAAkB;QAClB,gBAAgB;QAChB,qBAAqB;QACrB,kBAAkB;QAClB,QAAQ;QACR,eAAe;QACf,6BAA6B;QAC7B,0BAA0B;QAC1B,gBAAgB;QAChB,mBAAmB;QACnB,IAAI;QACJ,+CAA+C;QAC/C,WAAW,CAAC,mBAAmB;QAC/B,+CAA+C;QAC/C,WAAW,CAAC,mBAAmB;QAC/B,+CAA+C;QAC/C,WAAW,CAAC,WAAW;QACvB,+CAA+C;QAC/C,aAAa;QACb,+CAA+C;QAC/C,aAAa;QACb,+CAA+C;QAC/C,aAAa;QACb,+CAA+C;QAC/C,aAAa;KACd,CAAC,CAAC;IAEH,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IContextualMenuItem, IContextualMenuProps } from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useMemo } from 'react';\nimport { VideoGalleryParticipant, ViewScalingMode } from '../../types';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\nexport const useVideoTileContextualMenuProps = (props: {\n participant: VideoGalleryParticipant;\n strings?: {\n fitRemoteParticipantToFrame?: string;\n fillRemoteParticipantFrame?: string;\n pinParticipantForMe?: string;\n pinParticipantForMeLimitReached?: string;\n unpinParticipantForMe?: string;\n pinParticipantMenuItemAriaLabel?: string;\n unpinParticipantMenuItemAriaLabel?: string;\n pinnedParticipantAnnouncementAriaLabel?: string;\n unpinnedParticipantAnnouncementAriaLabel?: string;\n startSpotlightVideoTileMenuLabel?: string;\n addSpotlightVideoTileMenuLabel?: string;\n stopSpotlightVideoTileMenuLabel?: string;\n stopSpotlightOnSelfVideoTileMenuLabel?: string;\n spotlightLimitReachedMenuTitle?: string;\n muteParticipantMenuItemLabel?: string;\n /* @conditional-compile-remove(media-access) */\n forbidAudioTileMenuLabel?: string;\n /* @conditional-compile-remove(media-access) */\n permitAudioTileMenuLabel?: string;\n /* @conditional-compile-remove(media-access) */\n forbidVideoTileMenuLabel?: string;\n /* @conditional-compile-remove(media-access) */\n permitVideoTileMenuLabel?: string;\n };\n view?: { updateScalingMode: (scalingMode: ViewScalingMode) => Promise<void> };\n isPinned?: boolean;\n onPinParticipant?: (userId: string) => void;\n onUnpinParticipant?: (userId: string) => void;\n onUpdateScalingMode?: (userId: string, scalingMode: ViewScalingMode) => void;\n disablePinMenuItem?: boolean;\n toggleAnnouncerString?: (announcerString: string) => void;\n isSpotlighted?: boolean;\n spotlightedParticipantUserIds?: string[];\n onStartSpotlight?: (userIds: string[]) => void;\n onStopSpotlight?: (userIds: string[]) => void;\n maxParticipantsToSpotlight?: number;\n myUserId?: string;\n onMuteParticipant?: (userId: string) => void;\n /* @conditional-compile-remove(media-access) */\n onForbidAudio?: (userIds: string[]) => void;\n /* @conditional-compile-remove(media-access) */\n onPermitAudio?: (userIds: string[]) => void;\n /* @conditional-compile-remove(media-access) */\n onForbidVideo?: (userIds: string[]) => void;\n /* @conditional-compile-remove(media-access) */\n onPermitVideo?: (userIds: string[]) => void;\n}): IContextualMenuProps | undefined => {\n const {\n participant,\n view,\n strings,\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n onUpdateScalingMode,\n disablePinMenuItem,\n toggleAnnouncerString,\n spotlightedParticipantUserIds = [],\n isSpotlighted,\n onStartSpotlight,\n onStopSpotlight,\n maxParticipantsToSpotlight,\n myUserId,\n onMuteParticipant,\n /* @conditional-compile-remove(media-access) */\n onForbidAudio,\n /* @conditional-compile-remove(media-access) */\n onPermitAudio,\n /* @conditional-compile-remove(media-access) */\n onForbidVideo,\n /* @conditional-compile-remove(media-access) */\n onPermitVideo\n } = props;\n const scalingMode = useMemo(() => {\n return props.participant.videoStream?.scalingMode;\n }, [props.participant.videoStream?.scalingMode]);\n\n const contextualMenuProps: IContextualMenuProps | undefined = useMemo(() => {\n const items: IContextualMenuItem[] = [];\n if (onMuteParticipant && strings?.muteParticipantMenuItemLabel) {\n items.push({\n key: 'mute',\n text: strings?.muteParticipantMenuItemLabel,\n iconProps: {\n iconName: 'ContextualMenuMicMutedIcon',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onMuteParticipant(participant.userId),\n 'data-ui-id': 'video-tile-mute-participant',\n ariaLabel: strings?.muteParticipantMenuItemLabel,\n disabled: participant.isMuted\n });\n }\n\n /* @conditional-compile-remove(media-access) */\n if (\n participant.canAudioBeForbidden &&\n participant.mediaAccess &&\n !participant.mediaAccess.isAudioPermitted &&\n onPermitAudio\n ) {\n items.push({\n key: 'permitAudio',\n text: strings?.permitAudioTileMenuLabel,\n iconProps: {\n iconName: 'ControlButtonMicOn',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onPermitAudio([participant.userId]),\n 'data-ui-id': 'video-tile-permit-audio',\n ariaLabel: strings?.permitAudioTileMenuLabel\n });\n }\n /* @conditional-compile-remove(media-access) */\n if (participant.canAudioBeForbidden && participant.mediaAccess?.isAudioPermitted && onForbidAudio) {\n items.push({\n key: 'forbidAudio',\n text: strings?.forbidAudioTileMenuLabel,\n iconProps: {\n iconName: 'ControlButtonMicProhibited',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onForbidAudio([participant.userId]),\n 'data-ui-id': 'video-tile-forbid-audio',\n ariaLabel: strings?.forbidAudioTileMenuLabel\n });\n }\n\n /* @conditional-compile-remove(media-access) */\n if (\n participant.canVideoBeForbidden &&\n participant.mediaAccess &&\n !participant.mediaAccess.isVideoPermitted &&\n onPermitVideo\n ) {\n items.push({\n key: 'permitVideo',\n text: strings?.permitVideoTileMenuLabel,\n iconProps: {\n iconName: 'ControlButtonCameraOn',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onPermitVideo([participant.userId]),\n 'data-ui-id': 'video-tile-permit-video',\n ariaLabel: strings?.permitVideoTileMenuLabel\n });\n }\n /* @conditional-compile-remove(media-access) */\n if (participant.canVideoBeForbidden && participant.mediaAccess?.isVideoPermitted && onForbidVideo) {\n items.push({\n key: 'forbidVideo',\n text: strings?.forbidVideoTileMenuLabel,\n iconProps: {\n iconName: 'ControlButtonCameraProhibited',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onForbidVideo([participant.userId]),\n 'data-ui-id': 'video-tile-forbid-video',\n ariaLabel: strings?.forbidVideoTileMenuLabel\n });\n }\n\n if (isPinned !== undefined) {\n if (isPinned && onUnpinParticipant && strings?.unpinParticipantForMe) {\n let unpinActionString: string | undefined = undefined;\n if (toggleAnnouncerString && strings.unpinParticipantMenuItemAriaLabel && participant.displayName) {\n unpinActionString = _formatString(strings?.unpinParticipantMenuItemAriaLabel, {\n participantName: participant.displayName\n });\n }\n items.push({\n key: 'unpin',\n text: strings.unpinParticipantForMe,\n iconProps: {\n iconName: 'UnpinParticipant',\n styles: { root: { lineHeight: '1rem', textAlign: 'center' } }\n },\n onClick: () => {\n onUnpinParticipant(participant.userId);\n unpinActionString && toggleAnnouncerString?.(unpinActionString);\n },\n 'data-ui-id': 'video-tile-unpin-participant-button',\n ariaLabel: unpinActionString\n });\n }\n if (!isPinned && onPinParticipant && strings?.pinParticipantForMe) {\n let pinActionString: string | undefined = undefined;\n if (toggleAnnouncerString && strings.pinnedParticipantAnnouncementAriaLabel && participant.displayName) {\n pinActionString = _formatString(strings?.pinnedParticipantAnnouncementAriaLabel, {\n participantName: participant.displayName\n });\n }\n items.push({\n key: 'pin',\n text: disablePinMenuItem ? strings.pinParticipantForMeLimitReached : strings.pinParticipantForMe,\n iconProps: {\n iconName: 'PinParticipant',\n styles: { root: { lineHeight: '1rem', textAlign: 'center' } }\n },\n onClick: () => {\n onPinParticipant(participant.userId);\n pinActionString && toggleAnnouncerString?.(pinActionString);\n },\n 'data-ui-id': 'video-tile-pin-participant-button',\n disabled: disablePinMenuItem || isSpotlighted,\n ariaLabel: strings.pinParticipantForMe\n });\n }\n }\n\n if (isSpotlighted) {\n const stopSpotlightMenuLabel =\n myUserId === participant.userId\n ? strings?.stopSpotlightOnSelfVideoTileMenuLabel\n : strings?.stopSpotlightVideoTileMenuLabel;\n if (onStopSpotlight && participant.userId && strings?.stopSpotlightVideoTileMenuLabel) {\n items.push({\n key: 'stopSpotlight',\n text: stopSpotlightMenuLabel,\n iconProps: {\n iconName: 'StopSpotlightContextualMenuItem',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onStopSpotlight([participant.userId]),\n ariaLabel: strings.stopSpotlightVideoTileMenuLabel\n });\n }\n } else {\n const startSpotlightMenuLabel =\n spotlightedParticipantUserIds && spotlightedParticipantUserIds.length > 0\n ? strings?.addSpotlightVideoTileMenuLabel\n : strings?.startSpotlightVideoTileMenuLabel;\n const maxSpotlightedParticipantsReached = maxParticipantsToSpotlight\n ? spotlightedParticipantUserIds.length >= maxParticipantsToSpotlight\n : false;\n if (onStartSpotlight && participant.userId && startSpotlightMenuLabel) {\n items.push({\n key: 'startSpotlight',\n text: startSpotlightMenuLabel,\n iconProps: {\n iconName: 'StartSpotlightContextualMenuItem',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onStartSpotlight([participant.userId]),\n ariaLabel: startSpotlightMenuLabel,\n disabled: maxSpotlightedParticipantsReached,\n title: maxSpotlightedParticipantsReached ? strings?.spotlightLimitReachedMenuTitle : undefined\n });\n }\n }\n if (scalingMode) {\n if (scalingMode === 'Crop' && strings?.fitRemoteParticipantToFrame) {\n items.push({\n key: 'fitRemoteParticipantToFrame',\n text: strings.fitRemoteParticipantToFrame,\n iconProps: {\n iconName: 'VideoTileScaleFit',\n styles: { root: { lineHeight: '1rem', textAlign: 'center' } }\n },\n onClick: () => {\n onUpdateScalingMode?.(participant.userId, 'Fit');\n view?.updateScalingMode('Fit');\n },\n 'data-ui-id': 'video-tile-fit-to-frame',\n ariaLabel: strings.fitRemoteParticipantToFrame\n });\n } else if (scalingMode === 'Fit' && strings?.fillRemoteParticipantFrame) {\n items.push({\n key: 'fillRemoteParticipantFrame',\n text: strings.fillRemoteParticipantFrame,\n iconProps: {\n iconName: 'VideoTileScaleFill',\n styles: { root: { lineHeight: '1rem', textAlign: 'center' } }\n },\n onClick: () => {\n onUpdateScalingMode?.(participant.userId, 'Crop');\n view?.updateScalingMode('Crop');\n },\n 'data-ui-id': 'video-tile-fill-frame',\n ariaLabel: strings.fillRemoteParticipantFrame\n });\n }\n }\n if (items.length === 0) {\n return undefined;\n }\n\n return { items, styles: {}, calloutProps: { preventDismissOnEvent }, shouldFocusOnContainer: false };\n }, [\n onMuteParticipant,\n strings,\n participant.isMuted,\n participant.userId,\n participant.displayName,\n isPinned,\n isSpotlighted,\n scalingMode,\n onUnpinParticipant,\n onPinParticipant,\n toggleAnnouncerString,\n disablePinMenuItem,\n myUserId,\n onStopSpotlight,\n spotlightedParticipantUserIds,\n maxParticipantsToSpotlight,\n onStartSpotlight,\n onUpdateScalingMode,\n view,\n /* @conditional-compile-remove(media-access) */\n participant.canAudioBeForbidden,\n /* @conditional-compile-remove(media-access) */\n participant.canVideoBeForbidden,\n /* @conditional-compile-remove(media-access) */\n participant.mediaAccess,\n /* @conditional-compile-remove(media-access) */\n onPermitAudio,\n /* @conditional-compile-remove(media-access) */\n onForbidAudio,\n /* @conditional-compile-remove(media-access) */\n onPermitVideo,\n /* @conditional-compile-remove(media-access) */\n onForbidVideo\n ]);\n\n return contextualMenuProps;\n};\n"]}
1
+ {"version":3,"file":"useVideoTileContextualMenuProps.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,aAAa,EAAE,sCAAgC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAA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K,CAAC,EAAE,CAAC;YACvB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,qBAAqB,EAAE,EAAE,sBAAsB,EAAE,KAAK,EAAE,CAAC;IACvG,CAAC,EAAE;QACD,iBAAiB;QACjB,OAAO;QACP,WAAW,CAAC,OAAO;QACnB,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,WAAW;QACvB,QAAQ;QACR,aAAa;QACb,WAAW;QACX,kBAAkB;QAClB,gBAAgB;QAChB,qBAAqB;QACrB,kBAAkB;QAClB,QAAQ;QACR,eAAe;QACf,6BAA6B;QAC7B,0BAA0B;QAC1B,gBAAgB;QAChB,mBAAmB;QACnB,IAAI;QACJ,WAAW,CAAC,mBAAmB;QAC/B,WAAW,CAAC,mBAAmB;QAC/B,WAAW,CAAC,WAAW;QACvB,aAAa;QACb,aAAa;QACb,aAAa;QACb,aAAa;KACd,CAAC,CAAC;IAEH,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IContextualMenuItem, IContextualMenuProps } from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useMemo } from 'react';\nimport { VideoGalleryParticipant, ViewScalingMode } from '../../types';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\nexport const useVideoTileContextualMenuProps = (props: {\n participant: VideoGalleryParticipant;\n strings?: {\n fitRemoteParticipantToFrame?: string;\n fillRemoteParticipantFrame?: string;\n pinParticipantForMe?: string;\n pinParticipantForMeLimitReached?: string;\n unpinParticipantForMe?: string;\n pinParticipantMenuItemAriaLabel?: string;\n unpinParticipantMenuItemAriaLabel?: string;\n pinnedParticipantAnnouncementAriaLabel?: string;\n unpinnedParticipantAnnouncementAriaLabel?: string;\n startSpotlightVideoTileMenuLabel?: string;\n addSpotlightVideoTileMenuLabel?: string;\n stopSpotlightVideoTileMenuLabel?: string;\n stopSpotlightOnSelfVideoTileMenuLabel?: string;\n spotlightLimitReachedMenuTitle?: string;\n muteParticipantMenuItemLabel?: string;\n forbidAudioTileMenuLabel?: string;\n permitAudioTileMenuLabel?: string;\n forbidVideoTileMenuLabel?: string;\n permitVideoTileMenuLabel?: string;\n };\n view?: { updateScalingMode: (scalingMode: ViewScalingMode) => Promise<void> };\n isPinned?: boolean;\n onPinParticipant?: (userId: string) => void;\n onUnpinParticipant?: (userId: string) => void;\n onUpdateScalingMode?: (userId: string, scalingMode: ViewScalingMode) => void;\n disablePinMenuItem?: boolean;\n toggleAnnouncerString?: (announcerString: string) => void;\n isSpotlighted?: boolean;\n spotlightedParticipantUserIds?: string[];\n onStartSpotlight?: (userIds: string[]) => void;\n onStopSpotlight?: (userIds: string[]) => void;\n maxParticipantsToSpotlight?: number;\n myUserId?: string;\n onMuteParticipant?: (userId: string) => void;\n onForbidAudio?: (userIds: string[]) => void;\n onPermitAudio?: (userIds: string[]) => void;\n onForbidVideo?: (userIds: string[]) => void;\n onPermitVideo?: (userIds: string[]) => void;\n}): IContextualMenuProps | undefined => {\n const {\n participant,\n view,\n strings,\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n onUpdateScalingMode,\n disablePinMenuItem,\n toggleAnnouncerString,\n spotlightedParticipantUserIds = [],\n isSpotlighted,\n onStartSpotlight,\n onStopSpotlight,\n maxParticipantsToSpotlight,\n myUserId,\n onMuteParticipant,\n onForbidAudio,\n onPermitAudio,\n onForbidVideo,\n onPermitVideo\n } = props;\n const scalingMode = useMemo(() => {\n return props.participant.videoStream?.scalingMode;\n }, [props.participant.videoStream?.scalingMode]);\n\n const contextualMenuProps: IContextualMenuProps | undefined = useMemo(() => {\n const items: IContextualMenuItem[] = [];\n if (onMuteParticipant && strings?.muteParticipantMenuItemLabel) {\n items.push({\n key: 'mute',\n text: strings?.muteParticipantMenuItemLabel,\n iconProps: {\n iconName: 'ContextualMenuMicMutedIcon',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onMuteParticipant(participant.userId),\n 'data-ui-id': 'video-tile-mute-participant',\n ariaLabel: strings?.muteParticipantMenuItemLabel,\n disabled: participant.isMuted\n });\n }\n\n if (\n participant.canAudioBeForbidden &&\n participant.mediaAccess &&\n !participant.mediaAccess.isAudioPermitted &&\n onPermitAudio\n ) {\n items.push({\n key: 'permitAudio',\n text: strings?.permitAudioTileMenuLabel,\n iconProps: {\n iconName: 'ControlButtonMicOn',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onPermitAudio([participant.userId]),\n 'data-ui-id': 'video-tile-permit-audio',\n ariaLabel: strings?.permitAudioTileMenuLabel\n });\n }\n\n if (participant.canAudioBeForbidden && participant.mediaAccess?.isAudioPermitted && onForbidAudio) {\n items.push({\n key: 'forbidAudio',\n text: strings?.forbidAudioTileMenuLabel,\n iconProps: {\n iconName: 'ControlButtonMicProhibited',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onForbidAudio([participant.userId]),\n 'data-ui-id': 'video-tile-forbid-audio',\n ariaLabel: strings?.forbidAudioTileMenuLabel\n });\n }\n\n if (\n participant.canVideoBeForbidden &&\n participant.mediaAccess &&\n !participant.mediaAccess.isVideoPermitted &&\n onPermitVideo\n ) {\n items.push({\n key: 'permitVideo',\n text: strings?.permitVideoTileMenuLabel,\n iconProps: {\n iconName: 'ControlButtonCameraOn',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onPermitVideo([participant.userId]),\n 'data-ui-id': 'video-tile-permit-video',\n ariaLabel: strings?.permitVideoTileMenuLabel\n });\n }\n\n if (participant.canVideoBeForbidden && participant.mediaAccess?.isVideoPermitted && onForbidVideo) {\n items.push({\n key: 'forbidVideo',\n text: strings?.forbidVideoTileMenuLabel,\n iconProps: {\n iconName: 'ControlButtonCameraProhibited',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onForbidVideo([participant.userId]),\n 'data-ui-id': 'video-tile-forbid-video',\n ariaLabel: strings?.forbidVideoTileMenuLabel\n });\n }\n\n if (isPinned !== undefined) {\n if (isPinned && onUnpinParticipant && strings?.unpinParticipantForMe) {\n let unpinActionString: string | undefined = undefined;\n if (toggleAnnouncerString && strings.unpinParticipantMenuItemAriaLabel && participant.displayName) {\n unpinActionString = _formatString(strings?.unpinParticipantMenuItemAriaLabel, {\n participantName: participant.displayName\n });\n }\n items.push({\n key: 'unpin',\n text: strings.unpinParticipantForMe,\n iconProps: {\n iconName: 'UnpinParticipant',\n styles: { root: { lineHeight: '1rem', textAlign: 'center' } }\n },\n onClick: () => {\n onUnpinParticipant(participant.userId);\n unpinActionString && toggleAnnouncerString?.(unpinActionString);\n },\n 'data-ui-id': 'video-tile-unpin-participant-button',\n ariaLabel: unpinActionString\n });\n }\n if (!isPinned && onPinParticipant && strings?.pinParticipantForMe) {\n let pinActionString: string | undefined = undefined;\n if (toggleAnnouncerString && strings.pinnedParticipantAnnouncementAriaLabel && participant.displayName) {\n pinActionString = _formatString(strings?.pinnedParticipantAnnouncementAriaLabel, {\n participantName: participant.displayName\n });\n }\n items.push({\n key: 'pin',\n text: disablePinMenuItem ? strings.pinParticipantForMeLimitReached : strings.pinParticipantForMe,\n iconProps: {\n iconName: 'PinParticipant',\n styles: { root: { lineHeight: '1rem', textAlign: 'center' } }\n },\n onClick: () => {\n onPinParticipant(participant.userId);\n pinActionString && toggleAnnouncerString?.(pinActionString);\n },\n 'data-ui-id': 'video-tile-pin-participant-button',\n disabled: disablePinMenuItem || isSpotlighted,\n ariaLabel: strings.pinParticipantForMe\n });\n }\n }\n\n if (isSpotlighted) {\n const stopSpotlightMenuLabel =\n myUserId === participant.userId\n ? strings?.stopSpotlightOnSelfVideoTileMenuLabel\n : strings?.stopSpotlightVideoTileMenuLabel;\n if (onStopSpotlight && participant.userId && strings?.stopSpotlightVideoTileMenuLabel) {\n items.push({\n key: 'stopSpotlight',\n text: stopSpotlightMenuLabel,\n iconProps: {\n iconName: 'StopSpotlightContextualMenuItem',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onStopSpotlight([participant.userId]),\n ariaLabel: strings.stopSpotlightVideoTileMenuLabel\n });\n }\n } else {\n const startSpotlightMenuLabel =\n spotlightedParticipantUserIds && spotlightedParticipantUserIds.length > 0\n ? strings?.addSpotlightVideoTileMenuLabel\n : strings?.startSpotlightVideoTileMenuLabel;\n const maxSpotlightedParticipantsReached = maxParticipantsToSpotlight\n ? spotlightedParticipantUserIds.length >= maxParticipantsToSpotlight\n : false;\n if (onStartSpotlight && participant.userId && startSpotlightMenuLabel) {\n items.push({\n key: 'startSpotlight',\n text: startSpotlightMenuLabel,\n iconProps: {\n iconName: 'StartSpotlightContextualMenuItem',\n styles: { root: { lineHeight: 0 } }\n },\n onClick: () => onStartSpotlight([participant.userId]),\n ariaLabel: startSpotlightMenuLabel,\n disabled: maxSpotlightedParticipantsReached,\n title: maxSpotlightedParticipantsReached ? strings?.spotlightLimitReachedMenuTitle : undefined\n });\n }\n }\n if (scalingMode) {\n if (scalingMode === 'Crop' && strings?.fitRemoteParticipantToFrame) {\n items.push({\n key: 'fitRemoteParticipantToFrame',\n text: strings.fitRemoteParticipantToFrame,\n iconProps: {\n iconName: 'VideoTileScaleFit',\n styles: { root: { lineHeight: '1rem', textAlign: 'center' } }\n },\n onClick: () => {\n onUpdateScalingMode?.(participant.userId, 'Fit');\n view?.updateScalingMode('Fit');\n },\n 'data-ui-id': 'video-tile-fit-to-frame',\n ariaLabel: strings.fitRemoteParticipantToFrame\n });\n } else if (scalingMode === 'Fit' && strings?.fillRemoteParticipantFrame) {\n items.push({\n key: 'fillRemoteParticipantFrame',\n text: strings.fillRemoteParticipantFrame,\n iconProps: {\n iconName: 'VideoTileScaleFill',\n styles: { root: { lineHeight: '1rem', textAlign: 'center' } }\n },\n onClick: () => {\n onUpdateScalingMode?.(participant.userId, 'Crop');\n view?.updateScalingMode('Crop');\n },\n 'data-ui-id': 'video-tile-fill-frame',\n ariaLabel: strings.fillRemoteParticipantFrame\n });\n }\n }\n if (items.length === 0) {\n return undefined;\n }\n\n return { items, styles: {}, calloutProps: { preventDismissOnEvent }, shouldFocusOnContainer: false };\n }, [\n onMuteParticipant,\n strings,\n participant.isMuted,\n participant.userId,\n participant.displayName,\n isPinned,\n isSpotlighted,\n scalingMode,\n onUnpinParticipant,\n onPinParticipant,\n toggleAnnouncerString,\n disablePinMenuItem,\n myUserId,\n onStopSpotlight,\n spotlightedParticipantUserIds,\n maxParticipantsToSpotlight,\n onStartSpotlight,\n onUpdateScalingMode,\n view,\n participant.canAudioBeForbidden,\n participant.canVideoBeForbidden,\n participant.mediaAccess,\n onPermitAudio,\n onForbidAudio,\n onPermitVideo,\n onForbidVideo\n ]);\n\n return contextualMenuProps;\n};\n"]}
@@ -84,15 +84,7 @@ export const VideoGallery = (props) => {
84
84
  /* @conditional-compile-remove(together-mode) */
85
85
  togetherModeSeatingCoordinates,
86
86
  /* @conditional-compile-remove(together-mode) */
87
- onDisposeTogetherModeStreamView,
88
- /* @conditional-compile-remove(media-access) */
89
- onForbidAudio,
90
- /* @conditional-compile-remove(media-access) */
91
- onPermitAudio,
92
- /* @conditional-compile-remove(media-access) */
93
- onForbidVideo,
94
- /* @conditional-compile-remove(media-access) */
95
- onPermitVideo } = props;
87
+ onDisposeTogetherModeStreamView, onForbidAudio, onPermitAudio, onForbidVideo, onPermitVideo } = props;
96
88
  const ids = useIdentifiers();
97
89
  const theme = useTheme();
98
90
  const localeStrings = useLocale().strings.videoGallery;
@@ -150,9 +142,7 @@ export const VideoGallery = (props) => {
150
142
  return layout === 'default' ? strings.localVideoLabel : isNarrow ? '' : strings.localVideoLabel;
151
143
  };
152
144
  return (React.createElement(Stack, { styles: localVideoTileContainerStyles, key: "local-video-tile-key" },
153
- React.createElement(_LocalVideoTile, { alwaysShowLabelBackground: videoTilesOptions === null || videoTilesOptions === void 0 ? void 0 : videoTilesOptions.alwaysShowLabelBackground, 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: showDisplayNameTrampoline(), initialsName: initialsName, localVideoViewOptions: localVideoViewOptions, onRenderAvatar: onRenderAvatar, showLabel: showLocalVideoTileLabel, showMuteIndicator: showMuteIndicator, showCameraSwitcherInLocalPreview: showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps: localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel: strings.localVideoCameraSwitcherLabel, localVideoSelectedDescription: strings.localVideoSelectedDescription, styles: localVideoTileStyles, raisedHand: localParticipant.raisedHand, reaction: localParticipant.reaction, spotlightedParticipantUserIds: spotlightedParticipants, isSpotlighted: isSpotlighted, onStartSpotlight: onStartLocalSpotlight, onStopSpotlight: onStopLocalSpotlight, maxParticipantsToSpotlight: maxParticipantsToSpotlight, menuKind: remoteVideoTileMenu ? (remoteVideoTileMenu.kind === 'drawer' ? 'drawer' : 'contextual') : undefined, drawerMenuHostId: drawerMenuHostId, strings: strings, reactionResources: reactionResources, participantsCount: remoteParticipants.length + 1, isScreenSharingOn: localParticipant.isScreenSharingOn,
154
- /* @conditional-compile-remove(media-access) */
155
- mediaAccess: localParticipant.mediaAccess })));
145
+ React.createElement(_LocalVideoTile, { alwaysShowLabelBackground: videoTilesOptions === null || videoTilesOptions === void 0 ? void 0 : videoTilesOptions.alwaysShowLabelBackground, 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: showDisplayNameTrampoline(), initialsName: initialsName, localVideoViewOptions: localVideoViewOptions, onRenderAvatar: onRenderAvatar, showLabel: showLocalVideoTileLabel, showMuteIndicator: showMuteIndicator, showCameraSwitcherInLocalPreview: showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps: localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel: strings.localVideoCameraSwitcherLabel, localVideoSelectedDescription: strings.localVideoSelectedDescription, styles: localVideoTileStyles, raisedHand: localParticipant.raisedHand, reaction: localParticipant.reaction, spotlightedParticipantUserIds: spotlightedParticipants, isSpotlighted: isSpotlighted, onStartSpotlight: onStartLocalSpotlight, onStopSpotlight: onStopLocalSpotlight, maxParticipantsToSpotlight: maxParticipantsToSpotlight, menuKind: remoteVideoTileMenu ? (remoteVideoTileMenu.kind === 'drawer' ? 'drawer' : 'contextual') : undefined, drawerMenuHostId: drawerMenuHostId, strings: strings, reactionResources: reactionResources, participantsCount: remoteParticipants.length + 1, isScreenSharingOn: localParticipant.isScreenSharingOn, mediaAccess: localParticipant.mediaAccess })));
156
146
  }, [
157
147
  isNarrow,
158
148
  localParticipant,
@@ -232,15 +222,7 @@ export const VideoGallery = (props) => {
232
222
  ? remoteVideoTileMenu.kind === 'drawer'
233
223
  ? 'drawer'
234
224
  : 'contextual'
235
- : undefined, drawerMenuHostId: drawerMenuHostId, onPinParticipant: onPinParticipant, onUnpinParticipant: onUnpinParticipant, onUpdateScalingMode: onUpdateScalingMode, isPinned: isPinned, disablePinMenuItem: pinnedParticipants.length >= MAX_PINNED_REMOTE_VIDEO_TILES, toggleAnnouncerString: toggleAnnouncerString, spotlightedParticipantUserIds: spotlightedParticipants, isSpotlighted: isSpotlighted, onStartSpotlight: onStartRemoteSpotlight, onStopSpotlight: onStopRemoteSpotlight, maxParticipantsToSpotlight: maxParticipantsToSpotlight, reactionResources: reactionResources, onMuteParticipant: onMuteParticipant,
236
- /* @conditional-compile-remove(media-access) */
237
- onForbidAudio: onForbidAudio,
238
- /* @conditional-compile-remove(media-access) */
239
- onPermitAudio: onPermitAudio,
240
- /* @conditional-compile-remove(media-access) */
241
- onForbidVideo: onForbidVideo,
242
- /* @conditional-compile-remove(media-access) */
243
- onPermitVideo: onPermitVideo }));
225
+ : undefined, drawerMenuHostId: drawerMenuHostId, onPinParticipant: onPinParticipant, onUnpinParticipant: onUnpinParticipant, onUpdateScalingMode: onUpdateScalingMode, isPinned: isPinned, disablePinMenuItem: pinnedParticipants.length >= MAX_PINNED_REMOTE_VIDEO_TILES, toggleAnnouncerString: toggleAnnouncerString, spotlightedParticipantUserIds: spotlightedParticipants, isSpotlighted: isSpotlighted, onStartSpotlight: onStartRemoteSpotlight, onStopSpotlight: onStopRemoteSpotlight, maxParticipantsToSpotlight: maxParticipantsToSpotlight, reactionResources: reactionResources, onMuteParticipant: onMuteParticipant, onForbidAudio: onForbidAudio, onPermitAudio: onPermitAudio, onForbidVideo: onForbidVideo, onPermitVideo: onPermitVideo }));
244
226
  }, [
245
227
  selectedScalingModeState,
246
228
  pinnedParticipants,
@@ -263,13 +245,9 @@ export const VideoGallery = (props) => {
263
245
  maxParticipantsToSpotlight,
264
246
  reactionResources,
265
247
  onMuteParticipant,
266
- /* @conditional-compile-remove(media-access) */
267
248
  onForbidAudio,
268
- /* @conditional-compile-remove(media-access) */
269
249
  onPermitAudio,
270
- /* @conditional-compile-remove(media-access) */
271
250
  onForbidVideo,
272
- /* @conditional-compile-remove(media-access) */
273
251
  onPermitVideo,
274
252
  remoteVideoViewOptions
275
253
  ]);
@@ -282,7 +260,7 @@ export const VideoGallery = (props) => {
282
260
  ? localScreenShareStreamComponent
283
261
  : undefined;
284
262
  /* @conditional-compile-remove(together-mode) */
285
- const togetherModeStreamComponent = useMemo(() => (React.createElement(TogetherModeStream, { startTogetherModeEnabled: startTogetherModeEnabled, isTogetherModeActive: isTogetherModeActive, onCreateTogetherModeStreamView: onCreateTogetherModeStreamView, onStartTogetherMode: onStartTogetherMode, onDisposeTogetherModeStreamView: onDisposeTogetherModeStreamView, onSetTogetherModeSceneSize: onSetTogetherModeSceneSize, togetherModeStreams: togetherModeStreams, seatingCoordinates: togetherModeSeatingCoordinates, localParticipant: localParticipant, remoteParticipants: remoteParticipants, reactionResources: reactionResources, screenShareComponent: screenShareComponent, containerWidth: containerWidth, containerHeight: containerHeight })), [
263
+ const togetherModeStreamComponent = useMemo(() => (React.createElement(TogetherModeStream, { startTogetherModeEnabled: startTogetherModeEnabled, isTogetherModeActive: isTogetherModeActive, onCreateTogetherModeStreamView: onCreateTogetherModeStreamView, onStartTogetherMode: onStartTogetherMode, onDisposeTogetherModeStreamView: onDisposeTogetherModeStreamView, onSetTogetherModeSceneSize: onSetTogetherModeSceneSize, togetherModeStreams: togetherModeStreams, seatingCoordinates: togetherModeSeatingCoordinates, localParticipant: localParticipant, remoteParticipants: remoteParticipants, reactionResources: reactionResources, containerWidth: containerWidth, containerHeight: containerHeight })), [
286
264
  startTogetherModeEnabled,
287
265
  isTogetherModeActive,
288
266
  onCreateTogetherModeStreamView,
@@ -294,7 +272,6 @@ export const VideoGallery = (props) => {
294
272
  localParticipant,
295
273
  remoteParticipants,
296
274
  reactionResources,
297
- screenShareComponent,
298
275
  containerWidth,
299
276
  containerHeight
300
277
  ]);
@@ -317,9 +294,7 @@ export const VideoGallery = (props) => {
317
294
  pinnedParticipantUserIds: pinnedParticipants,
318
295
  overflowGalleryPosition,
319
296
  localVideoTileSize,
320
- spotlightedParticipantUserIds: spotlightedParticipants,
321
- /* @conditional-compile-remove(together-mode) */
322
- togetherModeStreamComponent
297
+ spotlightedParticipantUserIds: spotlightedParticipants
323
298
  }), [
324
299
  remoteParticipants,
325
300
  localParticipant,
@@ -336,9 +311,7 @@ export const VideoGallery = (props) => {
336
311
  pinnedParticipants,
337
312
  overflowGalleryPosition,
338
313
  localVideoTileSize,
339
- spotlightedParticipants,
340
- /* @conditional-compile-remove(together-mode) */
341
- togetherModeStreamComponent
314
+ spotlightedParticipants
342
315
  ]);
343
316
  const videoGalleryLayout = useMemo(() => {
344
317
  if (screenShareParticipant && layout === 'focusedContent') {
@@ -357,15 +330,17 @@ export const VideoGallery = (props) => {
357
330
  /* @conditional-compile-remove(together-mode) */
358
331
  // Teams users can switch to Together mode layout only if they have the capability,
359
332
  // while ACS users can do so only if Together mode is enabled.
360
- if (layout === 'togetherMode' && canSwitchToTogetherModeLayout) {
361
- return React.createElement(TogetherModeLayout, Object.assign({}, layoutProps));
333
+ if (!screenShareComponent && layout === 'togetherMode' && canSwitchToTogetherModeLayout) {
334
+ return React.createElement(TogetherModeLayout, { togetherModeStreamComponent: togetherModeStreamComponent });
362
335
  }
363
336
  return React.createElement(DefaultLayout, Object.assign({}, layoutProps));
364
337
  }, [
365
338
  /* @conditional-compile-remove(together-mode) */ canSwitchToTogetherModeLayout,
366
339
  layout,
367
340
  layoutProps,
368
- screenShareParticipant
341
+ screenShareComponent,
342
+ screenShareParticipant,
343
+ /* @conditional-compile-remove(together-mode) */ togetherModeStreamComponent
369
344
  ]);
370
345
  return (React.createElement("div", {
371
346
  // We don't assign an drawer menu host id to the VideoGallery when a drawerMenuHostId is assigned from props