@azure/communication-react 1.4.2-alpha-202212010027.0 → 1.4.2-alpha-202301052137
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.stable.md +10 -1
- package/dist/communication-react.d.ts +319 -275
- package/dist/dist-cjs/communication-react/index.js +2528 -1644
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/identifier.js +1 -1
- 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 +21 -10
- 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/utils/videoGalleryUtils.d.ts +12 -0
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +20 -2
- 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/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/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 +6 -2
- 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 +4 -4
- package/dist/dist-esm/communication-react/src/index.js +3 -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/{DomainPermissions.js → SitePermissions.js} +28 -22
- 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 +8 -0
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.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.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/ParticipantsButton.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/ParticipantsButton.js +25 -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 +9 -4
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +64 -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 +2 -2
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +12 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.d.ts +6 -2
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +14 -2
- package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.d.ts +16 -5
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +14 -11
- package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
- 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 +45 -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 +61 -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 +34 -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/PinnedParticipantsLayout.d.ts +25 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.js +62 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.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 +20 -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/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/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 +21 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +72 -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 +36 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +116 -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 +25 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +105 -122
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.js +15 -16
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +5 -3
- package/dist/dist-esm/react-components/src/components/index.js +2 -1
- 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/UnsupportedEnvironment.styles.d.ts +7 -3
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +23 -9
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +1 -1
- 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/utils.js +4 -0
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +28 -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 +46 -15
- 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 +9 -5
- package/dist/dist-esm/react-components/src/theming/icons.js +26 -18
- 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 +7 -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 +12 -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 +83 -37
- 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 +6 -17
- 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 +17 -16
- 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 +68 -28
- 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 +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +4 -2
- 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 +3 -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 +4 -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.js +19 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.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 +8 -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/Utils.d.ts +20 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +69 -25
- 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 +6 -0
- 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/icons.d.ts +9 -5
- 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 +3 -0
- package/package.json +9 -9
- 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.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-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
@@ -17,7 +17,7 @@ export interface LocalVideoStreamLifecycleMaintainerProps extends VideoStreamLif
|
|
17
17
|
*
|
18
18
|
* @private
|
19
19
|
*/
|
20
|
-
export declare const useLocalVideoStreamLifecycleMaintainer: (props: LocalVideoStreamLifecycleMaintainerProps) =>
|
20
|
+
export declare const useLocalVideoStreamLifecycleMaintainer: (props: LocalVideoStreamLifecycleMaintainerProps) => CreateVideoStreamViewResult | undefined;
|
21
21
|
/** @private */
|
22
22
|
export interface RemoteVideoStreamLifecycleMaintainerProps extends VideoStreamLifecycleMaintainerExtendableProps {
|
23
23
|
onCreateRemoteStreamView?: (userId: string, options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;
|
@@ -29,5 +29,5 @@ export interface RemoteVideoStreamLifecycleMaintainerProps extends VideoStreamLi
|
|
29
29
|
*
|
30
30
|
* @private
|
31
31
|
*/
|
32
|
-
export declare const useRemoteVideoStreamLifecycleMaintainer: (props: RemoteVideoStreamLifecycleMaintainerProps) =>
|
32
|
+
export declare const useRemoteVideoStreamLifecycleMaintainer: (props: RemoteVideoStreamLifecycleMaintainerProps) => CreateVideoStreamViewResult | undefined;
|
33
33
|
//# sourceMappingURL=useVideoStreamLifecycleMaintainer.d.ts.map
|
@@ -1,6 +1,6 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT license.
|
3
|
-
import { useEffect, useMemo } from 'react';
|
3
|
+
import { useEffect, useMemo, useState } from 'react';
|
4
4
|
/**
|
5
5
|
* Helper hook to maintain the video stream lifecycle. This calls onCreateStreamView and onDisposeStreamView
|
6
6
|
* appropriately based on react lifecycle events and prop changes.
|
@@ -21,9 +21,13 @@ import { useEffect, useMemo } from 'react';
|
|
21
21
|
*/
|
22
22
|
const useVideoStreamLifecycleMaintainer = (props) => {
|
23
23
|
const { isMirrored, isScreenSharingOn, isStreamAvailable, onCreateStreamView, onDisposeStreamView, renderElementExists, scalingMode } = props;
|
24
|
+
const [videoStreamViewResult, setVideoStreamViewResult] = useState();
|
24
25
|
useEffect(() => {
|
26
|
+
var _a;
|
25
27
|
if (isStreamAvailable && !renderElementExists) {
|
26
|
-
onCreateStreamView === null || onCreateStreamView === void 0 ? void 0 : onCreateStreamView({ isMirrored, scalingMode })
|
28
|
+
(_a = onCreateStreamView === null || onCreateStreamView === void 0 ? void 0 : onCreateStreamView({ isMirrored, scalingMode })) === null || _a === void 0 ? void 0 : _a.then((result) => {
|
29
|
+
result && setVideoStreamViewResult(result);
|
30
|
+
});
|
27
31
|
}
|
28
32
|
// Always clean up element to make tile up to date and be able to dispose correctly
|
29
33
|
return () => {
|
@@ -54,6 +58,7 @@ const useVideoStreamLifecycleMaintainer = (props) => {
|
|
54
58
|
}
|
55
59
|
};
|
56
60
|
}, [isScreenSharingOn, onDisposeStreamView]);
|
61
|
+
return videoStreamViewResult;
|
57
62
|
};
|
58
63
|
/**
|
59
64
|
* Extension of {@link useVideoStreamLifecycleMaintainer} specifically for local video streams
|
@@ -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,MAAM,OAAO,CAAC;
|
1
|
+
{"version":3,"file":"useVideoStreamLifecycleMaintainer.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC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AAG,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';\n\n/** @private */\nexport interface VideoStreamLifecycleMaintainerExtendableProps {\n isStreamAvailable?: boolean;\n renderElementExists?: boolean;\n isMirrored?: boolean;\n scalingMode?: ViewScalingMode;\n isScreenSharingOn?: 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 } = 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 }\n };\n }, [\n isMirrored,\n isScreenSharingOn,\n isStreamAvailable,\n onCreateStreamView,\n onDisposeStreamView,\n renderElementExists,\n scalingMode\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"]}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { IContextualMenuProps } from '@fluentui/react';
|
2
|
+
import { VideoGalleryRemoteParticipant, ViewScalingMode } from '../../types';
|
3
|
+
/**
|
4
|
+
* @private
|
5
|
+
*/
|
6
|
+
export declare const useVideoTileContextualMenuProps: (props: {
|
7
|
+
remoteParticipant: VideoGalleryRemoteParticipant;
|
8
|
+
strings?: {
|
9
|
+
fitRemoteParticipantToFrame?: string | undefined;
|
10
|
+
fillRemoteParticipantFrame?: string | undefined;
|
11
|
+
pinParticipantForMe?: string | undefined;
|
12
|
+
unpinParticipantForMe?: string | undefined;
|
13
|
+
} | undefined;
|
14
|
+
view?: {
|
15
|
+
updateScalingMode: (scalingMode: ViewScalingMode) => Promise<void>;
|
16
|
+
} | undefined;
|
17
|
+
isPinned?: boolean | undefined;
|
18
|
+
onPinParticipant?: ((userId: string) => void) | undefined;
|
19
|
+
onUnpinParticipant?: ((userId: string) => void) | undefined;
|
20
|
+
}) => IContextualMenuProps | undefined;
|
21
|
+
//# sourceMappingURL=useVideoTileContextualMenuProps.d.ts.map
|
@@ -0,0 +1,72 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT license.
|
3
|
+
import { useMemo } from 'react';
|
4
|
+
/**
|
5
|
+
* @private
|
6
|
+
*/
|
7
|
+
export const useVideoTileContextualMenuProps = (props) => {
|
8
|
+
var _a;
|
9
|
+
const { view, strings, isPinned, onPinParticipant, onUnpinParticipant } = props;
|
10
|
+
const scalingMode = useMemo(() => {
|
11
|
+
var _a;
|
12
|
+
/* @conditional-compile-remove(pinned-participants) */
|
13
|
+
return (_a = props.remoteParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.scalingMode;
|
14
|
+
return undefined;
|
15
|
+
}, [
|
16
|
+
/* @conditional-compile-remove(pinned-participants) */
|
17
|
+
(_a = props.remoteParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.scalingMode
|
18
|
+
]);
|
19
|
+
const contextualMenuProps = useMemo(() => {
|
20
|
+
const items = [];
|
21
|
+
if (isPinned !== undefined) {
|
22
|
+
if (isPinned && onUnpinParticipant && (strings === null || strings === void 0 ? void 0 : strings.unpinParticipantForMe)) {
|
23
|
+
items.push({
|
24
|
+
key: 'unpin',
|
25
|
+
text: strings.unpinParticipantForMe,
|
26
|
+
iconProps: { iconName: 'UnpinParticipant', styles: { root: { lineHeight: '1rem' } } },
|
27
|
+
onClick: () => onUnpinParticipant === null || onUnpinParticipant === void 0 ? void 0 : onUnpinParticipant(props.remoteParticipant.userId),
|
28
|
+
'data-ui-id': 'video-tile-unpin-participant-button'
|
29
|
+
});
|
30
|
+
}
|
31
|
+
if (!isPinned && onPinParticipant && (strings === null || strings === void 0 ? void 0 : strings.pinParticipantForMe)) {
|
32
|
+
items.push({
|
33
|
+
key: 'pin',
|
34
|
+
text: strings.pinParticipantForMe,
|
35
|
+
iconProps: { iconName: 'PinParticipant', styles: { root: { lineHeight: '1rem' } } },
|
36
|
+
onClick: () => onPinParticipant === null || onPinParticipant === void 0 ? void 0 : onPinParticipant(props.remoteParticipant.userId),
|
37
|
+
'data-ui-id': 'video-tile-pin-participant-button'
|
38
|
+
});
|
39
|
+
}
|
40
|
+
}
|
41
|
+
if (scalingMode) {
|
42
|
+
if (scalingMode === 'Crop' && (strings === null || strings === void 0 ? void 0 : strings.fitRemoteParticipantToFrame)) {
|
43
|
+
items.push({
|
44
|
+
key: 'fitRemoteParticipantToFrame',
|
45
|
+
text: strings.fitRemoteParticipantToFrame,
|
46
|
+
iconProps: { iconName: 'VideoTileScaleFit', styles: { root: { lineHeight: '1rem' } } },
|
47
|
+
onClick: () => {
|
48
|
+
view === null || view === void 0 ? void 0 : view.updateScalingMode('Fit');
|
49
|
+
}
|
50
|
+
});
|
51
|
+
}
|
52
|
+
else if (scalingMode === 'Fit' && (strings === null || strings === void 0 ? void 0 : strings.fillRemoteParticipantFrame)) {
|
53
|
+
{
|
54
|
+
items.push({
|
55
|
+
key: 'fillRemoteParticipantFrame',
|
56
|
+
text: strings.fillRemoteParticipantFrame,
|
57
|
+
iconProps: { iconName: 'VideoTileScaleFill', styles: { root: { lineHeight: '1rem' } } },
|
58
|
+
onClick: () => {
|
59
|
+
view === null || view === void 0 ? void 0 : view.updateScalingMode('Crop');
|
60
|
+
}
|
61
|
+
});
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
|
+
if (items.length === 0) {
|
66
|
+
return undefined;
|
67
|
+
}
|
68
|
+
return { items };
|
69
|
+
}, [scalingMode, strings, view, isPinned, onPinParticipant, onUnpinParticipant, props.remoteParticipant.userId]);
|
70
|
+
return contextualMenuProps;
|
71
|
+
};
|
72
|
+
//# sourceMappingURL=useVideoTileContextualMenuProps.js.map
|
@@ -0,0 +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,OAAO,EAAE,MAAM,OAAO,CAAC;AAGhC;;GAEG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,KAY/C,EAAoC,EAAE;;IACrC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IAChF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,EAAE;;QAC/B,sDAAsD;QACtD,OAAO,MAAA,KAAK,CAAC,iBAAiB,CAAC,WAAW,0CAAE,WAAW,CAAC;QACxD,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE;QACD,sDAAsD;QACtD,MAAA,KAAK,CAAC,iBAAiB,CAAC,WAAW,0CAAE,WAAW;KACjD,CAAC,CAAC;IAEH,MAAM,mBAAmB,GAAqC,OAAO,CAAC,GAAG,EAAE;QACzE,MAAM,KAAK,GAA0B,EAAE,CAAC;QAExC,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,IAAI,QAAQ,IAAI,kBAAkB,KAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,qBAAqB,CAAA,EAAE;gBACpE,KAAK,CAAC,IAAI,CAAC;oBACT,GAAG,EAAE,OAAO;oBACZ,IAAI,EAAE,OAAO,CAAC,qBAAqB;oBACnC,SAAS,EAAE,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;oBACrF,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAG,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC;oBACnE,YAAY,EAAE,qCAAqC;iB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E,QAAQ,EAAE,oBAAoB,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE;wBACvF,OAAO,EAAE,GAAG,EAAE;4BACZ,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAiB,CAAC,MAAM,CAAC,CAAC;wBAClC,CAAC;qBACF,CAAC,CAAC;iBACJ;aACF;SACF;QACD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACtB,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;IAEjH,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 { useMemo } from 'react';\nimport { VideoGalleryRemoteParticipant, ViewScalingMode } from '../../types';\n\n/**\n * @private\n */\nexport const useVideoTileContextualMenuProps = (props: {\n remoteParticipant: VideoGalleryRemoteParticipant;\n strings?: {\n fitRemoteParticipantToFrame?: string;\n fillRemoteParticipantFrame?: string;\n pinParticipantForMe?: string;\n unpinParticipantForMe?: string;\n };\n view?: { updateScalingMode: (scalingMode: ViewScalingMode) => Promise<void> };\n isPinned?: boolean;\n onPinParticipant?: (userId: string) => void;\n onUnpinParticipant?: (userId: string) => void;\n}): IContextualMenuProps | undefined => {\n const { view, strings, isPinned, onPinParticipant, onUnpinParticipant } = props;\n const scalingMode = useMemo(() => {\n /* @conditional-compile-remove(pinned-participants) */\n return props.remoteParticipant.videoStream?.scalingMode;\n return undefined;\n }, [\n /* @conditional-compile-remove(pinned-participants) */\n props.remoteParticipant.videoStream?.scalingMode\n ]);\n\n const contextualMenuProps: IContextualMenuProps | undefined = useMemo(() => {\n const items: IContextualMenuItem[] = [];\n\n if (isPinned !== undefined) {\n if (isPinned && onUnpinParticipant && strings?.unpinParticipantForMe) {\n items.push({\n key: 'unpin',\n text: strings.unpinParticipantForMe,\n iconProps: { iconName: 'UnpinParticipant', styles: { root: { lineHeight: '1rem' } } },\n onClick: () => onUnpinParticipant?.(props.remoteParticipant.userId),\n 'data-ui-id': 'video-tile-unpin-participant-button'\n });\n }\n if (!isPinned && onPinParticipant && strings?.pinParticipantForMe) {\n items.push({\n key: 'pin',\n text: strings.pinParticipantForMe,\n iconProps: { iconName: 'PinParticipant', styles: { root: { lineHeight: '1rem' } } },\n onClick: () => onPinParticipant?.(props.remoteParticipant.userId),\n 'data-ui-id': 'video-tile-pin-participant-button'\n });\n }\n }\n if (scalingMode) {\n if (scalingMode === 'Crop' && strings?.fitRemoteParticipantToFrame) {\n items.push({\n key: 'fitRemoteParticipantToFrame',\n text: strings.fitRemoteParticipantToFrame,\n iconProps: { iconName: 'VideoTileScaleFit', styles: { root: { lineHeight: '1rem' } } },\n onClick: () => {\n view?.updateScalingMode('Fit');\n }\n });\n } else if (scalingMode === 'Fit' && strings?.fillRemoteParticipantFrame) {\n {\n items.push({\n key: 'fillRemoteParticipantFrame',\n text: strings.fillRemoteParticipantFrame,\n iconProps: { iconName: 'VideoTileScaleFill', styles: { root: { lineHeight: '1rem' } } },\n onClick: () => {\n view?.updateScalingMode('Crop');\n }\n });\n }\n }\n }\n if (items.length === 0) {\n return undefined;\n }\n\n return { items };\n }, [scalingMode, strings, view, isPinned, onPinParticipant, onUnpinParticipant, props.remoteParticipant.userId]);\n\n return contextualMenuProps;\n};\n"]}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { VideoGalleryParticipant, VideoGalleryRemoteParticipant } from '../../../types';
|
2
|
+
/**
|
3
|
+
* Arguments for {@link useFloatingLocalVideoLayout } to determine grid participants and horizontal participants
|
4
|
+
* @private
|
5
|
+
*/
|
6
|
+
export interface UseFloatingLocalVideoLayoutArgs {
|
7
|
+
remoteParticipants: VideoGalleryRemoteParticipant[];
|
8
|
+
dominantSpeakers?: string[];
|
9
|
+
maxRemoteVideoStreams?: number;
|
10
|
+
maxAudioDominantSpeakers?: number;
|
11
|
+
isScreenShareActive?: boolean;
|
12
|
+
}
|
13
|
+
/**
|
14
|
+
* Arguments for {@link usePinnedParticipantLayout } to determine grid participants and horizontal participants
|
15
|
+
* @private
|
16
|
+
*/
|
17
|
+
export interface UsePinnedParticipantLayoutArgs extends UseFloatingLocalVideoLayoutArgs {
|
18
|
+
pinnedParticipantUserIds: string[];
|
19
|
+
}
|
20
|
+
/**
|
21
|
+
* A layout result that defines grid participants and horizontal participants
|
22
|
+
* @private
|
23
|
+
*/
|
24
|
+
export interface LayoutResult {
|
25
|
+
gridParticipants: VideoGalleryParticipant[];
|
26
|
+
horizontalGalleryParticipants: VideoGalleryParticipant[];
|
27
|
+
}
|
28
|
+
/**
|
29
|
+
* @private
|
30
|
+
*/
|
31
|
+
export declare const useFloatingLocalVideoLayout: (props: UseFloatingLocalVideoLayoutArgs) => LayoutResult;
|
32
|
+
/**
|
33
|
+
* @private
|
34
|
+
*/
|
35
|
+
export declare const usePinnedParticipantLayout: (props: UsePinnedParticipantLayoutArgs) => LayoutResult;
|
36
|
+
//# sourceMappingURL=videoGalleryLayoutUtils.d.ts.map
|
package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js
ADDED
@@ -0,0 +1,116 @@
|
|
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
|
+
/**
|
8
|
+
* @private
|
9
|
+
*/
|
10
|
+
export const useFloatingLocalVideoLayout = (props) => {
|
11
|
+
var _a, _b;
|
12
|
+
const visibleVideoParticipants = useRef([]);
|
13
|
+
const visibleAudioParticipants = useRef([]);
|
14
|
+
const { remoteParticipants, dominantSpeakers, maxRemoteVideoStreams = DEFAULT_MAX_REMOTE_VIDEOSTREAMS, maxAudioDominantSpeakers = DEFAULT_MAX_AUDIO_DOMINANT_SPEAKERS, isScreenShareActive = false } = props;
|
15
|
+
visibleVideoParticipants.current = smartDominantSpeakerParticipants({
|
16
|
+
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 : [],
|
17
|
+
dominantSpeakers,
|
18
|
+
lastVisibleParticipants: visibleVideoParticipants.current,
|
19
|
+
maxDominantSpeakers: maxRemoteVideoStreams
|
20
|
+
}).slice(0, maxRemoteVideoStreams);
|
21
|
+
const visibleVideoParticipantsSet = new Set(visibleVideoParticipants.current.map((p) => p.userId));
|
22
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
23
|
+
const callingParticipants = remoteParticipants.filter((p) => p.state === ('Connecting' || 'Ringing'));
|
24
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
25
|
+
const callingParticipantsSet = new Set(callingParticipants.map((p) => p.userId));
|
26
|
+
visibleAudioParticipants.current = smartDominantSpeakerParticipants({
|
27
|
+
participants: (_b = remoteParticipants === null || remoteParticipants === void 0 ? void 0 : remoteParticipants.filter((p) => !visibleVideoParticipantsSet.has(p.userId) &&
|
28
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !callingParticipantsSet.has(p.userId))) !== null && _b !== void 0 ? _b : [],
|
29
|
+
dominantSpeakers,
|
30
|
+
lastVisibleParticipants: visibleAudioParticipants.current,
|
31
|
+
maxDominantSpeakers: maxAudioDominantSpeakers
|
32
|
+
});
|
33
|
+
const getGridParticipants = useCallback(() => {
|
34
|
+
if (isScreenShareActive) {
|
35
|
+
return [];
|
36
|
+
}
|
37
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
38
|
+
return visibleVideoParticipants.current.length > 0
|
39
|
+
? visibleVideoParticipants.current
|
40
|
+
: visibleAudioParticipants.current.concat(callingParticipants);
|
41
|
+
return visibleVideoParticipants.current.length > 0
|
42
|
+
? visibleVideoParticipants.current
|
43
|
+
: visibleAudioParticipants.current;
|
44
|
+
}, [
|
45
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,
|
46
|
+
isScreenShareActive
|
47
|
+
]);
|
48
|
+
const gridParticipants = getGridParticipants();
|
49
|
+
const getHorizontalGalleryRemoteParticipants = useCallback(() => {
|
50
|
+
if (isScreenShareActive) {
|
51
|
+
// If screen sharing is active, assign video and audio participants as horizontal gallery participants
|
52
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
53
|
+
return visibleVideoParticipants.current.concat(visibleAudioParticipants.current.concat(callingParticipants));
|
54
|
+
return visibleVideoParticipants.current.concat(visibleAudioParticipants.current);
|
55
|
+
}
|
56
|
+
else {
|
57
|
+
// If screen sharing is not active, then assign all video tiles as grid tiles.
|
58
|
+
// If there are no video tiles, then assign audio tiles as grid tiles.
|
59
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
60
|
+
return visibleVideoParticipants.current.length > 0
|
61
|
+
? visibleAudioParticipants.current.concat(callingParticipants)
|
62
|
+
: [];
|
63
|
+
return visibleVideoParticipants.current.length > 0 ? visibleAudioParticipants.current : [];
|
64
|
+
}
|
65
|
+
}, [
|
66
|
+
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ callingParticipants,
|
67
|
+
isScreenShareActive
|
68
|
+
]);
|
69
|
+
const horizontalGalleryParticipants = getHorizontalGalleryRemoteParticipants();
|
70
|
+
return { gridParticipants, horizontalGalleryParticipants };
|
71
|
+
};
|
72
|
+
/**
|
73
|
+
* @private
|
74
|
+
*/
|
75
|
+
export const usePinnedParticipantLayout = (props) => {
|
76
|
+
// map remote participants by userId
|
77
|
+
const remoteParticipantMap = props.remoteParticipants.reduce((map, remoteParticipant) => {
|
78
|
+
map[remoteParticipant.userId] = remoteParticipant;
|
79
|
+
return map;
|
80
|
+
}, {});
|
81
|
+
// count pinned participants with video
|
82
|
+
let pinnedParticipantsWithVideoOnCount = 0;
|
83
|
+
// get pinned participants in the same order of pinned participant user ids using remoteParticipantMap
|
84
|
+
const pinnedParticipants = [];
|
85
|
+
props.pinnedParticipantUserIds.forEach((id) => {
|
86
|
+
var _a;
|
87
|
+
const pinnedParticipant = remoteParticipantMap[id];
|
88
|
+
if (pinnedParticipant) {
|
89
|
+
pinnedParticipants.push(pinnedParticipant);
|
90
|
+
if ((_a = pinnedParticipant.videoStream) === null || _a === void 0 ? void 0 : _a.isAvailable) {
|
91
|
+
pinnedParticipantsWithVideoOnCount++;
|
92
|
+
}
|
93
|
+
}
|
94
|
+
});
|
95
|
+
// get unpinned participants by filtering all remote participants using a set of pinned participant user ids
|
96
|
+
const pinnedParticipantUserIdSet = new Set(props.pinnedParticipantUserIds);
|
97
|
+
const unpinnedParticipants = props.remoteParticipants.filter((p) => !pinnedParticipantUserIdSet.has(p.userId));
|
98
|
+
const floatingLocalVideoLayoutProps = Object.assign(Object.assign({}, props), {
|
99
|
+
// if there are pinned participants then we should only consider unpinned participants
|
100
|
+
remoteParticipants: unpinnedParticipants,
|
101
|
+
// if there is a maximum of remote video streams we need to subtract pinned participants with video
|
102
|
+
maxRemoteVideoStreams: props.maxRemoteVideoStreams
|
103
|
+
? props.maxRemoteVideoStreams - pinnedParticipantsWithVideoOnCount
|
104
|
+
: undefined });
|
105
|
+
const floatingLocalVideoLayout = useFloatingLocalVideoLayout(floatingLocalVideoLayoutProps);
|
106
|
+
if (props.pinnedParticipantUserIds.length === 0) {
|
107
|
+
return floatingLocalVideoLayout;
|
108
|
+
}
|
109
|
+
return {
|
110
|
+
gridParticipants: props.isScreenShareActive ? [] : pinnedParticipants,
|
111
|
+
horizontalGalleryParticipants: props.isScreenShareActive
|
112
|
+
? pinnedParticipants.concat(floatingLocalVideoLayout.horizontalGalleryParticipants)
|
113
|
+
: floatingLocalVideoLayout.gridParticipants.concat(floatingLocalVideoLayout.horizontalGalleryParticipants)
|
114
|
+
};
|
115
|
+
};
|
116
|
+
//# 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":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,gCAAgC,EAAE,MAAM,kBAAkB,CAAC;AAgCpE,MAAM,+BAA+B,GAAG,CAAC,CAAC;AAE1C,MAAM,mCAAmC,GAAG,CAAC,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAsC,EAAgB,EAAE;;IAClG,MAAM,wBAAwB,GAAG,MAAM,CAAkC,EAAE,CAAC,CAAC;IAC7E,MAAM,wBAAwB,GAAG,MAAM,CAAkC,EAAE,CAAC,CAAC;IAE7E,MAAM,EACJ,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,GAAG,+BAA+B,EACvD,wBAAwB,GAAG,mCAAmC,EAC9D,mBAAmB,GAAG,KAAK,EAC5B,GAAG,KAAK,CAAC;IAEV,wBAAwB,CAAC,OAAO,GAAG,gCAAgC,CAAC;QAClE,YAAY,EAAE,MAAA,kBAAkB,aAAlB,kB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,MAAM,CAAC,CAAC,CAAC;IAE/G,MAAM,6BAA6B,mCAC9B,KAAK;QACR,sFAAsF;QACtF,kBAAkB,EAAE,oBAAoB;QACxC,mGAAmG;QACnG,qBAAqB,EAAE,KAAK,CAAC,qBAAqB;YAChD,CAAC,CAAC,KAAK,CAAC,qBAAqB,GAAG,kCAAkC;YAClE,CAAC,CAAC,SAAS,GACd,CAAC;IAEF,MAAM,wBAAwB,GAAG,2BAA2B,CAAC,6BAA6B,CAAC,CAAC;IAE5F,IAAI,KAAK,CAAC,wBAAwB,CAAC,MAAM,KAAK,CAAC,EAAE;QAC/C,OAAO,wBAAwB,CAAC;KACjC;IAED,OAAO;QACL,gBAAgB,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB;QACrE,6BAA6B,EAAE,KAAK,CAAC,mBAAmB;YACtD,CAAC,CAAC,kBAAkB,CAAC,MAAM,CAAC,wBAAwB,CAAC,6BAA6B,CAAC;YACnF,CAAC,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,MAAM,CAAC,wBAAwB,CAAC,6BAA6B,CAAC;KAC7G,CAAC;AACJ,CAAC,CAAC","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 for {@link useFloatingLocalVideoLayout } to determine grid participants and horizontal participants\n * @private\n */\nexport interface UseFloatingLocalVideoLayoutArgs {\n remoteParticipants: VideoGalleryRemoteParticipant[];\n dominantSpeakers?: string[];\n maxRemoteVideoStreams?: number;\n maxAudioDominantSpeakers?: number;\n isScreenShareActive?: boolean;\n}\n\n/**\n * Arguments for {@link usePinnedParticipantLayout } to determine grid participants and horizontal participants\n * @private\n */\nexport interface UsePinnedParticipantLayoutArgs extends UseFloatingLocalVideoLayoutArgs {\n pinnedParticipantUserIds: string[];\n}\n\n/**\n * A layout result that defines grid participants and horizontal participants\n * @private\n */\nexport interface LayoutResult {\n gridParticipants: VideoGalleryParticipant[];\n horizontalGalleryParticipants: VideoGalleryParticipant[];\n}\n\nconst DEFAULT_MAX_REMOTE_VIDEOSTREAMS = 4;\n\nconst DEFAULT_MAX_AUDIO_DOMINANT_SPEAKERS = 6;\n\n/**\n * @private\n */\nexport const useFloatingLocalVideoLayout = (props: UseFloatingLocalVideoLayoutArgs): LayoutResult => {\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/**\n * @private\n */\nexport const usePinnedParticipantLayout = (props: UsePinnedParticipantLayoutArgs): LayoutResult => {\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 floatingLocalVideoLayoutProps = {\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 floatingLocalVideoLayout = useFloatingLocalVideoLayout(floatingLocalVideoLayoutProps);\n\n if (props.pinnedParticipantUserIds.length === 0) {\n return floatingLocalVideoLayout;\n }\n\n return {\n gridParticipants: props.isScreenShareActive ? [] : pinnedParticipants,\n horizontalGalleryParticipants: props.isScreenShareActive\n ? pinnedParticipants.concat(floatingLocalVideoLayout.horizontalGalleryParticipants)\n : floatingLocalVideoLayout.gridParticipants.concat(floatingLocalVideoLayout.horizontalGalleryParticipants)\n };\n};\n"]}
|
@@ -34,6 +34,14 @@ export interface VideoGalleryStrings {
|
|
34
34
|
localVideoSelectedDescription: string;
|
35
35
|
/** placeholder text for participants who does not have a display name*/
|
36
36
|
displayNamePlaceholder: string;
|
37
|
+
/** Menu text shown in Video Tile contextual menu for setting a remote participants video to fit in frame */
|
38
|
+
fitRemoteParticipantToFrame: string;
|
39
|
+
/** Menu text shown in Video Tile contextual menu for setting a remote participants video to fill the frame */
|
40
|
+
fillRemoteParticipantFrame: string;
|
41
|
+
/** Menu text shown in Video Tile contextual menu for pinning a remote participant's video tile */
|
42
|
+
pinParticipantForMe: string;
|
43
|
+
/** Menu text shown in Video Tile contextual menu for setting a remote participant's video tile */
|
44
|
+
unpinParticipantForMe: string;
|
37
45
|
}
|
38
46
|
/**
|
39
47
|
* @public
|
@@ -112,6 +120,23 @@ export interface VideoGalleryProps {
|
|
112
120
|
* Camera control information for button to switch cameras.
|
113
121
|
*/
|
114
122
|
localVideoCameraCycleButtonProps?: LocalVideoCameraCycleButtonProps;
|
123
|
+
/**
|
124
|
+
* List of pinned participant userIds
|
125
|
+
*/
|
126
|
+
pinnedParticipants?: string[];
|
127
|
+
/**
|
128
|
+
* Whether to show the remote video tile contextual menu.
|
129
|
+
* @defaultValue `true`
|
130
|
+
*/
|
131
|
+
showRemoteVideoTileContextualMenu?: boolean;
|
132
|
+
/**
|
133
|
+
* This callback will be called when a participant video tile is pinned
|
134
|
+
*/
|
135
|
+
onPinParticipant?: (userId: string) => void;
|
136
|
+
/**
|
137
|
+
* This callback will be called when a participant video tile is un-pinned
|
138
|
+
*/
|
139
|
+
onUnpinParticipant?: (userId: string) => void;
|
115
140
|
}
|
116
141
|
/**
|
117
142
|
* VideoGallery represents a layout of video tiles for a specific call.
|