@azure/communication-react 1.3.3-alpha-202210290014.0 → 1.4.1-beta.1
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.md → CHANGELOG.beta.md} +52 -211
- package/CHANGELOG.json +2307 -0
- package/CHANGELOG.stable.md +287 -0
- package/dist/communication-react.d.ts +307 -91
- package/dist/dist-cjs/communication-react/index.js +11193 -10508
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetry.d.ts +10 -0
- package/dist/dist-esm/acs-ui-common/src/telemetry.js +10 -0
- package/dist/dist-esm/acs-ui-common/src/telemetry.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +5 -0
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +5 -0
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +51 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +270 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createDefaultCallingHandlersForComponent.d.ts +20 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createDefaultCallingHandlersForComponent.js +36 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createDefaultCallingHandlersForComponent.js.map +1 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.d.ts +6 -51
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +22 -299
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.d.ts +43 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +81 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -0
- package/dist/dist-esm/calling-component-bindings/src/hooks/useHandlers.d.ts +1 -1
- package/dist/dist-esm/calling-component-bindings/src/hooks/useHandlers.js +17 -5
- package/dist/dist-esm/calling-component-bindings/src/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.d.ts +2 -2
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/hooks/useSelector.js +3 -3
- package/dist/dist-esm/calling-component-bindings/src/hooks/useSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/index.d.ts +4 -0
- package/dist/dist-esm/calling-component-bindings/src/index.js +4 -0
- package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +10 -3
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/providers/CallAgentProvider.d.ts +12 -2
- package/dist/dist-esm/calling-component-bindings/src/providers/CallAgentProvider.js +25 -1
- package/dist/dist-esm/calling-component-bindings/src/providers/CallAgentProvider.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/providers/CallProvider.d.ts +16 -2
- package/dist/dist-esm/calling-component-bindings/src/providers/CallProvider.js +27 -1
- package/dist/dist-esm/calling-component-bindings/src/providers/CallProvider.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +11 -0
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +15 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts +7 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js +11 -0
- package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.d.ts +26 -0
- package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.js +4 -0
- package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.d.ts +9 -6
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js +37 -182
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.d.ts +53 -0
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +204 -0
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +5 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js +4 -65
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.d.ts +13 -0
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +88 -0
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +2 -2
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +4 -3
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +4 -0
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/IncomingCallDeclarative.d.ts +2 -1
- package/dist/dist-esm/calling-stateful-client/src/IncomingCallDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/IncomingCallSubscriber.d.ts +3 -2
- package/dist/dist-esm/calling-stateful-client/src/IncomingCallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +16 -0
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.d.ts +19 -0
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js +89 -0
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.d.ts +23 -0
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +48 -0
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +19 -0
- package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +35 -0
- package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +8 -0
- package/dist/dist-esm/calling-stateful-client/src/index-public.js +4 -0
- package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/index.d.ts +3 -7
- package/dist/dist-esm/calling-stateful-client/src/index.js +2 -1
- package/dist/dist-esm/calling-stateful-client/src/index.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/StatefulChatThreadClient.js +5 -0
- package/dist/dist-esm/chat-stateful-client/src/StatefulChatThreadClient.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +6 -4
- package/dist/dist-esm/communication-react/src/index.js +4 -2
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/{BrowserPermissionDenied.d.ts → DevicePermissions/BrowserPermissionDenied.d.ts} +4 -4
- package/dist/dist-esm/react-components/src/components/{BrowserPermissionDenied.js → DevicePermissions/BrowserPermissionDenied.js} +8 -6
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/{BrowserPermissionDeniedIOS.d.ts → DevicePermissions/BrowserPermissionDeniedIOS.d.ts} +1 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +58 -0
- package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/{DevicePermissionDropdown.d.ts → DevicePermissions/DevicePermissionDropdown.d.ts} +4 -0
- package/dist/dist-esm/react-components/src/components/{DevicePermissionDropdown.js → DevicePermissions/DevicePermissionDropdown.js} +3 -2
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DevicePermissionDropdown.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.d.ts +101 -0
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.js +80 -0
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissionsScaffolding.d.ts +86 -0
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissionsScaffolding.js +31 -0
- package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissionsScaffolding.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +1 -1
- package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js +7 -11
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js +3 -3
- package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/VideoTile.js +9 -2
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +9 -8
- package/dist/dist-esm/react-components/src/components/index.js +4 -4
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Dialpad.styles.js +0 -2
- package/dist/dist-esm/react-components/src/components/styles/Dialpad.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/DomainPermissions.styles.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/styles/DomainPermissions.styles.js +10 -1
- package/dist/dist-esm/react-components/src/components/styles/DomainPermissions.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.d.ts +1 -5
- package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.js +0 -11
- package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +6 -0
- package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/merge.d.ts +7 -0
- package/dist/dist-esm/react-components/src/components/utils/merge.js +16 -0
- package/dist/dist-esm/react-components/src/components/utils/merge.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/utils.js +6 -0
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +21 -5
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +56 -2
- package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.d.ts +2 -1
- package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +4 -1
- package/dist/dist-esm/react-components/src/theming/icons.js +30 -18
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +6 -0
- package/dist/dist-esm/react-components/src/theming/icons.styles.js +25 -0
- package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.d.ts +3 -0
- package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +0 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +23 -17
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +25 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +24 -11
- 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 +7 -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/adapter/index.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +14 -12
- 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 +4 -4
- 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/CallPane.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js +4 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageErrorBar.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageErrorBar.js +4 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageErrorBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js +6 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +11 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +76 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +5 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +5 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallComposite.styles.d.ts +6 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallComposite.styles.js +9 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallComposite.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +8 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +26 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +4 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +2 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js +0 -13
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/BaseComposite.js +10 -1
- package/dist/dist-esm/react-composites/src/composites/common/BaseComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.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/PeoplePaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/TabHeader.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +4 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.js +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
- package/package.json +12 -12
- package/dist/dist-esm/react-components/src/components/BrowserPermissionDenied.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.js +0 -57
- package/dist/dist-esm/react-components/src/components/BrowserPermissionDeniedIOS.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissionDropdown.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/DomainPermissions.d.ts +0 -53
- package/dist/dist-esm/react-components/src/components/DomainPermissions.js +0 -43
- package/dist/dist-esm/react-components/src/components/DomainPermissions.js.map +0 -1
@@ -4,6 +4,7 @@ import { RoomCallLocator } from '@azure/communication-calling';
|
|
4
4
|
import { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';
|
5
5
|
import { CallAdapter, CallEndedListener, CallIdChangedListener, CallAdapterState, DisplayNameChangedListener, IsMutedChangedListener, IsLocalScreenSharingActiveChangedListener, IsSpeakingChangedListener, ParticipantsJoinedListener, ParticipantsLeftListener, DiagnosticChangedEventListner } from './CallAdapter';
|
6
6
|
import { CreateVideoStreamViewResult, VideoStreamOptions } from "../../../../../react-components/src";
|
7
|
+
import { Role } from "../../../../../react-components/src";
|
7
8
|
import { CommunicationTokenCredential, CommunicationUserIdentifier, PhoneNumberIdentifier, CommunicationIdentifier } from '@azure/communication-common';
|
8
9
|
import { AdapterError } from '../../common/adapters';
|
9
10
|
/**
|
@@ -24,7 +25,9 @@ export declare class AzureCommunicationCallAdapter implements CallAdapter {
|
|
24
25
|
private onClientStateChange;
|
25
26
|
private get call();
|
26
27
|
private set call(value);
|
27
|
-
constructor(callClient: StatefulCallClient, locator: CallAdapterLocator, callAgent: CallAgent, deviceManager: StatefulDeviceManager
|
28
|
+
constructor(callClient: StatefulCallClient, locator: CallAdapterLocator, callAgent: CallAgent, deviceManager: StatefulDeviceManager, options?: {
|
29
|
+
roleHint?: Role;
|
30
|
+
});
|
28
31
|
private subscribeDeviceManagerEvents;
|
29
32
|
private bindPublicMethods;
|
30
33
|
dispose(): void;
|
@@ -113,6 +116,19 @@ export declare type CallParticipantsLocator = {
|
|
113
116
|
* @public
|
114
117
|
*/
|
115
118
|
export declare type CallAdapterLocator = TeamsMeetingLinkLocator | GroupCallLocator | /* @conditional-compile-remove(rooms) */ RoomCallLocator | /* @conditional-compile-remove(teams-adhoc-call) */ /* @conditional-compile-remove(PSTN-calls) */ CallParticipantsLocator;
|
119
|
+
/**
|
120
|
+
* Optional parameters to create {@link AzureCommunicationCallAdapter}
|
121
|
+
*
|
122
|
+
* @beta
|
123
|
+
*/
|
124
|
+
export declare type AzureCommunicationCallAdapterOptions = {
|
125
|
+
/**
|
126
|
+
* Use this to hint the role of the user when the role is not available before a Rooms call is started. This value
|
127
|
+
* should be obtained using the Rooms API. This role will determine permissions in the configuration page of the
|
128
|
+
* {@link CallComposite}. The true role of the user will be synced with ACS services when a Rooms call starts.
|
129
|
+
*/
|
130
|
+
roleHint?: Role;
|
131
|
+
};
|
116
132
|
/**
|
117
133
|
* Arguments for creating the Azure Communication Services implementation of {@link CallAdapter}.
|
118
134
|
*
|
@@ -126,6 +142,10 @@ export declare type AzureCommunicationCallAdapterArgs = {
|
|
126
142
|
credential: CommunicationTokenCredential;
|
127
143
|
locator: CallAdapterLocator;
|
128
144
|
alternateCallerId?: string;
|
145
|
+
/**
|
146
|
+
* Optional parameters for the {@link AzureCommunicationCallAdapter} created
|
147
|
+
*/
|
148
|
+
options?: AzureCommunicationCallAdapterOptions;
|
129
149
|
};
|
130
150
|
/**
|
131
151
|
* Create a {@link CallAdapter} backed by Azure Communication Services.
|
@@ -136,7 +156,7 @@ export declare type AzureCommunicationCallAdapterArgs = {
|
|
136
156
|
*
|
137
157
|
* @public
|
138
158
|
*/
|
139
|
-
export declare const createAzureCommunicationCallAdapter: ({ userId, displayName, credential, locator, alternateCallerId }: AzureCommunicationCallAdapterArgs) => Promise<CallAdapter>;
|
159
|
+
export declare const createAzureCommunicationCallAdapter: ({ userId, displayName, credential, locator, alternateCallerId, options }: AzureCommunicationCallAdapterArgs) => Promise<CallAdapter>;
|
140
160
|
/**
|
141
161
|
* A custom React hook to simplify the creation of {@link CallAdapter}.
|
142
162
|
*
|
@@ -160,5 +180,7 @@ export declare const useAzureCommunicationCallAdapter: (args: Partial<AzureCommu
|
|
160
180
|
*
|
161
181
|
* @public
|
162
182
|
*/
|
163
|
-
export declare const createAzureCommunicationCallAdapterFromClient: (callClient: StatefulCallClient, callAgent: CallAgent, locator: CallAdapterLocator
|
183
|
+
export declare const createAzureCommunicationCallAdapterFromClient: (callClient: StatefulCallClient, callAgent: CallAgent, locator: CallAdapterLocator, options?: {
|
184
|
+
roleHint?: Role;
|
185
|
+
}) => Promise<CallAdapter>;
|
164
186
|
//# sourceMappingURL=AzureCommunicationCallAdapter.d.ts.map
|
@@ -20,8 +20,8 @@ import { DiagnosticsForwarder } from './DiagnosticsForwarder';
|
|
20
20
|
import { useEffect, useRef, useState } from 'react';
|
21
21
|
/** Context of call, which is a centralized context for all state updates */
|
22
22
|
class CallContext {
|
23
|
-
constructor(clientState, isTeamsCall) {
|
24
|
-
var _a;
|
23
|
+
constructor(clientState, isTeamsCall, options) {
|
24
|
+
var _a, _b;
|
25
25
|
this.emitter = new EventEmitter();
|
26
26
|
this.state = {
|
27
27
|
isLocalPreviewMicrophoneEnabled: false,
|
@@ -32,8 +32,10 @@ class CallContext {
|
|
32
32
|
page: 'configuration',
|
33
33
|
latestErrors: clientState.latestErrors,
|
34
34
|
isTeamsCall,
|
35
|
-
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId: clientState.alternateCallerId
|
35
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId: clientState.alternateCallerId,
|
36
|
+
/* @conditional-compile-remove(rooms) */ roleHint: options === null || options === void 0 ? void 0 : options.roleHint
|
36
37
|
};
|
38
|
+
this.emitter.setMaxListeners((_b = options === null || options === void 0 ? void 0 : options.maxListeners) !== null && _b !== void 0 ? _b : 50);
|
37
39
|
}
|
38
40
|
onStateChange(handler) {
|
39
41
|
this.emitter.on('stateChanged', handler);
|
@@ -98,7 +100,8 @@ const findLatestEndedCall = (calls) => {
|
|
98
100
|
* @private
|
99
101
|
*/
|
100
102
|
export class AzureCommunicationCallAdapter {
|
101
|
-
constructor(callClient, locator, callAgent, deviceManager
|
103
|
+
constructor(callClient, locator, callAgent, deviceManager,
|
104
|
+
/* @conditional-compile-remove(rooms) */ options) {
|
102
105
|
this.participantSubscribers = new Map();
|
103
106
|
this.emitter = new EventEmitter();
|
104
107
|
this.isMyMutedChanged = () => {
|
@@ -114,7 +117,8 @@ export class AzureCommunicationCallAdapter {
|
|
114
117
|
this.locator = locator;
|
115
118
|
this.deviceManager = deviceManager;
|
116
119
|
const isTeamsMeeting = 'meetingLink' in this.locator;
|
117
|
-
this.context = new CallContext(callClient.getState(), isTeamsMeeting
|
120
|
+
this.context = new CallContext(callClient.getState(), isTeamsMeeting,
|
121
|
+
/* @conditional-compile-remove(rooms) */ options);
|
118
122
|
this.context.onCallEnded((endCallData) => this.emitter.emit('callEnded', endCallData));
|
119
123
|
const onStateChange = (clientState) => {
|
120
124
|
var _a;
|
@@ -562,7 +566,8 @@ export class AzureCommunicationCallAdapter {
|
|
562
566
|
* @public
|
563
567
|
*/
|
564
568
|
export const createAzureCommunicationCallAdapter = ({ userId, displayName, credential, locator,
|
565
|
-
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId
|
569
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
|
570
|
+
/* @conditional-compile-remove(rooms) */ options }) => __awaiter(void 0, void 0, void 0, function* () {
|
566
571
|
const callClient = createStatefulCallClient({
|
567
572
|
userId,
|
568
573
|
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId
|
@@ -570,7 +575,8 @@ export const createAzureCommunicationCallAdapter = ({ userId, displayName, crede
|
|
570
575
|
const callAgent = yield callClient.createCallAgent(credential, {
|
571
576
|
displayName
|
572
577
|
});
|
573
|
-
const adapter = createAzureCommunicationCallAdapterFromClient(callClient, callAgent, locator
|
578
|
+
const adapter = createAzureCommunicationCallAdapterFromClient(callClient, callAgent, locator,
|
579
|
+
/* @conditional-compile-remove(rooms) */ options);
|
574
580
|
return adapter;
|
575
581
|
});
|
576
582
|
/**
|
@@ -607,7 +613,9 @@ afterCreate,
|
|
607
613
|
* This is useful for clean up tasks, e.g., leaving any ongoing calls.
|
608
614
|
*/
|
609
615
|
beforeDispose) => {
|
610
|
-
const { credential, displayName, locator, userId,
|
616
|
+
const { credential, displayName, locator, userId,
|
617
|
+
/*@conditional-compile-remove(PSTN-calls) */ alternateCallerId,
|
618
|
+
/*@conditional-compile-remove(rooms) */ options } = args;
|
611
619
|
// State update needed to rerender the parent component when a new adapter is created.
|
612
620
|
const [adapter, setAdapter] = useState(undefined);
|
613
621
|
// Ref needed for cleanup to access the old adapter created asynchronously.
|
@@ -642,7 +650,8 @@ beforeDispose) => {
|
|
642
650
|
displayName,
|
643
651
|
locator,
|
644
652
|
userId,
|
645
|
-
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId
|
653
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
|
654
|
+
/* @conditional-compile-remove(rooms) */ options
|
646
655
|
});
|
647
656
|
if (afterCreateRef.current) {
|
648
657
|
newAdapter = yield afterCreateRef.current(newAdapter);
|
@@ -660,7 +669,8 @@ beforeDispose) => {
|
|
660
669
|
credential,
|
661
670
|
displayName,
|
662
671
|
locator,
|
663
|
-
userId
|
672
|
+
userId,
|
673
|
+
/* @conditional-compile-remove(PSTN-calls) */ options
|
664
674
|
]);
|
665
675
|
// Dispose any existing adapter when the component unmounts.
|
666
676
|
useEffect(() => {
|
@@ -686,8 +696,11 @@ beforeDispose) => {
|
|
686
696
|
*
|
687
697
|
* @public
|
688
698
|
*/
|
689
|
-
export const createAzureCommunicationCallAdapterFromClient = (callClient, callAgent, locator
|
699
|
+
export const createAzureCommunicationCallAdapterFromClient = (callClient, callAgent, locator,
|
700
|
+
/* @conditional-compile-remove(rooms) */ options) => __awaiter(void 0, void 0, void 0, function* () {
|
690
701
|
const deviceManager = (yield callClient.getDeviceManager());
|
702
|
+
/* @conditional-compile-remove(rooms) */
|
703
|
+
return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager, options);
|
691
704
|
return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager);
|
692
705
|
});
|
693
706
|
const isCallError = (e) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AzureCommunicationCallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kC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gB;QAChB,UAAU;QACV,WAAW;QACX,OAAO;QACP,MAAM;KACP,CACF,CAAC;IAEF,4DAA4D;IAC5D,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,CAAC,GAAS,EAAE;gBACV,IAAI,UAAU,CAAC,OAAO,EAAE;oBACtB,IAAI,gBAAgB,CAAC,OAAO,EAAE;wBAC5B,MAAM,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;qBACpD;oBACD,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;oBAC7B,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC;iBAChC;YACH,CAAC,CAAA,CAAC,EAAE,CAAC;QACP,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,6CAA6C,GAAG,CAC3D,UAA8B,EAC9B,SAAoB,EACpB,OAA2B,EACL,EAAE;IACxB,MAAM,aAAa,GAAG,CAAC,MAAM,UAAU,CAAC,gBAAgB,EAAE,CAA0B,CAAC;IACrF,OAAO,IAAI,6BAA6B,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;AAC1F,CAAC,CAAA,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAkB,EAAE;IAC/C,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,SAAS,CAAC;AACpE,CAAC,CAAC;AAEF,mDAAmD;AACnD,6CAA6C;AAC7C,MAAM,cAAc,GAAG,CAAC,WAA+B,EAA0C,EAAE;IACjG,OAAO,gBAAgB,IAAI,WAAW,CAAC;AACzC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n CallingHandlers,\n createDefaultCallingHandlers,\n _isInCall,\n _isInLobbyOrConnecting\n} from '@internal/calling-component-bindings';\nimport {\n CallClientState,\n CallError,\n CallState,\n createStatefulCallClient,\n StatefulCallClient,\n StatefulDeviceManager\n} from '@internal/calling-stateful-client';\nimport {\n AudioOptions,\n CallAgent,\n Call,\n GroupCallLocator,\n TeamsMeetingLinkLocator,\n LocalVideoStream as SDKLocalVideoStream,\n AudioDeviceInfo,\n VideoDeviceInfo,\n RemoteParticipant,\n PermissionConstraints,\n PropertyChangedEvent,\n StartCallOptions,\n VideoOptions\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(rooms) */\nimport { RoomCallLocator } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';\nimport { EventEmitter } from 'events';\nimport {\n CallAdapter,\n CallEndedListener,\n CallIdChangedListener,\n CallAdapterState,\n DisplayNameChangedListener,\n IsMutedChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsSpeakingChangedListener,\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n DiagnosticChangedEventListner,\n CallAdapterCallEndedEvent\n} from './CallAdapter';\nimport { getCallCompositePage, IsCallEndedPage, isCameraOn } from '../utils';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\nimport { toFlatCommunicationIdentifier, _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CommunicationTokenCredential,\n CommunicationUserIdentifier,\n isCommunicationUserIdentifier,\n isPhoneNumberIdentifier,\n UnknownIdentifier,\n PhoneNumberIdentifier,\n CommunicationIdentifier\n} from '@azure/communication-common';\nimport { ParticipantSubscriber } from './ParticipantSubcriber';\nimport { AdapterError } from '../../common/adapters';\nimport { DiagnosticsForwarder } from './DiagnosticsForwarder';\nimport { useEffect, useRef, useState } from 'react';\n\n/** Context of call, which is a centralized context for all state updates */\nclass CallContext {\n private emitter: EventEmitter = new EventEmitter();\n private state: CallAdapterState;\n private callId: string | undefined;\n\n constructor(clientState: CallClientState, isTeamsCall: boolean) {\n this.state = {\n isLocalPreviewMicrophoneEnabled: false,\n userId: clientState.userId,\n displayName: clientState.callAgent?.displayName,\n devices: clientState.deviceManager,\n call: undefined,\n page: 'configuration',\n latestErrors: clientState.latestErrors,\n isTeamsCall,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId: clientState.alternateCallerId\n };\n }\n\n public onStateChange(handler: (_uiState: CallAdapterState) => void): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (_uiState: CallAdapterState) => void): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: CallAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): CallAdapterState {\n return this.state;\n }\n\n public setIsLocalMicrophoneEnabled(isLocalPreviewMicrophoneEnabled: boolean): void {\n this.setState({ ...this.state, isLocalPreviewMicrophoneEnabled });\n }\n\n // This is the key to find current call object in client state\n public setCurrentCallId(callId: string | undefined): void {\n this.callId = callId;\n }\n\n public onCallEnded(handler: (callEndedData: CallAdapterCallEndedEvent) => void): void {\n this.emitter.on('callEnded', handler);\n }\n\n public offCallEnded(handler: (callEndedData: CallAdapterCallEndedEvent) => void): void {\n this.emitter.off('callEnded', handler);\n }\n\n public updateClientState(clientState: CallClientState): void {\n let call = this.callId ? clientState.calls[this.callId] : undefined;\n const latestEndedCall = findLatestEndedCall(clientState.callsEnded);\n\n // As the state is transitioning to a new state, trigger appropriate callback events.\n const oldPage = this.state.page;\n const newPage = getCallCompositePage(call, latestEndedCall);\n if (!IsCallEndedPage(oldPage) && IsCallEndedPage(newPage)) {\n this.emitter.emit('callEnded', { callId: this.callId });\n // Reset the callId to undefined as the call has ended.\n this.setCurrentCallId(undefined);\n // Make sure that the call is set to undefined in the state.\n call = undefined;\n }\n\n if (this.state.page) {\n this.setState({\n ...this.state,\n userId: clientState.userId,\n displayName: clientState.callAgent?.displayName,\n call,\n page: newPage,\n endedCall: latestEndedCall,\n devices: clientState.deviceManager,\n latestErrors: clientState.latestErrors\n });\n }\n }\n}\n\nconst findLatestEndedCall = (calls: { [key: string]: CallState }): CallState | undefined => {\n const callStates = Object.values(calls);\n if (callStates.length === 0) {\n return undefined;\n }\n let latestCall = callStates[0];\n for (const call of callStates.slice(1)) {\n if ((call.endTime?.getTime() ?? 0) > (latestCall.endTime?.getTime() ?? 0)) {\n latestCall = call;\n }\n }\n return latestCall;\n};\n\n/**\n * @private\n */\nexport class AzureCommunicationCallAdapter implements CallAdapter {\n private callClient: StatefulCallClient;\n private callAgent: CallAgent;\n private deviceManager: StatefulDeviceManager;\n private localStream: SDKLocalVideoStream | undefined;\n private locator: CallAdapterLocator;\n // Never use directly, even internally. Use `call` property instead.\n private _call?: Call;\n private context: CallContext;\n private diagnosticsForwarder?: DiagnosticsForwarder;\n private handlers: CallingHandlers;\n private participantSubscribers = new Map<string, ParticipantSubscriber>();\n private emitter: EventEmitter = new EventEmitter();\n private onClientStateChange: (clientState: CallClientState) => void;\n\n private get call(): Call | undefined {\n return this._call;\n }\n\n private set call(newCall: Call | undefined) {\n this.resetDiagnosticsForwarder(newCall);\n this._call = newCall;\n }\n\n constructor(\n callClient: StatefulCallClient,\n locator: CallAdapterLocator,\n callAgent: CallAgent,\n deviceManager: StatefulDeviceManager\n ) {\n this.bindPublicMethods();\n this.callClient = callClient;\n this.callAgent = callAgent;\n this.locator = locator;\n this.deviceManager = deviceManager;\n const isTeamsMeeting = 'meetingLink' in this.locator;\n this.context = new CallContext(callClient.getState(), isTeamsMeeting);\n\n this.context.onCallEnded((endCallData) => this.emitter.emit('callEnded', endCallData));\n\n const onStateChange = (clientState: CallClientState): void => {\n // unsubscribe when the instance gets disposed\n if (!this) {\n callClient.offStateChange(onStateChange);\n return;\n }\n\n // `updateClientState` searches for the current call from all the calls in the state using a cached `call.id`\n // from the call object. `call.id` can change during a call. We must update the cached `call.id` before\n // calling `updateClientState` so that we find the correct state object for the call even when `call.id`\n // has changed.\n // https://github.com/Azure/communication-ui-library/pull/1820\n if (this.call?.id) {\n this.context.setCurrentCallId(this.call.id);\n }\n this.context.updateClientState(clientState);\n };\n\n this.handlers = createDefaultCallingHandlers(callClient, callAgent, deviceManager, undefined);\n\n this.onClientStateChange = onStateChange;\n\n this.subscribeDeviceManagerEvents();\n\n this.callClient.onStateChange(onStateChange);\n }\n\n // TODO: update this to include the 'selectedCameraChanged' when calling adds it to the device manager\n private subscribeDeviceManagerEvents(): void {\n this.deviceManager.on('selectedMicrophoneChanged', () => {\n this.emitter.emit('selectedMicrophoneChanged');\n });\n this.deviceManager.on('selectedSpeakerChanged', () => {\n this.emitter.emit('selectedSpeakerChanged');\n });\n }\n\n private bindPublicMethods(): void {\n this.onStateChange.bind(this);\n this.offStateChange.bind(this);\n this.getState.bind(this);\n this.dispose.bind(this);\n this.joinCall.bind(this);\n this.leaveCall.bind(this);\n this.setCamera.bind(this);\n this.setMicrophone.bind(this);\n this.setSpeaker.bind(this);\n this.askDevicePermission.bind(this);\n this.queryCameras.bind(this);\n this.queryMicrophones.bind(this);\n this.querySpeakers.bind(this);\n this.startCamera.bind(this);\n this.stopCamera.bind(this);\n this.mute.bind(this);\n this.unmute.bind(this);\n this.startCall.bind(this);\n this.startScreenShare.bind(this);\n this.stopScreenShare.bind(this);\n this.removeParticipant.bind(this);\n this.createStreamView.bind(this);\n this.disposeStreamView.bind(this);\n this.on.bind(this);\n this.off.bind(this);\n this.processNewCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.addParticipant.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.holdCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.resumeCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.sendDtmfTone.bind(this);\n }\n\n public dispose(): void {\n this.resetDiagnosticsForwarder();\n this.callClient.offStateChange(this.onClientStateChange);\n this.callAgent.dispose();\n }\n\n public async queryCameras(): Promise<VideoDeviceInfo[]> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return this.deviceManager.getCameras();\n });\n }\n\n public async queryMicrophones(): Promise<AudioDeviceInfo[]> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return this.deviceManager.getMicrophones();\n });\n }\n\n public async querySpeakers(): Promise<AudioDeviceInfo[]> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return this.deviceManager.isSpeakerSelectionAvailable ? this.deviceManager.getSpeakers() : [];\n });\n }\n\n public async askDevicePermission(constrain: PermissionConstraints): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n await this.deviceManager.askDevicePermission(constrain);\n });\n }\n\n public joinCall(microphoneOn?: boolean): Call | undefined {\n if (_isInCall(this.getState().call?.state ?? 'None')) {\n throw new Error('You are already in the call!');\n }\n\n return this.teeErrorToEventEmitter(() => {\n const audioOptions: AudioOptions = { muted: !(microphoneOn ?? this.getState().isLocalPreviewMicrophoneEnabled) };\n // TODO: find a way to expose stream to here\n const videoOptions = { localVideoStreams: this.localStream ? [this.localStream] : undefined };\n /* @conditional-compile-remove(teams-adhoc-call) */\n /* @conditional-compile-remove(PSTN-calls) */\n if (isOutboundCall(this.locator)) {\n const phoneNumber = this.getState().alternateCallerId;\n return this.startCall(this.locator.participantIds, {\n alternateCallerId: phoneNumber ? { phoneNumber: phoneNumber } : undefined,\n audioOptions,\n videoOptions\n });\n }\n const call = this._joinCall(audioOptions, videoOptions);\n\n this.processNewCall(call);\n return call;\n });\n }\n\n private _joinCall(audioOptions: AudioOptions, videoOptions: VideoOptions): Call {\n const isTeamsMeeting = 'meetingLink' in this.locator;\n /* @conditional-compile-remove(rooms) */\n const isRoomsCall = 'roomId' in this.locator;\n\n if (isTeamsMeeting) {\n return this.callAgent.join(this.locator as TeamsMeetingLinkLocator, {\n audioOptions,\n videoOptions\n });\n }\n /* @conditional-compile-remove(rooms) */\n if (isRoomsCall) {\n return this.callAgent.join(this.locator as RoomCallLocator, {\n audioOptions,\n videoOptions\n });\n }\n return this.callAgent.join(this.locator as GroupCallLocator, {\n audioOptions,\n videoOptions\n });\n }\n\n public async createStreamView(\n remoteUserId?: string,\n options?: VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> {\n if (remoteUserId === undefined) {\n return await this.handlers.onCreateLocalStreamView(options);\n } else {\n return await this.handlers.onCreateRemoteStreamView(remoteUserId, options);\n }\n }\n\n public async disposeStreamView(remoteUserId?: string): Promise<void> {\n if (remoteUserId === undefined) {\n await this.handlers.onDisposeLocalStreamView();\n } else {\n await this.handlers.onDisposeRemoteStreamView(remoteUserId);\n }\n }\n\n public async leaveCall(forEveryone?: boolean): Promise<void> {\n await this.handlers.onHangUp(forEveryone);\n this.unsubscribeCallEvents();\n this.handlers = createDefaultCallingHandlers(this.callClient, this.callAgent, this.deviceManager, undefined);\n // We set the adapter.call object to undefined immediately when a call is ended.\n // We do not set the context.callId to undefined because it is a part of the immutable data flow loop.\n this.call = undefined;\n this.stopCamera();\n this.mute();\n }\n\n public async setCamera(device: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onSelectCamera(device, options);\n });\n }\n\n public async setMicrophone(device: AudioDeviceInfo): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onSelectMicrophone(device);\n });\n }\n\n public async setSpeaker(device: AudioDeviceInfo): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onSelectSpeaker(device);\n });\n }\n\n public async startCamera(options?: VideoStreamOptions): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n if (!isCameraOn(this.getState())) {\n await this.handlers.onToggleCamera(options);\n }\n });\n }\n\n public async stopCamera(): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n if (isCameraOn(this.getState())) {\n await this.handlers.onToggleCamera();\n }\n });\n }\n\n public async mute(): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n this.context.setIsLocalMicrophoneEnabled(false);\n if (_isInCall(this.call?.state) && !this.call?.isMuted) {\n await this.handlers.onToggleMicrophone();\n }\n });\n }\n\n public async unmute(): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n this.context.setIsLocalMicrophoneEnabled(true);\n if (_isInCall(this.call?.state) && this.call?.isMuted) {\n await this.handlers.onToggleMicrophone();\n }\n });\n }\n\n public async startScreenShare(): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n if (!this.call?.isScreenSharingOn) {\n await this.handlers.onToggleScreenShare();\n }\n });\n }\n\n public async stopScreenShare(): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n if (this.call?.isScreenSharingOn) {\n await this.handlers.onToggleScreenShare();\n }\n });\n }\n\n public startCall(\n participants:\n | string[]\n /* @conditional-compile-remove(PSTN-calls) */\n | CommunicationIdentifier[],\n options?: StartCallOptions\n ): Call | undefined {\n if (_isInCall(this.getState().call?.state ?? 'None')) {\n throw new Error('You are already in the call.');\n }\n\n const idsToAdd = participants.map((participant) => {\n // FIXME: `onStartCall` does not allow a Teams user.\n // Need some way to return an error if a Teams user is provided.\n const backendId: CommunicationIdentifier = _toCommunicationIdentifier(participant);\n if (isPhoneNumberIdentifier(backendId)) {\n if (options?.alternateCallerId === undefined) {\n throw new Error('Unable to start call, PSTN user present with no alternateCallerId.');\n }\n return backendId as PhoneNumberIdentifier;\n } else if (isCommunicationUserIdentifier(backendId)) {\n return backendId as CommunicationUserIdentifier;\n }\n return backendId as UnknownIdentifier;\n });\n\n const call = this.handlers.onStartCall(idsToAdd, options);\n if (!call) {\n throw new Error('Unable to start call.');\n }\n this.processNewCall(call);\n\n return this.call;\n }\n\n private processNewCall(call: Call): void {\n this.call = call;\n this.context.setCurrentCallId(call.id);\n\n // Resync state after callId is set\n this.context.updateClientState(this.callClient.getState());\n this.handlers = createDefaultCallingHandlers(this.callClient, this.callAgent, this.deviceManager, this.call);\n this.subscribeCallEvents();\n }\n\n public async removeParticipant(\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> {\n let participant = userId;\n /* @conditional-compile-remove(PSTN-calls) */\n participant = _toCommunicationIdentifier(userId);\n this.handlers.onRemoveParticipant(participant);\n }\n\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(\n participant: PhoneNumberIdentifier | CommunicationUserIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> {\n if (isPhoneNumberIdentifier(participant) && options) {\n this.handlers.onAddParticipant(participant, options);\n } else if (isCommunicationUserIdentifier(participant)) {\n this.handlers.onAddParticipant(participant);\n }\n }\n\n /* @conditional-compile-remove(PSTN-calls) */\n public async holdCall(): Promise<void> {\n if (this.call?.state !== 'LocalHold') {\n this.handlers.onToggleHold();\n }\n }\n\n /* @conditional-compile-remove(PSTN-calls) */\n public async resumeCall(): Promise<void> {\n if (this.call?.state === 'LocalHold') {\n this.handlers.onToggleHold();\n }\n }\n\n /* @conditional-compile-remove(PSTN-calls) */\n public async sendDtmfTone(dtmfTone: DtmfTone): Promise<void> {\n this.handlers.onSendDtmfTone(dtmfTone);\n }\n\n public getState(): CallAdapterState {\n return this.context.getState();\n }\n\n public onStateChange(handler: (state: CallAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n\n public offStateChange(handler: (state: CallAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n\n on(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n on(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n on(event: 'callEnded', listener: CallEndedListener): void;\n on(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n on(event: 'error', errorHandler: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public on(event: string, listener: (e: any) => void): void {\n this.emitter.on(event, listener);\n }\n\n private subscribeCallEvents(): void {\n this.call?.on('remoteParticipantsUpdated', this.onRemoteParticipantsUpdated.bind(this));\n this.call?.on('isMutedChanged', this.isMyMutedChanged.bind(this));\n this.call?.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged.bind(this));\n this.call?.on('idChanged', this.callIdChanged.bind(this));\n }\n\n private unsubscribeCallEvents(): void {\n for (const subscriber of this.participantSubscribers.values()) {\n subscriber.unsubscribeAll();\n }\n this.participantSubscribers.clear();\n this.call?.off('remoteParticipantsUpdated', this.onRemoteParticipantsUpdated.bind(this));\n this.call?.off('isMutedChanged', this.isMyMutedChanged.bind(this));\n this.call?.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged.bind(this));\n this.call?.off('idChanged', this.callIdChanged.bind(this));\n }\n\n private isMyMutedChanged = (): void => {\n this.emitter.emit('isMutedChanged', {\n participantId: this.getState().userId,\n isMuted: this.call?.isMuted\n });\n };\n\n private onRemoteParticipantsUpdated({\n added,\n removed\n }: {\n added: RemoteParticipant[];\n removed: RemoteParticipant[];\n }): void {\n if (added && added.length > 0) {\n this.emitter.emit('participantsJoined', added);\n }\n if (removed && removed.length > 0) {\n this.emitter.emit('participantsLeft', removed);\n }\n\n added.forEach((participant) => {\n this.participantSubscribers.set(\n toFlatCommunicationIdentifier(participant.identifier),\n new ParticipantSubscriber(participant, this.emitter)\n );\n });\n\n removed.forEach((participant) => {\n const subscriber = this.participantSubscribers.get(toFlatCommunicationIdentifier(participant.identifier));\n subscriber && subscriber.unsubscribeAll();\n this.participantSubscribers.delete(toFlatCommunicationIdentifier(participant.identifier));\n });\n }\n\n private isScreenSharingOnChanged(): void {\n this.emitter.emit('isLocalScreenSharingActiveChanged', { isScreenSharingOn: this.call?.isScreenSharingOn });\n }\n\n private callIdChanged(): void {\n this.call?.id && this.emitter.emit('callIdChanged', { callId: this.call.id });\n }\n\n private resetDiagnosticsForwarder(newCall?: Call): void {\n if (this.diagnosticsForwarder) {\n this.diagnosticsForwarder.unsubscribe();\n }\n if (newCall) {\n this.diagnosticsForwarder = new DiagnosticsForwarder(this.emitter, newCall);\n }\n }\n\n off(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n off(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n off(event: 'callEnded', listener: CallEndedListener): void;\n off(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n off(event: 'error', errorHandler: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public off(event: string, listener: (e: any) => void): void {\n this.emitter.off(event, listener);\n }\n\n private async asyncTeeErrorToEventEmitter<T>(f: () => Promise<T>): Promise<T> {\n try {\n return await f();\n } catch (error) {\n if (isCallError(error as Error)) {\n this.emitter.emit('error', error as AdapterError);\n }\n throw error;\n }\n }\n\n private teeErrorToEventEmitter<T>(f: () => T): T {\n try {\n return f();\n } catch (error) {\n if (isCallError(error as Error)) {\n this.emitter.emit('error', error as AdapterError);\n }\n throw error;\n }\n }\n}\n\n/* @conditional-compile-remove(teams-adhoc-call) */\n/* @conditional-compile-remove(PSTN-calls) */\n/**\n * Locator used by {@link createAzureCommunicationCallAdapter} to call one or more participants\n *\n * @remarks\n * This is currently in beta and only supports calling one Teams User.\n *\n * @example\n * ```\n * ['8:orgid:ab220efe-5725-4742-9792-9fba7c9ac458']\n * ```\n *\n * @beta\n */\nexport type CallParticipantsLocator = {\n participantIds: string[];\n};\n\n/**\n * Locator used by {@link createAzureCommunicationCallAdapter} to locate the call to join\n *\n * @public\n */\nexport type CallAdapterLocator =\n | TeamsMeetingLinkLocator\n | GroupCallLocator\n | /* @conditional-compile-remove(rooms) */ RoomCallLocator\n | /* @conditional-compile-remove(teams-adhoc-call) */ /* @conditional-compile-remove(PSTN-calls) */ CallParticipantsLocator;\n\n/**\n * Arguments for creating the Azure Communication Services implementation of {@link CallAdapter}.\n *\n * Note: `displayName` can be a maximum of 256 characters.\n *\n * @public\n */\nexport type AzureCommunicationCallAdapterArgs = {\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n locator: CallAdapterLocator;\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId?: string;\n};\n\n/**\n * Create a {@link CallAdapter} backed by Azure Communication Services.\n *\n * This is the default implementation of {@link CallAdapter} provided by this library.\n *\n * Note: `displayName` can be a maximum of 256 characters.\n *\n * @public\n */\nexport const createAzureCommunicationCallAdapter = async ({\n userId,\n displayName,\n credential,\n locator,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId\n}: AzureCommunicationCallAdapterArgs): Promise<CallAdapter> => {\n const callClient = createStatefulCallClient({\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId\n });\n const callAgent = await callClient.createCallAgent(credential, {\n displayName\n });\n const adapter = createAzureCommunicationCallAdapterFromClient(callClient, callAgent, locator);\n return adapter;\n};\n\n/**\n * A custom React hook to simplify the creation of {@link CallAdapter}.\n *\n * Similar to {@link createAzureCommunicationCallAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationCallAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationCallAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationCallAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: CallAdapter) => Promise<CallAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: CallAdapter) => Promise<void>\n): CallAdapter | undefined => {\n const { credential, displayName, locator, userId, /*@conditional-compile-remove(PSTN-calls) */ alternateCallerId } =\n args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<CallAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<CallAdapter | undefined>(undefined);\n\n const afterCreateRef = useRef<((adapter: CallAdapter) => Promise<CallAdapter>) | undefined>(undefined);\n const beforeDisposeRef = useRef<((adapter: CallAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !locator || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n\n let newAdapter = await createAzureCommunicationCallAdapter({\n credential,\n displayName,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [\n adapterRef,\n afterCreateRef,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n beforeDisposeRef,\n credential,\n displayName,\n locator,\n userId\n ]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Create a {@link CallAdapter} using the provided {@link StatefulCallClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulCallClient}.\n * Consider using {@link createAzureCommunicationCallAdapter} for a simpler API.\n *\n * @public\n */\nexport const createAzureCommunicationCallAdapterFromClient = async (\n callClient: StatefulCallClient,\n callAgent: CallAgent,\n locator: CallAdapterLocator\n): Promise<CallAdapter> => {\n const deviceManager = (await callClient.getDeviceManager()) as StatefulDeviceManager;\n return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager);\n};\n\nconst isCallError = (e: Error): e is CallError => {\n return e['target'] !== undefined && e['innerError'] !== undefined;\n};\n\n/* @conditional-compile-remove(teams-adhoc-call) */\n/* @conditional-compile-remove(PSTN-calls) */\nconst isOutboundCall = (callLocator: CallAdapterLocator): callLocator is CallParticipantsLocator => {\n return 'participantIds' in callLocator;\n};\n\"../../../../../calling-component-bindings/src\"\"../../../../../calling-stateful-client/src\"\"../../../../../react-components/src\"\"../../../../../acs-ui-common/src\""]}
|
1
|
+
{"version":3,"file":"AzureCommunicationCallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAEL,4BAA4B,EAC5B,SAAS,EAEV,sDAA6C;AAC9C,OAAO,EAIL,wBAAwB,EAGzB,mDAA0C;AAoB3C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAetC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAI7E,OAAO,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,yCAAgC;AACpG,OAAO,EAGL,6BAA6B,EAC7B,uBAAuB,EAIxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpD,4EAA4E;AAC5E,MAAM,WAAW;IAKf,YACE,WAA4B,EAC5B,WAAoB,EACpB,OAA6F;;QAPvF,YAAO,GAAiB,IAAI,YAAY,EAAE,CAAC;QASjD,IAAI,CAAC,KAAK,GAAG;YACX,+BAA+B,EAAE,KAAK;YACtC,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,WAAW,EAAE,MAAA,WAAW,CAAC,SAAS,0CAAE,WAAW;YAC/C,OAAO,EAAE,WAAW,CAAC,aAAa;YAClC,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,eAAe;YACrB,YAAY,EAAE,WAAW,CAAC,YAAY;YACtC,WAAW;YACX,6CAA6C,CAAC,iBAAiB,EAAE,WAAW,CAAC,iBAAiB;YAC9F,wCAAwC,CAAC,QAA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AwC,CAAC,OAAsE,EACzF,EAAE;IACxB,MAAM,aAAa,GAAG,CAAC,MAAM,UAAU,CAAC,gBAAgB,EAAE,CAA0B,CAAC;IACrF,wCAAwC;IACxC,OAAO,IAAI,6BAA6B,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;IACjG,OAAO,IAAI,6BAA6B,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;AAC1F,CAAC,CAAA,CAAC;AAEF,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAkB,EAAE;IAC/C,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,SAAS,CAAC;AACpE,CAAC,CAAC;AAEF,mDAAmD;AACnD,6CAA6C;AAC7C,MAAM,cAAc,GAAG,CAAC,WAA+B,EAA0C,EAAE;IACjG,OAAO,gBAAgB,IAAI,WAAW,CAAC;AACzC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n CallingHandlers,\n createDefaultCallingHandlers,\n _isInCall,\n _isInLobbyOrConnecting\n} from '@internal/calling-component-bindings';\nimport {\n CallClientState,\n CallError,\n CallState,\n createStatefulCallClient,\n StatefulCallClient,\n StatefulDeviceManager\n} from '@internal/calling-stateful-client';\nimport {\n AudioOptions,\n CallAgent,\n Call,\n GroupCallLocator,\n TeamsMeetingLinkLocator,\n LocalVideoStream as SDKLocalVideoStream,\n AudioDeviceInfo,\n VideoDeviceInfo,\n RemoteParticipant,\n PermissionConstraints,\n PropertyChangedEvent,\n StartCallOptions,\n VideoOptions\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(rooms) */\nimport { RoomCallLocator } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';\nimport { EventEmitter } from 'events';\nimport {\n CallAdapter,\n CallEndedListener,\n CallIdChangedListener,\n CallAdapterState,\n DisplayNameChangedListener,\n IsMutedChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsSpeakingChangedListener,\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n DiagnosticChangedEventListner,\n CallAdapterCallEndedEvent\n} from './CallAdapter';\nimport { getCallCompositePage, IsCallEndedPage, isCameraOn } from '../utils';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\n/* @conditional-compile-remove(rooms) */\nimport { Role } from '@internal/react-components';\nimport { toFlatCommunicationIdentifier, _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CommunicationTokenCredential,\n CommunicationUserIdentifier,\n isCommunicationUserIdentifier,\n isPhoneNumberIdentifier,\n UnknownIdentifier,\n PhoneNumberIdentifier,\n CommunicationIdentifier\n} from '@azure/communication-common';\nimport { ParticipantSubscriber } from './ParticipantSubcriber';\nimport { AdapterError } from '../../common/adapters';\nimport { DiagnosticsForwarder } from './DiagnosticsForwarder';\nimport { useEffect, useRef, useState } from 'react';\n\n/** Context of call, which is a centralized context for all state updates */\nclass CallContext {\n private emitter: EventEmitter = new EventEmitter();\n private state: CallAdapterState;\n private callId: string | undefined;\n\n constructor(\n clientState: CallClientState,\n isTeamsCall: boolean,\n options?: { maxListeners?: number; /* @conditional-compile-remove(rooms) */ roleHint?: Role }\n ) {\n this.state = {\n isLocalPreviewMicrophoneEnabled: false,\n userId: clientState.userId,\n displayName: clientState.callAgent?.displayName,\n devices: clientState.deviceManager,\n call: undefined,\n page: 'configuration',\n latestErrors: clientState.latestErrors,\n isTeamsCall,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId: clientState.alternateCallerId,\n /* @conditional-compile-remove(rooms) */ roleHint: options?.roleHint\n };\n this.emitter.setMaxListeners(options?.maxListeners ?? 50);\n }\n\n public onStateChange(handler: (_uiState: CallAdapterState) => void): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (_uiState: CallAdapterState) => void): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: CallAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): CallAdapterState {\n return this.state;\n }\n\n public setIsLocalMicrophoneEnabled(isLocalPreviewMicrophoneEnabled: boolean): void {\n this.setState({ ...this.state, isLocalPreviewMicrophoneEnabled });\n }\n\n // This is the key to find current call object in client state\n public setCurrentCallId(callId: string | undefined): void {\n this.callId = callId;\n }\n\n public onCallEnded(handler: (callEndedData: CallAdapterCallEndedEvent) => void): void {\n this.emitter.on('callEnded', handler);\n }\n\n public offCallEnded(handler: (callEndedData: CallAdapterCallEndedEvent) => void): void {\n this.emitter.off('callEnded', handler);\n }\n\n public updateClientState(clientState: CallClientState): void {\n let call = this.callId ? clientState.calls[this.callId] : undefined;\n const latestEndedCall = findLatestEndedCall(clientState.callsEnded);\n\n // As the state is transitioning to a new state, trigger appropriate callback events.\n const oldPage = this.state.page;\n const newPage = getCallCompositePage(call, latestEndedCall);\n if (!IsCallEndedPage(oldPage) && IsCallEndedPage(newPage)) {\n this.emitter.emit('callEnded', { callId: this.callId });\n // Reset the callId to undefined as the call has ended.\n this.setCurrentCallId(undefined);\n // Make sure that the call is set to undefined in the state.\n call = undefined;\n }\n\n if (this.state.page) {\n this.setState({\n ...this.state,\n userId: clientState.userId,\n displayName: clientState.callAgent?.displayName,\n call,\n page: newPage,\n endedCall: latestEndedCall,\n devices: clientState.deviceManager,\n latestErrors: clientState.latestErrors\n });\n }\n }\n}\n\nconst findLatestEndedCall = (calls: { [key: string]: CallState }): CallState | undefined => {\n const callStates = Object.values(calls);\n if (callStates.length === 0) {\n return undefined;\n }\n let latestCall = callStates[0];\n for (const call of callStates.slice(1)) {\n if ((call.endTime?.getTime() ?? 0) > (latestCall.endTime?.getTime() ?? 0)) {\n latestCall = call;\n }\n }\n return latestCall;\n};\n\n/**\n * @private\n */\nexport class AzureCommunicationCallAdapter implements CallAdapter {\n private callClient: StatefulCallClient;\n private callAgent: CallAgent;\n private deviceManager: StatefulDeviceManager;\n private localStream: SDKLocalVideoStream | undefined;\n private locator: CallAdapterLocator;\n // Never use directly, even internally. Use `call` property instead.\n private _call?: Call;\n private context: CallContext;\n private diagnosticsForwarder?: DiagnosticsForwarder;\n private handlers: CallingHandlers;\n private participantSubscribers = new Map<string, ParticipantSubscriber>();\n private emitter: EventEmitter = new EventEmitter();\n private onClientStateChange: (clientState: CallClientState) => void;\n\n private get call(): Call | undefined {\n return this._call;\n }\n\n private set call(newCall: Call | undefined) {\n this.resetDiagnosticsForwarder(newCall);\n this._call = newCall;\n }\n\n constructor(\n callClient: StatefulCallClient,\n locator: CallAdapterLocator,\n callAgent: CallAgent,\n deviceManager: StatefulDeviceManager,\n /* @conditional-compile-remove(rooms) */ options?: { /* @conditional-compile-remove(rooms) */ roleHint?: Role }\n ) {\n this.bindPublicMethods();\n this.callClient = callClient;\n this.callAgent = callAgent;\n this.locator = locator;\n this.deviceManager = deviceManager;\n const isTeamsMeeting = 'meetingLink' in this.locator;\n this.context = new CallContext(\n callClient.getState(),\n isTeamsMeeting,\n /* @conditional-compile-remove(rooms) */ options\n );\n\n this.context.onCallEnded((endCallData) => this.emitter.emit('callEnded', endCallData));\n\n const onStateChange = (clientState: CallClientState): void => {\n // unsubscribe when the instance gets disposed\n if (!this) {\n callClient.offStateChange(onStateChange);\n return;\n }\n\n // `updateClientState` searches for the current call from all the calls in the state using a cached `call.id`\n // from the call object. `call.id` can change during a call. We must update the cached `call.id` before\n // calling `updateClientState` so that we find the correct state object for the call even when `call.id`\n // has changed.\n // https://github.com/Azure/communication-ui-library/pull/1820\n if (this.call?.id) {\n this.context.setCurrentCallId(this.call.id);\n }\n this.context.updateClientState(clientState);\n };\n\n this.handlers = createDefaultCallingHandlers(callClient, callAgent, deviceManager, undefined);\n\n this.onClientStateChange = onStateChange;\n\n this.subscribeDeviceManagerEvents();\n\n this.callClient.onStateChange(onStateChange);\n }\n\n // TODO: update this to include the 'selectedCameraChanged' when calling adds it to the device manager\n private subscribeDeviceManagerEvents(): void {\n this.deviceManager.on('selectedMicrophoneChanged', () => {\n this.emitter.emit('selectedMicrophoneChanged');\n });\n this.deviceManager.on('selectedSpeakerChanged', () => {\n this.emitter.emit('selectedSpeakerChanged');\n });\n }\n\n private bindPublicMethods(): void {\n this.onStateChange.bind(this);\n this.offStateChange.bind(this);\n this.getState.bind(this);\n this.dispose.bind(this);\n this.joinCall.bind(this);\n this.leaveCall.bind(this);\n this.setCamera.bind(this);\n this.setMicrophone.bind(this);\n this.setSpeaker.bind(this);\n this.askDevicePermission.bind(this);\n this.queryCameras.bind(this);\n this.queryMicrophones.bind(this);\n this.querySpeakers.bind(this);\n this.startCamera.bind(this);\n this.stopCamera.bind(this);\n this.mute.bind(this);\n this.unmute.bind(this);\n this.startCall.bind(this);\n this.startScreenShare.bind(this);\n this.stopScreenShare.bind(this);\n this.removeParticipant.bind(this);\n this.createStreamView.bind(this);\n this.disposeStreamView.bind(this);\n this.on.bind(this);\n this.off.bind(this);\n this.processNewCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.addParticipant.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.holdCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.resumeCall.bind(this);\n /* @conditional-compile-remove(PSTN-calls) */\n this.sendDtmfTone.bind(this);\n }\n\n public dispose(): void {\n this.resetDiagnosticsForwarder();\n this.callClient.offStateChange(this.onClientStateChange);\n this.callAgent.dispose();\n }\n\n public async queryCameras(): Promise<VideoDeviceInfo[]> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return this.deviceManager.getCameras();\n });\n }\n\n public async queryMicrophones(): Promise<AudioDeviceInfo[]> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return this.deviceManager.getMicrophones();\n });\n }\n\n public async querySpeakers(): Promise<AudioDeviceInfo[]> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return this.deviceManager.isSpeakerSelectionAvailable ? this.deviceManager.getSpeakers() : [];\n });\n }\n\n public async askDevicePermission(constrain: PermissionConstraints): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n await this.deviceManager.askDevicePermission(constrain);\n });\n }\n\n public joinCall(microphoneOn?: boolean): Call | undefined {\n if (_isInCall(this.getState().call?.state ?? 'None')) {\n throw new Error('You are already in the call!');\n }\n\n return this.teeErrorToEventEmitter(() => {\n const audioOptions: AudioOptions = { muted: !(microphoneOn ?? this.getState().isLocalPreviewMicrophoneEnabled) };\n // TODO: find a way to expose stream to here\n const videoOptions = { localVideoStreams: this.localStream ? [this.localStream] : undefined };\n /* @conditional-compile-remove(teams-adhoc-call) */\n /* @conditional-compile-remove(PSTN-calls) */\n if (isOutboundCall(this.locator)) {\n const phoneNumber = this.getState().alternateCallerId;\n return this.startCall(this.locator.participantIds, {\n alternateCallerId: phoneNumber ? { phoneNumber: phoneNumber } : undefined,\n audioOptions,\n videoOptions\n });\n }\n const call = this._joinCall(audioOptions, videoOptions);\n\n this.processNewCall(call);\n return call;\n });\n }\n\n private _joinCall(audioOptions: AudioOptions, videoOptions: VideoOptions): Call {\n const isTeamsMeeting = 'meetingLink' in this.locator;\n /* @conditional-compile-remove(rooms) */\n const isRoomsCall = 'roomId' in this.locator;\n\n if (isTeamsMeeting) {\n return this.callAgent.join(this.locator as TeamsMeetingLinkLocator, {\n audioOptions,\n videoOptions\n });\n }\n /* @conditional-compile-remove(rooms) */\n if (isRoomsCall) {\n return this.callAgent.join(this.locator as RoomCallLocator, {\n audioOptions,\n videoOptions\n });\n }\n return this.callAgent.join(this.locator as GroupCallLocator, {\n audioOptions,\n videoOptions\n });\n }\n\n public async createStreamView(\n remoteUserId?: string,\n options?: VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> {\n if (remoteUserId === undefined) {\n return await this.handlers.onCreateLocalStreamView(options);\n } else {\n return await this.handlers.onCreateRemoteStreamView(remoteUserId, options);\n }\n }\n\n public async disposeStreamView(remoteUserId?: string): Promise<void> {\n if (remoteUserId === undefined) {\n await this.handlers.onDisposeLocalStreamView();\n } else {\n await this.handlers.onDisposeRemoteStreamView(remoteUserId);\n }\n }\n\n public async leaveCall(forEveryone?: boolean): Promise<void> {\n await this.handlers.onHangUp(forEveryone);\n this.unsubscribeCallEvents();\n this.handlers = createDefaultCallingHandlers(this.callClient, this.callAgent, this.deviceManager, undefined);\n // We set the adapter.call object to undefined immediately when a call is ended.\n // We do not set the context.callId to undefined because it is a part of the immutable data flow loop.\n this.call = undefined;\n this.stopCamera();\n this.mute();\n }\n\n public async setCamera(device: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onSelectCamera(device, options);\n });\n }\n\n public async setMicrophone(device: AudioDeviceInfo): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onSelectMicrophone(device);\n });\n }\n\n public async setSpeaker(device: AudioDeviceInfo): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onSelectSpeaker(device);\n });\n }\n\n public async startCamera(options?: VideoStreamOptions): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n if (!isCameraOn(this.getState())) {\n await this.handlers.onToggleCamera(options);\n }\n });\n }\n\n public async stopCamera(): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n if (isCameraOn(this.getState())) {\n await this.handlers.onToggleCamera();\n }\n });\n }\n\n public async mute(): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n this.context.setIsLocalMicrophoneEnabled(false);\n if (_isInCall(this.call?.state) && !this.call?.isMuted) {\n await this.handlers.onToggleMicrophone();\n }\n });\n }\n\n public async unmute(): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n this.context.setIsLocalMicrophoneEnabled(true);\n if (_isInCall(this.call?.state) && this.call?.isMuted) {\n await this.handlers.onToggleMicrophone();\n }\n });\n }\n\n public async startScreenShare(): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n if (!this.call?.isScreenSharingOn) {\n await this.handlers.onToggleScreenShare();\n }\n });\n }\n\n public async stopScreenShare(): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n if (this.call?.isScreenSharingOn) {\n await this.handlers.onToggleScreenShare();\n }\n });\n }\n\n public startCall(\n participants:\n | string[]\n /* @conditional-compile-remove(PSTN-calls) */\n | CommunicationIdentifier[],\n options?: StartCallOptions\n ): Call | undefined {\n if (_isInCall(this.getState().call?.state ?? 'None')) {\n throw new Error('You are already in the call.');\n }\n\n const idsToAdd = participants.map((participant) => {\n // FIXME: `onStartCall` does not allow a Teams user.\n // Need some way to return an error if a Teams user is provided.\n const backendId: CommunicationIdentifier = _toCommunicationIdentifier(participant);\n if (isPhoneNumberIdentifier(backendId)) {\n if (options?.alternateCallerId === undefined) {\n throw new Error('Unable to start call, PSTN user present with no alternateCallerId.');\n }\n return backendId as PhoneNumberIdentifier;\n } else if (isCommunicationUserIdentifier(backendId)) {\n return backendId as CommunicationUserIdentifier;\n }\n return backendId as UnknownIdentifier;\n });\n\n const call = this.handlers.onStartCall(idsToAdd, options);\n if (!call) {\n throw new Error('Unable to start call.');\n }\n this.processNewCall(call);\n\n return this.call;\n }\n\n private processNewCall(call: Call): void {\n this.call = call;\n this.context.setCurrentCallId(call.id);\n\n // Resync state after callId is set\n this.context.updateClientState(this.callClient.getState());\n this.handlers = createDefaultCallingHandlers(this.callClient, this.callAgent, this.deviceManager, this.call);\n this.subscribeCallEvents();\n }\n\n public async removeParticipant(\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> {\n let participant = userId;\n /* @conditional-compile-remove(PSTN-calls) */\n participant = _toCommunicationIdentifier(userId);\n this.handlers.onRemoveParticipant(participant);\n }\n\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(\n participant: PhoneNumberIdentifier | CommunicationUserIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> {\n if (isPhoneNumberIdentifier(participant) && options) {\n this.handlers.onAddParticipant(participant, options);\n } else if (isCommunicationUserIdentifier(participant)) {\n this.handlers.onAddParticipant(participant);\n }\n }\n\n /* @conditional-compile-remove(PSTN-calls) */\n public async holdCall(): Promise<void> {\n if (this.call?.state !== 'LocalHold') {\n this.handlers.onToggleHold();\n }\n }\n\n /* @conditional-compile-remove(PSTN-calls) */\n public async resumeCall(): Promise<void> {\n if (this.call?.state === 'LocalHold') {\n this.handlers.onToggleHold();\n }\n }\n\n /* @conditional-compile-remove(PSTN-calls) */\n public async sendDtmfTone(dtmfTone: DtmfTone): Promise<void> {\n this.handlers.onSendDtmfTone(dtmfTone);\n }\n\n public getState(): CallAdapterState {\n return this.context.getState();\n }\n\n public onStateChange(handler: (state: CallAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n\n public offStateChange(handler: (state: CallAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n\n on(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n on(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n on(event: 'callEnded', listener: CallEndedListener): void;\n on(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n on(event: 'error', errorHandler: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public on(event: string, listener: (e: any) => void): void {\n this.emitter.on(event, listener);\n }\n\n private subscribeCallEvents(): void {\n this.call?.on('remoteParticipantsUpdated', this.onRemoteParticipantsUpdated.bind(this));\n this.call?.on('isMutedChanged', this.isMyMutedChanged.bind(this));\n this.call?.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged.bind(this));\n this.call?.on('idChanged', this.callIdChanged.bind(this));\n }\n\n private unsubscribeCallEvents(): void {\n for (const subscriber of this.participantSubscribers.values()) {\n subscriber.unsubscribeAll();\n }\n this.participantSubscribers.clear();\n this.call?.off('remoteParticipantsUpdated', this.onRemoteParticipantsUpdated.bind(this));\n this.call?.off('isMutedChanged', this.isMyMutedChanged.bind(this));\n this.call?.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged.bind(this));\n this.call?.off('idChanged', this.callIdChanged.bind(this));\n }\n\n private isMyMutedChanged = (): void => {\n this.emitter.emit('isMutedChanged', {\n participantId: this.getState().userId,\n isMuted: this.call?.isMuted\n });\n };\n\n private onRemoteParticipantsUpdated({\n added,\n removed\n }: {\n added: RemoteParticipant[];\n removed: RemoteParticipant[];\n }): void {\n if (added && added.length > 0) {\n this.emitter.emit('participantsJoined', added);\n }\n if (removed && removed.length > 0) {\n this.emitter.emit('participantsLeft', removed);\n }\n\n added.forEach((participant) => {\n this.participantSubscribers.set(\n toFlatCommunicationIdentifier(participant.identifier),\n new ParticipantSubscriber(participant, this.emitter)\n );\n });\n\n removed.forEach((participant) => {\n const subscriber = this.participantSubscribers.get(toFlatCommunicationIdentifier(participant.identifier));\n subscriber && subscriber.unsubscribeAll();\n this.participantSubscribers.delete(toFlatCommunicationIdentifier(participant.identifier));\n });\n }\n\n private isScreenSharingOnChanged(): void {\n this.emitter.emit('isLocalScreenSharingActiveChanged', { isScreenSharingOn: this.call?.isScreenSharingOn });\n }\n\n private callIdChanged(): void {\n this.call?.id && this.emitter.emit('callIdChanged', { callId: this.call.id });\n }\n\n private resetDiagnosticsForwarder(newCall?: Call): void {\n if (this.diagnosticsForwarder) {\n this.diagnosticsForwarder.unsubscribe();\n }\n if (newCall) {\n this.diagnosticsForwarder = new DiagnosticsForwarder(this.emitter, newCall);\n }\n }\n\n off(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n off(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n off(event: 'callEnded', listener: CallEndedListener): void;\n off(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n off(event: 'error', errorHandler: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public off(event: string, listener: (e: any) => void): void {\n this.emitter.off(event, listener);\n }\n\n private async asyncTeeErrorToEventEmitter<T>(f: () => Promise<T>): Promise<T> {\n try {\n return await f();\n } catch (error) {\n if (isCallError(error as Error)) {\n this.emitter.emit('error', error as AdapterError);\n }\n throw error;\n }\n }\n\n private teeErrorToEventEmitter<T>(f: () => T): T {\n try {\n return f();\n } catch (error) {\n if (isCallError(error as Error)) {\n this.emitter.emit('error', error as AdapterError);\n }\n throw error;\n }\n }\n}\n\n/* @conditional-compile-remove(teams-adhoc-call) */\n/* @conditional-compile-remove(PSTN-calls) */\n/**\n * Locator used by {@link createAzureCommunicationCallAdapter} to call one or more participants\n *\n * @remarks\n * This is currently in beta and only supports calling one Teams User.\n *\n * @example\n * ```\n * ['8:orgid:ab220efe-5725-4742-9792-9fba7c9ac458']\n * ```\n *\n * @beta\n */\nexport type CallParticipantsLocator = {\n participantIds: string[];\n};\n\n/**\n * Locator used by {@link createAzureCommunicationCallAdapter} to locate the call to join\n *\n * @public\n */\nexport type CallAdapterLocator =\n | TeamsMeetingLinkLocator\n | GroupCallLocator\n | /* @conditional-compile-remove(rooms) */ RoomCallLocator\n | /* @conditional-compile-remove(teams-adhoc-call) */ /* @conditional-compile-remove(PSTN-calls) */ CallParticipantsLocator;\n\n/* @conditional-compile-remove(rooms) */\n/**\n * Optional parameters to create {@link AzureCommunicationCallAdapter}\n *\n * @beta\n */\nexport type AzureCommunicationCallAdapterOptions = {\n /**\n * Use this to hint the role of the user when the role is not available before a Rooms call is started. This value\n * should be obtained using the Rooms API. This role will determine permissions in the configuration page of the\n * {@link CallComposite}. The true role of the user will be synced with ACS services when a Rooms call starts.\n */\n roleHint?: Role;\n};\n\n/**\n * Arguments for creating the Azure Communication Services implementation of {@link CallAdapter}.\n *\n * Note: `displayName` can be a maximum of 256 characters.\n *\n * @public\n */\nexport type AzureCommunicationCallAdapterArgs = {\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n locator: CallAdapterLocator;\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId?: string;\n /* @conditional-compile-remove(rooms) */\n /**\n * Optional parameters for the {@link AzureCommunicationCallAdapter} created\n */\n options?: AzureCommunicationCallAdapterOptions;\n};\n\n/**\n * Create a {@link CallAdapter} backed by Azure Communication Services.\n *\n * This is the default implementation of {@link CallAdapter} provided by this library.\n *\n * Note: `displayName` can be a maximum of 256 characters.\n *\n * @public\n */\nexport const createAzureCommunicationCallAdapter = async ({\n userId,\n displayName,\n credential,\n locator,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(rooms) */ options\n}: AzureCommunicationCallAdapterArgs): Promise<CallAdapter> => {\n const callClient = createStatefulCallClient({\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId\n });\n const callAgent = await callClient.createCallAgent(credential, {\n displayName\n });\n const adapter = createAzureCommunicationCallAdapterFromClient(\n callClient,\n callAgent,\n locator,\n /* @conditional-compile-remove(rooms) */ options\n );\n return adapter;\n};\n\n/**\n * A custom React hook to simplify the creation of {@link CallAdapter}.\n *\n * Similar to {@link createAzureCommunicationCallAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationCallAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationCallAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationCallAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: CallAdapter) => Promise<CallAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: CallAdapter) => Promise<void>\n): CallAdapter | undefined => {\n const {\n credential,\n displayName,\n locator,\n userId,\n /*@conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /*@conditional-compile-remove(rooms) */ options\n } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<CallAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<CallAdapter | undefined>(undefined);\n\n const afterCreateRef = useRef<((adapter: CallAdapter) => Promise<CallAdapter>) | undefined>(undefined);\n const beforeDisposeRef = useRef<((adapter: CallAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !locator || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n\n let newAdapter = await createAzureCommunicationCallAdapter({\n credential,\n displayName,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(rooms) */ options\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [\n adapterRef,\n afterCreateRef,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n beforeDisposeRef,\n credential,\n displayName,\n locator,\n userId,\n /* @conditional-compile-remove(PSTN-calls) */ options\n ]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Create a {@link CallAdapter} using the provided {@link StatefulCallClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulCallClient}.\n * Consider using {@link createAzureCommunicationCallAdapter} for a simpler API.\n *\n * @public\n */\nexport const createAzureCommunicationCallAdapterFromClient: (\n callClient: StatefulCallClient,\n callAgent: CallAgent,\n locator: CallAdapterLocator,\n /* @conditional-compile-remove(rooms) */ options?: { roleHint?: Role }\n) => Promise<CallAdapter> = async (\n callClient: StatefulCallClient,\n callAgent: CallAgent,\n locator: CallAdapterLocator,\n /* @conditional-compile-remove(rooms) */ options?: { /* @conditional-compile-remove(rooms) */ roleHint?: Role }\n): Promise<CallAdapter> => {\n const deviceManager = (await callClient.getDeviceManager()) as StatefulDeviceManager;\n /* @conditional-compile-remove(rooms) */\n return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager, options);\n return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager);\n};\n\nconst isCallError = (e: Error): e is CallError => {\n return e['target'] !== undefined && e['innerError'] !== undefined;\n};\n\n/* @conditional-compile-remove(teams-adhoc-call) */\n/* @conditional-compile-remove(PSTN-calls) */\nconst isOutboundCall = (callLocator: CallAdapterLocator): callLocator is CallParticipantsLocator => {\n return 'participantIds' in callLocator;\n};\n\"../../../../../calling-component-bindings/src\"\"../../../../../calling-stateful-client/src\"\"../../../../../react-components/src\"\"../../../../../acs-ui-common/src\""]}
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { CallState, DeviceManagerState } from "../../../../../calling-stateful-client/src";
|
2
2
|
import type { AudioDeviceInfo, VideoDeviceInfo, Call, PermissionConstraints, RemoteParticipant, StartCallOptions, MediaDiagnosticChangedEventArgs, NetworkDiagnosticChangedEventArgs, PropertyChangedEvent } from '@azure/communication-calling';
|
3
3
|
import { CreateVideoStreamViewResult, VideoStreamOptions } from "../../../../../react-components/src";
|
4
|
+
import { Role } from "../../../../../react-components/src";
|
4
5
|
import type { CommunicationIdentifierKind } from '@azure/communication-common';
|
5
6
|
import { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';
|
6
7
|
import type { CommunicationIdentifier, CommunicationUserIdentifier, PhoneNumberIdentifier } from '@azure/communication-common';
|
@@ -45,6 +46,12 @@ export declare type CallAdapterClientState = {
|
|
45
46
|
* Azure communications Phone number to make PSTN calls with.
|
46
47
|
*/
|
47
48
|
alternateCallerId?: string;
|
49
|
+
/**
|
50
|
+
* Use this to hint the role of the user when the role is not available before a Rooms call is started. This value
|
51
|
+
* should be obtained using the Rooms API. This role will determine permissions in the configuration page of the
|
52
|
+
* {@link CallComposite}. The true role of the user will be synced with ACS services when a Rooms call starts.
|
53
|
+
*/
|
54
|
+
roleHint?: Role;
|
48
55
|
};
|
49
56
|
/**
|
50
57
|
* {@link CallAdapter} state.
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/CallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA4ClC;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB;IACjD,0BAA0B;IAC1B,8BAA8B;IAC9B,UAAU;IACV,wCAAwC,CAAC,wBAAwB;IACjE,iBAAiB;IACjB,wCAAwC,CAAC,cAAc;IACvD,sDAAsD,CAAC,wBAAwB;CAChF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CallState, DeviceManagerState } from '@internal/calling-stateful-client';\nimport type {\n AudioDeviceInfo,\n VideoDeviceInfo,\n Call,\n PermissionConstraints,\n RemoteParticipant,\n StartCallOptions,\n MediaDiagnosticChangedEventArgs,\n NetworkDiagnosticChangedEventArgs,\n PropertyChangedEvent\n} from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\nimport type { CommunicationIdentifierKind } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport type {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\nimport type { AdapterState, Disposable, AdapterError, AdapterErrors } from '../../common/adapters';\n\n/**\n * Major UI screens shown in the {@link CallComposite}.\n *\n * @public\n */\nexport type CallCompositePage =\n | 'accessDeniedTeamsMeeting'\n | 'call'\n | 'configuration'\n | /* @conditional-compile-remove(PSTN-calls) */ 'hold'\n | 'joinCallFailedDueToNoNetwork'\n | 'leftCall'\n | 'lobby'\n | /* @conditional-compile-remove(rooms) */ 'deniedPermissionToRoom'\n | 'removedFromCall'\n | /* @conditional-compile-remove(rooms) */ 'roomNotFound'\n | /* @conditional-compile-remove(unsupported-browser) */ 'unsupportedEnvironment';\n\n/**\n * Subset of CallCompositePages that represent an end call state.\n * @private\n */\nexport const END_CALL_PAGES: CallCompositePage[] = [\n 'accessDeniedTeamsMeeting',\n 'joinCallFailedDueToNoNetwork',\n 'leftCall',\n /* @conditional-compile-remove(rooms) */ 'deniedPermissionToRoom',\n 'removedFromCall',\n /* @conditional-compile-remove(rooms) */ 'roomNotFound',\n /* @conditional-compile-remove(unsupported-browser) */ 'unsupportedEnvironment'\n];\n\n/**\n * {@link CallAdapter} state for pure UI purposes.\n *\n * @public\n */\nexport type CallAdapterUiState = {\n isLocalPreviewMicrophoneEnabled: boolean;\n page: CallCompositePage;\n};\n\n/**\n * {@link CallAdapter} state inferred from Azure Communication Services backend.\n *\n * @public\n */\nexport type CallAdapterClientState = {\n userId: CommunicationIdentifierKind;\n displayName?: string;\n call?: CallState;\n devices: DeviceManagerState;\n endedCall?: CallState;\n isTeamsCall: boolean;\n /**\n * Latest error encountered for each operation performed via the adapter.\n */\n latestErrors: AdapterErrors;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Azure communications Phone number to make PSTN calls with.\n */\n alternateCallerId?: string;\n};\n\n/**\n * {@link CallAdapter} state.\n *\n * @public\n */\nexport type CallAdapterState = CallAdapterUiState & CallAdapterClientState;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'participantsJoined' event.\n *\n * @public\n */\nexport type ParticipantsJoinedListener = (event: { joined: RemoteParticipant[] }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'participantsLeft' event.\n *\n * @public\n */\nexport type ParticipantsLeftListener = (event: { removed: RemoteParticipant[] }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isMuted' event.\n *\n * @public\n */\nexport type IsMutedChangedListener = (event: { identifier: CommunicationIdentifierKind; isMuted: boolean }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'callIdChanged' event.\n *\n * @public\n */\nexport type CallIdChangedListener = (event: { callId: string }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isLocalScreenSharingActiveChanged' event.\n *\n * @public\n */\nexport type IsLocalScreenSharingActiveChangedListener = (event: { isScreenSharingOn: boolean }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isSpeakingChanged' event.\n *\n * @public\n */\nexport type IsSpeakingChangedListener = (event: {\n identifier: CommunicationIdentifierKind;\n isSpeaking: boolean;\n}) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'displayNameChanged' event.\n *\n * @public\n */\nexport type DisplayNameChangedListener = (event: {\n participantId: CommunicationIdentifierKind;\n displayName: string;\n}) => void;\n\n/**\n * Payload for {@link CallEndedListener} containing details on the ended call.\n *\n * @public\n */\nexport type CallAdapterCallEndedEvent = { callId: string };\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'callEnded' event.\n *\n * @public\n */\nexport type CallEndedListener = (event: CallAdapterCallEndedEvent) => void;\n\n/**\n * Payload for {@link DiagnosticChangedEventListner} where there is a change in a media diagnostic.\n *\n * @public\n */\nexport type MediaDiagnosticChangedEvent = MediaDiagnosticChangedEventArgs & {\n type: 'media';\n};\n\n/**\n * Payload for {@link DiagnosticChangedEventListner} where there is a change in a network diagnostic.\n *\n * @public\n */\nexport type NetworkDiagnosticChangedEvent = NetworkDiagnosticChangedEventArgs & {\n type: 'network';\n};\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'diagnosticChanged' event.\n *\n * @public\n */\nexport type DiagnosticChangedEventListner = (\n event: MediaDiagnosticChangedEvent | NetworkDiagnosticChangedEvent\n) => void;\n\n/**\n * Functionality for managing the current call.\n *\n * @public\n */\nexport interface CallAdapterCallManagement {\n /**\n * Join the call with microphone initially on/off.\n *\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @public\n */\n joinCall(microphoneOn?: boolean): Call | undefined;\n /**\n * Leave the call\n *\n * @param forEveryone - Whether to remove all participants when leaving\n *\n * @public\n */\n leaveCall(forEveryone?: boolean): Promise<void>;\n /**\n * Start the camera\n * This method will start rendering a local camera view when the call is not active\n *\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n startCamera(options?: VideoStreamOptions): Promise<void>;\n /**\n * Stop the camera\n * This method will stop rendering a local camera view when the call is not active\n *\n * @public\n */\n stopCamera(): Promise<void>;\n /**\n * Mute the current user during the call or disable microphone locally\n *\n * @public\n */\n mute(): Promise<void>;\n /**\n * Unmute the current user during the call or enable microphone locally\n *\n * @public\n */\n unmute(): Promise<void>;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @public\n */\n startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @beta\n */\n startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined;\n /**\n * Start sharing the screen during a call.\n *\n * @public\n */\n startScreenShare(): Promise<void>;\n /**\n * Stop sharing the screen\n *\n * @public\n */\n stopScreenShare(): Promise<void>;\n /**\n * Remove a participant from the call.\n *\n * @param userId - Id of the participant to be removed\n *\n * @public\n */\n removeParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Remove a participant from the call.\n * @param participant - {@link @azure/communication-common#CommunicationIdentifier} of the participant to be removed\n * @beta\n */\n removeParticipant(participant: CommunicationIdentifier): Promise<void>;\n /**\n * Create the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to create the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n createStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void | CreateVideoStreamViewResult>;\n /**\n * Dispose the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to dispose the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Holds the call.\n *\n * @beta\n */\n holdCall(): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Resumes the call from a `LocalHold` state.\n *\n * @beta\n */\n resumeCall(): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Add a participant to the call.\n *\n * @beta\n */\n addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * send dtmf tone to another participant in a 1:1 PSTN call\n *\n * @beta\n */\n sendDtmfTone(dtmfTone: DtmfTone): Promise<void>;\n}\n\n/**\n * Functionality for managing devices within a call.\n *\n * @public\n */\nexport interface CallAdapterDeviceManagement {\n /**\n * Ask for permissions of devices.\n *\n * @remarks\n * Browser permission window will pop up if permissions are not granted yet\n *\n * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n *\n * @public\n */\n askDevicePermission(constrain: PermissionConstraints): Promise<void>;\n /**\n * Query for available camera devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of video device information entities {@link @azure/communication-calling#VideoDeviceInfo }\n *\n * @public\n */\n queryCameras(): Promise<VideoDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n queryMicrophones(): Promise<AudioDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n querySpeakers(): Promise<AudioDeviceInfo[]>;\n /**\n * Set the camera to use in the call.\n *\n * @param sourceInfo - Camera device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryCameras }\n * @param options - Options to control how the camera stream is rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>;\n /**\n * Set the microphone to use in the call.\n *\n * @param sourceInfo - Microphone device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryMicrophones }\n *\n * @public\n */\n setMicrophone(sourceInfo: AudioDeviceInfo): Promise<void>;\n /**\n * Set the speaker to use in the call.\n *\n * @param sourceInfo - Speaker device to choose, pick one returned by {@link CallAdapterDeviceManagement#querySpeakers }\n *\n * @public\n */\n setSpeaker(sourceInfo: AudioDeviceInfo): Promise<void>;\n}\n\n/**\n * Call composite events that can be subscribed to.\n *\n * @public\n */\nexport interface CallAdapterSubscribers {\n /**\n * Subscribe function for 'participantsJoined' event.\n */\n on(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n /**\n * Subscribe function for 'participantsLeft' event.\n */\n on(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n /**\n * Subscribe function for 'isMutedChanged' event.\n *\n * @remarks\n * The event will be triggered whenever current user or remote user mute state changed\n *\n */\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n /**\n * Subscribe function for 'callIdChanged' event.\n *\n * @remarks\n * The event will be triggered when callId of current user changed.\n *\n */\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n /**\n * Subscribe function for 'isLocalScreenSharingActiveChanged' event.\n */\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n /**\n * Subscribe function for 'displayNameChanged' event.\n */\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n /**\n * Subscribe function for 'isSpeakingChanged' event.\n */\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n /**\n * Subscribe function for 'callEnded' event.\n */\n on(event: 'callEnded', listener: CallEndedListener): void;\n /**\n * Subscribe function for 'diagnosticChanged' event.\n *\n * This event fires whenever there is a change in user facing diagnostics about the ongoing call.\n */\n on(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n /**\n * Subscribe function for 'selectedMicrophoneChanged' event.\n *\n * This event fires whenever the user selects a new microphone device.\n */\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n /**\n * Subscribe function for 'selectedSpeakerChanged' event.\n *\n * This event fires whenever the user selects a new speaker device.\n */\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n /**\n * Subscribe function for 'error' event.\n */\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n /**\n * Unsubscribe function for 'participantsJoined' event.\n */\n off(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n /**\n * Unsubscribe function for 'participantsLeft' event.\n */\n off(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n /**\n * Unsubscribe function for 'isMutedChanged' event.\n */\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n /**\n * Unsubscribe function for 'callIdChanged' event.\n */\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n /**\n * Unsubscribe function for 'isLocalScreenSharingActiveChanged' event.\n */\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n /**\n * Unsubscribe function for 'displayNameChanged' event.\n */\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n /**\n * Unsubscribe function for 'isSpeakingChanged' event.\n */\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n /**\n * Unsubscribe function for 'callEnded' event.\n */\n off(event: 'callEnded', listener: CallEndedListener): void;\n /**\n * Unsubscribe function for 'diagnosticChanged' event.\n */\n off(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n /**\n * Unsubscribe function for 'selectedMicrophoneChanged' event.\n */\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n /**\n * Unsubscribe function for 'selectedSpeakerChanged' event.\n */\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n /**\n * Unsubscribe function for 'error' event.\n */\n off(event: 'error', listener: (e: AdapterError) => void): void;\n}\n\n/**\n * {@link CallComposite} Adapter interface.\n *\n * @public\n */\nexport interface CallAdapter\n extends AdapterState<CallAdapterState>,\n Disposable,\n CallAdapterCallManagement,\n CallAdapterDeviceManagement,\n CallAdapterSubscribers {}\n\"../../../../../calling-stateful-client/src\"\"../../../../../react-components/src\""]}
|
1
|
+
{"version":3,"file":"CallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/CallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA8ClC;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB;IACjD,0BAA0B;IAC1B,8BAA8B;IAC9B,UAAU;IACV,wCAAwC,CAAC,wBAAwB;IACjE,iBAAiB;IACjB,wCAAwC,CAAC,cAAc;IACvD,sDAAsD,CAAC,wBAAwB;CAChF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CallState, DeviceManagerState } from '@internal/calling-stateful-client';\nimport type {\n AudioDeviceInfo,\n VideoDeviceInfo,\n Call,\n PermissionConstraints,\n RemoteParticipant,\n StartCallOptions,\n MediaDiagnosticChangedEventArgs,\n NetworkDiagnosticChangedEventArgs,\n PropertyChangedEvent\n} from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\n/* @conditional-compile-remove(rooms) */\nimport { Role } from '@internal/react-components';\nimport type { CommunicationIdentifierKind } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport type {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\nimport type { AdapterState, Disposable, AdapterError, AdapterErrors } from '../../common/adapters';\n\n/**\n * Major UI screens shown in the {@link CallComposite}.\n *\n * @public\n */\nexport type CallCompositePage =\n | 'accessDeniedTeamsMeeting'\n | 'call'\n | 'configuration'\n | /* @conditional-compile-remove(PSTN-calls) */ 'hold'\n | 'joinCallFailedDueToNoNetwork'\n | 'leftCall'\n | 'lobby'\n | /* @conditional-compile-remove(rooms) */ 'deniedPermissionToRoom'\n | 'removedFromCall'\n | /* @conditional-compile-remove(rooms) */ 'roomNotFound'\n | /* @conditional-compile-remove(unsupported-browser) */ 'unsupportedEnvironment';\n\n/**\n * Subset of CallCompositePages that represent an end call state.\n * @private\n */\nexport const END_CALL_PAGES: CallCompositePage[] = [\n 'accessDeniedTeamsMeeting',\n 'joinCallFailedDueToNoNetwork',\n 'leftCall',\n /* @conditional-compile-remove(rooms) */ 'deniedPermissionToRoom',\n 'removedFromCall',\n /* @conditional-compile-remove(rooms) */ 'roomNotFound',\n /* @conditional-compile-remove(unsupported-browser) */ 'unsupportedEnvironment'\n];\n\n/**\n * {@link CallAdapter} state for pure UI purposes.\n *\n * @public\n */\nexport type CallAdapterUiState = {\n isLocalPreviewMicrophoneEnabled: boolean;\n page: CallCompositePage;\n};\n\n/**\n * {@link CallAdapter} state inferred from Azure Communication Services backend.\n *\n * @public\n */\nexport type CallAdapterClientState = {\n userId: CommunicationIdentifierKind;\n displayName?: string;\n call?: CallState;\n devices: DeviceManagerState;\n endedCall?: CallState;\n isTeamsCall: boolean;\n /**\n * Latest error encountered for each operation performed via the adapter.\n */\n latestErrors: AdapterErrors;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Azure communications Phone number to make PSTN calls with.\n */\n alternateCallerId?: string;\n /* @conditional-compile-remove(rooms) */\n /**\n * Use this to hint the role of the user when the role is not available before a Rooms call is started. This value\n * should be obtained using the Rooms API. This role will determine permissions in the configuration page of the\n * {@link CallComposite}. The true role of the user will be synced with ACS services when a Rooms call starts.\n */\n roleHint?: Role;\n};\n\n/**\n * {@link CallAdapter} state.\n *\n * @public\n */\nexport type CallAdapterState = CallAdapterUiState & CallAdapterClientState;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'participantsJoined' event.\n *\n * @public\n */\nexport type ParticipantsJoinedListener = (event: { joined: RemoteParticipant[] }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'participantsLeft' event.\n *\n * @public\n */\nexport type ParticipantsLeftListener = (event: { removed: RemoteParticipant[] }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isMuted' event.\n *\n * @public\n */\nexport type IsMutedChangedListener = (event: { identifier: CommunicationIdentifierKind; isMuted: boolean }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'callIdChanged' event.\n *\n * @public\n */\nexport type CallIdChangedListener = (event: { callId: string }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isLocalScreenSharingActiveChanged' event.\n *\n * @public\n */\nexport type IsLocalScreenSharingActiveChangedListener = (event: { isScreenSharingOn: boolean }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isSpeakingChanged' event.\n *\n * @public\n */\nexport type IsSpeakingChangedListener = (event: {\n identifier: CommunicationIdentifierKind;\n isSpeaking: boolean;\n}) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'displayNameChanged' event.\n *\n * @public\n */\nexport type DisplayNameChangedListener = (event: {\n participantId: CommunicationIdentifierKind;\n displayName: string;\n}) => void;\n\n/**\n * Payload for {@link CallEndedListener} containing details on the ended call.\n *\n * @public\n */\nexport type CallAdapterCallEndedEvent = { callId: string };\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'callEnded' event.\n *\n * @public\n */\nexport type CallEndedListener = (event: CallAdapterCallEndedEvent) => void;\n\n/**\n * Payload for {@link DiagnosticChangedEventListner} where there is a change in a media diagnostic.\n *\n * @public\n */\nexport type MediaDiagnosticChangedEvent = MediaDiagnosticChangedEventArgs & {\n type: 'media';\n};\n\n/**\n * Payload for {@link DiagnosticChangedEventListner} where there is a change in a network diagnostic.\n *\n * @public\n */\nexport type NetworkDiagnosticChangedEvent = NetworkDiagnosticChangedEventArgs & {\n type: 'network';\n};\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'diagnosticChanged' event.\n *\n * @public\n */\nexport type DiagnosticChangedEventListner = (\n event: MediaDiagnosticChangedEvent | NetworkDiagnosticChangedEvent\n) => void;\n\n/**\n * Functionality for managing the current call.\n *\n * @public\n */\nexport interface CallAdapterCallManagement {\n /**\n * Join the call with microphone initially on/off.\n *\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @public\n */\n joinCall(microphoneOn?: boolean): Call | undefined;\n /**\n * Leave the call\n *\n * @param forEveryone - Whether to remove all participants when leaving\n *\n * @public\n */\n leaveCall(forEveryone?: boolean): Promise<void>;\n /**\n * Start the camera\n * This method will start rendering a local camera view when the call is not active\n *\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n startCamera(options?: VideoStreamOptions): Promise<void>;\n /**\n * Stop the camera\n * This method will stop rendering a local camera view when the call is not active\n *\n * @public\n */\n stopCamera(): Promise<void>;\n /**\n * Mute the current user during the call or disable microphone locally\n *\n * @public\n */\n mute(): Promise<void>;\n /**\n * Unmute the current user during the call or enable microphone locally\n *\n * @public\n */\n unmute(): Promise<void>;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @public\n */\n startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @beta\n */\n startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined;\n /**\n * Start sharing the screen during a call.\n *\n * @public\n */\n startScreenShare(): Promise<void>;\n /**\n * Stop sharing the screen\n *\n * @public\n */\n stopScreenShare(): Promise<void>;\n /**\n * Remove a participant from the call.\n *\n * @param userId - Id of the participant to be removed\n *\n * @public\n */\n removeParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Remove a participant from the call.\n * @param participant - {@link @azure/communication-common#CommunicationIdentifier} of the participant to be removed\n * @beta\n */\n removeParticipant(participant: CommunicationIdentifier): Promise<void>;\n /**\n * Create the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to create the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n createStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void | CreateVideoStreamViewResult>;\n /**\n * Dispose the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to dispose the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Holds the call.\n *\n * @beta\n */\n holdCall(): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Resumes the call from a `LocalHold` state.\n *\n * @beta\n */\n resumeCall(): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Add a participant to the call.\n *\n * @beta\n */\n addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * send dtmf tone to another participant in a 1:1 PSTN call\n *\n * @beta\n */\n sendDtmfTone(dtmfTone: DtmfTone): Promise<void>;\n}\n\n/**\n * Functionality for managing devices within a call.\n *\n * @public\n */\nexport interface CallAdapterDeviceManagement {\n /**\n * Ask for permissions of devices.\n *\n * @remarks\n * Browser permission window will pop up if permissions are not granted yet\n *\n * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n *\n * @public\n */\n askDevicePermission(constrain: PermissionConstraints): Promise<void>;\n /**\n * Query for available camera devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of video device information entities {@link @azure/communication-calling#VideoDeviceInfo }\n *\n * @public\n */\n queryCameras(): Promise<VideoDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n queryMicrophones(): Promise<AudioDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n querySpeakers(): Promise<AudioDeviceInfo[]>;\n /**\n * Set the camera to use in the call.\n *\n * @param sourceInfo - Camera device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryCameras }\n * @param options - Options to control how the camera stream is rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>;\n /**\n * Set the microphone to use in the call.\n *\n * @param sourceInfo - Microphone device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryMicrophones }\n *\n * @public\n */\n setMicrophone(sourceInfo: AudioDeviceInfo): Promise<void>;\n /**\n * Set the speaker to use in the call.\n *\n * @param sourceInfo - Speaker device to choose, pick one returned by {@link CallAdapterDeviceManagement#querySpeakers }\n *\n * @public\n */\n setSpeaker(sourceInfo: AudioDeviceInfo): Promise<void>;\n}\n\n/**\n * Call composite events that can be subscribed to.\n *\n * @public\n */\nexport interface CallAdapterSubscribers {\n /**\n * Subscribe function for 'participantsJoined' event.\n */\n on(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n /**\n * Subscribe function for 'participantsLeft' event.\n */\n on(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n /**\n * Subscribe function for 'isMutedChanged' event.\n *\n * @remarks\n * The event will be triggered whenever current user or remote user mute state changed\n *\n */\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n /**\n * Subscribe function for 'callIdChanged' event.\n *\n * @remarks\n * The event will be triggered when callId of current user changed.\n *\n */\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n /**\n * Subscribe function for 'isLocalScreenSharingActiveChanged' event.\n */\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n /**\n * Subscribe function for 'displayNameChanged' event.\n */\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n /**\n * Subscribe function for 'isSpeakingChanged' event.\n */\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n /**\n * Subscribe function for 'callEnded' event.\n */\n on(event: 'callEnded', listener: CallEndedListener): void;\n /**\n * Subscribe function for 'diagnosticChanged' event.\n *\n * This event fires whenever there is a change in user facing diagnostics about the ongoing call.\n */\n on(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n /**\n * Subscribe function for 'selectedMicrophoneChanged' event.\n *\n * This event fires whenever the user selects a new microphone device.\n */\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n /**\n * Subscribe function for 'selectedSpeakerChanged' event.\n *\n * This event fires whenever the user selects a new speaker device.\n */\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n /**\n * Subscribe function for 'error' event.\n */\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n /**\n * Unsubscribe function for 'participantsJoined' event.\n */\n off(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n /**\n * Unsubscribe function for 'participantsLeft' event.\n */\n off(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n /**\n * Unsubscribe function for 'isMutedChanged' event.\n */\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n /**\n * Unsubscribe function for 'callIdChanged' event.\n */\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n /**\n * Unsubscribe function for 'isLocalScreenSharingActiveChanged' event.\n */\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n /**\n * Unsubscribe function for 'displayNameChanged' event.\n */\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n /**\n * Unsubscribe function for 'isSpeakingChanged' event.\n */\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n /**\n * Unsubscribe function for 'callEnded' event.\n */\n off(event: 'callEnded', listener: CallEndedListener): void;\n /**\n * Unsubscribe function for 'diagnosticChanged' event.\n */\n off(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n /**\n * Unsubscribe function for 'selectedMicrophoneChanged' event.\n */\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n /**\n * Unsubscribe function for 'selectedSpeakerChanged' event.\n */\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n /**\n * Unsubscribe function for 'error' event.\n */\n off(event: 'error', listener: (e: AdapterError) => void): void;\n}\n\n/**\n * {@link CallComposite} Adapter interface.\n *\n * @public\n */\nexport interface CallAdapter\n extends AdapterState<CallAdapterState>,\n Disposable,\n CallAdapterCallManagement,\n CallAdapterDeviceManagement,\n CallAdapterSubscribers {}\n\"../../../../../calling-stateful-client/src\"\"../../../../../react-components/src\""]}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
export { createAzureCommunicationCallAdapter, createAzureCommunicationCallAdapterFromClient, useAzureCommunicationCallAdapter } from './AzureCommunicationCallAdapter';
|
2
2
|
export type { AzureCommunicationCallAdapterArgs, CallAdapterLocator } from './AzureCommunicationCallAdapter';
|
3
|
+
export type { AzureCommunicationCallAdapterOptions } from './AzureCommunicationCallAdapter';
|
3
4
|
export type { CallParticipantsLocator } from './AzureCommunicationCallAdapter';
|
4
5
|
export type { CallAdapter, CallAdapterCallEndedEvent, CallAdapterCallManagement, CallAdapterClientState, CallAdapterDeviceManagement, CallAdapterState, CallAdapterSubscribers, CallAdapterUiState, CallCompositePage, CallEndedListener, CallIdChangedListener, DiagnosticChangedEventListner, DisplayNameChangedListener, IsLocalScreenSharingActiveChangedListener, IsMutedChangedListener, IsSpeakingChangedListener, MediaDiagnosticChangedEvent, NetworkDiagnosticChangedEvent, ParticipantsJoinedListener, ParticipantsLeftListener } from './CallAdapter';
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,mCAAmC,EACnC,6CAA6C,EAC7C,gCAAgC,EACjC,MAAM,iCAAiC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport {\n createAzureCommunicationCallAdapter,\n createAzureCommunicationCallAdapterFromClient,\n useAzureCommunicationCallAdapter\n} from './AzureCommunicationCallAdapter';\nexport type { AzureCommunicationCallAdapterArgs, CallAdapterLocator } from './AzureCommunicationCallAdapter';\n\n/* @conditional-compile-remove(teams-adhoc-call) */\nexport type { CallParticipantsLocator } from './AzureCommunicationCallAdapter';\n\nexport type {\n CallAdapter,\n CallAdapterCallEndedEvent,\n CallAdapterCallManagement,\n CallAdapterClientState,\n CallAdapterDeviceManagement,\n CallAdapterState,\n CallAdapterSubscribers,\n CallAdapterUiState,\n CallCompositePage,\n CallEndedListener,\n CallIdChangedListener,\n DiagnosticChangedEventListner,\n DisplayNameChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsMutedChangedListener,\n IsSpeakingChangedListener,\n MediaDiagnosticChangedEvent,\n NetworkDiagnosticChangedEvent,\n ParticipantsJoinedListener,\n ParticipantsLeftListener\n} from './CallAdapter';\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,mCAAmC,EACnC,6CAA6C,EAC7C,gCAAgC,EACjC,MAAM,iCAAiC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport {\n createAzureCommunicationCallAdapter,\n createAzureCommunicationCallAdapterFromClient,\n useAzureCommunicationCallAdapter\n} from './AzureCommunicationCallAdapter';\nexport type { AzureCommunicationCallAdapterArgs, CallAdapterLocator } from './AzureCommunicationCallAdapter';\n/* @conditional-compile-remove(rooms) */\nexport type { AzureCommunicationCallAdapterOptions } from './AzureCommunicationCallAdapter';\n\n/* @conditional-compile-remove(teams-adhoc-call) */\nexport type { CallParticipantsLocator } from './AzureCommunicationCallAdapter';\n\nexport type {\n CallAdapter,\n CallAdapterCallEndedEvent,\n CallAdapterCallManagement,\n CallAdapterClientState,\n CallAdapterDeviceManagement,\n CallAdapterState,\n CallAdapterSubscribers,\n CallAdapterUiState,\n CallCompositePage,\n CallEndedListener,\n CallIdChangedListener,\n DiagnosticChangedEventListner,\n DisplayNameChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsMutedChangedListener,\n IsSpeakingChangedListener,\n MediaDiagnosticChangedEvent,\n NetworkDiagnosticChangedEvent,\n ParticipantsJoinedListener,\n ParticipantsLeftListener\n} from './CallAdapter';\n"]}
|