@azure/communication-react 1.5.1-alpha-202211250013.0 → 1.5.1-alpha-202301250013
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/CHANGELOG.beta.md +47 -1
- package/CHANGELOG.json +1554 -0
- package/CHANGELOG.stable.md +88 -2
- package/dist/communication-react.d.ts +469 -297
- package/dist/dist-cjs/communication-react/index.js +2975 -1716
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/identifier.js +3 -47
- package/dist/dist-esm/acs-ui-common/src/identifier.js.map +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/calling-component-bindings/src/baseSelectors.d.ts +5 -0
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +8 -0
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +30 -11
- package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.d.ts +1 -2
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js +0 -7
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +13 -4
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +7 -0
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +9 -0
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +12 -0
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +31 -6
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +2 -13
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +2 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +2 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +14 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Logger.d.ts +3 -0
- package/dist/dist-esm/calling-stateful-client/src/Logger.js +3 -0
- package/dist/dist-esm/calling-stateful-client/src/Logger.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +2 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +11 -4
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +93 -27
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +2 -2
- package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.d.ts +19 -0
- package/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.js +43 -0
- package/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.js.map +1 -0
- package/dist/dist-esm/communication-react/src/index.d.ts +7 -5
- package/dist/dist-esm/communication-react/src/index.js +5 -3
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +105 -0
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +86 -0
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/DevicePermissions/{DomainPermissionsScaffolding.d.ts → SitePermissionsScaffolding.d.ts} +12 -12
- package/dist/dist-esm/react-components/src/components/DevicePermissions/{DomainPermissionsScaffolding.js → SitePermissionsScaffolding.js} +4 -4
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +20 -9
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerContentContainer.d.ts +1 -0
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerContentContainer.js +18 -2
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerContentContainer.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenu.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenu.js +1 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenu.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerSurface.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerSurface.js +1 -1
- package/dist/dist-esm/react-components/src/components/Drawer/DrawerSurface.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +8 -0
- package/dist/dist-esm/react-components/src/components/ErrorBar.js +1 -2
- package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js +6 -4
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.d.ts +0 -2
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js +10 -12
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantsButton.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/ParticipantsButton.js +26 -4
- package/dist/dist-esm/react-components/src/components/ParticipantsButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +10 -4
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +79 -7
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.d.ts +6 -6
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +13 -21
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.d.ts +37 -0
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +27 -0
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.d.ts +41 -0
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +32 -0
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.d.ts +32 -0
- package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +25 -0
- package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.d.ts +16 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +60 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.d.ts +12 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +41 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.d.ts +25 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +76 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +38 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js +4 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.d.ts +9 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js +18 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.d.ts +14 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js +19 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/DefaultLayout.styles.d.ts +6 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/DefaultLayout.styles.js +9 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/DefaultLayout.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.d.ts +62 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +118 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideoLayout.styles.d.ts +14 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideoLayout.styles.js +28 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideoLayout.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/Layout.styles.d.ts +6 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/Layout.styles.js +9 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/Layout.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/RemoteVideoTile.styles.d.ts +9 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/RemoteVideoTile.styles.js +22 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/RemoteVideoTile.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.d.ts +10 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js +29 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.d.ts +45 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js +57 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js +7 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.d.ts +23 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +96 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +27 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +121 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +66 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +131 -124
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +12 -17
- package/dist/dist-esm/react-components/src/components/VideoTile.js +71 -38
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +8 -3
- package/dist/dist-esm/react-components/src/components/index.js +3 -2
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/{DomainPermissions.styles.d.ts → SitePermissions.styles.d.ts} +1 -1
- package/dist/dist-esm/react-components/src/components/styles/{DomainPermissions.styles.js → SitePermissions.styles.js} +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.js +2 -1
- package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +26 -0
- package/dist/dist-esm/react-components/src/components/styles/{UnsupportedBrowser.styles.js → UnsupportedEnvironment.styles.js} +25 -10
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.d.ts +1 -95
- package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.js +3 -138
- package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +11 -26
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/useLongPress.d.ts +13 -10
- package/dist/dist-esm/react-components/src/components/utils/useLongPress.js +66 -37
- package/dist/dist-esm/react-components/src/components/utils/useLongPress.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils.d.ts +1 -6
- package/dist/dist-esm/react-components/src/components/utils.js +4 -16
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/index.d.ts +0 -1
- package/dist/dist-esm/react-components/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +31 -19
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +49 -14
- package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +11 -6
- package/dist/dist-esm/react-components/src/theming/icons.js +30 -20
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.styles.js +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +2 -0
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +24 -11
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +9 -9
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +56 -0
- 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 +16 -10
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +89 -40
- 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.d.ts +11 -16
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +19 -18
- 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/CallReadinessModal.d.ts +5 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +79 -39
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +16 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/{ConfigurationpageCameraDropdown.js → ConfigurationPageCameraDropdown.js} +4 -6
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/{ConfigurationpageErrorBar.d.ts → ConfigurationPageErrorBar.d.ts} +3 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/{ConfigurationpageErrorBar.js → ConfigurationPageErrorBar.js} +4 -6
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +16 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/{ConfigurationpageMicDropdown.js → ConfigurationPageMicDropdown.js} +4 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +16 -14
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js +8 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +3 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +26 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +11 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +4 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +6 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +46 -27
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +28 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.js +9 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.d.ts +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js +10 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.d.ts +29 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +119 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +20 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +74 -21
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +16 -7
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +22 -10
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +11 -5
- 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.d.ts +4 -0
- 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 +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +7 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +8 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +4 -0
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js +26 -3
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.d.ts +8 -0
- package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.js +40 -0
- package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +11 -6
- package/dist/dist-esm/react-composites/src/composites/common/styles/ModalLocalAndRemotePIP.styles.js +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/styles/ModalLocalAndRemotePIP.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js +2 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +15 -1
- package/package.json +13 -12
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.d.ts +0 -101
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.js +0 -80
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissionsScaffolding.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/DomainPermissions.styles.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedBrowser.styles.d.ts +0 -22
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedBrowser.styles.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.d.ts +0 -17
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageErrorBar.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.d.ts +0 -17
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js.map +0 -1
package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT license.
|
3
|
+
import { useCallback, useRef } from 'react';
|
4
|
+
import { smartDominantSpeakerParticipants } from '../../../gallery';
|
5
|
+
const DEFAULT_MAX_REMOTE_VIDEOSTREAMS = 4;
|
6
|
+
const DEFAULT_MAX_AUDIO_DOMINANT_SPEAKERS = 6;
|
7
|
+
const _useOrganizedParticipants = (props) => {
|
8
|
+
var _a, _b;
|
9
|
+
const visibleVideoParticipants = useRef([]);
|
10
|
+
const visibleAudioParticipants = useRef([]);
|
11
|
+
const { remoteParticipants, dominantSpeakers, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEOSTREAMS, maxAudioDominantSpeakers = DEFAULT_MAX_AUDIO_DOMINANT_SPEAKERS, isScreenShareActive = false } = props;
|
12
|
+
visibleVideoParticipants.current = smartDominantSpeakerParticipants({
|
13
|
+
participants: (_a = remoteParticipants === null || remoteParticipants === void 0 ? void 0 : remoteParticipants.filter((p) => { var _a; return (_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable; })) !== null && _a !== void 0 ? _a : [],
|
14
|
+
dominantSpeakers,
|
15
|
+
lastVisibleParticipants: visibleVideoParticipants.current,
|
16
|
+
maxDominantSpeakers: maxRemoteVideoStreams
|
17
|
+
}).slice(0, maxRemoteVideoStreams);
|
18
|
+
const visibleVideoParticipantsSet = new Set(visibleVideoParticipants.current.map((p) => p.userId));
|
19
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
20
|
+
const callingParticipants = remoteParticipants.filter((p) => p.state === ('Connecting' || 'Ringing'));
|
21
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
22
|
+
const callingParticipantsSet = new Set(callingParticipants.map((p) => p.userId));
|
23
|
+
visibleAudioParticipants.current = smartDominantSpeakerParticipants({
|
24
|
+
participants: (_b = remoteParticipants === null || remoteParticipants === void 0 ? void 0 : remoteParticipants.filter((p) => !visibleVideoParticipantsSet.has(p.userId) &&
|
25
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !callingParticipantsSet.has(p.userId))) !== null && _b !== void 0 ? _b : [],
|
26
|
+
dominantSpeakers,
|
27
|
+
lastVisibleParticipants: visibleAudioParticipants.current,
|
28
|
+
maxDominantSpeakers: maxAudioDominantSpeakers
|
29
|
+
});
|
30
|
+
const getGridParticipants = useCallback(() => {
|
31
|
+
if (isScreenShareActive) {
|
32
|
+
return [];
|
33
|
+
}
|
34
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
35
|
+
return visibleVideoParticipants.current.length > 0
|
36
|
+
? visibleVideoParticipants.current
|
37
|
+
: visibleAudioParticipants.current.concat(callingParticipants);
|
38
|
+
return visibleVideoParticipants.current.length > 0
|
39
|
+
? visibleVideoParticipants.current
|
40
|
+
: visibleAudioParticipants.current;
|
41
|
+
}, [
|
42
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,
|
43
|
+
isScreenShareActive
|
44
|
+
]);
|
45
|
+
const gridParticipants = getGridParticipants();
|
46
|
+
const getHorizontalGalleryRemoteParticipants = useCallback(() => {
|
47
|
+
if (isScreenShareActive) {
|
48
|
+
// If screen sharing is active, assign video and audio participants as horizontal gallery participants
|
49
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
50
|
+
return visibleVideoParticipants.current.concat(visibleAudioParticipants.current.concat(callingParticipants));
|
51
|
+
return visibleVideoParticipants.current.concat(visibleAudioParticipants.current);
|
52
|
+
}
|
53
|
+
else {
|
54
|
+
// If screen sharing is not active, then assign all video tiles as grid tiles.
|
55
|
+
// If there are no video tiles, then assign audio tiles as grid tiles.
|
56
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
57
|
+
return visibleVideoParticipants.current.length > 0
|
58
|
+
? visibleAudioParticipants.current.concat(callingParticipants)
|
59
|
+
: [];
|
60
|
+
return visibleVideoParticipants.current.length > 0 ? visibleAudioParticipants.current : [];
|
61
|
+
}
|
62
|
+
}, [
|
63
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,
|
64
|
+
isScreenShareActive
|
65
|
+
]);
|
66
|
+
const horizontalGalleryParticipants = getHorizontalGalleryRemoteParticipants();
|
67
|
+
return { gridParticipants, horizontalGalleryParticipants };
|
68
|
+
};
|
69
|
+
/* @conditional-compile-remove(pinned-participants) */
|
70
|
+
const _useOrganizedParticipantsWithPinnedParticipants = (props) => {
|
71
|
+
var _a;
|
72
|
+
// map remote participants by userId
|
73
|
+
const remoteParticipantMap = props.remoteParticipants.reduce((map, remoteParticipant) => {
|
74
|
+
map[remoteParticipant.userId] = remoteParticipant;
|
75
|
+
return map;
|
76
|
+
}, {});
|
77
|
+
// count pinned participants with video
|
78
|
+
let pinnedParticipantsWithVideoOnCount = 0;
|
79
|
+
// get pinned participants in the same order of pinned participant user ids using remoteParticipantMap
|
80
|
+
const pinnedParticipants = [];
|
81
|
+
(_a = props.pinnedParticipantUserIds) === null || _a === void 0 ? void 0 : _a.forEach((id) => {
|
82
|
+
var _a;
|
83
|
+
const pinnedParticipant = remoteParticipantMap[id];
|
84
|
+
if (pinnedParticipant) {
|
85
|
+
pinnedParticipants.push(pinnedParticipant);
|
86
|
+
if ((_a = pinnedParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) {
|
87
|
+
pinnedParticipantsWithVideoOnCount++;
|
88
|
+
}
|
89
|
+
}
|
90
|
+
});
|
91
|
+
// get unpinned participants by filtering all remote participants using a set of pinned participant user ids
|
92
|
+
const pinnedParticipantUserIdSet = new Set(props.pinnedParticipantUserIds);
|
93
|
+
const unpinnedParticipants = props.remoteParticipants.filter((p) => !pinnedParticipantUserIdSet.has(p.userId));
|
94
|
+
const useOrganizedParticipantsProps = Object.assign(Object.assign({}, props), {
|
95
|
+
// if there are pinned participants then we should only consider unpinned participants
|
96
|
+
remoteParticipants: unpinnedParticipants,
|
97
|
+
// if there is a maximum of remote video streams we need to subtract pinned participants with video
|
98
|
+
maxRemoteVideoStreams: props.maxRemoteVideoStreams
|
99
|
+
? props.maxRemoteVideoStreams - pinnedParticipantsWithVideoOnCount
|
100
|
+
: undefined });
|
101
|
+
const useOrganizedParticipantsResult = _useOrganizedParticipants(useOrganizedParticipantsProps);
|
102
|
+
if (pinnedParticipants.length === 0) {
|
103
|
+
return useOrganizedParticipantsResult;
|
104
|
+
}
|
105
|
+
return {
|
106
|
+
gridParticipants: props.isScreenShareActive ? [] : pinnedParticipants,
|
107
|
+
horizontalGalleryParticipants: props.isScreenShareActive
|
108
|
+
? pinnedParticipants.concat(useOrganizedParticipantsResult.horizontalGalleryParticipants)
|
109
|
+
: useOrganizedParticipantsResult.gridParticipants.concat(useOrganizedParticipantsResult.horizontalGalleryParticipants)
|
110
|
+
};
|
111
|
+
};
|
112
|
+
/**
|
113
|
+
* Hook to determine which participants should be in grid and horizontal gallery and their order respectively
|
114
|
+
* @private
|
115
|
+
*/
|
116
|
+
export const useOrganizedParticipants = (args) => {
|
117
|
+
/* @conditional-compile-remove(pinned-participants) */
|
118
|
+
return _useOrganizedParticipantsWithPinnedParticipants(args);
|
119
|
+
return _useOrganizedParticipants(args);
|
120
|
+
};
|
121
|
+
//# sourceMappingURL=videoGalleryLayoutUtils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"videoGalleryLayoutUtils.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.ts"],"names":[],"mappings":"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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { useCallback, useRef } from 'react';\nimport { smartDominantSpeakerParticipants } from '../../../gallery';\nimport { VideoGalleryParticipant, VideoGalleryRemoteParticipant } from '../../../types';\n\n/**\n * Arguments used to determine a {@link OrganizedParticipantsResult}\n * @private\n */\nexport interface OrganizedParticipantsArgs {\n remoteParticipants: VideoGalleryRemoteParticipant[];\n dominantSpeakers?: string[];\n maxRemoteVideoStreams?: number;\n maxAudioDominantSpeakers?: number;\n isScreenShareActive?: boolean;\n /* @conditional-compile-remove(pinned-participants) */ pinnedParticipantUserIds?: string[];\n}\n\n/**\n * A result that defines grid participants and horizontal participants in the VideoGallery\n * @private\n */\nexport interface OrganizedParticipantsResult {\n gridParticipants: VideoGalleryParticipant[];\n horizontalGalleryParticipants: VideoGalleryParticipant[];\n}\n\nconst DEFAULT_MAX_REMOTE_VIDEOSTREAMS = 4;\n\nconst DEFAULT_MAX_AUDIO_DOMINANT_SPEAKERS = 6;\n\nconst _useOrganizedParticipants = (props: OrganizedParticipantsArgs): OrganizedParticipantsResult => {\n const visibleVideoParticipants = useRef<VideoGalleryRemoteParticipant[]>([]);\n const visibleAudioParticipants = useRef<VideoGalleryRemoteParticipant[]>([]);\n\n const {\n remoteParticipants,\n dominantSpeakers,\n maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEOSTREAMS,\n maxAudioDominantSpeakers = DEFAULT_MAX_AUDIO_DOMINANT_SPEAKERS,\n isScreenShareActive = false\n } = props;\n\n visibleVideoParticipants.current = smartDominantSpeakerParticipants({\n participants: remoteParticipants?.filter((p) => p.videoStream?.isAvailable) ?? [],\n dominantSpeakers,\n lastVisibleParticipants: visibleVideoParticipants.current,\n maxDominantSpeakers: maxRemoteVideoStreams\n }).slice(0, maxRemoteVideoStreams);\n\n const visibleVideoParticipantsSet = new Set(visibleVideoParticipants.current.map((p) => p.userId));\n\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n const callingParticipants = remoteParticipants.filter((p) => p.state === ('Connecting' || 'Ringing'));\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n const callingParticipantsSet = new Set(callingParticipants.map((p) => p.userId));\n\n visibleAudioParticipants.current = smartDominantSpeakerParticipants({\n participants:\n remoteParticipants?.filter(\n (p) =>\n !visibleVideoParticipantsSet.has(p.userId) &&\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !callingParticipantsSet.has(\n p.userId\n )\n ) ?? [],\n dominantSpeakers,\n lastVisibleParticipants: visibleAudioParticipants.current,\n maxDominantSpeakers: maxAudioDominantSpeakers\n });\n\n const getGridParticipants = useCallback((): VideoGalleryRemoteParticipant[] => {\n if (isScreenShareActive) {\n return [];\n }\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n return visibleVideoParticipants.current.length > 0\n ? visibleVideoParticipants.current\n : visibleAudioParticipants.current.concat(callingParticipants);\n return visibleVideoParticipants.current.length > 0\n ? visibleVideoParticipants.current\n : visibleAudioParticipants.current;\n }, [\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,\n isScreenShareActive\n ]);\n\n const gridParticipants = getGridParticipants();\n\n const getHorizontalGalleryRemoteParticipants = useCallback((): VideoGalleryRemoteParticipant[] => {\n if (isScreenShareActive) {\n // If screen sharing is active, assign video and audio participants as horizontal gallery participants\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n return visibleVideoParticipants.current.concat(visibleAudioParticipants.current.concat(callingParticipants));\n return visibleVideoParticipants.current.concat(visibleAudioParticipants.current);\n } else {\n // If screen sharing is not active, then assign all video tiles as grid tiles.\n // If there are no video tiles, then assign audio tiles as grid tiles.\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n return visibleVideoParticipants.current.length > 0\n ? visibleAudioParticipants.current.concat(callingParticipants)\n : [];\n return visibleVideoParticipants.current.length > 0 ? visibleAudioParticipants.current : [];\n }\n }, [\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,\n isScreenShareActive\n ]);\n\n const horizontalGalleryParticipants = getHorizontalGalleryRemoteParticipants();\n\n return { gridParticipants, horizontalGalleryParticipants };\n};\n\n/* @conditional-compile-remove(pinned-participants) */\nconst _useOrganizedParticipantsWithPinnedParticipants = (\n props: OrganizedParticipantsArgs\n): OrganizedParticipantsResult => {\n // map remote participants by userId\n const remoteParticipantMap = props.remoteParticipants.reduce((map, remoteParticipant) => {\n map[remoteParticipant.userId] = remoteParticipant;\n return map;\n }, {});\n\n // count pinned participants with video\n let pinnedParticipantsWithVideoOnCount = 0;\n\n // get pinned participants in the same order of pinned participant user ids using remoteParticipantMap\n const pinnedParticipants: VideoGalleryRemoteParticipant[] = [];\n props.pinnedParticipantUserIds?.forEach((id) => {\n const pinnedParticipant = remoteParticipantMap[id];\n if (pinnedParticipant) {\n pinnedParticipants.push(pinnedParticipant);\n if (pinnedParticipant.videoStream?.isAvailable) {\n pinnedParticipantsWithVideoOnCount++;\n }\n }\n });\n\n // get unpinned participants by filtering all remote participants using a set of pinned participant user ids\n const pinnedParticipantUserIdSet = new Set(props.pinnedParticipantUserIds);\n const unpinnedParticipants = props.remoteParticipants.filter((p) => !pinnedParticipantUserIdSet.has(p.userId));\n\n const useOrganizedParticipantsProps = {\n ...props,\n // if there are pinned participants then we should only consider unpinned participants\n remoteParticipants: unpinnedParticipants,\n // if there is a maximum of remote video streams we need to subtract pinned participants with video\n maxRemoteVideoStreams: props.maxRemoteVideoStreams\n ? props.maxRemoteVideoStreams - pinnedParticipantsWithVideoOnCount\n : undefined\n };\n\n const useOrganizedParticipantsResult = _useOrganizedParticipants(useOrganizedParticipantsProps);\n\n if (pinnedParticipants.length === 0) {\n return useOrganizedParticipantsResult;\n }\n\n return {\n gridParticipants: props.isScreenShareActive ? [] : pinnedParticipants,\n horizontalGalleryParticipants: props.isScreenShareActive\n ? pinnedParticipants.concat(useOrganizedParticipantsResult.horizontalGalleryParticipants)\n : useOrganizedParticipantsResult.gridParticipants.concat(\n useOrganizedParticipantsResult.horizontalGalleryParticipants\n )\n };\n};\n\n/**\n * Hook to determine which participants should be in grid and horizontal gallery and their order respectively\n * @private\n */\nexport const useOrganizedParticipants = (args: OrganizedParticipantsArgs): OrganizedParticipantsResult => {\n /* @conditional-compile-remove(pinned-participants) */\n return _useOrganizedParticipantsWithPinnedParticipants(args);\n return _useOrganizedParticipants(args);\n};\n"]}
|
@@ -14,6 +14,18 @@ export declare const DEFAULT_MAX_REMOTE_VIDEO_STREAMS = 4;
|
|
14
14
|
* Set aside only 6 dominant speakers for remaining audio participants
|
15
15
|
*/
|
16
16
|
export declare const MAX_AUDIO_DOMINANT_SPEAKERS = 6;
|
17
|
+
/**
|
18
|
+
* @private
|
19
|
+
* Default remote video tile menu options
|
20
|
+
*/
|
21
|
+
export declare const DEFAULT_REMOTE_VIDEO_TILE_MENU_OPTIONS: {
|
22
|
+
kind: string;
|
23
|
+
};
|
24
|
+
/**
|
25
|
+
* @private
|
26
|
+
* Maximum number of remote video tiles that can be pinned
|
27
|
+
*/
|
28
|
+
export declare const MAX_PINNED_REMOTE_VIDEO_TILES = 4;
|
17
29
|
/**
|
18
30
|
* All strings that may be shown on the UI in the {@link VideoGallery}.
|
19
31
|
*
|
@@ -34,6 +46,14 @@ export interface VideoGalleryStrings {
|
|
34
46
|
localVideoSelectedDescription: string;
|
35
47
|
/** placeholder text for participants who does not have a display name*/
|
36
48
|
displayNamePlaceholder: string;
|
49
|
+
/** Menu text shown in Video Tile contextual menu for setting a remote participants video to fit in frame */
|
50
|
+
fitRemoteParticipantToFrame: string;
|
51
|
+
/** Menu text shown in Video Tile contextual menu for setting a remote participants video to fill the frame */
|
52
|
+
fillRemoteParticipantFrame: string;
|
53
|
+
/** Menu text shown in Video Tile contextual menu for pinning a remote participant's video tile */
|
54
|
+
pinParticipantForMe: string;
|
55
|
+
/** Menu text shown in Video Tile contextual menu for setting a remote participant's video tile */
|
56
|
+
unpinParticipantForMe: string;
|
37
57
|
}
|
38
58
|
/**
|
39
59
|
* @public
|
@@ -112,6 +132,52 @@ export interface VideoGalleryProps {
|
|
112
132
|
* Camera control information for button to switch cameras.
|
113
133
|
*/
|
114
134
|
localVideoCameraCycleButtonProps?: LocalVideoCameraCycleButtonProps;
|
135
|
+
/**
|
136
|
+
* List of pinned participant userIds.
|
137
|
+
*/
|
138
|
+
pinnedParticipants?: string[];
|
139
|
+
/**
|
140
|
+
* This callback will be called when a participant video tile is pinned.
|
141
|
+
*/
|
142
|
+
onPinParticipant?: (userId: string) => void;
|
143
|
+
/**
|
144
|
+
* This callback will be called when a participant video tile is un-pinned.
|
145
|
+
*/
|
146
|
+
onUnpinParticipant?: (userId: string) => void;
|
147
|
+
/**
|
148
|
+
* Options for showing the remote video tile menu.
|
149
|
+
*
|
150
|
+
* @defaultValue \{ kind: 'contextual' \}
|
151
|
+
*/
|
152
|
+
remoteVideoTileMenuOptions?: false | VideoTileContextualMenuProps | VideoTileDrawerMenuProps;
|
153
|
+
}
|
154
|
+
/**
|
155
|
+
* Properties for showing contextual menu for remote {@link VideoTile} components in {@link VideoGallery}.
|
156
|
+
*
|
157
|
+
* @beta
|
158
|
+
*/
|
159
|
+
export interface VideoTileContextualMenuProps {
|
160
|
+
/**
|
161
|
+
* The menu property kind
|
162
|
+
*/
|
163
|
+
kind: 'contextual';
|
164
|
+
}
|
165
|
+
/**
|
166
|
+
* Properties for showing drawer menu on remote {@link VideoTile} long touch in {@link VideoGallery}.
|
167
|
+
*
|
168
|
+
* @beta
|
169
|
+
*/
|
170
|
+
export interface VideoTileDrawerMenuProps {
|
171
|
+
/**
|
172
|
+
* The menu property kind
|
173
|
+
*/
|
174
|
+
kind: 'drawer';
|
175
|
+
/**
|
176
|
+
* The optional id property provided on an element that the drawer menu should render within when a
|
177
|
+
* remote participant video tile Drawer is shown. If an id is not provided, then a drawer menu will
|
178
|
+
* render within the VideoGallery component.
|
179
|
+
*/
|
180
|
+
hostId?: string;
|
115
181
|
}
|
116
182
|
/**
|
117
183
|
* VideoGallery represents a layout of video tiles for a specific call.
|
@@ -1,25 +1,23 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT license.
|
3
|
-
import { concatStyleSets,
|
3
|
+
import { concatStyleSets, mergeStyles, Stack } from '@fluentui/react';
|
4
4
|
import React, { useCallback, useMemo, useRef } from 'react';
|
5
|
-
import { smartDominantSpeakerParticipants } from '../gallery';
|
6
|
-
import { useIdentifiers } from '../identifiers/IdentifierProvider';
|
7
5
|
import { useLocale } from '../localization';
|
8
6
|
import { useTheme } from '../theming';
|
9
|
-
import { GridLayout } from './GridLayout';
|
10
7
|
import { _RemoteVideoTile } from './RemoteVideoTile';
|
11
|
-
import { ResponsiveHorizontalGallery } from './ResponsiveHorizontalGallery';
|
12
|
-
import { HORIZONTAL_GALLERY_BUTTON_WIDTH, HORIZONTAL_GALLERY_GAP } from './styles/HorizontalGallery.styles';
|
13
|
-
import { LARGE_HORIZONTAL_GALLERY_TILE_SIZE_REM, SMALL_HORIZONTAL_GALLERY_TILE_SIZE_REM, floatingLocalVideoModalStyle, floatingLocalVideoTileStyle, horizontalGalleryContainerStyle, horizontalGalleryStyle, layerHostStyle, localVideoTileContainerStyle, videoGalleryContainerStyle, videoGalleryOuterDivStyle, localVideoTileOuterPaddingPX, SMALL_FLOATING_MODAL_SIZE_PX, LARGE_FLOATING_MODAL_SIZE_PX } from './styles/VideoGallery.styles';
|
14
8
|
import { isNarrowWidth, _useContainerHeight, _useContainerWidth } from './utils/responsive';
|
15
9
|
import { LocalScreenShare } from './VideoGallery/LocalScreenShare';
|
16
10
|
import { RemoteScreenShare } from './VideoGallery/RemoteScreenShare';
|
17
|
-
import { useId } from '@fluentui/react-hooks';
|
18
|
-
import { localVideoTileWithControlsContainerStyle, LOCAL_VIDEO_TILE_ZINDEX } from './styles/VideoGallery.styles';
|
19
|
-
import { _ModalClone } from './ModalClone/ModalClone';
|
20
11
|
import { _LocalVideoTile } from './LocalVideoTile';
|
21
12
|
/* @conditional-compile-remove(rooms) */
|
22
13
|
import { _usePermissions } from '../permissions';
|
14
|
+
import { DefaultLayout } from './VideoGallery/DefaultLayout';
|
15
|
+
import { FloatingLocalVideoLayout } from './VideoGallery/FloatingLocalVideoLayout';
|
16
|
+
import { useIdentifiers } from '../identifiers';
|
17
|
+
import { videoGalleryOuterDivStyle } from './styles/VideoGallery.styles';
|
18
|
+
import { floatingLocalVideoTileStyle } from './VideoGallery/styles/FloatingLocalVideo.styles';
|
19
|
+
/* @conditional-compile-remove(pinned-participants) */
|
20
|
+
import { useId } from '@fluentui/react-hooks';
|
23
21
|
/**
|
24
22
|
* @private
|
25
23
|
* Currently the Calling JS SDK supports up to 4 remote video streams
|
@@ -30,17 +28,19 @@ export const DEFAULT_MAX_REMOTE_VIDEO_STREAMS = 4;
|
|
30
28
|
* Set aside only 6 dominant speakers for remaining audio participants
|
31
29
|
*/
|
32
30
|
export const MAX_AUDIO_DOMINANT_SPEAKERS = 6;
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
31
|
+
/**
|
32
|
+
* @private
|
33
|
+
* Default remote video tile menu options
|
34
|
+
*/
|
35
|
+
export const DEFAULT_REMOTE_VIDEO_TILE_MENU_OPTIONS = {
|
36
|
+
kind: 'contextual'
|
38
37
|
};
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
/* @conditional-compile-remove(pinned-participants) */
|
39
|
+
/**
|
40
|
+
* @private
|
41
|
+
* Maximum number of remote video tiles that can be pinned
|
42
|
+
*/
|
43
|
+
export const MAX_PINNED_REMOTE_VIDEO_TILES = 4;
|
44
44
|
/**
|
45
45
|
* VideoGallery represents a layout of video tiles for a specific call.
|
46
46
|
* It displays a {@link VideoTile} for the local user as well as for each remote participant who has joined the call.
|
@@ -48,53 +48,34 @@ const modalMaxDragPosition = { x: localVideoTileOuterPaddingPX, y: localVideoTil
|
|
48
48
|
* @public
|
49
49
|
*/
|
50
50
|
export const VideoGallery = (props) => {
|
51
|
-
var _a, _b, _c
|
52
|
-
const { localParticipant, remoteParticipants = [], localVideoViewOptions, remoteVideoViewOptions, dominantSpeakers, onRenderLocalVideoTile, onRenderRemoteVideoTile, onCreateLocalStreamView, onDisposeLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteStreamView, styles, layout, onRenderAvatar, showMuteIndicator, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS, showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps
|
51
|
+
var _a, _b, _c;
|
52
|
+
const { localParticipant, remoteParticipants = [], localVideoViewOptions, remoteVideoViewOptions, dominantSpeakers, onRenderLocalVideoTile, onRenderRemoteVideoTile, onCreateLocalStreamView, onDisposeLocalStreamView, onCreateRemoteStreamView, onDisposeRemoteStreamView, styles, layout, onRenderAvatar, showMuteIndicator, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEO_STREAMS, showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps,
|
53
|
+
/* @conditional-compile-remove(pinned-participants) */
|
54
|
+
onPinParticipant: onPinParticipantHandler,
|
55
|
+
/* @conditional-compile-remove(pinned-participants) */
|
56
|
+
onUnpinParticipant: onUnpinParticipantHandler,
|
57
|
+
/* @conditional-compile-remove(pinned-participants) */
|
58
|
+
remoteVideoTileMenuOptions = DEFAULT_REMOTE_VIDEO_TILE_MENU_OPTIONS } = props;
|
53
59
|
const ids = useIdentifiers();
|
54
60
|
const theme = useTheme();
|
55
61
|
const localeStrings = useLocale().strings.videoGallery;
|
56
|
-
const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
|
62
|
+
const strings = useMemo(() => (Object.assign(Object.assign({}, localeStrings), props.strings)), [localeStrings, props.strings]);
|
63
|
+
/* @conditional-compile-remove(pinned-participants) */
|
64
|
+
const drawerMenuHostIdFromProp = remoteVideoTileMenuOptions && remoteVideoTileMenuOptions.kind === 'drawer'
|
65
|
+
? remoteVideoTileMenuOptions.hostId
|
66
|
+
: undefined;
|
67
|
+
/* @conditional-compile-remove(pinned-participants) */
|
68
|
+
const drawerMenuHostId = useId('drawerMenuHost', drawerMenuHostIdFromProp);
|
57
69
|
const shouldFloatLocalVideo = !!(layout === 'floatingLocalVideo' && remoteParticipants.length > 0);
|
58
|
-
const shouldFloatNonDraggableLocalVideo = !!(showCameraSwitcherInLocalPreview && shouldFloatLocalVideo);
|
59
70
|
const containerRef = useRef(null);
|
60
71
|
const containerWidth = _useContainerWidth(containerRef);
|
61
72
|
const containerHeight = _useContainerHeight(containerRef);
|
62
73
|
const isNarrow = containerWidth ? isNarrowWidth(containerWidth) : false;
|
63
|
-
|
64
|
-
const
|
65
|
-
/* @conditional-compile-remove(
|
66
|
-
|
67
|
-
const
|
68
|
-
const modalHeight = isNarrow ? SMALL_FLOATING_MODAL_SIZE_PX.height : LARGE_FLOATING_MODAL_SIZE_PX.height;
|
69
|
-
// The minimum drag position is the top left of the video gallery. i.e. the modal (PiP) should not be able
|
70
|
-
// to be dragged offscreen and these are the top and left bounds of that calculation.
|
71
|
-
const modalMinDragPosition = useMemo(() => containerWidth && containerHeight
|
72
|
-
? {
|
73
|
-
// We use -containerWidth/Height because our modal is positioned to start in the bottom right,
|
74
|
-
// hence (0,0) is the bottom right of the video gallery.
|
75
|
-
x: -containerWidth + modalWidth + localVideoTileOuterPaddingPX,
|
76
|
-
y: -containerHeight + modalHeight + localVideoTileOuterPaddingPX
|
77
|
-
}
|
78
|
-
: undefined, [containerHeight, containerWidth, modalHeight, modalWidth]);
|
79
|
-
visibleVideoParticipants.current = smartDominantSpeakerParticipants({
|
80
|
-
participants: (_a = remoteParticipants === null || remoteParticipants === void 0 ? void 0 : remoteParticipants.filter((p) => { var _a; return (_a = p.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable; })) !== null && _a !== void 0 ? _a : [],
|
81
|
-
dominantSpeakers,
|
82
|
-
lastVisibleParticipants: visibleVideoParticipants.current,
|
83
|
-
maxDominantSpeakers: maxRemoteVideoStreams
|
84
|
-
}).slice(0, maxRemoteVideoStreams);
|
85
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
86
|
-
visibleCallingParticipants.current = (_b = remoteParticipants === null || remoteParticipants === void 0 ? void 0 : remoteParticipants.filter((p) => p.state === ('Connecting' || 'Ringing'))) !== null && _b !== void 0 ? _b : [];
|
87
|
-
// This set will be used to filter out participants already in visibleVideoParticipants
|
88
|
-
const visibleVideoParticipantsSet = new Set(visibleVideoParticipants.current.map((p) => p.userId));
|
89
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
90
|
-
const visibleCallingParticipantsSet = new Set(visibleCallingParticipants.current.map((p) => p.userId));
|
91
|
-
visibleAudioParticipants.current = smartDominantSpeakerParticipants({
|
92
|
-
participants: (_c = remoteParticipants === null || remoteParticipants === void 0 ? void 0 : remoteParticipants.filter((p) => !visibleVideoParticipantsSet.has(p.userId) &&
|
93
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !visibleCallingParticipantsSet.has(p.userId))) !== null && _c !== void 0 ? _c : [],
|
94
|
-
dominantSpeakers,
|
95
|
-
lastVisibleParticipants: visibleAudioParticipants.current,
|
96
|
-
maxDominantSpeakers: MAX_AUDIO_DOMINANT_SPEAKERS
|
97
|
-
});
|
74
|
+
/* @conditional-compile-remove(pinned-participants) */
|
75
|
+
const [pinnedParticipantsState, setPinnedParticipantsState] = React.useState([]);
|
76
|
+
/* @conditional-compile-remove(pinned-participants) */
|
77
|
+
// Use pinnedParticipants from props but if it is not defined use the maintained state of pinned participants
|
78
|
+
const pinnedParticipants = (_a = props.pinnedParticipants) !== null && _a !== void 0 ? _a : pinnedParticipantsState;
|
98
79
|
/* @conditional-compile-remove(rooms) */
|
99
80
|
const permissions = _usePermissions();
|
100
81
|
/**
|
@@ -112,7 +93,7 @@ export const VideoGallery = (props) => {
|
|
112
93
|
const localVideoTileStyles = concatStyleSets(shouldFloatLocalVideo ? floatingLocalVideoTileStyle : {}, {
|
113
94
|
root: { borderRadius: theme.effects.roundedCorner4 }
|
114
95
|
}, styles === null || styles === void 0 ? void 0 : styles.localVideo);
|
115
|
-
const initialsName = !localParticipant.displayName ?
|
96
|
+
const initialsName = !localParticipant.displayName ? '' : localParticipant.displayName;
|
116
97
|
return (React.createElement(Stack, { key: "local-video-tile-key", tabIndex: 0, "aria-label": strings.localVideoMovementLabel, role: 'dialog' },
|
117
98
|
React.createElement(_LocalVideoTile, { userId: localParticipant.userId, onCreateLocalStreamView: onCreateLocalStreamView, onDisposeLocalStreamView: onDisposeLocalStreamView, isAvailable: (_a = localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable, isMuted: localParticipant.isMuted, renderElement: (_b = localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.videoStream) === null || _b === void 0 ? void 0 : _b.renderElement, displayName: isNarrow ? '' : strings.localVideoLabel, initialsName: initialsName, localVideoViewOptions: localVideoViewOptions, onRenderAvatar: onRenderAvatar, showLabel: !(shouldFloatLocalVideo && isNarrow), showMuteIndicator: showMuteIndicator, showCameraSwitcherInLocalPreview: showCameraSwitcherInLocalPreview, localVideoCameraCycleButtonProps: localVideoCameraCycleButtonProps, localVideoCameraSwitcherLabel: strings.localVideoCameraSwitcherLabel, localVideoSelectedDescription: strings.localVideoSelectedDescription, styles: localVideoTileStyles })));
|
118
99
|
}, [
|
@@ -131,78 +112,104 @@ export const VideoGallery = (props) => {
|
|
131
112
|
strings.localVideoLabel,
|
132
113
|
strings.localVideoMovementLabel,
|
133
114
|
strings.localVideoSelectedDescription,
|
134
|
-
strings.displayNamePlaceholder,
|
135
115
|
styles === null || styles === void 0 ? void 0 : styles.localVideo,
|
136
116
|
theme.effects.roundedCorner4,
|
137
117
|
/* @conditional-compile-remove(rooms) */ permissions.cameraButton
|
138
118
|
]);
|
119
|
+
/* @conditional-compile-remove(pinned-participants) */
|
120
|
+
const onPinParticipant = useCallback((userId) => {
|
121
|
+
if (pinnedParticipants.length >= MAX_PINNED_REMOTE_VIDEO_TILES) {
|
122
|
+
return;
|
123
|
+
}
|
124
|
+
if (!pinnedParticipantsState.includes(userId)) {
|
125
|
+
setPinnedParticipantsState(pinnedParticipantsState.concat(userId));
|
126
|
+
}
|
127
|
+
onPinParticipantHandler === null || onPinParticipantHandler === void 0 ? void 0 : onPinParticipantHandler(userId);
|
128
|
+
}, [pinnedParticipants.length, pinnedParticipantsState, setPinnedParticipantsState, onPinParticipantHandler]);
|
129
|
+
/* @conditional-compile-remove(pinned-participants) */
|
130
|
+
const onUnpinParticipant = useCallback((userId) => {
|
131
|
+
setPinnedParticipantsState(pinnedParticipantsState.filter((p) => p !== userId));
|
132
|
+
onUnpinParticipantHandler === null || onUnpinParticipantHandler === void 0 ? void 0 : onUnpinParticipantHandler(userId);
|
133
|
+
}, [pinnedParticipantsState, setPinnedParticipantsState, onUnpinParticipantHandler]);
|
139
134
|
const defaultOnRenderVideoTile = useCallback((participant, isVideoParticipant) => {
|
140
135
|
const remoteVideoStream = participant.videoStream;
|
141
|
-
|
136
|
+
/* @conditional-compile-remove(pinned-participants) */
|
137
|
+
const isPinned = pinnedParticipants === null || pinnedParticipants === void 0 ? void 0 : pinnedParticipants.includes(participant.userId);
|
138
|
+
return (React.createElement(_RemoteVideoTile, { key: participant.userId, userId: participant.userId, remoteParticipant: participant, onCreateRemoteStreamView: isVideoParticipant ? onCreateRemoteStreamView : undefined, onDisposeRemoteStreamView: isVideoParticipant ? onDisposeRemoteStreamView : undefined, isAvailable: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isAvailable : false, isReceiving: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.isReceiving : false, renderElement: isVideoParticipant ? remoteVideoStream === null || remoteVideoStream === void 0 ? void 0 : remoteVideoStream.renderElement : undefined, remoteVideoViewOptions: isVideoParticipant ? remoteVideoViewOptions : undefined, onRenderAvatar: onRenderAvatar, showMuteIndicator: showMuteIndicator, strings: strings,
|
142
139
|
/* @conditional-compile-remove(PSTN-calls) */
|
143
|
-
participantState: participant.state
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
140
|
+
participantState: participant.state,
|
141
|
+
/* @conditional-compile-remove(pinned-participants) */
|
142
|
+
menuKind: remoteVideoTileMenuOptions
|
143
|
+
? remoteVideoTileMenuOptions.kind === 'drawer'
|
144
|
+
? 'drawer'
|
145
|
+
: 'contextual'
|
146
|
+
: undefined,
|
147
|
+
/* @conditional-compile-remove(pinned-participants) */
|
148
|
+
drawerMenuHostId: drawerMenuHostId,
|
149
|
+
/* @conditional-compile-remove(pinned-participants) */
|
150
|
+
onPinParticipant: onPinParticipant,
|
151
|
+
/* @conditional-compile-remove(pinned-participants) */
|
152
|
+
onUnpinParticipant: onUnpinParticipant,
|
153
|
+
/* @conditional-compile-remove(pinned-participants) */
|
154
|
+
isPinned: isPinned,
|
155
|
+
/* @conditional-compile-remove(pinned-participants) */
|
156
|
+
disablePinMenuItem: pinnedParticipants.length >= MAX_PINNED_REMOTE_VIDEO_TILES }));
|
157
|
+
}, [
|
158
|
+
onCreateRemoteStreamView,
|
159
|
+
onDisposeRemoteStreamView,
|
160
|
+
remoteVideoViewOptions,
|
161
|
+
onRenderAvatar,
|
162
|
+
showMuteIndicator,
|
163
|
+
strings,
|
164
|
+
/* @conditional-compile-remove(pinned-participants) */ drawerMenuHostId,
|
165
|
+
/* @conditional-compile-remove(pinned-participants) */ remoteVideoTileMenuOptions,
|
166
|
+
/* @conditional-compile-remove(pinned-participants) */ pinnedParticipants,
|
167
|
+
/* @conditional-compile-remove(pinned-participants) */ onPinParticipant,
|
168
|
+
/* @conditional-compile-remove(pinned-participants) */ onUnpinParticipant
|
169
|
+
]);
|
161
170
|
const screenShareParticipant = remoteParticipants.find((participant) => { var _a; return (_a = participant.screenShareStream) === null || _a === void 0 ? void 0 : _a.isAvailable; });
|
162
|
-
const screenShareActive = screenShareParticipant || (localParticipant === null || localParticipant === void 0 ? void 0 : localParticipant.isScreenSharingOn);
|
163
|
-
const createGridTiles = () => {
|
164
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
165
|
-
return videoTiles.length > 0 ? videoTiles : audioTiles.concat(callingTiles);
|
166
|
-
return videoTiles.length > 0 ? videoTiles : audioTiles;
|
167
|
-
};
|
168
|
-
const gridTiles = createGridTiles();
|
169
|
-
const createHorizontalGalleryTiles = () => {
|
170
|
-
if (screenShareActive) {
|
171
|
-
// If screen sharing is active, assign video and audio participants as horizontal gallery participants
|
172
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
173
|
-
return videoTiles.concat(audioTiles.concat(callingTiles));
|
174
|
-
return videoTiles.concat(audioTiles);
|
175
|
-
}
|
176
|
-
else {
|
177
|
-
// If screen sharing is not active, then assign all video tiles as grid tiles.
|
178
|
-
// If there are no video tiles, then assign audio tiles as grid tiles.
|
179
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
180
|
-
return videoTiles.length > 0 ? audioTiles.concat(callingTiles) : [];
|
181
|
-
return videoTiles.length > 0 ? audioTiles : [];
|
182
|
-
}
|
183
|
-
};
|
184
|
-
const horizontalGalleryTiles = createHorizontalGalleryTiles();
|
185
|
-
if (!shouldFloatLocalVideo && localVideoTile) {
|
186
|
-
gridTiles.push(localVideoTile);
|
187
|
-
}
|
188
171
|
const localScreenShareStreamComponent = React.createElement(LocalScreenShare, { localParticipant: localParticipant });
|
189
|
-
const remoteScreenShareComponent = screenShareParticipant && (React.createElement(RemoteScreenShare, Object.assign({}, screenShareParticipant, { renderElement: (
|
190
|
-
const
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
172
|
+
const remoteScreenShareComponent = screenShareParticipant && (React.createElement(RemoteScreenShare, Object.assign({}, screenShareParticipant, { renderElement: (_b = screenShareParticipant.screenShareStream) === null || _b === void 0 ? void 0 : _b.renderElement, onCreateRemoteStreamView: onCreateRemoteStreamView, onDisposeRemoteStreamView: onDisposeRemoteStreamView, isReceiving: (_c = screenShareParticipant.screenShareStream) === null || _c === void 0 ? void 0 : _c.isReceiving })));
|
173
|
+
const screenShareComponent = remoteScreenShareComponent
|
174
|
+
? remoteScreenShareComponent
|
175
|
+
: localParticipant.isScreenSharingOn
|
176
|
+
? localScreenShareStreamComponent
|
177
|
+
: undefined;
|
178
|
+
const layoutProps = useMemo(() => ({
|
179
|
+
remoteParticipants,
|
180
|
+
screenShareComponent,
|
181
|
+
showCameraSwitcherInLocalPreview,
|
182
|
+
maxRemoteVideoStreams,
|
183
|
+
dominantSpeakers,
|
184
|
+
styles,
|
185
|
+
onRenderRemoteParticipant: onRenderRemoteVideoTile !== null && onRenderRemoteVideoTile !== void 0 ? onRenderRemoteVideoTile : defaultOnRenderVideoTile,
|
186
|
+
localVideoComponent: localVideoTile,
|
187
|
+
parentWidth: containerWidth,
|
188
|
+
parentHeight: containerHeight,
|
189
|
+
/* @conditional-compile-remove(pinned-participants) */ pinnedParticipantUserIds: pinnedParticipants
|
190
|
+
}), [
|
191
|
+
remoteParticipants,
|
192
|
+
screenShareComponent,
|
193
|
+
showCameraSwitcherInLocalPreview,
|
194
|
+
maxRemoteVideoStreams,
|
195
|
+
dominantSpeakers,
|
196
|
+
styles,
|
197
|
+
localVideoTile,
|
198
|
+
containerWidth,
|
199
|
+
containerHeight,
|
200
|
+
onRenderRemoteVideoTile,
|
201
|
+
defaultOnRenderVideoTile,
|
202
|
+
/* @conditional-compile-remove(pinned-participants) */ pinnedParticipants
|
203
|
+
]);
|
204
|
+
const videoGalleryLayout = useMemo(() => {
|
205
|
+
if (layout === 'floatingLocalVideo') {
|
206
|
+
return React.createElement(FloatingLocalVideoLayout, Object.assign({}, layoutProps));
|
207
|
+
}
|
208
|
+
return React.createElement(DefaultLayout, Object.assign({}, layoutProps));
|
209
|
+
}, [layout, layoutProps]);
|
210
|
+
return (React.createElement("div", {
|
211
|
+
/* @conditional-compile-remove(pinned-participants) */
|
212
|
+
// We don't assign an drawer menu host id to the VideoGallery when a drawerMenuHostId is assigned from props
|
213
|
+
id: drawerMenuHostIdFromProp ? undefined : drawerMenuHostId, "data-ui-id": ids.videoGallery, ref: containerRef, className: mergeStyles(videoGalleryOuterDivStyle, styles === null || styles === void 0 ? void 0 : styles.root) }, videoGalleryLayout));
|
207
214
|
};
|
208
215
|
//# sourceMappingURL=VideoGallery.js.map
|