@azure/communication-react 1.24.0-alpha-202501310016 → 1.24.0-alpha-202502040016
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +25 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CAFpQ8Yk.js → ChatMessageComponentAsRichTextEditBox-AkTSmAsd.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-CAFpQ8Yk.js.map → ChatMessageComponentAsRichTextEditBox-AkTSmAsd.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DTWPl1yi.js → RichTextSendBoxWrapper-B3Xe7mdR.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DTWPl1yi.js.map → RichTextSendBoxWrapper-B3Xe7mdR.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-B8uYcMR8.js → index-CNpitKVB.js} +279 -524
- package/dist/dist-cjs/communication-react/index-CNpitKVB.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +1 -2
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +2 -7
- package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantList.js +11 -23
- package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +6 -18
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.js +24 -40
- package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js +1 -3
- package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.d.ts +3 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js +4 -72
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js +4 -17
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +1 -20
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +26 -3
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +11 -36
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +1 -2
- package/dist/dist-esm/react-components/src/components/VideoTile.js +6 -39
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.d.ts +10 -1
- package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.js +34 -5
- package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils.js +1 -13
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/index.d.ts +1 -1
- package/dist/dist-esm/react-components/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +45 -22
- package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +45 -22
- package/dist/dist-esm/react-components/src/localization/locales/cy-GB/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +43 -20
- package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/es-MX/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/fr-CA/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +45 -22
- package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +45 -22
- package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +44 -21
- package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +44 -21
- package/dist/dist-esm/react-components/src/theming/icons.js +0 -6
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +0 -21
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +24 -38
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js +5 -23
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +1 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +1 -85
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +0 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +16 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +16 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +0 -8
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -8
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +39 -5
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +38 -8
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/es-MX/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-CA/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +19 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +19 -0
- package/package.json +4 -4
- 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
|
4
|
+
import React from 'react';
|
5
5
|
/* @conditional-compile-remove(together-mode) */
|
6
|
-
import {
|
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 {
|
29
|
-
|
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
|
package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js.map
CHANGED
@@ -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,
|
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>;
|
package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TogetherModeStream.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/TogetherModeStream.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,gDAAgD;AAChD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAaxD,gDAAgD;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,gDAAgD;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,gDAAgD;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,gDAAgD;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,gDAAgD;AAChD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CACpC,CAAC,
|
1
|
+
{"version":3,"file":"TogetherModeStream.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/TogetherModeStream.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,gDAAgD;AAChD,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAaxD,gDAAgD;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,gDAAgD;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,gDAAgD;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,gDAAgD;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,gDAAgD;AAChD;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,IAAI,CACpC,CAAC,KAcA,EAAe,EAAE;;IAChB,MAAM,EACJ,wBAAwB,EACxB,oBAAoB,EACpB,8BAA8B,EAC9B,mBAAmB,EACnB,0BAA0B,EAC1B,+BAA+B,EAC/B,mBAAmB,EACnB,cAAc,EACd,eAAe,EAChB,GAAG,KAAK,CAAC;IAEV,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,oEAAoE;YACpE,+BAA+B,IAAI,+BAA+B,EAAE,CAAC;QACvE,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,+BAA+B,CAAC,CAAC,CAAC;IAEtC,6CAA6C;IAC7C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,wBAAwB,IAAI,CAAC,oBAAoB,EAAE,CAAC;YACtD,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,EAAI,CAAC;QAC1B,CAAC;IACH,CAAC,EAAE,CAAC,wBAAwB,EAAE,oBAAoB,EAAE,mBAAmB,CAAC,CAAC,CAAC;IAE1E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B,EACxC,kBAAkB,EAAE,KAAK,CAAC,kBAAkB,EAC5C,yBAAyB,EAAE,KAAK,CAAC,kBAAkB,EACnD,WAAW,EAAC,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 {
|
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
|
-
|
29
|
-
/* @conditional-compile-remove(media-access) */ isVideoPermitted) => {
|
26
|
+
useEffect(() => {
|
30
27
|
var _a;
|
31
|
-
|
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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AAC,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;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,EACR,gBAAgB,EACjB,GAAG,KAAK,CAAC;IAEV,MAAM,CAAC,qBAAqB,EAAE,wBAAwB,CAAC,GAAG,QAAQ,EAA2C,CAAC;IAE9G,SAAS,CAAC,GAAG,EAAE;;QACb,IAAI,gBAAgB,KAAK,KAAK,IAAI,iBAAiB,IAAI,CAAC,mBAAmB,EAAE,CAAC;YAC5E,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,CAAC,CAAC;QACL,CAAC;QAED,mFAAmF;QACnF,OAAO,GAAG,EAAE;YACV,IAAI,mBAAmB,EAAE,CAAC;gBACxB,wFAAwF;gBACxF,IAAI,CAAC,iBAAiB,EAAE,CAAC;oBACvB,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,EAAI,CAAC;gBAC1B,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,sBAAsB,CAAC,OAAO,CAAC,+DAA+D,CAAC,CAAC;YAClG,CAAC;QACH,CAAC,CAAC;IACJ,CAAC,EAAE;QACD,UAAU;QACV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,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 { 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,qBAAqB,EACrB,6BAA6B,GAAG,EAAE,EAClC,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,QAAQ,EACR,iBAAiB;IACjB,+CAA+C;IAC/C,aAAa;IACb,+CAA+C;IAC/C,aAAa;IACb,+CAA+C;IAC/C,aAAa;IACb,+CAA+C;IAC/C,aAAa,EACd,GAAG,KAAK,CAAC;IACV,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;;QAC/B,OAAO,MAAA,KAAK,CAAC,WAAW,CAAC,WAAW,0CAAE,WAAW,CAAC;IACpD,CAAC,EAAE,CAAC,MAAA,KAAK,CAAC,WAAW,CAAC,WAAW,0CAAE,WAAW,CAAC,CAAC,CAAC;IAEjD,MAAM,mBAAmB,GAAqC,OAAO,CAAC,GAAG,EAAE;;QACzE,MAAM,KAAK,GAA0B,EAAE,CAAC;QACxC,IAAI,iBAAiB,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,4BAA4B,CAAA,EAAE,CAAC;YAC/D,KAAK,CAAC,IAAI,CAAC;gBACT,GAAG,EAA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ed 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,CAAC;AAEhC,OAAO,EAAE,sBAAsB,IAAI,qBAAqB,EAAE,sCAAgC;AAE1F;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,KAyC/C,EAAoC,EAAE;;IACrC,MAAM,EACJ,WAAW,EACX,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,6BAA6B,GAAG,EAAE,EAClC,aAAa,EACb,gBAAgB,EAChB,eAAe,EACf,0BAA0B,EAC1B,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACd,GAAG,KAAK,CAAC;IACV,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;;QAC/B,OAAO,MAAA,KAAK,CAAC,WAAW,CAAC,WAAW,0CAAE,WAAW,CAAC;IACpD,CAAC,EAAE,CAAC,MAAA,KAAK,CAAC,WAAW,CAAC,WAAW,0CAAE,WAAW,CAAC,CAAC,CAAC;IAEjD,MAAM,mBAAm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ourcesContent":["// 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"]}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
import { IStyle } from '@fluentui/react';
|
3
3
|
import { GridLayoutStyles } from '.';
|
4
4
|
import { BaseCustomStyles, OnRenderAvatarCallback, VideoGalleryLocalParticipant, VideoGalleryRemoteParticipant, VideoStreamOptions, CreateVideoStreamViewResult } from '../types';
|
5
|
-
import { VideoGalleryTogetherModeParticipantPosition, VideoGalleryTogetherModeStreams, TogetherModeStreamViewResult } from '../types/TogetherModeTypes';
|
5
|
+
import { VideoGalleryTogetherModeParticipantPosition, VideoGalleryTogetherModeStreams, TogetherModeStreamViewResult, TogetherModeStreamOptions } from '../types/TogetherModeTypes';
|
6
6
|
import { HorizontalGalleryStyles } from './HorizontalGallery';
|
7
7
|
import { LocalVideoCameraCycleButtonProps } from './LocalVideoCameraButton';
|
8
8
|
import { VerticalGalleryStyles } from './VerticalGallery';
|
@@ -264,14 +264,37 @@ export interface VideoGalleryProps {
|
|
264
264
|
* This callback is to mute a remote participant
|
265
265
|
*/
|
266
266
|
onMuteParticipant?: (userId: string) => Promise<void>;
|
267
|
+
/**
|
268
|
+
* Indicates if the local participant can start together mode
|
269
|
+
*/
|
267
270
|
startTogetherModeEnabled?: boolean;
|
271
|
+
/**
|
272
|
+
* Indicates if together mode is active
|
273
|
+
*/
|
268
274
|
isTogetherModeActive?: boolean;
|
269
|
-
|
270
|
-
|
275
|
+
/**
|
276
|
+
* Callback to create a together mode stream view
|
277
|
+
*/
|
278
|
+
onCreateTogetherModeStreamView?: (options?: TogetherModeStreamOptions) => Promise<void | TogetherModeStreamViewResult>;
|
279
|
+
/**
|
280
|
+
* This callback is to start together mode
|
281
|
+
*/
|
271
282
|
onStartTogetherMode?: () => Promise<void>;
|
283
|
+
/**
|
284
|
+
* This callback is to set the scene size for together mode
|
285
|
+
*/
|
272
286
|
onSetTogetherModeSceneSize?: (width: number, height: number) => void;
|
287
|
+
/**
|
288
|
+
* Together mode video streams
|
289
|
+
*/
|
273
290
|
togetherModeStreams?: VideoGalleryTogetherModeStreams;
|
291
|
+
/**
|
292
|
+
* Seating position of participants in together mode
|
293
|
+
*/
|
274
294
|
togetherModeSeatingCoordinates?: VideoGalleryTogetherModeParticipantPosition;
|
295
|
+
/**
|
296
|
+
* Callback to dispose a together mode stream view
|
297
|
+
*/
|
275
298
|
onDisposeTogetherModeStreamView?: () => Promise<void>;
|
276
299
|
/**
|
277
300
|
* This callback is to forbid audio for remote participant(s)
|
@@ -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,
|
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,
|
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
|
-
|
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
|