@azure/communication-react 1.23.0-alpha-202412200016 → 1.23.0-alpha-202412210016

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 (94) hide show
  1. package/dist/communication-react.d.ts +174 -15
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-bdhcp77f.js → ChatMessageComponentAsRichTextEditBox-9kQzqcEk.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-bdhcp77f.js.map → ChatMessageComponentAsRichTextEditBox-9kQzqcEk.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DCfnYa5y.js → RichTextSendBoxWrapper-CPU8bZEb.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-DCfnYa5y.js.map → RichTextSendBoxWrapper-CPU8bZEb.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-O64dqfKP.js → index-C8ch4y0S.js} +840 -156
  7. package/dist/dist-cjs/communication-react/index-C8ch4y0S.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +1 -1
  12. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  13. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +0 -8
  14. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  15. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +1 -1
  16. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +2 -2
  18. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  19. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +1 -1
  20. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +12 -25
  21. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  22. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +2 -2
  23. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  24. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +5 -5
  25. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  26. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  27. package/dist/dist-esm/react-components/src/components/LocalVideoTile.d.ts +2 -0
  28. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +11 -4
  29. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  30. package/dist/dist-esm/react-components/src/components/NotificationStack.d.ts +12 -0
  31. package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/components/ParticipantList.js +23 -4
  33. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  34. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +4 -0
  35. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +23 -5
  36. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  37. package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js +3 -1
  38. package/dist/dist-esm/react-components/src/components/VideoGallery/LocalScreenShare.js.map +1 -1
  39. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.d.ts +1 -0
  40. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js +18 -9
  41. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js.map +1 -1
  42. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.d.ts +8 -0
  43. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +99 -14
  44. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  45. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +16 -0
  46. package/dist/dist-esm/react-components/src/components/VideoGallery.js +37 -11
  47. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +5 -0
  49. package/dist/dist-esm/react-components/src/components/VideoTile.js +18 -3
  50. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  51. package/dist/dist-esm/react-components/src/components/utils.js +8 -0
  52. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  53. package/dist/dist-esm/react-components/src/theming/icons.d.ts +5 -0
  54. package/dist/dist-esm/react-components/src/theming/icons.js +13 -1
  55. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  56. package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.d.ts +1 -1
  57. package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.js.map +1 -1
  58. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +5 -2
  59. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
  60. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +70 -0
  61. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  62. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +9 -0
  63. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +76 -10
  64. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  65. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +32 -0
  66. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  67. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +52 -10
  68. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  69. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js +4 -0
  70. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js.map +1 -1
  71. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +10 -0
  72. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +288 -26
  73. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  74. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +1 -1
  75. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
  76. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +57 -8
  77. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  78. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +3 -0
  79. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +3 -0
  80. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  81. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +8 -0
  82. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +48 -0
  83. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  84. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +18 -0
  85. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  86. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +8 -0
  87. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +48 -0
  88. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  89. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +4 -0
  90. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  91. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +9 -2
  92. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  93. package/package.json +1 -1
  94. package/dist/dist-cjs/communication-react/index-O64dqfKP.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { useEffect, useMemo, useState } from 'react';
3
+ import { useCallback, 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,15 +21,26 @@ 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 } = props;
24
+ const { isMirrored, isScreenSharingOn, isStreamAvailable, onCreateStreamView, onDisposeStreamView, renderElementExists, scalingMode, streamId,
25
+ /* @conditional-compile-remove(media-access) */
26
+ isVideoPermitted } = props;
25
27
  const [videoStreamViewResult, setVideoStreamViewResult] = useState();
