@azure/communication-react 1.5.1-beta.1 → 1.5.1-beta.2
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 +76 -1
- package/CHANGELOG.json +621 -0
- package/dist/communication-react.d.ts +217 -7
- package/dist/dist-cjs/communication-react/index.js +2207 -1184
- package/dist/dist-cjs/communication-react/index.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/errorBarSelector.js +1 -1
- package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +4 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +37 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +22 -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 +14 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +44 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +21 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +1 -0
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.d.ts +13 -1
- package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +8 -1
- package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.d.ts +4 -0
- package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js +28 -0
- package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.d.ts +29 -0
- package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.js +54 -0
- package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/Logger.d.ts +16 -29
- package/dist/dist-esm/calling-stateful-client/src/Logger.js +16 -29
- package/dist/dist-esm/calling-stateful-client/src/Logger.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +137 -370
- package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.d.ts +17 -0
- package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.js +198 -0
- package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
- package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +10 -2
- package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +2 -0
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CameraButton.d.ts +16 -0
- package/dist/dist-esm/react-components/src/components/CameraButton.js +38 -1
- package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +30 -0
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +47 -0
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +6 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ControlBarButton.js +1 -1
- package/dist/dist-esm/react-components/src/components/ControlBarButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/DevicesButton.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/DevicesButton.js +79 -55
- package/dist/dist-esm/react-components/src/components/DevicesButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/HorizontalGallery.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/HorizontalGallery.js +29 -24
- package/dist/dist-esm/react-components/src/components/HorizontalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/MessageThread.js +24 -11
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +12 -0
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.js +29 -1
- package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.d.ts +4 -2
- package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js +6 -42
- package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.d.ts +35 -0
- package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js +32 -0
- package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/SendBox.js +5 -2
- package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VerticalGallery.d.ts +67 -0
- package/dist/dist-esm/react-components/src/components/VerticalGallery.js +113 -0
- package/dist/dist-esm/react-components/src/components/VerticalGallery.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.d.ts +21 -0
- package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.js +65 -0
- package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.d.ts +75 -0
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +44 -0
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.d.ts +88 -0
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +80 -0
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +55 -19
- package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.d.ts +10 -3
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +11 -9
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +81 -24
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +11 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.d.ts +21 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js +63 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.d.ts +2 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js +8 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.d.ts +32 -7
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +28 -12
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js +2 -2
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.d.ts +4 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js +8 -7
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.d.ts +64 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js +79 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.d.ts +25 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.js +94 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +4 -4
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +58 -49
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +25 -0
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +32 -4
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.js +9 -12
- 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 -0
- package/dist/dist-esm/react-components/src/components/index.js +4 -0
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.d.ts +13 -0
- package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.js +35 -0
- package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/styles/HorizontalGallery.styles.js +1 -0
- package/dist/dist-esm/react-components/src/components/styles/HorizontalGallery.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +30 -2
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.d.ts +32 -0
- package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.js +66 -0
- package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils/overFlowGalleriesUtils.d.ts +11 -0
- package/dist/dist-esm/react-components/src/components/utils/overFlowGalleriesUtils.js +22 -0
- package/dist/dist-esm/react-components/src/components/utils/overFlowGalleriesUtils.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils/responsive.d.ts +6 -0
- package/dist/dist-esm/react-components/src/components/utils/responsive.js +7 -0
- package/dist/dist-esm/react-components/src/components/utils/responsive.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils.d.ts +5 -0
- package/dist/dist-esm/react-components/src/components/utils.js +20 -0
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js +6 -14
- package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js.map +1 -1
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +10 -4
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +7 -2
- package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +5 -0
- 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 +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +14 -3
- package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +14 -3
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +7 -0
- package/dist/dist-esm/react-components/src/theming/icons.js +19 -7
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +27 -2
- 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 +42 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +8 -2
- 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/CallControls.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +21 -3
- 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/NetworkReconnectTile.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.d.ts +5 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.d.ts +0 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js +1 -31
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +12 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +11 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +12 -8
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.d.ts +16 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js +49 -43
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +24 -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 +19 -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 +4 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +18 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js +47 -26
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js +4 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js +5 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +16 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.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/VideoEffectsPane.d.ts +11 -0
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +19 -0
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/common/icons.js +4 -4
- package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.d.ts +7 -0
- package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.js +9 -0
- package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.js.map +1 -0
- package/package.json +12 -12
- package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.d.ts +0 -14
- package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js +0 -19
- package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"StreamUtils.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/StreamUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAEL,gBAAgB,EAChB,mBAAmB,EAEpB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,6CAA6C,EAC7C,+CAA+C,EAC/C,kDAAkD,EACnD,MAAM,aAAa,C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,CACT,OAAO,EACP,eAAe,EACf,MAAM,EACN,cAAc,EACd,+CAA+C,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAChF,CAAC;aACH;SACF;KACF;IACD,MAAM,sBAAsB,GAAG,eAAe,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC1E,IAAI,sBAAsB,IAAI,sBAAsB,CAAC,QAAQ,EAAE;QAC7D,+GAA+G;QAC/G,+GAA+G;QAC/G,WAAW,CACT,OAAO,EACP,eAAe,EACf,MAAM,EACN,SAAS,EACT,6CAA6C,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAC7E,CAAC;KACH;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,OAAoB,EAAE,eAAoC;IACxF,MAAM,OAAO,GAAG,eAAe,CAAC,UAAU,EAAE,CAAC;IAC7C,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,uBAAuB,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,CAAC,CAAC;KAC3D;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n CreateViewOptions,\n LocalVideoStream,\n VideoStreamRenderer,\n VideoStreamRendererView\n} from '@azure/communication-calling';\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { LocalVideoStreamState, RemoteVideoStreamState } from './CallClientState';\nimport { CallContext } from './CallContext';\nimport {\n convertSdkLocalStreamToDeclarativeLocalStream,\n convertSdkRemoteStreamToDeclarativeRemoteStream,\n convertFromSDKToDeclarativeVideoStreamRendererView\n} from './Converter';\nimport { InternalCallContext } from './InternalCallContext';\nimport { toFlatCommunicationIdentifier, _logEvent } from '@internal/acs-ui-common';\nimport { callingStatefulLogger, EventNames } from './Logger';\n\n/**\n * Return result from {@link StatefulCallClient.createView}.\n *\n * @public\n */\nexport type CreateViewResult = {\n renderer: VideoStreamRenderer;\n view: VideoStreamRendererView;\n};\n\nasync function createViewRemoteVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string,\n participantId: CommunicationIdentifierKind | string,\n stream: RemoteVideoStreamState,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n // Render RemoteVideoStream that is part of a Call\n const streamId = stream.id;\n let participantKey;\n if (typeof participantId === 'string') {\n participantKey = participantId;\n } else {\n participantKey = toFlatCommunicationIdentifier(participantId);\n }\n const streamLogInfo = { callId, participantKey, streamId };\n\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATING_REMOTE_VIEW,\n level: 'info',\n message: 'Start creating view for remote video.',\n data: streamLogInfo\n });\n const renderInfo = internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, streamId);\n\n if (!renderInfo) {\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_STREAM_NOT_FOUND,\n level: 'error',\n message: 'RemoteVideoStream not found in state.',\n data: streamLogInfo\n });\n console.warn('RemoteVideoStream not found in state');\n return;\n }\n\n if (renderInfo.status === 'Rendered') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_STREAM_ALREADY_RENDERED,\n level: 'warning',\n message: 'RemoteVideoStream is already rendered.',\n data: streamLogInfo\n });\n console.warn('RemoteVideoStream is already rendered');\n return;\n }\n\n if (renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_STREAM_RENDERING,\n level: 'warning',\n message: 'RemoteVideoStream is rendering.',\n data: streamLogInfo\n });\n return;\n }\n\n // \"Stopping\" only happens if the stream was in \"rendering\" but `disposeView` was called.\n // Now that `createView` has been re-called, we can flip the state back to \"rendering\".\n if (renderInfo.status === 'Stopping') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_STREAM_STOPPING,\n level: 'warning',\n message: 'RemoteVideoStream was marked as stopping by dispose view. Resetting state to \"Rendering\".'\n });\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n streamId,\n renderInfo.stream,\n 'Rendering',\n renderInfo.renderer\n );\n return;\n }\n\n const renderer = new VideoStreamRenderer(renderInfo.stream);\n\n internalContext.setRemoteRenderInfo(callId, participantKey, streamId, renderInfo.stream, 'Rendering', undefined);\n\n let view;\n try {\n view = await renderer.createView(options);\n } catch (e) {\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATE_REMOTE_STREAM_FAIL,\n level: 'error',\n message: 'Failed to create remote view',\n data: streamLogInfo\n });\n internalContext.setRemoteRenderInfo(callId, participantKey, streamId, renderInfo.stream, 'NotRendered', undefined);\n throw e;\n }\n\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo = internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, streamId);\n if (!refreshedRenderInfo) {\n // RenderInfo was removed. This should not happen unless stream was removed from the call so dispose the renderer\n // and clean up state.\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_RENDER_INFO_NOT_FOUND,\n level: 'error',\n message: 'Cannot find remote render info after create the view.',\n data: streamLogInfo\n });\n renderer.dispose();\n context.setRemoteVideoStreamRendererView(callId, participantKey, streamId, undefined);\n return;\n }\n\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state.\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_CREATED_STREAM_STOPPING,\n level: 'warning',\n message: 'Render info status is stopping, dispose renderer.',\n data: streamLogInfo\n });\n renderer.dispose();\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n streamId,\n refreshedRenderInfo.stream,\n 'NotRendered',\n undefined\n );\n context.setRemoteVideoStreamRendererView(callId, participantKey, streamId, undefined);\n return;\n }\n\n // Else the stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n streamId,\n refreshedRenderInfo.stream,\n 'Rendered',\n renderer\n );\n context.setRemoteVideoStreamRendererView(\n callId,\n participantKey,\n streamId,\n convertFromSDKToDeclarativeVideoStreamRendererView(view)\n );\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_VIEW_RENDER_SUCCEED,\n level: 'info',\n message: `Successfully render the remote view.`,\n data: {\n streamLogInfo\n }\n });\n\n return {\n renderer,\n view\n };\n}\n\nasync function createViewLocalVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n _logEvent(callingStatefulLogger, {\n name: EventNames.START_LOCAL_STREAM_RENDERING,\n level: 'info',\n message: 'Start creating view for local video.'\n });\n // Render LocalVideoStream that is part of a Call\n const renderInfo = internalContext.getLocalRenderInfo(callId);\n\n if (!renderInfo) {\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_STREAM_NOT_FOUND,\n level: 'error',\n message: 'LocalVideoStream not found in state.'\n });\n console.warn('LocalVideoStream not found in state');\n return;\n }\n\n if (renderInfo.status === 'Rendered') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_STREAM_ALREADY_RENDERED,\n level: 'warning',\n message: 'LocalVideoStream is already rendered.'\n });\n console.warn('LocalVideoStream is already rendered');\n return;\n }\n\n if (renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_STREAM_RENDERING,\n level: 'warning',\n message: 'LocalVideoStream is rendering.'\n });\n return;\n }\n\n // \"Stopping\" only happens if the stream was in \"rendering\" but `disposeView` was called.\n // Now that `createView` has been re-called, we can flip the state back to \"rendering\".\n if (renderInfo.status === 'Stopping') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_STREAM_STOPPING,\n level: 'warning',\n message: 'LocalVideoStream was marked as stopping by dispose view. Resetting state to \"Rendering\".'\n });\n internalContext.setLocalRenderInfo(callId, renderInfo.stream, 'Rendering', renderInfo.renderer);\n return;\n }\n\n const renderer = new VideoStreamRenderer(renderInfo.stream);\n\n internalContext.setLocalRenderInfo(callId, renderInfo.stream, 'Rendering', renderer);\n\n let view;\n try {\n view = await renderer.createView(options);\n } catch (e) {\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATE_LOCAL_STREAM_FAIL,\n level: 'error',\n message: 'Failed to create view.',\n data: {\n error: e\n }\n });\n internalContext.setLocalRenderInfo(callId, renderInfo.stream, 'NotRendered', undefined);\n throw e;\n }\n\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo = internalContext.getLocalRenderInfo(callId);\n if (!refreshedRenderInfo) {\n // RenderInfo was removed. This should not happen unless stream was removed from the call so dispose the renderer\n // and clean up the state.\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_RENDER_INFO_NOT_FOUND,\n level: 'error',\n message: 'Cannot find local render info after create the view. ',\n data: {\n callId\n }\n });\n renderer.dispose();\n context.setLocalVideoStreamRendererView(callId, undefined);\n return;\n }\n\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state.\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_CREATED_STREAM_STOPPING,\n level: 'warning',\n message: 'Render info status is stopping, dispose renderer.',\n data: {\n callId\n }\n });\n renderer.dispose();\n internalContext.setLocalRenderInfo(callId, refreshedRenderInfo.stream, 'NotRendered', undefined);\n context.setLocalVideoStreamRendererView(callId, undefined);\n return;\n }\n\n // Else The stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n internalContext.setLocalRenderInfo(callId, refreshedRenderInfo.stream, 'Rendered', renderer);\n context.setLocalVideoStreamRendererView(callId, convertFromSDKToDeclarativeVideoStreamRendererView(view));\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_VIEW_RENDER_SUCCEED,\n level: 'info',\n message: `Successfully render the local view.`,\n data: {\n callId\n }\n });\n\n return {\n renderer,\n view\n };\n}\n\nasync function createViewUnparentedVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n stream: LocalVideoStreamState,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n const renderInfo = internalContext.getUnparentedRenderInfo(stream);\n\n if (renderInfo && renderInfo.status === 'Rendered') {\n console.warn('Unparented LocalVideoStream is already rendered');\n return;\n }\n\n if (renderInfo && renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n return;\n }\n\n if (renderInfo && renderInfo.status === 'Stopping') {\n console.warn('Unparented LocalVideoStream is in the middle of stopping');\n return;\n }\n\n const localVideoStream = new LocalVideoStream(stream.source);\n const renderer = new VideoStreamRenderer(localVideoStream);\n\n internalContext.setUnparentedRenderInfo(stream, localVideoStream, 'Rendering', undefined);\n\n let view: VideoStreamRendererView;\n try {\n view = await renderer.createView(options);\n } catch (e) {\n // Special case for unparented views. Since they are not tied to anything and created by us based on the calls to\n // this function we'll delete it to clean up the data since keeping it around doesn't help us and if developer wants\n // to create a new view they can check that the view is not rendered and call this function again.\n internalContext.deleteUnparentedRenderInfo(stream);\n throw e;\n }\n\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (!refreshedRenderInfo) {\n // Unparented stream's RenderInfo was deleted. Currently this shouldn't happen but if it does we'll just dispose the\n // renderer and clean up state. If developer wanted the stream they could call this function again and that should\n // generate new working state via this function.\n renderer.dispose();\n context.deleteDeviceManagerUnparentedView(stream);\n return;\n }\n\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state. Special case for unparented views, delete them from state when stopped to free up\n // the memory since we were the ones generating this and not tied to any Call state.\n internalContext.deleteUnparentedRenderInfo(stream);\n context.deleteDeviceManagerUnparentedView(stream);\n return;\n }\n\n // Else the stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n internalContext.setUnparentedRenderInfo(stream, localVideoStream, 'Rendered', renderer);\n context.setDeviceManagerUnparentedView(stream, convertFromSDKToDeclarativeVideoStreamRendererView(view));\n\n return {\n renderer,\n view\n };\n}\n\nfunction disposeViewRemoteVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string,\n participantId: CommunicationIdentifierKind | string,\n stream: RemoteVideoStreamState\n): void {\n const streamId = stream.id;\n\n let participantKey;\n if (typeof participantId === 'string') {\n participantKey = participantId;\n } else {\n participantKey = toFlatCommunicationIdentifier(participantId);\n }\n\n const streamLogInfo = { callId, participantKey, streamId };\n\n _logEvent(callingStatefulLogger, {\n name: EventNames.START_DISPOSE_REMOTE_STREAM,\n level: 'info',\n message: 'Start disposing remote stream.',\n data: streamLogInfo\n });\n\n context.setRemoteVideoStreamRendererView(callId, participantKey, streamId, undefined);\n\n const renderInfo = internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, streamId);\n if (!renderInfo) {\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_DISPOSE_INFO_NOT_FOUND,\n level: 'error',\n message: 'Cannot find render info when disposing remote stream.',\n data: streamLogInfo\n });\n return;\n }\n\n // Nothing to dispose of or clean up -- we can safely exit early here.\n if (renderInfo.status === 'NotRendered') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_STREAM_ALREADY_DISPOSED,\n level: 'info',\n message: 'RemoteVideoStream is already disposed.',\n data: streamLogInfo\n });\n return;\n }\n\n // Status is already marked as \"stopping\" so we can exit early here. This is because stopping only occurs\n // when the stream is being created in createView but hasn't been completed being created yet. The createView\n // method will see the \"stopping\" status and perform the cleanup\n if (renderInfo.status === 'Stopping') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_STREAM_STOPPING,\n level: 'info',\n message: 'Remote stream is already stopping.',\n data: streamLogInfo\n });\n return;\n }\n\n // If the stream is in the middle of being rendered (i.e. has state \"Rendering\"), we need the status as\n // \"stopping\" without performing any cleanup. This will tell the `createView` method that it should stop\n // rendering and clean up the state once the view has finished being created.\n if (renderInfo.status === 'Rendering') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_STREAM_STOPPING,\n level: 'info',\n message: 'Remote stream is still rendering. Changing status to stopping.',\n data: streamLogInfo\n });\n internalContext.setRemoteRenderInfo(callId, participantKey, streamId, renderInfo.stream, 'Stopping', undefined);\n return;\n }\n\n // Else the state must be in the \"Rendered\" state, so we can dispose the renderer and clean up the state.\n internalContext.setRemoteRenderInfo(callId, participantKey, streamId, renderInfo.stream, 'NotRendered', undefined);\n\n if (renderInfo.renderer) {\n _logEvent(callingStatefulLogger, {\n name: EventNames.DISPOSING_REMOTE_RENDERER,\n level: 'info',\n message: 'Disposing remote view renderer.',\n data: streamLogInfo\n });\n renderInfo.renderer.dispose();\n } else {\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_RENDERER_NOT_FOUND,\n level: 'error',\n message: 'Cannot find remote view renderer.',\n data: streamLogInfo\n });\n }\n}\n\nfunction disposeViewLocalVideo(context: CallContext, internalContext: InternalCallContext, callId: string): void {\n const streamLogInfo = { callId };\n\n _logEvent(callingStatefulLogger, {\n name: EventNames.START_DISPOSE_LOCAL_STREAM,\n level: 'info',\n message: 'Start disposing local stream.',\n data: streamLogInfo\n });\n\n const renderInfo = internalContext.getLocalRenderInfo(callId);\n if (!renderInfo) {\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_DISPOSE_INFO_NOT_FOUND,\n level: 'error',\n message: 'Cannot find render info when disposing local stream.',\n data: streamLogInfo\n });\n return;\n }\n\n // Nothing to dispose of or clean up -- we can safely exit early here.\n if (renderInfo.status === 'NotRendered') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_STREAM_ALREADY_DISPOSED,\n level: 'info',\n message: 'LocalVideoStream is already disposed.'\n });\n return;\n }\n\n // Status is already marked as \"stopping\" so we can exit early here. This is because stopping only occurs\n // when the stream is being created in createView but hasn't been completed being created yet. The createView\n // method will see the \"stopping\" status and perform the cleanup\n if (renderInfo.status === 'Stopping') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_STREAM_STOPPING,\n level: 'info',\n message: 'Local stream is already stopping.',\n data: streamLogInfo\n });\n return;\n }\n\n // If the stream is in the middle of being rendered (i.e. has state \"Rendering\"), we need the status as\n // \"stopping\" without performing any cleanup. This will tell the `createView` method that it should stop\n // rendering and clean up the state once the view has finished being created.\n if (renderInfo.status === 'Rendering') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.REMOTE_STREAM_STOPPING,\n level: 'info',\n message: 'Remote stream is still rendering. Changing status to stopping.',\n data: streamLogInfo\n });\n internalContext.setLocalRenderInfo(callId, renderInfo.stream, 'Stopping', renderInfo.renderer);\n return;\n }\n\n if (renderInfo.renderer) {\n _logEvent(callingStatefulLogger, {\n name: EventNames.DISPOSING_LOCAL_RENDERER,\n level: 'info',\n message: 'Disposing local view renderer.',\n data: streamLogInfo\n });\n renderInfo.renderer.dispose();\n\n // We will after disposing of the renderer tell the internal context and context that the\n // local view is gone so we need to update their states.\n internalContext.setLocalRenderInfo(callId, renderInfo.stream, 'NotRendered', undefined);\n context.setLocalVideoStreamRendererView(callId, undefined);\n } else {\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_RENDERER_NOT_FOUND,\n level: 'error',\n message: 'Cannot find renderer when disposing local stream.',\n data: streamLogInfo\n });\n }\n}\n\nfunction disposeViewUnparentedVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n stream: LocalVideoStreamState\n): void {\n _logEvent(callingStatefulLogger, {\n name: EventNames.START_DISPOSE_LOCAL_STREAM,\n level: 'info',\n message: 'Start disposing unparented local stream.'\n });\n\n context.deleteDeviceManagerUnparentedView(stream);\n\n const renderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (!renderInfo) {\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_DISPOSE_INFO_NOT_FOUND,\n level: 'error',\n message: 'Cannot find render info when disposing unparented local stream.'\n });\n return;\n }\n\n if (renderInfo.status === 'Rendering') {\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_STREAM_STOPPING,\n level: 'info',\n message: 'Unparented local stream is still rendering. Changing status to stopping.'\n });\n internalContext.setUnparentedRenderInfo(stream, renderInfo.stream, 'Stopping', undefined);\n } else {\n internalContext.deleteUnparentedRenderInfo(stream);\n }\n\n if (renderInfo.renderer) {\n _logEvent(callingStatefulLogger, {\n name: EventNames.DISPOSING_LOCAL_RENDERER,\n level: 'info',\n message: 'Disposing unparented local view renderer.'\n });\n renderInfo.renderer.dispose();\n } else {\n _logEvent(callingStatefulLogger, {\n name: EventNames.LOCAL_RENDERER_NOT_FOUND,\n level: 'error',\n message: 'Cannot find renderer when disposing unparented local stream.'\n });\n }\n}\n\n/**\n * @private\n */\nexport function createView(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string | undefined,\n participantId: CommunicationIdentifierKind | string | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n if ('id' in stream && callId && participantId) {\n // Render RemoteVideoStream that is part of a Call\n return createViewRemoteVideo(context, internalContext, callId, participantId, stream, options);\n } else if (!('id' in stream) && callId) {\n // Render LocalVideoStream that is part of a Call\n return createViewLocalVideo(context, internalContext, callId, options);\n } else if (!('id' in stream) && !callId) {\n // Render LocalVideoStream that is not part of a Call\n // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).\n // We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.\n return context.withAsyncErrorTeedToState(\n async () => await createViewUnparentedVideo(context, internalContext, stream, options),\n 'Call.startVideo'\n )();\n } else {\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATE_STREAM_INVALID_PARAMS,\n level: 'warning',\n message: 'Create View invalid combination of parameters.'\n });\n return Promise.resolve(undefined);\n }\n}\n\n/**\n * @private\n */\nexport function disposeView(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string | undefined,\n participantId: CommunicationIdentifierKind | string | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState\n): void {\n if ('id' in stream && callId && participantId) {\n // Stop rendering RemoteVideoStream that is part of a Call\n disposeViewRemoteVideo(context, internalContext, callId, participantId, stream);\n } else if (!('id' in stream) && callId) {\n // Stop rendering LocalVideoStream that is part of a Call\n disposeViewLocalVideo(context, internalContext, callId);\n } else if (!('id' in stream) && !callId) {\n // Stop rendering LocalVideoStream that is not part of a Call\n // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).\n // We do not have a stopLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.\n context.withErrorTeedToState(\n () => disposeViewUnparentedVideo(context, internalContext, stream),\n 'Call.stopVideo'\n )();\n } else {\n _logEvent(callingStatefulLogger, {\n name: EventNames.DISPOSE_STREAM_INVALID_PARAMS,\n level: 'warning',\n message: 'Dispose View invalid combination of parameters.'\n });\n return;\n }\n}\n\n/**\n * @private\n * Only stops videos that are tied to a Call.\n */\nexport function disposeAllViewsFromCall(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string\n): void {\n const callStreams = internalContext.getRemoteRenderInfoForCall(callId);\n if (callStreams) {\n for (const [participantKey, participantStreams] of callStreams.entries()) {\n for (const [_, remoteStreamAndRenderer] of participantStreams.entries()) {\n // We don't want to accept SDK stream as parameter but we also don't cache the declarative stream so we have to\n // convert the SDK stream to declarative stream which is not pretty so this could use some further refactoring.\n disposeView(\n context,\n internalContext,\n callId,\n participantKey,\n convertSdkRemoteStreamToDeclarativeRemoteStream(remoteStreamAndRenderer.stream)\n );\n }\n }\n }\n const localStreamAndRenderer = internalContext.getLocalRenderInfo(callId);\n if (localStreamAndRenderer && localStreamAndRenderer.renderer) {\n // We don't want to accept SDK stream as parameter but we also don't cache the declarative stream so we have to\n // convert the SDK stream to declarative stream which is not pretty so this could use some further refactoring.\n disposeView(\n context,\n internalContext,\n callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localStreamAndRenderer.stream)\n );\n }\n}\n\n/**\n * @private\n */\nexport function disposeAllViews(context: CallContext, internalContext: InternalCallContext): void {\n const callIds = internalContext.getCallIds();\n for (const callId of callIds) {\n disposeAllViewsFromCall(context, internalContext, callId);\n }\n}\n\"../../acs-ui-common/src\""]}
|
1
|
+
{"version":3,"file":"StreamUtils.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/StreamUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAEL,gBAAgB,EAEhB,mBAAmB,EAEpB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EACL,6CAA6C,EAC7C,+CAA+C,EAC/C,kDAAkD,EACnD,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,6BAA6B,EAAa,gCAAgC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAYvD,SAAe,eAAe,CAC5B,OAAoB,EACpB,eAAoC,EACpC,MAAc,EACd,MAAuD,EACvD,aAAoD,EACpD,OAA2B;;QAE3B,yCAAyC;QACzC,IAAI,eAAgF,CAAC;QAErF,6GAA6G;QAE7G,IAAI,aAAa,EAAE;YACjB,eAAe,GAAG,kBAAkB,CAAC;SACtC;aAAM,IAAI,MAAM,EAAE;YACjB,eAAe,GAAG,iBAAiB,CAAC;SACrC;aAAM;YACL,wCAAwC;YACxC,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;YAClE,eAAe,GAAG,sBAAsB,CAAC;SAC1C;QAED,MAAM,UAAU,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,eAAe,CAAC;QAC3C,MAAM,QAAQ,GAAI,MAA4B,CAAC,EAAE,CAAC;QAElD,oHAAoH;QACpH,MAAM,cAAc,GAClB,eAAe,KAAK,kBAAkB,IAAI,aAAa;YACrD,CAAC,CAAC,OAAO,aAAa,KAAK,QAAQ;gBACjC,CAAC,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,CAAC,CAAC;KAC3D;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n CreateViewOptions,\n LocalVideoStream,\n RemoteVideoStream,\n VideoStreamRenderer,\n VideoStreamRendererView\n} from '@azure/communication-calling';\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { LocalVideoStreamState, RemoteVideoStreamState } from './CallClientState';\nimport { CallContext } from './CallContext';\nimport {\n convertSdkLocalStreamToDeclarativeLocalStream,\n convertSdkRemoteStreamToDeclarativeRemoteStream,\n convertFromSDKToDeclarativeVideoStreamRendererView\n} from './Converter';\nimport { InternalCallContext } from './InternalCallContext';\nimport { toFlatCommunicationIdentifier, _logEvent } from '@internal/acs-ui-common';\nimport { EventNames } from './Logger';\nimport { _logStreamEvent } from './StreamUtilsLogging';\n\n/**\n * Return result from {@link StatefulCallClient.createView}.\n *\n * @public\n */\nexport type CreateViewResult = {\n renderer: VideoStreamRenderer;\n view: VideoStreamRendererView;\n};\n\nasync function createViewVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string,\n stream?: RemoteVideoStreamState | LocalVideoStreamState,\n participantId?: CommunicationIdentifierKind | string,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n // we can only have 3 types of createView\n let streamEventType: 'createViewLocal' | 'createViewRemote' | 'createViewUnparented';\n\n // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.\n\n if (participantId) {\n streamEventType = 'createViewRemote';\n } else if (callId) {\n streamEventType = 'createViewLocal';\n } else {\n // TODO update for when unparented view.\n throw new Error('unparented createView not implemented yet here');\n streamEventType = 'createViewUnparented';\n }\n\n const streamType = stream?.mediaStreamType;\n const streamId = (stream as RemoteVideoStream).id;\n\n // we want to check to see if there is a participantId this will tell us whether its a local stream or a remote one.\n const participantKey =\n streamEventType === 'createViewRemote' && participantId\n ? typeof participantId === 'string'\n ? participantId\n : toFlatCommunicationIdentifier(participantId)\n : undefined;\n\n const streamLogInfo = { callId, participantKey, streamId, streamType, streamEventType };\n\n // make different logging announcement based on whether or not we are starting a local or remote\n _logStreamEvent(EventNames.CREATING_VIEW, streamLogInfo);\n\n // if we have a participant Id and a stream get the remote info, else get the local render info from state.\n const renderInfo =\n streamEventType === 'createViewRemote' && participantKey\n ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, streamId)\n : internalContext.getLocalRenderInfo(callId);\n\n if (!renderInfo) {\n _logStreamEvent(EventNames.STREAM_NOT_FOUND, streamLogInfo);\n return;\n }\n\n if (renderInfo.status === 'Rendered') {\n _logStreamEvent(EventNames.STREAM_ALREADY_RENDERED, streamLogInfo);\n return;\n }\n\n if (renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n _logStreamEvent(EventNames.STREAM_RENDERING, streamLogInfo);\n return;\n }\n\n // \"Stopping\" only happens if the stream was in \"rendering\" but `disposeView` was called.\n // Now that `createView` has been re-called, we can flip the state back to \"rendering\".\n if (renderInfo.status === 'Stopping') {\n if (streamEventType === 'createViewRemote' && participantKey) {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n streamId,\n renderInfo.stream as RemoteVideoStream,\n 'Rendering',\n renderInfo.renderer\n );\n } else if (streamEventType === 'createViewLocal') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setLocalRenderInfo(\n callId,\n renderInfo.stream as LocalVideoStream,\n 'Rendering',\n renderInfo.renderer\n );\n }\n return;\n }\n\n const renderer = new VideoStreamRenderer(renderInfo.stream);\n\n streamEventType === 'createViewRemote' && participantKey\n ? internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n streamId,\n renderInfo.stream as RemoteVideoStream,\n 'Rendering',\n undefined\n )\n : internalContext.setLocalRenderInfo(callId, renderInfo.stream as LocalVideoStream, 'Rendering', renderer);\n\n let view;\n try {\n view = await renderer.createView(options);\n } catch (e) {\n if (streamEventType === 'createViewRemote' && participantKey) {\n _logStreamEvent(EventNames.CREATE_STREAM_FAIL, streamLogInfo);\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n streamId,\n renderInfo.stream as RemoteVideoStream,\n 'NotRendered',\n undefined\n );\n } else if (streamEventType === 'createViewLocal') {\n _logStreamEvent(EventNames.CREATE_STREAM_FAIL, streamLogInfo, e);\n internalContext.setLocalRenderInfo(callId, renderInfo.stream as LocalVideoStream, 'NotRendered', undefined);\n }\n throw e;\n }\n\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo =\n streamEventType === 'createViewRemote' && participantKey\n ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, streamId)\n : internalContext.getLocalRenderInfo(callId);\n\n if (!refreshedRenderInfo) {\n // RenderInfo was removed. This should not happen unless stream was removed from the call so dispose the renderer\n // and clean up the state.\n _logStreamEvent(EventNames.RENDER_INFO_NOT_FOUND, streamLogInfo);\n renderer.dispose();\n streamEventType === 'createViewRemote' && participantKey\n ? context.setRemoteVideoStreamRendererView(callId, participantKey, streamId, undefined)\n : context.setLocalVideoStreamRendererView(callId, undefined);\n return;\n }\n\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state.\n streamEventType === 'createViewRemote';\n _logStreamEvent(EventNames.CREATED_STREAM_STOPPING, streamLogInfo);\n renderer.dispose();\n if (streamEventType === 'createViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n streamId,\n refreshedRenderInfo.stream as RemoteVideoStream,\n 'NotRendered',\n undefined\n );\n context.setRemoteVideoStreamRendererView(callId, participantKey, streamId, undefined);\n } else if (streamEventType === 'createViewLocal') {\n internalContext.setLocalRenderInfo(\n callId,\n refreshedRenderInfo.stream as LocalVideoStream,\n 'NotRendered',\n undefined\n );\n context.setLocalVideoStreamRendererView(callId, undefined);\n }\n return;\n }\n\n // Else the stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n if (streamEventType === 'createViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n streamId,\n refreshedRenderInfo.stream as RemoteVideoStream,\n 'Rendered',\n renderer\n );\n context.setRemoteVideoStreamRendererView(\n callId,\n participantKey,\n streamId,\n convertFromSDKToDeclarativeVideoStreamRendererView(view)\n );\n _logStreamEvent(EventNames.VIEW_RENDER_SUCCEED, streamLogInfo);\n } else if (streamEventType === 'createViewLocal') {\n internalContext.setLocalRenderInfo(callId, refreshedRenderInfo.stream as LocalVideoStream, 'Rendered', renderer);\n context.setLocalVideoStreamRendererView(callId, convertFromSDKToDeclarativeVideoStreamRendererView(view));\n _logStreamEvent(EventNames.VIEW_RENDER_SUCCEED, streamLogInfo);\n }\n\n return {\n renderer,\n view\n };\n}\n\nasync function createViewUnparentedVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n stream: LocalVideoStreamState,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n const renderInfo = internalContext.getUnparentedRenderInfo(stream);\n\n if (renderInfo && renderInfo.status === 'Rendered') {\n console.warn('Unparented LocalVideoStream is already rendered');\n return;\n }\n\n if (renderInfo && renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n return;\n }\n\n if (renderInfo && renderInfo.status === 'Stopping') {\n console.warn('Unparented LocalVideoStream is in the middle of stopping');\n return;\n }\n\n const localVideoStream = new LocalVideoStream(stream.source);\n const renderer = new VideoStreamRenderer(localVideoStream);\n\n internalContext.setUnparentedRenderInfo(stream, localVideoStream, 'Rendering', undefined);\n\n let view: VideoStreamRendererView;\n try {\n view = await renderer.createView(options);\n } catch (e) {\n // Special case for unparented views. Since they are not tied to anything and created by us based on the calls to\n // this function we'll delete it to clean up the data since keeping it around doesn't help us and if developer wants\n // to create a new view they can check that the view is not rendered and call this function again.\n internalContext.deleteUnparentedRenderInfo(stream);\n throw e;\n }\n\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (!refreshedRenderInfo) {\n // Unparented stream's RenderInfo was deleted. Currently this shouldn't happen but if it does we'll just dispose the\n // renderer and clean up state. If developer wanted the stream they could call this function again and that should\n // generate new working state via this function.\n renderer.dispose();\n context.deleteDeviceManagerUnparentedView(stream);\n return;\n }\n\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state. Special case for unparented views, delete them from state when stopped to free up\n // the memory since we were the ones generating this and not tied to any Call state.\n internalContext.deleteUnparentedRenderInfo(stream);\n context.deleteDeviceManagerUnparentedView(stream);\n return;\n }\n // Else the stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n internalContext.setUnparentedRenderInfo(stream, localVideoStream, 'Rendered', renderer);\n internalContext.subscribeToUnparentedViewVideoEffects(localVideoStream, context);\n context.setDeviceManagerUnparentedView(stream, convertFromSDKToDeclarativeVideoStreamRendererView(view));\n\n return {\n renderer,\n view\n };\n}\n\nfunction disposeViewVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string,\n stream: RemoteVideoStreamState | LocalVideoStreamState,\n participantId?: CommunicationIdentifierKind | string\n): void {\n // we can only have 3 types of createView\n let streamEventType: 'disposeViewLocal' | 'disposeViewRemote' | 'disposeViewUnparented';\n\n // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.\n\n if (participantId) {\n streamEventType = 'disposeViewRemote';\n } else if (callId) {\n streamEventType = 'disposeViewLocal';\n } else {\n // TODO update for when unparented view.\n streamEventType = 'disposeViewUnparented';\n }\n\n const streamType = stream.mediaStreamType;\n const streamId = (stream as RemoteVideoStream).id;\n\n // we want to check to see if there is a participantId this will tell us whether its a local stream or a remote one.\n const participantKey =\n streamEventType === 'disposeViewRemote' && participantId\n ? typeof participantId === 'string'\n ? participantId\n : toFlatCommunicationIdentifier(participantId)\n : undefined;\n const streamLogInfo = { callId, participantKey, streamId, streamType };\n\n _logStreamEvent(EventNames.START_DISPOSE_STREAM, streamLogInfo);\n\n if (streamEventType === 'disposeViewRemote' && participantKey) {\n context.setRemoteVideoStreamRendererView(callId, participantKey, streamId, undefined);\n }\n\n const renderInfo =\n streamEventType === 'disposeViewRemote' && participantKey\n ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, streamId)\n : internalContext.getLocalRenderInfo(callId);\n\n if (!renderInfo) {\n _logStreamEvent(EventNames.DISPOSE_INFO_NOT_FOUND, streamLogInfo);\n return;\n }\n\n // Nothing to dispose of or clean up -- we can safely exit early here.\n if (renderInfo.status === 'NotRendered') {\n _logStreamEvent(EventNames.STREAM_ALREADY_DISPOSED, streamLogInfo);\n return;\n }\n\n // Status is already marked as \"stopping\" so we can exit early here. This is because stopping only occurs\n // when the stream is being created in createView but hasn't been completed being created yet. The createView\n // method will see the \"stopping\" status and perform the cleanup\n if (renderInfo.status === 'Stopping') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n return;\n }\n\n // If the stream is in the middle of being rendered (i.e. has state \"Rendering\"), we need the status as\n // \"stopping\" without performing any cleanup. This will tell the `createView` method that it should stop\n // rendering and clean up the state once the view has finished being created.\n if (renderInfo.status === 'Rendering') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n streamEventType === 'disposeViewRemote' && participantKey\n ? internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n streamId,\n renderInfo.stream as RemoteVideoStream,\n 'Stopping',\n undefined\n )\n : internalContext.setLocalRenderInfo(\n callId,\n renderInfo.stream as LocalVideoStream,\n 'Stopping',\n renderInfo.renderer\n );\n return;\n }\n\n if (renderInfo.renderer) {\n _logStreamEvent(EventNames.DISPOSING_RENDERER, streamLogInfo);\n renderInfo.renderer.dispose();\n // Else the state must be in the \"Rendered\" state, so we can dispose the renderer and clean up the state.\n if (streamEventType === 'disposeViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(\n callId,\n participantKey,\n streamId,\n renderInfo.stream as RemoteVideoStream,\n 'NotRendered',\n undefined\n );\n } else if (streamEventType === 'disposeViewLocal') {\n internalContext.setLocalRenderInfo(callId, renderInfo.stream as LocalVideoStream, 'NotRendered', undefined);\n context.setLocalVideoStreamRendererView(callId, undefined);\n }\n } else {\n _logStreamEvent(EventNames.RENDERER_NOT_FOUND, streamLogInfo);\n }\n}\n\nfunction disposeViewUnparentedVideo(\n context: CallContext,\n internalContext: InternalCallContext,\n stream: LocalVideoStreamState\n): void {\n const streamType = stream.mediaStreamType;\n const streamLogInfo = { streamType, streamEventType: 'disposeViewUnparented' };\n\n _logStreamEvent(EventNames.START_DISPOSE_STREAM, streamLogInfo);\n\n context.deleteDeviceManagerUnparentedView(stream);\n\n const renderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (!renderInfo) {\n _logStreamEvent(EventNames.DISPOSE_INFO_NOT_FOUND, streamLogInfo);\n return;\n }\n\n if (renderInfo.status === 'Rendering') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setUnparentedRenderInfo(stream, renderInfo.stream, 'Stopping', undefined);\n } else {\n internalContext.deleteUnparentedRenderInfo(stream);\n }\n\n if (renderInfo.renderer) {\n _logStreamEvent(EventNames.DISPOSING_RENDERER, streamLogInfo);\n renderInfo.renderer.dispose();\n } else {\n _logStreamEvent(EventNames.RENDERER_NOT_FOUND, streamLogInfo);\n }\n}\n\n/**\n * @private\n */\nexport function createView(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string | undefined,\n participantId: CommunicationIdentifierKind | string | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState,\n options?: CreateViewOptions\n): Promise<CreateViewResult | undefined> {\n const streamType = stream.mediaStreamType;\n\n if (callId) {\n return createViewVideo(context, internalContext, callId, stream, participantId, options);\n } else if (!('id' in stream) && !callId) {\n // Render LocalVideoStream that is not part of a Call\n // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).\n // We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.\n return context.withAsyncErrorTeedToState(\n async () => await createViewUnparentedVideo(context, internalContext, stream, options),\n 'Call.startVideo'\n )();\n } else {\n _logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, { streamType });\n return Promise.resolve(undefined);\n }\n}\n\n/**\n * @private\n */\nexport function disposeView(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string | undefined,\n participantId: CommunicationIdentifierKind | string | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState\n): void {\n const streamType = stream.mediaStreamType;\n if (callId) {\n disposeViewVideo(context, internalContext, callId, stream, participantId);\n } else if (!('id' in stream) && !callId) {\n // Stop rendering LocalVideoStream that is not part of a Call\n // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).\n // We do not have a stopLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.\n context.withErrorTeedToState(\n () => disposeViewUnparentedVideo(context, internalContext, stream),\n 'Call.stopVideo'\n )();\n } else {\n _logStreamEvent(EventNames.DISPOSE_STREAM_INVALID_PARAMS, { streamType });\n return;\n }\n}\n\n/**\n * @private\n * Only stops videos that are tied to a Call.\n */\nexport function disposeAllViewsFromCall(\n context: CallContext,\n internalContext: InternalCallContext,\n callId: string\n): void {\n const callStreams = internalContext.getRemoteRenderInfoForCall(callId);\n if (callStreams) {\n for (const [participantKey, participantStreams] of callStreams.entries()) {\n for (const [_, remoteStreamAndRenderer] of participantStreams.entries()) {\n // We don't want to accept SDK stream as parameter but we also don't cache the declarative stream so we have to\n // convert the SDK stream to declarative stream which is not pretty so this could use some further refactoring.\n disposeView(\n context,\n internalContext,\n callId,\n participantKey,\n convertSdkRemoteStreamToDeclarativeRemoteStream(remoteStreamAndRenderer.stream)\n );\n }\n }\n }\n const localStreamAndRenderer = internalContext.getLocalRenderInfo(callId);\n if (localStreamAndRenderer && localStreamAndRenderer.renderer) {\n // We don't want to accept SDK stream as parameter but we also don't cache the declarative stream so we have to\n // convert the SDK stream to declarative stream which is not pretty so this could use some further refactoring.\n disposeView(\n context,\n internalContext,\n callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localStreamAndRenderer.stream)\n );\n }\n}\n\n/**\n * @private\n */\nexport function disposeAllViews(context: CallContext, internalContext: InternalCallContext): void {\n const callIds = internalContext.getCallIds();\n for (const callId of callIds) {\n disposeAllViewsFromCall(context, internalContext, callId);\n }\n}\n\"../../acs-ui-common/src\""]}
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { MediaStreamType } from '@azure/communication-calling';
|
2
|
+
import { EventNames } from './Logger';
|
3
|
+
/**
|
4
|
+
* helper function to fire streamUtils logging events
|
5
|
+
*
|
6
|
+
* @param eventName Name of event from streamUtils
|
7
|
+
* @param streamLogInfo informaiton about the event and who called it
|
8
|
+
* @param error if any errors present will be added to message in logging
|
9
|
+
*/
|
10
|
+
export declare function _logStreamEvent(eventName: EventNames, streamLogInfo: {
|
11
|
+
callId?: string;
|
12
|
+
participantKey?: any;
|
13
|
+
streamId?: number;
|
14
|
+
streamType?: MediaStreamType;
|
15
|
+
streamEventType?: string;
|
16
|
+
}, error?: unknown): void;
|
17
|
+
//# sourceMappingURL=StreamUtilsLogging.d.ts.map
|
@@ -0,0 +1,198 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT license.
|
3
|
+
import { _logEvent } from "../../acs-ui-common/src";
|
4
|
+
import { callingStatefulLogger, EventNames } from './Logger';
|
5
|
+
/**
|
6
|
+
* helper function to manage logging for stream disposals
|
7
|
+
*
|
8
|
+
* @param eventName Name of event that occured when managing streams
|
9
|
+
* @param streamLogInfo Data about the stream in the event
|
10
|
+
* @returns
|
11
|
+
*/
|
12
|
+
function _logDisposeStreamEvent(eventName, streamLogInfo) {
|
13
|
+
switch (eventName) {
|
14
|
+
case EventNames.DISPOSE_STREAM_INVALID_PARAMS:
|
15
|
+
_logEvent(callingStatefulLogger, {
|
16
|
+
name: EventNames.DISPOSE_STREAM_INVALID_PARAMS,
|
17
|
+
level: 'warning',
|
18
|
+
message: 'Dispose View invalid combination of parameters.',
|
19
|
+
data: { streamType: streamLogInfo.streamType }
|
20
|
+
});
|
21
|
+
return;
|
22
|
+
case EventNames.START_DISPOSE_STREAM:
|
23
|
+
_logEvent(callingStatefulLogger, {
|
24
|
+
name: EventNames.START_DISPOSE_STREAM,
|
25
|
+
level: 'info',
|
26
|
+
message: 'Start disposing stream.',
|
27
|
+
data: streamLogInfo
|
28
|
+
});
|
29
|
+
return;
|
30
|
+
case EventNames.DISPOSE_INFO_NOT_FOUND:
|
31
|
+
_logEvent(callingStatefulLogger, {
|
32
|
+
name: EventNames.DISPOSE_INFO_NOT_FOUND,
|
33
|
+
level: 'error',
|
34
|
+
message: 'Cannot find render info when disposing stream.',
|
35
|
+
data: streamLogInfo
|
36
|
+
});
|
37
|
+
return;
|
38
|
+
case EventNames.STREAM_STOPPING:
|
39
|
+
_logEvent(callingStatefulLogger, {
|
40
|
+
name: EventNames.STREAM_STOPPING,
|
41
|
+
level: 'info',
|
42
|
+
message: 'Stream is currently marked as stopping, will continue if is local preview',
|
43
|
+
data: streamLogInfo
|
44
|
+
});
|
45
|
+
return;
|
46
|
+
case EventNames.DISPOSING_RENDERER:
|
47
|
+
_logEvent(callingStatefulLogger, {
|
48
|
+
name: EventNames.DISPOSING_RENDERER,
|
49
|
+
level: 'info',
|
50
|
+
message: 'Disposing view renderer.',
|
51
|
+
data: streamLogInfo
|
52
|
+
});
|
53
|
+
return;
|
54
|
+
case EventNames.RENDERER_NOT_FOUND:
|
55
|
+
_logEvent(callingStatefulLogger, {
|
56
|
+
name: EventNames.RENDERER_NOT_FOUND,
|
57
|
+
level: 'error',
|
58
|
+
message: 'Cannot find renderer when disposing stream.',
|
59
|
+
data: streamLogInfo
|
60
|
+
});
|
61
|
+
return;
|
62
|
+
case EventNames.STREAM_ALREADY_DISPOSED:
|
63
|
+
_logEvent(callingStatefulLogger, {
|
64
|
+
name: EventNames.STREAM_ALREADY_DISPOSED,
|
65
|
+
level: 'info',
|
66
|
+
message: 'Stream is already disposed.',
|
67
|
+
data: streamLogInfo
|
68
|
+
});
|
69
|
+
return;
|
70
|
+
default:
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
/**
|
75
|
+
* helper function to manage logging for local stream creations
|
76
|
+
*
|
77
|
+
* @param eventName Name of the event to occured when creating a local stream
|
78
|
+
* @param streamLogInfo Data about the stream in the event
|
79
|
+
* @param error that is thrown by caller
|
80
|
+
* @returns
|
81
|
+
*/
|
82
|
+
function _logCreateStreamEvent(eventName, streamLogInfo, error) {
|
83
|
+
switch (eventName) {
|
84
|
+
case EventNames.CREATE_STREAM_INVALID_PARAMS:
|
85
|
+
_logEvent(callingStatefulLogger, {
|
86
|
+
name: EventNames.CREATE_STREAM_INVALID_PARAMS,
|
87
|
+
level: 'warning',
|
88
|
+
message: 'Create View invalid combination of parameters.',
|
89
|
+
data: { streamType: streamLogInfo.streamType }
|
90
|
+
});
|
91
|
+
return;
|
92
|
+
case EventNames.START_STREAM_RENDERING:
|
93
|
+
_logEvent(callingStatefulLogger, {
|
94
|
+
name: EventNames.START_STREAM_RENDERING,
|
95
|
+
level: 'info',
|
96
|
+
message: 'Start creating view for local video.',
|
97
|
+
data: streamLogInfo
|
98
|
+
});
|
99
|
+
return;
|
100
|
+
case EventNames.STREAM_NOT_FOUND:
|
101
|
+
_logEvent(callingStatefulLogger, {
|
102
|
+
name: EventNames.STREAM_NOT_FOUND,
|
103
|
+
level: 'error',
|
104
|
+
message: 'Stream not found in state.',
|
105
|
+
data: { callId: streamLogInfo.callId }
|
106
|
+
});
|
107
|
+
return;
|
108
|
+
case EventNames.STREAM_ALREADY_RENDERED:
|
109
|
+
_logEvent(callingStatefulLogger, {
|
110
|
+
name: EventNames.STREAM_ALREADY_RENDERED,
|
111
|
+
level: 'warning',
|
112
|
+
message: 'Stream is already rendered.',
|
113
|
+
data: streamLogInfo
|
114
|
+
});
|
115
|
+
return;
|
116
|
+
case EventNames.STREAM_RENDERING:
|
117
|
+
_logEvent(callingStatefulLogger, {
|
118
|
+
name: EventNames.STREAM_RENDERING,
|
119
|
+
level: 'warning',
|
120
|
+
message: 'Stream is rendering.',
|
121
|
+
data: streamLogInfo
|
122
|
+
});
|
123
|
+
return;
|
124
|
+
case EventNames.STREAM_STOPPING:
|
125
|
+
_logEvent(callingStatefulLogger, {
|
126
|
+
name: EventNames.STREAM_STOPPING,
|
127
|
+
level: 'warning',
|
128
|
+
message: 'Stream was marked as stopping by dispose view. Resetting state to "Rendering".',
|
129
|
+
data: streamLogInfo
|
130
|
+
});
|
131
|
+
return;
|
132
|
+
case EventNames.CREATE_STREAM_FAIL:
|
133
|
+
_logEvent(callingStatefulLogger, {
|
134
|
+
name: EventNames.CREATE_STREAM_FAIL,
|
135
|
+
level: 'error',
|
136
|
+
message: 'Failed to create view.',
|
137
|
+
data: {
|
138
|
+
error: error,
|
139
|
+
streamType: streamLogInfo.streamType,
|
140
|
+
callId: streamLogInfo.callId
|
141
|
+
}
|
142
|
+
});
|
143
|
+
return;
|
144
|
+
case EventNames.RENDER_INFO_NOT_FOUND:
|
145
|
+
_logEvent(callingStatefulLogger, {
|
146
|
+
name: EventNames.RENDER_INFO_NOT_FOUND,
|
147
|
+
level: 'error',
|
148
|
+
message: 'Cannot find render info after create the view. ',
|
149
|
+
data: streamLogInfo
|
150
|
+
});
|
151
|
+
return;
|
152
|
+
case EventNames.CREATED_STREAM_STOPPING:
|
153
|
+
_logEvent(callingStatefulLogger, {
|
154
|
+
name: EventNames.CREATED_STREAM_STOPPING,
|
155
|
+
level: 'warning',
|
156
|
+
message: 'Render info status is stopping, dispose renderer.',
|
157
|
+
data: streamLogInfo
|
158
|
+
});
|
159
|
+
return;
|
160
|
+
case EventNames.VIEW_RENDER_SUCCEED:
|
161
|
+
_logEvent(callingStatefulLogger, {
|
162
|
+
name: EventNames.VIEW_RENDER_SUCCEED,
|
163
|
+
level: 'info',
|
164
|
+
message: `Successfully render the view.`,
|
165
|
+
data: streamLogInfo
|
166
|
+
});
|
167
|
+
return;
|
168
|
+
case EventNames.CREATING_VIEW:
|
169
|
+
_logEvent(callingStatefulLogger, {
|
170
|
+
name: EventNames.CREATING_VIEW,
|
171
|
+
level: 'info',
|
172
|
+
message: 'Start creating view for remote video.',
|
173
|
+
data: streamLogInfo
|
174
|
+
});
|
175
|
+
return;
|
176
|
+
default:
|
177
|
+
return;
|
178
|
+
}
|
179
|
+
}
|
180
|
+
/**
|
181
|
+
* helper function to fire streamUtils logging events
|
182
|
+
*
|
183
|
+
* @param eventName Name of event from streamUtils
|
184
|
+
* @param streamLogInfo informaiton about the event and who called it
|
185
|
+
* @param error if any errors present will be added to message in logging
|
186
|
+
*/
|
187
|
+
export function _logStreamEvent(eventName, streamLogInfo, error) {
|
188
|
+
if (streamLogInfo.streamEventType === 'disposeViewLocal' ||
|
189
|
+
streamLogInfo.streamEventType === 'disposeViewRemote' ||
|
190
|
+
streamLogInfo.streamEventType === 'disposeViewUnparented') {
|
191
|
+
_logDisposeStreamEvent(eventName, streamLogInfo);
|
192
|
+
}
|
193
|
+
else if (streamLogInfo.streamEventType === 'createViewLocal' ||
|
194
|
+
streamLogInfo.streamEventType === 'createViewRemote') {
|
195
|
+
_logCreateStreamEvent(eventName, streamLogInfo, error);
|
196
|
+
}
|
197
|
+
}
|
198
|
+
//# sourceMappingURL=StreamUtilsLogging.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"StreamUtilsLogging.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/StreamUtilsLogging.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,SAAS,EAAE,gCAAgC;AACpD,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE7D;;;;;;GAMG;AACH,SAAS,sBAAsB,CAC7B,SA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O,EAAE,mDAAmD;gBAC5D,IAAI,EAAE,aAAa;aACpB,CAAC,CAAC;YACH,OAAO;QACT,KAAK,UAAU,CAAC,mBAAmB;YACjC,SAAS,CAAC,qBAAqB,EAAE;gBAC/B,IAAI,EAAE,UAAU,CAAC,mBAAmB;gBACpC,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,+BAA+B;gBACxC,IAAI,EAAE,aAAa;aACpB,CAAC,CAAC;YACH,OAAO;QACT,KAAK,UAAU,CAAC,aAAa;YAC3B,SAAS,CAAC,qBAAqB,EAAE;gBAC/B,IAAI,EAAE,UAAU,CAAC,aAAa;gBAC9B,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,uCAAuC;gBAChD,IAAI,EAAE,aAAa;aACpB,CAAC,CAAC;YACH,OAAO;QACT;YACE,OAAO;KACV;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC7B,SAAqB,EACrB,aAMC,EACD,KAAe;IAEf,IACE,aAAa,CAAC,eAAe,KAAK,kBAAkB;QACpD,aAAa,CAAC,eAAe,KAAK,mBAAmB;QACrD,aAAa,CAAC,eAAe,KAAK,uBAAuB,EACzD;QACA,sBAAsB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;KAClD;SAAM,IACL,aAAa,CAAC,eAAe,KAAK,iBAAiB;QACnD,aAAa,CAAC,eAAe,KAAK,kBAAkB,EACpD;QACA,qBAAqB,CAAC,SAAS,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;KACxD;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { MediaStreamType } from '@azure/communication-calling';\nimport { _logEvent } from '@internal/acs-ui-common';\nimport { callingStatefulLogger, EventNames } from './Logger';\n\n/**\n * helper function to manage logging for stream disposals\n *\n * @param eventName Name of event that occured when managing streams\n * @param streamLogInfo Data about the stream in the event\n * @returns\n */\nfunction _logDisposeStreamEvent(\n eventName: EventNames,\n streamLogInfo: {\n callId?: string;\n participantKey?: any;\n streamId?: number;\n streamType?: MediaStreamType;\n streamEventType?: string;\n }\n): void {\n switch (eventName) {\n case EventNames.DISPOSE_STREAM_INVALID_PARAMS:\n _logEvent(callingStatefulLogger, {\n name: EventNames.DISPOSE_STREAM_INVALID_PARAMS,\n level: 'warning',\n message: 'Dispose View invalid combination of parameters.',\n data: { streamType: streamLogInfo.streamType }\n });\n return;\n case EventNames.START_DISPOSE_STREAM:\n _logEvent(callingStatefulLogger, {\n name: EventNames.START_DISPOSE_STREAM,\n level: 'info',\n message: 'Start disposing stream.',\n data: streamLogInfo\n });\n return;\n case EventNames.DISPOSE_INFO_NOT_FOUND:\n _logEvent(callingStatefulLogger, {\n name: EventNames.DISPOSE_INFO_NOT_FOUND,\n level: 'error',\n message: 'Cannot find render info when disposing stream.',\n data: streamLogInfo\n });\n return;\n case EventNames.STREAM_STOPPING:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_STOPPING,\n level: 'info',\n message: 'Stream is currently marked as stopping, will continue if is local preview',\n data: streamLogInfo\n });\n return;\n case EventNames.DISPOSING_RENDERER:\n _logEvent(callingStatefulLogger, {\n name: EventNames.DISPOSING_RENDERER,\n level: 'info',\n message: 'Disposing view renderer.',\n data: streamLogInfo\n });\n return;\n case EventNames.RENDERER_NOT_FOUND:\n _logEvent(callingStatefulLogger, {\n name: EventNames.RENDERER_NOT_FOUND,\n level: 'error',\n message: 'Cannot find renderer when disposing stream.',\n data: streamLogInfo\n });\n return;\n case EventNames.STREAM_ALREADY_DISPOSED:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_ALREADY_DISPOSED,\n level: 'info',\n message: 'Stream is already disposed.',\n data: streamLogInfo\n });\n return;\n default:\n return;\n }\n}\n\n/**\n * helper function to manage logging for local stream creations\n *\n * @param eventName Name of the event to occured when creating a local stream\n * @param streamLogInfo Data about the stream in the event\n * @param error that is thrown by caller\n * @returns\n */\nfunction _logCreateStreamEvent(\n eventName: string,\n streamLogInfo: {\n callId?: string;\n participantKey?: any;\n streamId?: number;\n streamType?: MediaStreamType;\n streamEventType?: string;\n },\n error?: unknown\n): void {\n switch (eventName) {\n case EventNames.CREATE_STREAM_INVALID_PARAMS:\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATE_STREAM_INVALID_PARAMS,\n level: 'warning',\n message: 'Create View invalid combination of parameters.',\n data: { streamType: streamLogInfo.streamType }\n });\n return;\n case EventNames.START_STREAM_RENDERING:\n _logEvent(callingStatefulLogger, {\n name: EventNames.START_STREAM_RENDERING,\n level: 'info',\n message: 'Start creating view for local video.',\n data: streamLogInfo\n });\n return;\n case EventNames.STREAM_NOT_FOUND:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_NOT_FOUND,\n level: 'error',\n message: 'Stream not found in state.',\n data: { callId: streamLogInfo.callId }\n });\n return;\n case EventNames.STREAM_ALREADY_RENDERED:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_ALREADY_RENDERED,\n level: 'warning',\n message: 'Stream is already rendered.',\n data: streamLogInfo\n });\n return;\n case EventNames.STREAM_RENDERING:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_RENDERING,\n level: 'warning',\n message: 'Stream is rendering.',\n data: streamLogInfo\n });\n return;\n case EventNames.STREAM_STOPPING:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_STOPPING,\n level: 'warning',\n message: 'Stream was marked as stopping by dispose view. Resetting state to \"Rendering\".',\n data: streamLogInfo\n });\n return;\n case EventNames.CREATE_STREAM_FAIL:\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATE_STREAM_FAIL,\n level: 'error',\n message: 'Failed to create view.',\n data: {\n error: error,\n streamType: streamLogInfo.streamType,\n callId: streamLogInfo.callId\n }\n });\n return;\n case EventNames.RENDER_INFO_NOT_FOUND:\n _logEvent(callingStatefulLogger, {\n name: EventNames.RENDER_INFO_NOT_FOUND,\n level: 'error',\n message: 'Cannot find render info after create the view. ',\n data: streamLogInfo\n });\n return;\n case EventNames.CREATED_STREAM_STOPPING:\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATED_STREAM_STOPPING,\n level: 'warning',\n message: 'Render info status is stopping, dispose renderer.',\n data: streamLogInfo\n });\n return;\n case EventNames.VIEW_RENDER_SUCCEED:\n _logEvent(callingStatefulLogger, {\n name: EventNames.VIEW_RENDER_SUCCEED,\n level: 'info',\n message: `Successfully render the view.`,\n data: streamLogInfo\n });\n return;\n case EventNames.CREATING_VIEW:\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATING_VIEW,\n level: 'info',\n message: 'Start creating view for remote video.',\n data: streamLogInfo\n });\n return;\n default:\n return;\n }\n}\n\n/**\n * helper function to fire streamUtils logging events\n *\n * @param eventName Name of event from streamUtils\n * @param streamLogInfo informaiton about the event and who called it\n * @param error if any errors present will be added to message in logging\n */\nexport function _logStreamEvent(\n eventName: EventNames,\n streamLogInfo: {\n callId?: string;\n participantKey?: any;\n streamId?: number;\n streamType?: MediaStreamType;\n streamEventType?: string;\n },\n error?: unknown\n): void {\n if (\n streamLogInfo.streamEventType === 'disposeViewLocal' ||\n streamLogInfo.streamEventType === 'disposeViewRemote' ||\n streamLogInfo.streamEventType === 'disposeViewUnparented'\n ) {\n _logDisposeStreamEvent(eventName, streamLogInfo);\n } else if (\n streamLogInfo.streamEventType === 'createViewLocal' ||\n streamLogInfo.streamEventType === 'createViewRemote'\n ) {\n _logCreateStreamEvent(eventName, streamLogInfo, error);\n }\n}\n\"../../acs-ui-common/src\""]}
|
@@ -5,4 +5,5 @@ export type { CallAgentState, CallClientState, CallError, CallErrors, CallErrorT
|
|
5
5
|
export type { CreateViewResult } from './StreamUtils';
|
6
6
|
export type { DeclarativeCallAgent, IncomingCallManagement } from './CallAgentDeclarative';
|
7
7
|
export type { DeclarativeIncomingCall } from './IncomingCallDeclarative';
|
8
|
+
export type { LocalVideoStreamVideoEffectsState } from './CallClientState';
|
8
9
|
//# sourceMappingURL=index-public.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-public.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/index-public.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { createStatefulCallClient } from './StatefulCallClient';\nexport type { StatefulCallClient, StatefulCallClientArgs, StatefulCallClientOptions } from './StatefulCallClient';\nexport type { StatefulDeviceManager } from './DeviceManagerDeclarative';\nexport type {\n CallAgentState,\n CallClientState,\n CallError,\n CallErrors,\n CallErrorTarget,\n CallState,\n DeviceManagerState,\n DiagnosticsCallFeatureState,\n IncomingCallState,\n LocalVideoStreamState,\n MediaDiagnosticsState,\n NetworkDiagnosticsState,\n RecordingCallFeatureState as RecordingCallFeature,\n RemoteParticipantState,\n RemoteVideoStreamState,\n TranscriptionCallFeatureState as TranscriptionCallFeature,\n VideoStreamRendererViewState\n} from './CallClientState';\nexport type { CreateViewResult } from './StreamUtils';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeCallAgent, IncomingCallManagement } from './CallAgentDeclarative';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeIncomingCall } from './IncomingCallDeclarative';\n"]}
|
1
|
+
{"version":3,"file":"index-public.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/index-public.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport { createStatefulCallClient } from './StatefulCallClient';\nexport type { StatefulCallClient, StatefulCallClientArgs, StatefulCallClientOptions } from './StatefulCallClient';\nexport type { StatefulDeviceManager } from './DeviceManagerDeclarative';\nexport type {\n CallAgentState,\n CallClientState,\n CallError,\n CallErrors,\n CallErrorTarget,\n CallState,\n DeviceManagerState,\n DiagnosticsCallFeatureState,\n IncomingCallState,\n LocalVideoStreamState,\n MediaDiagnosticsState,\n NetworkDiagnosticsState,\n RecordingCallFeatureState as RecordingCallFeature,\n RemoteParticipantState,\n RemoteVideoStreamState,\n TranscriptionCallFeatureState as TranscriptionCallFeature,\n VideoStreamRendererViewState\n} from './CallClientState';\nexport type { CreateViewResult } from './StreamUtils';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeCallAgent, IncomingCallManagement } from './CallAgentDeclarative';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeIncomingCall } from './IncomingCallDeclarative';\n/* @conditional-compile-remove(video-background-effects) */\nexport type { LocalVideoStreamVideoEffectsState } from './CallClientState';\n"]}
|
@@ -127,7 +127,7 @@ export const messageThreadSelector = createSelector([getUserId, getChatMessages,
|
|
127
127
|
updateMessagesWithAttached(convertedMessages);
|
128
128
|
return {
|
129
129
|
userId,
|
130
|
-
showMessageStatus:
|
130
|
+
showMessageStatus: true,
|
131
131
|
messages: convertedMessages,
|
132
132
|
participantCount,
|
133
133
|
readReceiptsBySenderId
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"messageThreadSelector.js","sourceRoot":"","sources":["../../../../../chat-component-bindings/src/messageThreadSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,YAAY,EAAE,gCAAgC;AASvD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAKhF,MAAM,6BAA6B,GAAG,YAAY,CAChD,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,eAAe,KAAK,SAAS,CACxC;SACA,MAAM,CAAC,wCAAwC,CAAC;SAChD,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;;QACf,OAAO,UAAU,CACf,MAAA,OAAO,CAAC,EAAE,mCAAI,OAAO,CAAC,eAAe,EACrC,OAAO,EACP,MAAM,EACN,OAAO,CAAC,SAAS,IAAI,cAAc,EACnC,YAAY,CACb,CAAC;IACJ,CAAC,CAAC,CACL,CAAC;IAEF,0BAA0B,CAAC,iBAAiB,CAAC,CAAC;IAC9C,OAAO;QACL,MAAM;QACN,iBAAiB,EAAE,CAAC,YAAY;QAChC,QAAQ,EAAE,iBAAiB;QAC3B,gBAAgB;QAChB,sBAAsB;KACvB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,IAAY,EAAsB,EAAE;IACvE,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACzC,OAAO,aAAa,KAAK,MAAM,IAAI,aAAa,KAAK,MAAM,IAAI,aAAa,KAAK,eAAe;QAC9F,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,wCAAwC,GAAG,CAAC,OAA8B,EAAW,EAAE;;IAC3F,IAAI,OAAO,CAAC,SAAS,EAAE;QACrB,OAAO,KAAK,CAAC;KACd;IACD,IAAI,MAAA,OAAO,CAAC,QAAQ,0CAAG,qBAAqB,CAAC,EAAE;QAC7C,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,OAAO,MAAK,EAAE,CAAC,CAAC;AAChE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ChatBaseSelectorProps,\n getChatMessages,\n getIsLargeGroup,\n getLatestReadTime,\n getParticipants,\n getReadReceipts,\n getUserId\n} from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatClientState, ChatMessageWithStatus } from '@internal/chat-stateful-client';\nimport { memoizeFnAll } from '@internal/acs-ui-common';\nimport {\n ChatMessage,\n Message,\n CommunicationParticipant,\n SystemMessage,\n MessageContentType,\n ReadReceiptsBySenderId\n} from '@internal/react-components';\nimport { createSelector } from 'reselect';\nimport { ACSKnownMessageType } from './utils/constants';\nimport { updateMessagesWithAttached } from './utils/updateMessagesWithAttached';\n\n/* @conditional-compile-remove(file-sharing) */\nimport { FileMetadata } from '@internal/react-components';\n\nconst memoizedAllConvertChatMessage = memoizeFnAll(\n (\n _key: string,\n chatMessage: ChatMessageWithStatus,\n userId: string,\n isSeen: boolean,\n isLargeGroup: boolean\n ): Message => {\n const messageType = chatMessage.type.toLowerCase();\n if (\n messageType === ACSKnownMessageType.text ||\n messageType === ACSKnownMessageType.richtextHtml ||\n messageType === ACSKnownMessageType.html\n ) {\n return convertToUiChatMessage(chatMessage, userId, isSeen, isLargeGroup);\n } else {\n return convertToUiSystemMessage(chatMessage);\n }\n }\n);\n\n/* @conditional-compile-remove(file-sharing) */\nconst extractAttachedFilesMetadata = (metadata: Record<string, string>): FileMetadata[] => {\n const fileMetadata = metadata['fileSharingMetadata'];\n if (!fileMetadata) {\n return [];\n }\n try {\n return JSON.parse(fileMetadata);\n } catch (e) {\n console.error(e);\n return [];\n }\n};\n\nconst convertToUiChatMessage = (\n message: ChatMessageWithStatus,\n userId: string,\n isSeen: boolean,\n isLargeGroup: boolean\n): ChatMessage => {\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n return {\n messageType: 'chat',\n createdOn: message.createdOn,\n content: message.content?.message,\n contentType: sanitizedMessageContentType(message.type),\n status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,\n senderDisplayName: message.senderDisplayName,\n senderId: messageSenderId,\n messageId: message.id,\n clientMessageId: message.clientMessageId,\n editedOn: message.editedOn,\n deletedOn: message.deletedOn,\n mine: messageSenderId === userId,\n metadata: message.metadata,\n /* @conditional-compile-remove(file-sharing) */\n attachedFilesMetadata: extractAttachedFilesMetadata(message.metadata || {})\n };\n};\n\nconst convertToUiSystemMessage = (message: ChatMessageWithStatus): SystemMessage => {\n const systemMessageType = message.type;\n if (systemMessageType === 'participantAdded' || systemMessageType === 'participantRemoved') {\n return {\n messageType: 'system',\n systemMessageType,\n createdOn: message.createdOn,\n participants:\n message.content?.participants\n // TODO: In our moderator logic, we use undefined name as our displayName for moderator, which should be filtered out\n // Once we have a better solution to identify the moderator, remove this line\n ?.filter((participant) => participant.displayName && participant.displayName !== '')\n .map(\n (participant): CommunicationParticipant => ({\n userId: toFlatCommunicationIdentifier(participant.id),\n displayName: participant.displayName\n })\n ) ?? [],\n messageId: message.id,\n iconName: systemMessageType === 'participantAdded' ? 'PeopleAdd' : 'PeopleBlock'\n };\n } else {\n // Only topic updated type left, according to ACSKnown type\n return {\n messageType: 'system',\n systemMessageType: 'topicUpdated',\n createdOn: message.createdOn,\n topic: message.content?.topic ?? '',\n messageId: message.id,\n iconName: 'Edit'\n };\n }\n};\n\n/**\n * Selector type for {@link MessageThread} component.\n *\n * @public\n */\nexport type MessageThreadSelector = (\n state: ChatClientState,\n props: ChatBaseSelectorProps\n) => {\n userId: string;\n showMessageStatus: boolean;\n messages: Message[];\n};\n\n/** Returns `true` if the message has participants and at least one participant has a display name. */\nconst hasValidParticipant = (chatMessage: ChatMessageWithStatus): boolean =>\n !!chatMessage.content?.participants && chatMessage.content.participants.some((p) => !!p.displayName);\n\n/**\n * Selector for {@link MessageThread} component.\n *\n * @public\n */\nexport const messageThreadSelector: MessageThreadSelector = createSelector(\n [getUserId, getChatMessages, getLatestReadTime, getIsLargeGroup, getReadReceipts, getParticipants],\n (userId, chatMessages, latestReadTime, isLargeGroup, readReceipts, participants) => {\n // We can't get displayName in teams meeting interop for now, disable rr feature when it is teams interop\n const isTeamsInterop = Object.values(participants).find((p) => 'microsoftTeamsUserId' in p.id) !== undefined;\n\n // get number of participants\n // filter out the non valid participants (no display name)\n // Read Receipt details will be disabled when participant count is 0\n const participantCount = isTeamsInterop\n ? undefined\n : Object.values(participants).filter((p) => p.displayName && p.displayName !== '').length;\n\n // creating key value pairs of senderID: last read message information\n\n const readReceiptsBySenderId: ReadReceiptsBySenderId = {};\n\n // readReceiptsBySenderId[senderID] gets updated everytime a new message is read by this sender\n // in this way we can make sure that we are only saving the latest read message id and read on time for each sender\n readReceipts\n .filter((r) => r.sender && toFlatCommunicationIdentifier(r.sender) !== userId)\n .forEach((r) => {\n readReceiptsBySenderId[toFlatCommunicationIdentifier(r.sender)] = {\n lastReadMessage: r.chatMessageId,\n displayName: participants[toFlatCommunicationIdentifier(r.sender)]?.displayName ?? ''\n };\n });\n\n // A function takes parameter above and generate return value\n const convertedMessages = memoizedAllConvertChatMessage((memoizedFn) =>\n Object.values(chatMessages)\n .filter(\n (message) =>\n message.type.toLowerCase() === ACSKnownMessageType.text ||\n message.type.toLowerCase() === ACSKnownMessageType.richtextHtml ||\n message.type.toLowerCase() === ACSKnownMessageType.html ||\n (message.type === ACSKnownMessageType.participantAdded && hasValidParticipant(message)) ||\n (message.type === ACSKnownMessageType.participantRemoved && hasValidParticipant(message)) ||\n // TODO: Add support for topicUpdated system messages in MessageThread component.\n // message.type === ACSKnownMessageType.topicUpdated ||\n message.clientMessageId !== undefined\n )\n .filter(messagesWithContentOrFileSharingMetadata)\n .map((message) => {\n return memoizedFn(\n message.id ?? message.clientMessageId,\n message,\n userId,\n message.createdOn <= latestReadTime,\n isLargeGroup\n );\n })\n );\n\n updateMessagesWithAttached(convertedMessages);\n return {\n userId,\n showMessageStatus: !isLargeGroup,\n messages: convertedMessages,\n participantCount,\n readReceiptsBySenderId\n };\n }\n);\n\nconst sanitizedMessageContentType = (type: string): MessageContentType => {\n const lowerCaseType = type.toLowerCase();\n return lowerCaseType === 'text' || lowerCaseType === 'html' || lowerCaseType === 'richtext/html'\n ? lowerCaseType\n : 'unknown';\n};\n\nconst messagesWithContentOrFileSharingMetadata = (message: ChatMessageWithStatus): boolean => {\n if (message.deletedOn) {\n return false;\n }\n if (message.metadata?.['fileSharingMetadata']) {\n return true;\n }\n return !!(message.content && message.content?.message !== '');\n};\n\"../../acs-ui-common/src\"\"../../chat-stateful-client/src\"\"../../react-components/src\""]}
|
1
|
+
{"version":3,"file":"messageThreadSelector.js","sourceRoot":"","sources":["../../../../../chat-component-bindings/src/messageThreadSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,YAAY,EAAE,gCAAgC;AASvD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAKhF,MAAM,6BAA6B,GAAG,YAAY,CAChD,CACE,IAAY,EACZ,WAAkC,EAClC,MAAc,EACd,MAAe,EACf,YAAqB,EACZ,EAAE;IACX,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACnD,IACE,WAAW,KAAK,mBAAmB,CAAC,IAAI;QACxC,WAAW,KAAK,mBAAmB,CAAC,YAAY;QAChD,WAAW,KAAK,mBAAmB,CAAC,IAAI,EACxC;QACA,OAAO,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;KAC1E;SAAM;QACL,OAAO,wBAAwB,CAAC,WAAW,CAAC,CAAC;KAC9C;AACH,CAAC,CACF,CAAC;AAEF,+CAA+C;AAC/C,MAAM,4BAA4B,GAAG,CAAC,QAAgC,EAAkB,EAAE;IACxF,M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AAsB,EAAE;IACvE,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACzC,OAAO,aAAa,KAAK,MAAM,IAAI,aAAa,KAAK,MAAM,IAAI,aAAa,KAAK,eAAe;QAC9F,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC,CAAC;AAEF,MAAM,wCAAwC,GAAG,CAAC,OAA8B,EAAW,EAAE;;IAC3F,IAAI,OAAO,CAAC,SAAS,EAAE;QACrB,OAAO,KAAK,CAAC;KACd;IACD,IAAI,MAAA,OAAO,CAAC,QAAQ,0CAAG,qBAAqB,CAAC,EAAE;QAC7C,OAAO,IAAI,CAAC;KACb;IACD,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,OAAO,MAAK,EAAE,CAAC,CAAC;AAChE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ChatBaseSelectorProps,\n getChatMessages,\n getIsLargeGroup,\n getLatestReadTime,\n getParticipants,\n getReadReceipts,\n getUserId\n} from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatClientState, ChatMessageWithStatus } from '@internal/chat-stateful-client';\nimport { memoizeFnAll } from '@internal/acs-ui-common';\nimport {\n ChatMessage,\n Message,\n CommunicationParticipant,\n SystemMessage,\n MessageContentType,\n ReadReceiptsBySenderId\n} from '@internal/react-components';\nimport { createSelector } from 'reselect';\nimport { ACSKnownMessageType } from './utils/constants';\nimport { updateMessagesWithAttached } from './utils/updateMessagesWithAttached';\n\n/* @conditional-compile-remove(file-sharing) */\nimport { FileMetadata } from '@internal/react-components';\n\nconst memoizedAllConvertChatMessage = memoizeFnAll(\n (\n _key: string,\n chatMessage: ChatMessageWithStatus,\n userId: string,\n isSeen: boolean,\n isLargeGroup: boolean\n ): Message => {\n const messageType = chatMessage.type.toLowerCase();\n if (\n messageType === ACSKnownMessageType.text ||\n messageType === ACSKnownMessageType.richtextHtml ||\n messageType === ACSKnownMessageType.html\n ) {\n return convertToUiChatMessage(chatMessage, userId, isSeen, isLargeGroup);\n } else {\n return convertToUiSystemMessage(chatMessage);\n }\n }\n);\n\n/* @conditional-compile-remove(file-sharing) */\nconst extractAttachedFilesMetadata = (metadata: Record<string, string>): FileMetadata[] => {\n const fileMetadata = metadata['fileSharingMetadata'];\n if (!fileMetadata) {\n return [];\n }\n try {\n return JSON.parse(fileMetadata);\n } catch (e) {\n console.error(e);\n return [];\n }\n};\n\nconst convertToUiChatMessage = (\n message: ChatMessageWithStatus,\n userId: string,\n isSeen: boolean,\n isLargeGroup: boolean\n): ChatMessage => {\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n return {\n messageType: 'chat',\n createdOn: message.createdOn,\n content: message.content?.message,\n contentType: sanitizedMessageContentType(message.type),\n status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,\n senderDisplayName: message.senderDisplayName,\n senderId: messageSenderId,\n messageId: message.id,\n clientMessageId: message.clientMessageId,\n editedOn: message.editedOn,\n deletedOn: message.deletedOn,\n mine: messageSenderId === userId,\n metadata: message.metadata,\n /* @conditional-compile-remove(file-sharing) */\n attachedFilesMetadata: extractAttachedFilesMetadata(message.metadata || {})\n };\n};\n\nconst convertToUiSystemMessage = (message: ChatMessageWithStatus): SystemMessage => {\n const systemMessageType = message.type;\n if (systemMessageType === 'participantAdded' || systemMessageType === 'participantRemoved') {\n return {\n messageType: 'system',\n systemMessageType,\n createdOn: message.createdOn,\n participants:\n message.content?.participants\n // TODO: In our moderator logic, we use undefined name as our displayName for moderator, which should be filtered out\n // Once we have a better solution to identify the moderator, remove this line\n ?.filter((participant) => participant.displayName && participant.displayName !== '')\n .map(\n (participant): CommunicationParticipant => ({\n userId: toFlatCommunicationIdentifier(participant.id),\n displayName: participant.displayName\n })\n ) ?? [],\n messageId: message.id,\n iconName: systemMessageType === 'participantAdded' ? 'PeopleAdd' : 'PeopleBlock'\n };\n } else {\n // Only topic updated type left, according to ACSKnown type\n return {\n messageType: 'system',\n systemMessageType: 'topicUpdated',\n createdOn: message.createdOn,\n topic: message.content?.topic ?? '',\n messageId: message.id,\n iconName: 'Edit'\n };\n }\n};\n\n/**\n * Selector type for {@link MessageThread} component.\n *\n * @public\n */\nexport type MessageThreadSelector = (\n state: ChatClientState,\n props: ChatBaseSelectorProps\n) => {\n userId: string;\n showMessageStatus: boolean;\n messages: Message[];\n};\n\n/** Returns `true` if the message has participants and at least one participant has a display name. */\nconst hasValidParticipant = (chatMessage: ChatMessageWithStatus): boolean =>\n !!chatMessage.content?.participants && chatMessage.content.participants.some((p) => !!p.displayName);\n\n/**\n * Selector for {@link MessageThread} component.\n *\n * @public\n */\nexport const messageThreadSelector: MessageThreadSelector = createSelector(\n [getUserId, getChatMessages, getLatestReadTime, getIsLargeGroup, getReadReceipts, getParticipants],\n (userId, chatMessages, latestReadTime, isLargeGroup, readReceipts, participants) => {\n // We can't get displayName in teams meeting interop for now, disable rr feature when it is teams interop\n const isTeamsInterop = Object.values(participants).find((p) => 'microsoftTeamsUserId' in p.id) !== undefined;\n\n // get number of participants\n // filter out the non valid participants (no display name)\n // Read Receipt details will be disabled when participant count is 0\n const participantCount = isTeamsInterop\n ? undefined\n : Object.values(participants).filter((p) => p.displayName && p.displayName !== '').length;\n\n // creating key value pairs of senderID: last read message information\n\n const readReceiptsBySenderId: ReadReceiptsBySenderId = {};\n\n // readReceiptsBySenderId[senderID] gets updated everytime a new message is read by this sender\n // in this way we can make sure that we are only saving the latest read message id and read on time for each sender\n readReceipts\n .filter((r) => r.sender && toFlatCommunicationIdentifier(r.sender) !== userId)\n .forEach((r) => {\n readReceiptsBySenderId[toFlatCommunicationIdentifier(r.sender)] = {\n lastReadMessage: r.chatMessageId,\n displayName: participants[toFlatCommunicationIdentifier(r.sender)]?.displayName ?? ''\n };\n });\n\n // A function takes parameter above and generate return value\n const convertedMessages = memoizedAllConvertChatMessage((memoizedFn) =>\n Object.values(chatMessages)\n .filter(\n (message) =>\n message.type.toLowerCase() === ACSKnownMessageType.text ||\n message.type.toLowerCase() === ACSKnownMessageType.richtextHtml ||\n message.type.toLowerCase() === ACSKnownMessageType.html ||\n (message.type === ACSKnownMessageType.participantAdded && hasValidParticipant(message)) ||\n (message.type === ACSKnownMessageType.participantRemoved && hasValidParticipant(message)) ||\n // TODO: Add support for topicUpdated system messages in MessageThread component.\n // message.type === ACSKnownMessageType.topicUpdated ||\n message.clientMessageId !== undefined\n )\n .filter(messagesWithContentOrFileSharingMetadata)\n .map((message) => {\n return memoizedFn(\n message.id ?? message.clientMessageId,\n message,\n userId,\n message.createdOn <= latestReadTime,\n isLargeGroup\n );\n })\n );\n\n updateMessagesWithAttached(convertedMessages);\n return {\n userId,\n showMessageStatus: true,\n messages: convertedMessages,\n participantCount,\n readReceiptsBySenderId\n };\n }\n);\n\nconst sanitizedMessageContentType = (type: string): MessageContentType => {\n const lowerCaseType = type.toLowerCase();\n return lowerCaseType === 'text' || lowerCaseType === 'html' || lowerCaseType === 'richtext/html'\n ? lowerCaseType\n : 'unknown';\n};\n\nconst messagesWithContentOrFileSharingMetadata = (message: ChatMessageWithStatus): boolean => {\n if (message.deletedOn) {\n return false;\n }\n if (message.metadata?.['fileSharingMetadata']) {\n return true;\n }\n return !!(message.content && message.content?.message !== '');\n};\n\"../../acs-ui-common/src\"\"../../chat-stateful-client/src\"\"../../react-components/src\""]}
|
@@ -16,6 +16,7 @@ var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
16
16
|
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
17
17
|
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
18
18
|
};
|
19
|
+
import { toFlatCommunicationIdentifier } from "../../acs-ui-common/src";
|
19
20
|
import { convertChatMessage } from './convertChatMessage';
|
20
21
|
// TODO: When we can get messageId of event from SDK, remove this
|
21
22
|
// Maximum time to look back message list when we receive a system event
|
@@ -84,7 +85,8 @@ export class EventSubscriber {
|
|
84
85
|
});
|
85
86
|
this.fetchLastParticipantMessage(event.threadId, 'participantAdded');
|
86
87
|
};
|
87
|
-
// This is a
|
88
|
+
// This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.
|
89
|
+
// Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.
|
88
90
|
this.fetchLastParticipantMessage = (threadId, actionType) => __awaiter(this, void 0, void 0, function* () {
|
89
91
|
var e_1, _a;
|
90
92
|
try {
|
@@ -110,7 +112,13 @@ export class EventSubscriber {
|
|
110
112
|
return participant.id;
|
111
113
|
});
|
112
114
|
this.chatContext.deleteParticipants(event.threadId, participantIds);
|
113
|
-
|
115
|
+
// If the current user is removed from the thread, do not fetch the last participant message
|
116
|
+
// as they no longer have access to the thread.
|
117
|
+
const currentUserId = toFlatCommunicationIdentifier(this.chatContext.getState().userId);
|
118
|
+
const wasCurrentUserRemoved = participantIds.find((id) => toFlatCommunicationIdentifier(id) === currentUserId);
|
119
|
+
if (!wasCurrentUserRemoved) {
|
120
|
+
this.fetchLastParticipantMessage(event.threadId, 'participantRemoved');
|
121
|
+
}
|
114
122
|
};
|
115
123
|
this.onReadReceiptReceived = (event) => {
|
116
124
|
const readReceipt = Object.assign(Object.assign({}, event), { sender: event.sender, readOn: new Date(event.readOn) });
|