26
- useEffect(() => {
28
+ const createStreamViewTrampoline = useCallback((isStreamAvailable, renderElementExists,
29
+ /* @conditional-compile-remove(media-access) */ isVideoPermitted) => {
27
30
  var _a;
31
+ /* @conditional-compile-remove(media-access) */
32
+ if (isVideoPermitted === false) {
33
+ return;
34
+ }
28
35
  if (isStreamAvailable && !renderElementExists) {
29
36
  (_a = onCreateStreamView === null || onCreateStreamView === void 0 ? void 0 : onCreateStreamView({ isMirrored, scalingMode })) === null || _a === void 0 ? void 0 : _a.then((result) => {
30
37
  result && setVideoStreamViewResult(result);
31
38
  });
32
39
  }
40
+ }, [isMirrored, onCreateStreamView, scalingMode]);
41
+ useEffect(() => {
42
+ createStreamViewTrampoline(isStreamAvailable, renderElementExists,
43
+ /* @conditional-compile-remove(media-access) */ isVideoPermitted);
33
44
  // Always clean up element to make tile up to date and be able to dispose correctly
34
45
  return () => {
35
46
  if (renderElementExists) {
@@ -50,12 +61,10 @@ const useVideoStreamLifecycleMaintainer = (props) => {
50
61
  onDisposeStreamView,
51
62
  renderElementExists,
52
63
  scalingMode,
53
- /**
54
- * this is here in order to force a re-render when streamId changes
55
- * - this should not happen but to recover for the user we will make sure that we subscribe to the
56
- * new stream by forcing a re-render.
57
- */
58
- streamId
64
+ streamId,
65
+ createStreamViewTrampoline,
66
+ /* @conditional-compile-remove(media-access) */
67
+ isVideoPermitted
59
68
  ]);
60
69
  // The execution order for above useEffect is onCreateRemoteStreamView =>(async time gap) RenderElement generated => element disposed => onDisposeRemoteStreamView
61
70
  // Element disposed could happen during async time gap, which still cause leaks for unused renderElement.
@@ -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,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAiBzD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,iCAAiC,GAAG,CACxC,KAA0C,EACD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B,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}\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 } = props;\n\n const [videoStreamViewResult, setVideoStreamViewResult] = useState<CreateVideoStreamViewResult | undefined>();\n\n useEffect(() => {\n if (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 /**\n * this is here in order to force a re-render when streamId changes\n * - this should not happen but to recover for the user we will make sure that we subscribe to the\n * new stream by forcing a re-render.\n */\n streamId\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,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAElE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAkBzD;;;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H,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"]}
@@ -21,6 +21,10 @@ export declare const useVideoTileContextualMenuProps: (props: {
21
21
  stopSpotlightOnSelfVideoTileMenuLabel?: string;
22
22
  spotlightLimitReachedMenuTitle?: string;
23
23
  muteParticipantMenuItemLabel?: string;
24
+ forbidAudioTileMenuLabel?: string;
25
+ permitAudioTileMenuLabel?: string;
26
+ forbidVideoTileMenuLabel?: string;
27
+ permitVideoTileMenuLabel?: string;
24
28
  };
25
29
  view?: {
26
30
  updateScalingMode: (scalingMode: ViewScalingMode) => Promise<void>;
@@ -38,5 +42,9 @@ export declare const useVideoTileContextualMenuProps: (props: {
38
42
  maxParticipantsToSpotlight?: number;
39
43
  myUserId?: string;
40
44
  onMuteParticipant?: (userId: string) => void;
45
+ onForbidAudio?: (userIds: string[]) => void;
46
+ onPermitAudio?: (userIds: string[]) => void;
47
+ onForbidVideo?: (userIds: string[]) => void;
48
+ onPermitVideo?: (userIds: string[]) => void;
41
49
  }) => IContextualMenuProps | undefined;
42
50
  //# sourceMappingURL=useVideoTileContextualMenuProps.d.ts.map
@@ -8,12 +8,21 @@ 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 } = props;
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;
12
20
  const scalingMode = useMemo(() => {
13
21
  var _a;
14
22
  return (_a = props.participant.videoStream) === null || _a === void 0 ? void 0 : _a.scalingMode;
15
23
  }, [(_a = props.participant.videoStream) === null || _a === void 0 ? void 0 : _a.scalingMode]);
16
24
  const contextualMenuProps = useMemo(() => {
25
+ var _a, _b;
17
26
  const items = [];
18
27
  if (onMuteParticipant && (strings === null || strings === void 0 ? void 0 : strings.muteParticipantMenuItemLabel)) {
19
28
  items.push({
@@ -29,6 +38,68 @@ export const useVideoTileContextualMenuProps = (props) => {
29
38
  disabled: participant.isMuted
30
39
  });
31
40
  }
41
+ /* @conditional-compile-remove(media-access) */
42
+ if (participant.canAudioBeForbidden &&
43
+ participant.mediaAccess &&
44
+ !participant.mediaAccess.isAudioPermitted &&
45
+ onPermitAudio) {
46
+ items.push({
47
+ key: 'permitAudio',
48
+ text: strings === null || strings === void 0 ? void 0 : strings.permitAudioTileMenuLabel,
49
+ iconProps: {
50
+ iconName: 'ControlButtonMicOn',
51
+ styles: { root: { lineHeight: 0 } }
52
+ },
53
+ onClick: () => onPermitAudio([participant.userId]),
54
+ 'data-ui-id': 'audio-tile-permit-audio',
55
+ ariaLabel: strings === null || strings === void 0 ? void 0 : strings.permitAudioTileMenuLabel
56
+ });
57
+ }
58
+ /* @conditional-compile-remove(media-access) */
59
+ if (participant.canAudioBeForbidden && ((_a = participant.mediaAccess) === null || _a === void 0 ? void 0 : _a.isAudioPermitted) && onForbidAudio) {
60
+ items.push({
61
+ key: 'forbidAudio',
62
+ text: strings === null || strings === void 0 ? void 0 : strings.forbidAudioTileMenuLabel,
63
+ iconProps: {
64
+ iconName: 'ControlButtonMicProhibited',
65
+ styles: { root: { lineHeight: 0 } }
66
+ },
67
+ onClick: () => onForbidAudio([participant.userId]),
68
+ 'data-ui-id': 'audio-tile-forbid-audio',
69
+ ariaLabel: strings === null || strings === void 0 ? void 0 : strings.forbidAudioTileMenuLabel
70
+ });
71
+ }
72
+ /* @conditional-compile-remove(media-access) */
73
+ if (participant.canVideoBeForbidden &&
74
+ participant.mediaAccess &&
75
+ !participant.mediaAccess.isVideoPermitted &&
76
+ onPermitVideo) {
77
+ items.push({
78
+ key: 'permitVideo',
79
+ text: strings === null || strings === void 0 ? void 0 : strings.permitVideoTileMenuLabel,
80
+ iconProps: {
81
+ iconName: 'ControlButtonCameraOn',
82
+ styles: { root: { lineHeight: 0 } }
83
+ },
84
+ onClick: () => onPermitVideo([participant.userId]),
85
+ 'data-ui-id': 'video-tile-permit-video',
86
+ ariaLabel: strings === null || strings === void 0 ? void 0 : strings.permitVideoTileMenuLabel
87
+ });
88
+ }
89
+ /* @conditional-compile-remove(media-access) */
90
+ if (participant.canVideoBeForbidden && ((_b = participant.mediaAccess) === null || _b === void 0 ? void 0 : _b.isVideoPermitted) && onForbidVideo) {
91
+ items.push({
92
+ key: 'forbidVideo',
93
+ text: strings === null || strings === void 0 ? void 0 : strings.forbidVideoTileMenuLabel,
94
+ iconProps: {
95
+ iconName: 'ControlButtonCameraProhibited',
96
+ styles: { root: { lineHeight: 0 } }
97
+ },
98
+ onClick: () => onForbidVideo([participant.userId]),
99
+ 'data-ui-id': 'video-tile-forbid-video',
100
+ ariaLabel: strings === null || strings === void 0 ? void 0 : strings.forbidVideoTileMenuLabel
101
+ });
102
+ }
32
103
  if (isPinned !== undefined) {
33
104
  if (isPinned && onUnpinParticipant && (strings === null || strings === void 0 ? void 0 : strings.unpinParticipantForMe)) {
34
105
  let unpinActionString = undefined;
@@ -154,25 +225,39 @@ export const useVideoTileContextualMenuProps = (props) => {
154
225
  }
155
226
  return { items, styles: {}, calloutProps: { preventDismissOnEvent }, shouldFocusOnContainer: false };
156
227
  }, [
157
- scalingMode,
228
+ onMuteParticipant,
158
229
  strings,
159
- view,
160
- isPinned,
161
- onPinParticipant,
162
- onUnpinParticipant,
163
- onUpdateScalingMode,
230
+ participant.isMuted,
164
231
  participant.userId,
165
232
  participant.displayName,
166
- disablePinMenuItem,
167
- toggleAnnouncerString,
168
- spotlightedParticipantUserIds,
233
+ isPinned,
169
234
  isSpotlighted,
170
- onStartSpotlight,
235
+ scalingMode,
236
+ onUnpinParticipant,
237
+ onPinParticipant,
238
+ toggleAnnouncerString,
239
+ disablePinMenuItem,
240
+ myUserId,
171
241
  onStopSpotlight,
242
+ spotlightedParticipantUserIds,
172
243
  maxParticipantsToSpotlight,
173
- myUserId,
174
- onMuteParticipant,
175
- participant.isMuted
244
+ onStartSpotlight,
245
+ onUpdateScalingMode,
246
+ view,
247
+ /* @conditional-compile-remove(media-access) */
248
+ participant.canAudioBeForbidden,
249
+ /* @conditional-compile-remove(media-access) */
250
+ participant.canVideoBeForbidden,
251
+ /* @conditional-compile-remove(media-access) */
252
+ participant.mediaAccess,
253
+ /* @conditional-compile-remove(media-access) */
254
+ onPermitAudio,
255
+ /* @conditional-compile-remove(media-access) */
256
+ onForbidAudio,
257
+ /* @conditional-compile-remove(media-access) */
258
+ onPermitVideo,
259
+ /* @conditional-compile-remove(media-access) */
260
+ onForbidVideo
176
261
  ]);
177
262
  return contextualMenuProps;
178
263
  };
@@ -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,KAiC/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,EAClB,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,EAAE,MAAM;gBACX,IAAI,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,4BAA4B;gBAC3C,SAAS,EAAE;oBACT,QAAQ,EAAE,4BAA4B;oBACtC,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,CAAC,EAAE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BACD,OAAO,EAAE,GAAG,EAAE;wBACZ,mBAAmB,aAAnB,mBAAmB,uBAAnB,mBAAmB,CAAG,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;wBAClD,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;oBAClC,CAAC;oBACD,YAAY,EAAE,uBAAuB;oBACrC,SAAS,EAAE,OAAO,CAAC,0BAA0B;iBAC9C,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QACD,IAAI,KAAK,CAAC,MAAM,KAAK,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,WAAW;QACX,OAAO;QACP,IAAI;QACJ,QAAQ;QACR,gBAAgB;QAChB,kBAAkB;QAClB,mBAAmB;QACnB,WAAW,CAAC,MAAM;QAClB,WAAW,CAAC,WAAW;QACvB,kBAAkB;QAClB,qBAAqB;QACrB,6BAA6B;QAC7B,aAAa;QACb,gBAAgB;QAChB,eAAe;QACf,0BAA0B;QAC1B,QAAQ;QACR,iBAAiB;QACjB,WAAW,CAAC,OAAO;KACpB,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 };\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}): 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 } = 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 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 scalingMode,\n strings,\n view,\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n onUpdateScalingMode,\n participant.userId,\n participant.displayName,\n disablePinMenuItem,\n toggleAnnouncerString,\n spotlightedParticipantUserIds,\n isSpotlighted,\n onStartSpotlight,\n onStopSpotlight,\n maxParticipantsToSpotlight,\n myUserId,\n onMuteParticipant,\n participant.isMuted\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,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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ACR,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': 'audio-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': 'audio-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"]}
@@ -263,6 +263,22 @@ export interface VideoGalleryProps {
263
263
  * This callback is to mute a remote participant
264
264
  */
265
265
  onMuteParticipant?: (userId: string) => Promise<void>;
266
+ /**
267
+ * This callback is to forbid audio for a remote participant(s)
268
+ */
269
+ onForbidAudio?: (userIds: string[]) => Promise<void>;
270
+ /**
271
+ * This callback is to permit audio for a remote participant(s)
272
+ */
273
+ onPermitAudio?: (userIds: string[]) => Promise<void>;
274
+ /**
275
+ * This callback is to forbid video for a remote participant(s)
276
+ */
277
+ onForbidVideo?: (userIds: string[]) => Promise<void>;
278
+ /**
279
+ * This callback is to permit video for a remote participant(s)
280
+ */
281
+ onPermitVideo?: (userIds: string[]) => Promise<void>;
266
282
  }
267
283
  /**
268
284
  * Options that apply to all Video Tiles in the {@link VideoGallery}
@@ -62,7 +62,15 @@ export const MAX_PINNED_REMOTE_VIDEO_TILES = 4;
62
62
  */
63
63
  export const VideoGallery = (props) => {
64
64
  var _a, _b, _c, _d;
65
- const { localParticipant, remoteParticipants = [], localVideoViewOptions, remoteVideoViewOptions, dominantSpeakers, onRenderLocalVideoTile, onRenderRemoteVideoTile, onCreateLocalStreamView, onDisposeLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteScreenShareStreamView, onDisposeLocalScreenShareStreamView, onDisposeRemoteVideoStreamView, styles, layout, onRenderAvatar, showMuteIndicator, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS, showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps, onPinParticipant: onPinParticipantHandler, onUnpinParticipant: onUnpinParticipantHandler, remoteVideoTileMenu = DEFAULT_REMOTE_VIDEO_TILE_MENU_OPTIONS, overflowGalleryPosition = 'horizontalBottom', localVideoTileSize = 'followDeviceOrientation', spotlightedParticipants, onStartLocalSpotlight, onStartRemoteSpotlight, onStopLocalSpotlight, onStopRemoteSpotlight, maxParticipantsToSpotlight, reactionResources, videoTilesOptions, onMuteParticipant } = props;
65
+ const { localParticipant, remoteParticipants = [], localVideoViewOptions, remoteVideoViewOptions, dominantSpeakers, onRenderLocalVideoTile, onRenderRemoteVideoTile, onCreateLocalStreamView, onDisposeLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteScreenShareStreamView, onDisposeLocalScreenShareStreamView, onDisposeRemoteVideoStreamView, styles, layout, onRenderAvatar, showMuteIndicator, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS, showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps, onPinParticipant: onPinParticipantHandler, onUnpinParticipant: onUnpinParticipantHandler, remoteVideoTileMenu = DEFAULT_REMOTE_VIDEO_TILE_MENU_OPTIONS, overflowGalleryPosition = 'horizontalBottom', localVideoTileSize = 'followDeviceOrientation', spotlightedParticipants, onStartLocalSpotlight, onStartRemoteSpotlight, onStopLocalSpotlight, onStopRemoteSpotlight, maxParticipantsToSpotlight, reactionResources, videoTilesOptions, onMuteParticipant,
66
+ /* @conditional-compile-remove(media-access) */
67
+ onForbidAudio,
68
+ /* @conditional-compile-remove(media-access) */
69
+ onPermitAudio,
70
+ /* @conditional-compile-remove(media-access) */
71
+ onForbidVideo,
72
+ /* @conditional-compile-remove(media-access) */
73
+ onPermitVideo } = props;
66
74
  const ids = useIdentifiers();
67
75
  const theme = useTheme();
68
76
  const localeStrings = useLocale().strings.videoGallery;
@@ -121,7 +129,9 @@ export const VideoGallery = (props) => {
121
129
  return isNarrow ? '' : strings.localVideoLabel;
122
130
  };
123
131
  return (React.createElement(Stack, { styles: localVideoTileContainerStyles, key: "local-video-tile-key" },
124
- 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 })));
132
+ 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,
133
+ /* @conditional-compile-remove(media-access) */
134
+ mediaAccess: localParticipant.mediaAccess })));
125
135
  }, [
126
136
  isNarrow,
127
137
  localParticipant,
@@ -201,30 +211,46 @@ export const VideoGallery = (props) => {
201
211
  ? remoteVideoTileMenu.kind === 'drawer'
202
212
  ? 'drawer'
203
213
  : 'contextual'
204
- : 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 }));
214
+ : 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,
215
+ /* @conditional-compile-remove(media-access) */
216
+ onForbidAudio: onForbidAudio,
217
+ /* @conditional-compile-remove(media-access) */
218
+ onPermitAudio: onPermitAudio,
219
+ /* @conditional-compile-remove(media-access) */
220
+ onForbidVideo: onForbidVideo,
221
+ /* @conditional-compile-remove(media-access) */
222
+ onPermitVideo: onPermitVideo }));
205
223
  }, [
224
+ selectedScalingModeState,
225
+ pinnedParticipants,
226
+ videoTilesOptions === null || videoTilesOptions === void 0 ? void 0 : videoTilesOptions.alwaysShowLabelBackground,
206
227
  onCreateRemoteStreamView,
207
228
  onDisposeRemoteVideoStreamView,
208
- remoteVideoViewOptions,
209
- localParticipant,
210
229
  onRenderAvatar,
211
230
  showMuteIndicator,
212
231
  strings,
213
- drawerMenuHostId,
232
+ localParticipant.userId,
214
233
  remoteVideoTileMenu,
215
- selectedScalingModeState,
216
- pinnedParticipants,
234
+ drawerMenuHostId,
217
235
  onPinParticipant,
218
236
  onUnpinParticipant,
219
- toggleAnnouncerString,
220
237
  onUpdateScalingMode,
238
+ toggleAnnouncerString,
221
239
  spotlightedParticipants,
222
240
  onStartRemoteSpotlight,
223
241
  onStopRemoteSpotlight,
224
242
  maxParticipantsToSpotlight,
225
- onMuteParticipant,
226
243
  reactionResources,
227
- videoTilesOptions
244
+ onMuteParticipant,
245
+ /* @conditional-compile-remove(media-access) */
246
+ onForbidAudio,
247
+ /* @conditional-compile-remove(media-access) */
248
+ onPermitAudio,
249
+ /* @conditional-compile-remove(media-access) */
250
+ onForbidVideo,
251
+ /* @conditional-compile-remove(media-access) */
252
+ onPermitVideo,
253
+ remoteVideoViewOptions
228
254
  ]);
229
255
  const screenShareParticipant = remoteParticipants.find((participant) => { var _a; return (_a = participant.screenShareStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
230
256
  const localScreenShareStreamComponent = (React.createElement(LocalScreenShare, { localParticipant: localParticipant, renderElement: (_a = localParticipant.screenShareStream) === null || _a === void 0 ? void 0 : _a.renderElement, isAvailable: (_b = localParticipant.screenShareStream) === null || _b === void 0 ? void 0 : _b.isAvailable, onCreateLocalStreamView: onCreateLocalStreamView, onDisposeLocalScreenShareStreamView: onDisposeLocalScreenShareStreamView }));