@azure/communication-react 1.5.1-beta.1 → 1.5.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (253) hide show
  1. package/CHANGELOG.beta.md +76 -1
  2. package/CHANGELOG.json +621 -0
  3. package/dist/communication-react.d.ts +217 -7
  4. package/dist/dist-cjs/communication-react/index.js +2207 -1184
  5. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  6. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  7. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  8. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  10. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +4 -0
  11. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +37 -1
  12. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  13. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +22 -1
  14. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  15. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +14 -0
  16. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +44 -0
  17. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  18. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
  19. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +21 -0
  20. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  21. package/dist/dist-esm/calling-stateful-client/src/Converter.js +1 -0
  22. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  23. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.d.ts +13 -1
  24. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +8 -1
  25. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  26. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.d.ts +4 -0
  27. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js +28 -0
  28. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
  29. package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.d.ts +29 -0
  30. package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.js +54 -0
  31. package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.js.map +1 -0
  32. package/dist/dist-esm/calling-stateful-client/src/Logger.d.ts +16 -29
  33. package/dist/dist-esm/calling-stateful-client/src/Logger.js +16 -29
  34. package/dist/dist-esm/calling-stateful-client/src/Logger.js.map +1 -1
  35. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +1 -1
  36. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  37. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +137 -370
  38. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
  39. package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.d.ts +17 -0
  40. package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.js +198 -0
  41. package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.js.map +1 -0
  42. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  43. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  44. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +1 -1
  45. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  46. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +10 -2
  47. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  48. package/dist/dist-esm/communication-react/src/index.d.ts +2 -0
  49. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  50. package/dist/dist-esm/react-components/src/components/CameraButton.d.ts +16 -0
  51. package/dist/dist-esm/react-components/src/components/CameraButton.js +38 -1
  52. package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
  53. package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +30 -0
  54. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +47 -0
  55. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -0
  56. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +6 -1
  57. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
  58. package/dist/dist-esm/react-components/src/components/ControlBarButton.js +1 -1
  59. package/dist/dist-esm/react-components/src/components/ControlBarButton.js.map +1 -1
  60. package/dist/dist-esm/react-components/src/components/DevicesButton.d.ts +1 -1
  61. package/dist/dist-esm/react-components/src/components/DevicesButton.js +79 -55
  62. package/dist/dist-esm/react-components/src/components/DevicesButton.js.map +1 -1
  63. package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +4 -0
  64. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  65. package/dist/dist-esm/react-components/src/components/HorizontalGallery.d.ts +4 -0
  66. package/dist/dist-esm/react-components/src/components/HorizontalGallery.js +29 -24
  67. package/dist/dist-esm/react-components/src/components/HorizontalGallery.js.map +1 -1
  68. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +2 -2
  69. package/dist/dist-esm/react-components/src/components/MessageThread.js +24 -11
  70. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  71. package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +12 -0
  72. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js +29 -1
  73. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
  74. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -1
  75. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  76. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +1 -1
  77. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  78. package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.d.ts +4 -2
  79. package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js +6 -42
  80. package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js.map +1 -1
  81. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.d.ts +35 -0
  82. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js +32 -0
  83. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js.map +1 -0
  84. package/dist/dist-esm/react-components/src/components/SendBox.js +5 -2
  85. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  86. package/dist/dist-esm/react-components/src/components/VerticalGallery.d.ts +67 -0
  87. package/dist/dist-esm/react-components/src/components/VerticalGallery.js +113 -0
  88. package/dist/dist-esm/react-components/src/components/VerticalGallery.js.map +1 -0
  89. package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.d.ts +21 -0
  90. package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.js +65 -0
  91. package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.js.map +1 -0
  92. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.d.ts +75 -0
  93. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +44 -0
  94. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -0
  95. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.d.ts +88 -0
  96. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +80 -0
  97. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -0
  98. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.d.ts +1 -1
  99. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +55 -19
  100. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
  101. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.d.ts +10 -3
  102. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +11 -9
  103. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -1
  104. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.d.ts +1 -1
  105. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +81 -24
  106. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  107. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +11 -1
  108. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
  109. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.d.ts +21 -0
  110. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js +63 -0
  111. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js.map +1 -0
  112. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.d.ts +2 -1
  113. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js +8 -2
  114. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js.map +1 -1
  115. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.d.ts +32 -7
  116. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +28 -12
  117. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
  118. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js +2 -2
  119. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js.map +1 -1
  120. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.d.ts +4 -1
  121. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js +8 -7
  122. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js.map +1 -1
  123. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.d.ts +64 -0
  124. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js +79 -0
  125. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js.map +1 -0
  126. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.d.ts +25 -0
  127. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.js +94 -0
  128. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.js.map +1 -0
  129. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +4 -4
  130. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +58 -49
  131. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  132. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +25 -0
  133. package/dist/dist-esm/react-components/src/components/VideoGallery.js +32 -4
  134. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  135. package/dist/dist-esm/react-components/src/components/VideoTile.js +9 -12
  136. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  137. package/dist/dist-esm/react-components/src/components/index.d.ts +8 -0
  138. package/dist/dist-esm/react-components/src/components/index.js +4 -0
  139. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  140. package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.d.ts +13 -0
  141. package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.js +35 -0
  142. package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.js.map +1 -0
  143. package/dist/dist-esm/react-components/src/components/styles/HorizontalGallery.styles.js +1 -0
  144. package/dist/dist-esm/react-components/src/components/styles/HorizontalGallery.styles.js.map +1 -1
  145. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +2 -2
  146. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +30 -2
  147. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  148. package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.d.ts +32 -0
  149. package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.js +66 -0
  150. package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.js.map +1 -0
  151. package/dist/dist-esm/react-components/src/components/utils/overFlowGalleriesUtils.d.ts +11 -0
  152. package/dist/dist-esm/react-components/src/components/utils/overFlowGalleriesUtils.js +22 -0
  153. package/dist/dist-esm/react-components/src/components/utils/overFlowGalleriesUtils.js.map +1 -0
  154. package/dist/dist-esm/react-components/src/components/utils/responsive.d.ts +6 -0
  155. package/dist/dist-esm/react-components/src/components/utils/responsive.js +7 -0
  156. package/dist/dist-esm/react-components/src/components/utils/responsive.js.map +1 -1
  157. package/dist/dist-esm/react-components/src/components/utils.d.ts +5 -0
  158. package/dist/dist-esm/react-components/src/components/utils.js +20 -0
  159. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  160. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js +6 -14
  161. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js.map +1 -1
  162. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +10 -4
  163. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +7 -2
  164. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  165. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +5 -0
  166. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  167. package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +14 -3
  168. package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +14 -3
  169. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +14 -3
  170. package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +14 -3
  171. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +14 -3
  172. package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +14 -3
  173. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +14 -3
  174. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +14 -3
  175. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +14 -3
  176. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +14 -3
  177. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +14 -3
  178. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +14 -3
  179. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +14 -3
  180. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +14 -3
  181. package/dist/dist-esm/react-components/src/theming/icons.d.ts +7 -0
  182. package/dist/dist-esm/react-components/src/theming/icons.js +19 -7
  183. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  184. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  185. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +4 -0
  186. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +27 -2
  187. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  188. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +42 -0
  189. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  190. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +8 -2
  191. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  192. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +1 -1
  193. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  194. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +21 -3
  195. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  196. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +1 -1
  197. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
  198. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.d.ts +5 -4
  199. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +3 -1
  200. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  201. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.d.ts +0 -5
  202. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js +1 -31
  203. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js.map +1 -1
  204. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +12 -0
  205. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  206. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -0
  207. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  208. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +1 -1
  209. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  210. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.d.ts +1 -1
  211. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +3 -3
  212. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -1
  213. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +11 -1
  214. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  215. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.d.ts +1 -0
  216. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +12 -8
  217. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -1
  218. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.d.ts +16 -3
  219. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js +49 -43
  220. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js.map +1 -1
  221. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +4 -0
  222. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +24 -0
  223. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  224. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +19 -0
  225. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  226. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +4 -0
  227. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +18 -0
  228. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  229. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.d.ts +2 -0
  230. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js +47 -26
  231. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js.map +1 -1
  232. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js +4 -4
  233. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +1 -1
  234. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.d.ts +1 -1
  235. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js +5 -3
  236. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
  237. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +16 -1
  238. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  239. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -1
  240. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  241. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +11 -0
  242. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +19 -0
  243. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -0
  244. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +7 -0
  245. package/dist/dist-esm/react-composites/src/composites/common/icons.js +4 -4
  246. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  247. package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.d.ts +7 -0
  248. package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.js +9 -0
  249. package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.js.map +1 -0
  250. package/package.json +12 -12
  251. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.d.ts +0 -14
  252. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js +0 -19
  253. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import { StatefulCallClient, StatefulDeviceManager, TeamsCall, TeamsCallAgent as BetaTeamsCallAgent } from "../../../../../calling-stateful-client/src";
2
2
  import { CallAgent, GroupCallLocator, TeamsMeetingLinkLocator, AudioDeviceInfo, VideoDeviceInfo, PermissionConstraints, PropertyChangedEvent, StartCallOptions, Call } from '@azure/communication-calling';
3
+ import { BackgroundBlurConfig, BackgroundReplacementConfig } from '@azure/communication-calling-effects';
3
4
  import { TeamsCallAgent } from '@azure/communication-calling';
4
5
  import { RoomCallLocator } from '@azure/communication-calling';
5
6
  import { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';
@@ -56,6 +57,9 @@ export declare class AzureCommunicationCallAdapter<AgentType extends CallAgent |
56
57
  startScreenShare(): Promise<void>;
57
58
  stopScreenShare(): Promise<void>;
58
59
  allowUnsupportedBrowserVersion(): void;
60
+ blurVideoBackground(backgroundBlurConfig?: BackgroundBlurConfig): Promise<void>;
61
+ replaceVideoBackground(backgroundReplacementConfig: BackgroundReplacementConfig): Promise<void>;
62
+ stopVideoBackgroundEffect(): Promise<void>;
59
63
  startCall(participants: string[] | CommunicationIdentifier[], options?: StartCallOptions): CallTypeOf<AgentType> | undefined;
60
64
  private processNewCall;
61
65
  removeParticipant(userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier): Promise<void>;
@@ -42,6 +42,7 @@ class CallContext {
42
42
  /* @conditional-compile-remove(unsupported-browser) */ environmentInfo: clientState.environmentInfo,
43
43
  /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserVersionsAllowed: false,
44
44
  /* @conditional-compile-remove(rooms) */ roleHint: options === null || options === void 0 ? void 0 : options.roleHint,
45
+ /* @conditional-compile-remove(video-background-effects) */ videoBackgroundImages: options === null || options === void 0 ? void 0 : options.videoBackgroundImages,
45
46
  cameraStatus: undefined
46
47
  };
47
48
  this.emitter.setMaxListeners((_b = options === null || options === void 0 ? void 0 : options.maxListeners) !== null && _b !== void 0 ? _b : 50);
@@ -225,6 +226,12 @@ export class AzureCommunicationCallAdapter {
225
226
  this.sendDtmfTone.bind(this);
226
227
  /* @conditional-compile-remove(unsupported-browser) */
227
228
  this.allowUnsupportedBrowserVersion.bind(this);
229
+ /* @conditional-compile-remove(video-background-effects) */
230
+ this.blurVideoBackground.bind(this);
231
+ /* @conditional-compile-remove(video-background-effects) */
232
+ this.replaceVideoBackground.bind(this);
233
+ /* @conditional-compile-remove(video-background-effects) */
234
+ this.stopVideoBackgroundEffect.bind(this);
228
235
  }
229
236
  dispose() {
230
237
  this.resetDiagnosticsForwarder();
@@ -433,6 +440,24 @@ export class AzureCommunicationCallAdapter {
433
440
  this.context.setAllowedUnsupportedBrowser();
434
441
  this.context.updateClientState(this.callClient.getState());
435
442
  }
443
+ /* @conditional-compile-remove(video-background-effects) */
444
+ blurVideoBackground(backgroundBlurConfig) {
445
+ return __awaiter(this, void 0, void 0, function* () {
446
+ yield this.handlers.onBlurVideoBackground(backgroundBlurConfig);
447
+ });
448
+ }
449
+ /* @conditional-compile-remove(video-background-effects) */
450
+ replaceVideoBackground(backgroundReplacementConfig) {
451
+ return __awaiter(this, void 0, void 0, function* () {
452
+ yield this.handlers.onReplaceVideoBackground(backgroundReplacementConfig);
453
+ });
454
+ }
455
+ /* @conditional-compile-remove(video-background-effects) */
456
+ stopVideoBackgroundEffect() {
457
+ return __awaiter(this, void 0, void 0, function* () {
458
+ yield this.handlers.onRemoveVideoBackgroundEffects();
459
+ });
460
+ }
436
461
  startCall(participants, options) {
437
462
  var _a, _b;
438
463
  if (_isInCall((_b = (_a = this.getState().call) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : 'None')) {
@@ -544,10 +569,10 @@ export class AzureCommunicationCallAdapter {
544
569
  }
545
570
  onRemoteParticipantsUpdated({ added, removed }) {
546
571
  if (added && added.length > 0) {
547
- this.emitter.emit('participantsJoined', added);
572
+ this.emitter.emit('participantsJoined', { joined: added });
548
573
  }
549
574
  if (removed && removed.length > 0) {
550
- this.emitter.emit('participantsLeft', removed);
575
+ this.emitter.emit('participantsLeft', { removed: removed });
551
576
  }
552
577
  added.forEach((participant) => {
553
578
  this.participantSubscribers.set(toFlatCommunicationIdentifier(participant.identifier), new ParticipantSubscriber(participant, this.emitter));
@@ -1 +1 @@
1
- {"version":3,"file":"AzureCommunicationCallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,SAAS,EAA0B,sDAA6C;AACzF,OAAO,EAIL,wBAAwB,EAKzB,mDAA0C;AAC3C,yDAAyD;AACzD,OAAO,EAAE,iBAAiB,EAAE,mDAA0C;AAqBtE,sDAAsD;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAGxD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAkBtC,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAIhG,OAAO,EAAE,6BAA6B,EAAE,0BAA0B,EAAE,yCAAgC;AACpG,OAAO,EAGL,6BAA6B,EAC7B,uBAAuB,EAKxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,EAAE,o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,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAClE,OAAO,IAAI,6BAA6B,CACtC,UAAU,EACV,OAAO,EACP,SAAS,EACT,aAAa;IACb,wCAAwC,CAAC,OAAO,CACjD,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,yDAAyD;AACzD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,UAA8B,EAC9B,SAAyB,EACzB,OAA2B,EAC3B,OAA6B,EACF,EAAE;IAC7B,MAAM,aAAa,GAAG,CAAC,MAAM,UAAU,CAAC,gBAAgB,EAAE,CAA0B,CAAC;IACrF,sDAAsD;IACtD,MAAM,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAClE,OAAO,IAAI,6BAA6B,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;AACnG,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 { _isInCall, _isInLobbyOrConnecting } from '@internal/calling-component-bindings';\nimport {\n CallClientState,\n CallError,\n CallState,\n createStatefulCallClient,\n StatefulCallClient,\n StatefulDeviceManager,\n TeamsCall,\n TeamsCallAgent as BetaTeamsCallAgent\n} from '@internal/calling-stateful-client';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { _isTeamsCallAgent } from '@internal/calling-stateful-client';\nimport { CallCommon } from '@internal/calling-stateful-client';\nimport {\n AudioOptions,\n CallAgent,\n GroupCallLocator,\n TeamsMeetingLinkLocator,\n LocalVideoStream as SDKLocalVideoStream,\n AudioDeviceInfo,\n VideoDeviceInfo,\n RemoteParticipant,\n PermissionConstraints,\n PropertyChangedEvent,\n StartCallOptions,\n VideoOptions,\n Call\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support)) */\nimport { TeamsCallAgent } from '@azure/communication-calling';\n/* @conditional-compile-remove(rooms) */\nimport { RoomCallLocator } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { Features } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';\nimport { EventEmitter } from 'events';\nimport {\n CommonCallAdapter,\n CallEndedListener,\n CallIdChangedListener,\n CallAdapterState,\n DisplayNameChangedListener,\n IsMutedChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsSpeakingChangedListener,\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n DiagnosticChangedEventListner,\n CallAdapterCallEndedEvent,\n CallAdapter\n} from './CallAdapter';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCallAdapter } from './CallAdapter';\nimport { getCallCompositePage, IsCallEndedPage, isCameraOn, isValidIdentifier } 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 MicrosoftTeamsUserIdentifier\n} from '@azure/communication-common';\nimport { ParticipantSubscriber } from './ParticipantSubcriber';\nimport { AdapterError } from '../../common/adapters';\nimport { DiagnosticsForwarder } from './DiagnosticsForwarder';\nimport { useEffect, useRef, useState } from 'react';\nimport { CallHandlersOf, createHandlers } from './createHandlers';\nimport { createProfileStateModifier, OnFetchProfileCallback } from './OnFetchProfileCallback';\n\ntype CallTypeOf<AgentType extends CallAgent | BetaTeamsCallAgent> = AgentType extends CallAgent ? Call : TeamsCall;\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 private displayNameModifier: AdapterStateModifier | undefined;\n\n constructor(\n clientState: CallClientState,\n isTeamsCall: boolean,\n options?: {\n /* @conditional-compile-remove(rooms) */ roleHint?: Role;\n maxListeners?: number;\n onFetchProfile?: OnFetchProfileCallback;\n }\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(unsupported-browser) */ environmentInfo: clientState.environmentInfo,\n /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserVersionsAllowed: false,\n /* @conditional-compile-remove(rooms) */ roleHint: options?.roleHint,\n cameraStatus: undefined\n };\n this.emitter.setMaxListeners(options?.maxListeners ?? 50);\n this.bindPublicMethods();\n this.displayNameModifier = options?.onFetchProfile\n ? createProfileStateModifier(options.onFetchProfile, () => {\n this.setState(this.getState());\n })\n : undefined;\n }\n\n private bindPublicMethods(): void {\n /* @conditional-compile-remove(unsupported-browser) */\n this.setAllowedUnsupportedBrowser.bind(this);\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 = this.displayNameModifier ? this.displayNameModifier(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 = clientState.callsEnded ? findLatestEndedCall(clientState.callsEnded) : undefined;\n // As the state is transitioning to a new state, trigger appropriate callback events.\n const oldPage = this.state.page;\n /* @conditional-compile-remove(unsupported-browser) */\n const environmentInfo = {\n environmentInfo: this.state.environmentInfo,\n unsupportedBrowserVersionOptedIn: this.state.unsupportedBrowserVersionsAllowed\n };\n const newPage = getCallCompositePage(\n call,\n latestEndedCall,\n /* @conditional-compile-remove(unsupported-browser) */ environmentInfo\n );\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 cameraStatus:\n call?.localVideoStreams.find((s) => s.mediaStreamType === 'Video') ||\n clientState.deviceManager.unparentedViews.find((s) => s.mediaStreamType === 'Video')\n ? 'On'\n : 'Off'\n });\n }\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public setAllowedUnsupportedBrowser(): void {\n this.setState({ ...this.state, unsupportedBrowserVersionsAllowed: true });\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 type AdapterStateModifier = (state: CallAdapterState) => CallAdapterState;\n\n/**\n * @private\n */\nexport class AzureCommunicationCallAdapter<AgentType extends CallAgent | BetaTeamsCallAgent = CallAgent>\n implements CommonCallAdapter\n{\n private callClient: StatefulCallClient;\n private callAgent: AgentType;\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?: CallCommon;\n private context: CallContext;\n private diagnosticsForwarder?: DiagnosticsForwarder;\n private handlers: CallHandlersOf<AgentType>;\n private participantSubscribers = new Map<string, ParticipantSubscriber>();\n private emitter: EventEmitter = new EventEmitter();\n private onClientStateChange: (clientState: CallClientState) => void;\n\n private get call(): CallCommon | undefined {\n return this._call;\n }\n\n private set call(newCall: CallCommon | undefined) {\n this.resetDiagnosticsForwarder(newCall);\n this._call = newCall;\n }\n\n constructor(\n callClient: StatefulCallClient,\n locator: CallAdapterLocator,\n callAgent: AgentType,\n deviceManager: StatefulDeviceManager,\n options?: AzureCommunicationCallAdapterOptions & TeamsAdapterOptions\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, options);\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 = createHandlers(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 /* @conditional-compile-remove(unsupported-browser) */\n this.allowUnsupportedBrowserVersion.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): CallTypeOf<AgentType> | 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): CallTypeOf<AgentType> {\n const isTeamsMeeting = 'meetingLink' in this.locator;\n /* @conditional-compile-remove(rooms) */\n const isRoomsCall = 'roomId' in this.locator;\n\n /* @conditional-compile-remove(teams-identity-support) */\n if (_isTeamsCallAgent(this.callAgent)) {\n if (!isTeamsMeeting) {\n throw new Error('Locator not supported by TeamsCallAgent');\n }\n\n return this.callAgent.join(this.locator as TeamsMeetingLinkLocator, {\n audioOptions,\n videoOptions\n }) as CallTypeOf<AgentType>;\n }\n if (isTeamsMeeting) {\n return this.callAgent.join(this.locator as TeamsMeetingLinkLocator, {\n audioOptions,\n videoOptions\n }) as CallTypeOf<AgentType>;\n }\n /* @conditional-compile-remove(rooms) */\n if (isRoomsCall) {\n return this.callAgent.join(this.locator as RoomCallLocator, {\n audioOptions,\n videoOptions\n }) as CallTypeOf<AgentType>;\n }\n return this.callAgent.join(this.locator as GroupCallLocator, {\n audioOptions,\n videoOptions\n }) as CallTypeOf<AgentType>;\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 = createHandlers(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 /* @conditional-compile-remove(unsupported-browser) */\n public allowUnsupportedBrowserVersion(): void {\n this.context.setAllowedUnsupportedBrowser();\n this.context.updateClientState(this.callClient.getState());\n }\n\n public startCall(\n participants:\n | string[]\n /* @conditional-compile-remove(PSTN-calls) */\n | CommunicationIdentifier[],\n options?: StartCallOptions\n ): CallTypeOf<AgentType> | 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) as CallTypeOf<AgentType>;\n if (!call) {\n throw new Error('Unable to start call.');\n }\n this.processNewCall(call);\n\n return call;\n }\n\n private processNewCall(call: CallCommon): 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 = createHandlers(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?: CallCommon): 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 * Optional parameters to create {@link AzureCommunicationCallAdapter}\n *\n * @beta\n */\nexport type AzureCommunicationCallAdapterOptions = {\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 * 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 /**\n * A phone number in E.164 format procured using Azure Communication Services that will be used to represent callers identity.\n * E.164 numbers are formatted as [+] [country code] [phone number including area code]. For example, +14255550123 for a US phone number.\n */\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 * Optional parameters to create {@link AzureCommunicationCallAdapter}\n *\n * @beta\n */\nexport type TeamsAdapterOptions = {\n /**\n * Use this to fetch profile information which will override data in {@link CallAdapterState} like display name\n * The onFetchProfile is fetch-and-forget one time action for each user, once a user profile is updated, the value will be cached\n * and would not be updated again within the lifecycle of adapter.\n */\n onFetchProfile?: OnFetchProfileCallback;\n};\n\n/**\n * Arguments for creating the Azure Communication Services implementation of {@link TeamsCallAdapter}.\n *\n * @beta\n */\nexport type TeamsCallAdapterArgs = {\n userId: MicrosoftTeamsUserIdentifier;\n credential: CommunicationTokenCredential;\n locator: TeamsMeetingLinkLocator;\n /**\n * Optional parameters for the {@link TeamsCallAdapter} created\n */\n options?: TeamsAdapterOptions;\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 if (!isValidIdentifier(userId)) {\n throw new Error('Invalid identifier. Please provide valid identifier object.');\n }\n\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/* @conditional-compile-remove(teams-identity-support) */\n/**\n * @beta\n */\nexport const createTeamsCallAdapter = async ({\n userId,\n credential,\n locator,\n options\n}: TeamsCallAdapterArgs): Promise<TeamsCallAdapter> => {\n const callClient = createStatefulCallClient({\n userId\n });\n const callAgent = await callClient.createTeamsCallAgent(credential, {\n undefined\n });\n const adapter = createTeamsCallAdapterFromClient(callClient, callAgent, locator, options);\n return adapter;\n};\n\ntype PartialArgsType<Adapter> = Adapter extends CallAdapter\n ? Partial<AzureCommunicationCallAdapterArgs>\n : Partial<TeamsCallAdapterArgs>;\n\ntype AdapterOf<AdapterKind extends 'AzureCommunication' | 'Teams'> = AdapterKind extends 'AzureCommunication'\n ? CallAdapter\n : never | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallAdapter;\n\n/**\n * @private\n */\nconst useAzureCommunicationCallAdapterGeneric = <\n AdapterKind extends 'AzureCommunication' | 'Teams',\n Adapter extends AdapterOf<AdapterKind>\n>(\n args: PartialArgsType<Adapter>,\n afterCreate?: (adapter: Adapter) => Promise<Adapter>,\n beforeDispose?: (adapter: Adapter) => Promise<void>,\n adapterKind: AdapterKind = 'AzureCommunication' as AdapterKind\n): Adapter | undefined => {\n const { credential, locator, userId } = args;\n const displayName = 'displayName' in args ? args.displayName : undefined;\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = 'alternateCallerId' in args ? args.alternateCallerId : undefined;\n /* @conditional-compile-remove(rooms) */\n const options = 'options' in args ? args.options : undefined;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<Adapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<Adapter | undefined>(undefined);\n\n const afterCreateRef = useRef<((adapter: Adapter) => Promise<Adapter>) | undefined>(undefined);\n const beforeDisposeRef = useRef<((adapter: Adapter) => 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 || !locator || !userId) {\n return;\n }\n\n if (adapterKind === 'AzureCommunication' && !displayName) {\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: Adapter | undefined = undefined;\n if (adapterKind === 'AzureCommunication') {\n // This is just the type check to ensure that displayName is defined.\n if (!displayName) {\n throw new Error('Unreachable code, displayName already checked above.');\n }\n // This is just the type check to ensure that roleHint is defined.\n /* @conditional-compile-remove(rooms) */\n if (options && !('roleHint' in options)) {\n throw new Error('Unreachable code, provided a options without roleHint.');\n }\n newAdapter = (await createAzureCommunicationCallAdapter({\n credential,\n displayName: displayName,\n locator,\n userId: userId as CommunicationUserIdentifier,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(rooms) */ options\n })) as Adapter;\n } else if (adapterKind === 'Teams') {\n // This is just the type check to ensure that roleHint is defined.\n /* @conditional-compile-remove(teams-identity-support)) */\n if (options && !('onFetchProfile' in options)) {\n throw new Error('Unreachable code, provided a options without roleHint.');\n }\n /* @conditional-compile-remove(teams-identity-support) */\n newAdapter = (await createTeamsCallAdapter({\n credential,\n locator: locator as TeamsMeetingLinkLocator,\n userId: userId as MicrosoftTeamsUserIdentifier,\n options\n })) as Adapter;\n } else {\n throw new Error('Unreachable code, unknown adapterKind');\n }\n\n if (!newAdapter) {\n throw Error('Unreachable code! Get undefined adapter');\n }\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 beforeDisposeRef,\n credential,\n locator,\n adapterKind,\n userId,\n displayName,\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId,\n /* @conditional-compile-remove(rooms) */\n /* @conditional-compile-remove(teams-identity-support) */\n 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 * 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 return useAzureCommunicationCallAdapterGeneric(args, afterCreate, beforeDispose, 'AzureCommunication');\n};\n\n/* @conditional-compile-remove(teams-identity-support) */\n/**\n * A custom React hook to simplify the creation of {@link TeamsCallAdapter}.\n *\n * Similar to {@link createTeamsAzureCommunicationCallAdapter}, 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 * @beta\n */\nexport const useTeamsCallAdapter = (\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<TeamsCallAdapterArgs>,\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: TeamsCallAdapter) => Promise<TeamsCallAdapter>,\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: TeamsCallAdapter) => Promise<void>\n): TeamsCallAdapter | undefined => {\n return useAzureCommunicationCallAdapterGeneric(args, afterCreate, beforeDispose, 'Teams');\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?: AzureCommunicationCallAdapterOptions\n) => Promise<CallAdapter> = async (\n callClient: StatefulCallClient,\n callAgent: CallAgent,\n locator: CallAdapterLocator,\n options?\n): Promise<CallAdapter> => {\n const deviceManager = (await callClient.getDeviceManager()) as StatefulDeviceManager;\n /* @conditional-compile-remove(unsupported-browser) */\n await callClient.feature(Features.DebugInfo).getEnvironmentInfo();\n return new AzureCommunicationCallAdapter(\n callClient,\n locator,\n callAgent,\n deviceManager,\n /* @conditional-compile-remove(rooms) */ options\n );\n};\n\n/* @conditional-compile-remove(teams-identity-support) */\n/**\n * Create a {@link TeamsCallAdapter} 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 * @beta\n */\nexport const createTeamsCallAdapterFromClient = async (\n callClient: StatefulCallClient,\n callAgent: TeamsCallAgent,\n locator: CallAdapterLocator,\n options?: TeamsAdapterOptions\n): Promise<TeamsCallAdapter> => {\n const deviceManager = (await callClient.getDeviceManager()) as StatefulDeviceManager;\n /* @conditional-compile-remove(unsupported-browser) */\n await callClient.feature(Features.DebugInfo).getEnvironmentInfo();\n return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager, options);\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"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xB,MAAM,aAAa,GAAG,CAAC,MAAM,UAAU,CAAC,gBAAgB,EAAE,CAA0B,CAAC;IACrF,sDAAsD;IACtD,MAAM,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAClE,OAAO,IAAI,6BAA6B,CACtC,UAAU,EACV,OAAO,EACP,SAAS,EACT,aAAa;IACb,wCAAwC,CAAC,OAAO,CACjD,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,yDAAyD;AACzD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAC9C,UAA8B,EAC9B,SAAyB,EACzB,OAA2B,EAC3B,OAA6B,EACF,EAAE;IAC7B,MAAM,aAAa,GAAG,CAAC,MAAM,UAAU,CAAC,gBAAgB,EAAE,CAA0B,CAAC;IACrF,sDAAsD;IACtD,MAAM,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE,CAAC;IAClE,OAAO,IAAI,6BAA6B,CAAC,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;AACnG,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 { _isInCall, _isInLobbyOrConnecting } from '@internal/calling-component-bindings';\nimport {\n CallClientState,\n CallError,\n CallState,\n createStatefulCallClient,\n StatefulCallClient,\n StatefulDeviceManager,\n TeamsCall,\n TeamsCallAgent as BetaTeamsCallAgent\n} from '@internal/calling-stateful-client';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { _isTeamsCallAgent } from '@internal/calling-stateful-client';\nimport { CallCommon } from '@internal/calling-stateful-client';\nimport {\n AudioOptions,\n CallAgent,\n GroupCallLocator,\n TeamsMeetingLinkLocator,\n LocalVideoStream as SDKLocalVideoStream,\n AudioDeviceInfo,\n VideoDeviceInfo,\n RemoteParticipant,\n PermissionConstraints,\n PropertyChangedEvent,\n StartCallOptions,\n VideoOptions,\n Call\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(video-background-effects) */\nimport { BackgroundBlurConfig, BackgroundReplacementConfig } from '@azure/communication-calling-effects';\n/* @conditional-compile-remove(teams-identity-support)) */\nimport { TeamsCallAgent } from '@azure/communication-calling';\n/* @conditional-compile-remove(rooms) */\nimport { RoomCallLocator } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { Features } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';\nimport { EventEmitter } from 'events';\nimport {\n CommonCallAdapter,\n CallEndedListener,\n CallIdChangedListener,\n CallAdapterState,\n DisplayNameChangedListener,\n IsMutedChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsSpeakingChangedListener,\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n DiagnosticChangedEventListner,\n CallAdapterCallEndedEvent,\n CallAdapter\n} from './CallAdapter';\n/* @conditional-compile-remove(video-background-effects) */\nimport { VideoBackgroundImage } from './CallAdapter';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCallAdapter } from './CallAdapter';\nimport { getCallCompositePage, IsCallEndedPage, isCameraOn, isValidIdentifier } 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 MicrosoftTeamsUserIdentifier\n} from '@azure/communication-common';\nimport { ParticipantSubscriber } from './ParticipantSubcriber';\nimport { AdapterError } from '../../common/adapters';\nimport { DiagnosticsForwarder } from './DiagnosticsForwarder';\nimport { useEffect, useRef, useState } from 'react';\nimport { CallHandlersOf, createHandlers } from './createHandlers';\nimport { createProfileStateModifier, OnFetchProfileCallback } from './OnFetchProfileCallback';\n\ntype CallTypeOf<AgentType extends CallAgent | BetaTeamsCallAgent> = AgentType extends CallAgent ? Call : TeamsCall;\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 private displayNameModifier: AdapterStateModifier | undefined;\n\n constructor(\n clientState: CallClientState,\n isTeamsCall: boolean,\n options?: {\n /* @conditional-compile-remove(rooms) */ roleHint?: Role;\n maxListeners?: number;\n onFetchProfile?: OnFetchProfileCallback;\n /* @conditional-compile-remove(video-background-effects) */ videoBackgroundImages?: VideoBackgroundImage[];\n }\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(unsupported-browser) */ environmentInfo: clientState.environmentInfo,\n /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserVersionsAllowed: false,\n /* @conditional-compile-remove(rooms) */ roleHint: options?.roleHint,\n /* @conditional-compile-remove(video-background-effects) */ videoBackgroundImages: options?.videoBackgroundImages,\n cameraStatus: undefined\n };\n this.emitter.setMaxListeners(options?.maxListeners ?? 50);\n this.bindPublicMethods();\n this.displayNameModifier = options?.onFetchProfile\n ? createProfileStateModifier(options.onFetchProfile, () => {\n this.setState(this.getState());\n })\n : undefined;\n }\n\n private bindPublicMethods(): void {\n /* @conditional-compile-remove(unsupported-browser) */\n this.setAllowedUnsupportedBrowser.bind(this);\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 = this.displayNameModifier ? this.displayNameModifier(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 = clientState.callsEnded ? findLatestEndedCall(clientState.callsEnded) : undefined;\n // As the state is transitioning to a new state, trigger appropriate callback events.\n const oldPage = this.state.page;\n /* @conditional-compile-remove(unsupported-browser) */\n const environmentInfo = {\n environmentInfo: this.state.environmentInfo,\n unsupportedBrowserVersionOptedIn: this.state.unsupportedBrowserVersionsAllowed\n };\n const newPage = getCallCompositePage(\n call,\n latestEndedCall,\n /* @conditional-compile-remove(unsupported-browser) */ environmentInfo\n );\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 cameraStatus:\n call?.localVideoStreams.find((s) => s.mediaStreamType === 'Video') ||\n clientState.deviceManager.unparentedViews.find((s) => s.mediaStreamType === 'Video')\n ? 'On'\n : 'Off'\n });\n }\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public setAllowedUnsupportedBrowser(): void {\n this.setState({ ...this.state, unsupportedBrowserVersionsAllowed: true });\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 type AdapterStateModifier = (state: CallAdapterState) => CallAdapterState;\n\n/**\n * @private\n */\nexport class AzureCommunicationCallAdapter<AgentType extends CallAgent | BetaTeamsCallAgent = CallAgent>\n implements CommonCallAdapter\n{\n private callClient: StatefulCallClient;\n private callAgent: AgentType;\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?: CallCommon;\n private context: CallContext;\n private diagnosticsForwarder?: DiagnosticsForwarder;\n private handlers: CallHandlersOf<AgentType>;\n private participantSubscribers = new Map<string, ParticipantSubscriber>();\n private emitter: EventEmitter = new EventEmitter();\n private onClientStateChange: (clientState: CallClientState) => void;\n\n private get call(): CallCommon | undefined {\n return this._call;\n }\n\n private set call(newCall: CallCommon | undefined) {\n this.resetDiagnosticsForwarder(newCall);\n this._call = newCall;\n }\n\n constructor(\n callClient: StatefulCallClient,\n locator: CallAdapterLocator,\n callAgent: AgentType,\n deviceManager: StatefulDeviceManager,\n options?: AzureCommunicationCallAdapterOptions & TeamsAdapterOptions\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, options);\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 = createHandlers(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 /* @conditional-compile-remove(unsupported-browser) */\n this.allowUnsupportedBrowserVersion.bind(this);\n /* @conditional-compile-remove(video-background-effects) */\n this.blurVideoBackground.bind(this);\n /* @conditional-compile-remove(video-background-effects) */\n this.replaceVideoBackground.bind(this);\n /* @conditional-compile-remove(video-background-effects) */\n this.stopVideoBackgroundEffect.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): CallTypeOf<AgentType> | 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): CallTypeOf<AgentType> {\n const isTeamsMeeting = 'meetingLink' in this.locator;\n /* @conditional-compile-remove(rooms) */\n const isRoomsCall = 'roomId' in this.locator;\n\n /* @conditional-compile-remove(teams-identity-support) */\n if (_isTeamsCallAgent(this.callAgent)) {\n if (!isTeamsMeeting) {\n throw new Error('Locator not supported by TeamsCallAgent');\n }\n\n return this.callAgent.join(this.locator as TeamsMeetingLinkLocator, {\n audioOptions,\n videoOptions\n }) as CallTypeOf<AgentType>;\n }\n if (isTeamsMeeting) {\n return this.callAgent.join(this.locator as TeamsMeetingLinkLocator, {\n audioOptions,\n videoOptions\n }) as CallTypeOf<AgentType>;\n }\n /* @conditional-compile-remove(rooms) */\n if (isRoomsCall) {\n return this.callAgent.join(this.locator as RoomCallLocator, {\n audioOptions,\n videoOptions\n }) as CallTypeOf<AgentType>;\n }\n return this.callAgent.join(this.locator as GroupCallLocator, {\n audioOptions,\n videoOptions\n }) as CallTypeOf<AgentType>;\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 = createHandlers(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 /* @conditional-compile-remove(unsupported-browser) */\n public allowUnsupportedBrowserVersion(): void {\n this.context.setAllowedUnsupportedBrowser();\n this.context.updateClientState(this.callClient.getState());\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n public async blurVideoBackground(backgroundBlurConfig?: BackgroundBlurConfig): Promise<void> {\n await this.handlers.onBlurVideoBackground(backgroundBlurConfig);\n }\n /* @conditional-compile-remove(video-background-effects) */\n public async replaceVideoBackground(backgroundReplacementConfig: BackgroundReplacementConfig): Promise<void> {\n await this.handlers.onReplaceVideoBackground(backgroundReplacementConfig);\n }\n\n /* @conditional-compile-remove(video-background-effects) */\n public async stopVideoBackgroundEffect(): Promise<void> {\n await this.handlers.onRemoveVideoBackgroundEffects();\n }\n\n public startCall(\n participants:\n | string[]\n /* @conditional-compile-remove(PSTN-calls) */\n | CommunicationIdentifier[],\n options?: StartCallOptions\n ): CallTypeOf<AgentType> | 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) as CallTypeOf<AgentType>;\n if (!call) {\n throw new Error('Unable to start call.');\n }\n this.processNewCall(call);\n\n return call;\n }\n\n private processNewCall(call: CallCommon): 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 = createHandlers(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', { joined: added });\n }\n if (removed && removed.length > 0) {\n this.emitter.emit('participantsLeft', { removed: 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?: CallCommon): 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 * Optional parameters to create {@link AzureCommunicationCallAdapter}\n *\n * @beta\n */\nexport type AzureCommunicationCallAdapterOptions = {\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 * 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 /**\n * A phone number in E.164 format procured using Azure Communication Services that will be used to represent callers identity.\n * E.164 numbers are formatted as [+] [country code] [phone number including area code]. For example, +14255550123 for a US phone number.\n */\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 * Optional parameters to create {@link AzureCommunicationCallAdapter}\n *\n * @beta\n */\nexport type TeamsAdapterOptions = {\n /**\n * Use this to fetch profile information which will override data in {@link CallAdapterState} like display name\n * The onFetchProfile is fetch-and-forget one time action for each user, once a user profile is updated, the value will be cached\n * and would not be updated again within the lifecycle of adapter.\n */\n onFetchProfile?: OnFetchProfileCallback;\n};\n\n/**\n * Arguments for creating the Azure Communication Services implementation of {@link TeamsCallAdapter}.\n *\n * @beta\n */\nexport type TeamsCallAdapterArgs = {\n userId: MicrosoftTeamsUserIdentifier;\n credential: CommunicationTokenCredential;\n locator: TeamsMeetingLinkLocator;\n /**\n * Optional parameters for the {@link TeamsCallAdapter} created\n */\n options?: TeamsAdapterOptions;\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 if (!isValidIdentifier(userId)) {\n throw new Error('Invalid identifier. Please provide valid identifier object.');\n }\n\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/* @conditional-compile-remove(teams-identity-support) */\n/**\n * @beta\n */\nexport const createTeamsCallAdapter = async ({\n userId,\n credential,\n locator,\n options\n}: TeamsCallAdapterArgs): Promise<TeamsCallAdapter> => {\n const callClient = createStatefulCallClient({\n userId\n });\n const callAgent = await callClient.createTeamsCallAgent(credential, {\n undefined\n });\n const adapter = createTeamsCallAdapterFromClient(callClient, callAgent, locator, options);\n return adapter;\n};\n\ntype PartialArgsType<Adapter> = Adapter extends CallAdapter\n ? Partial<AzureCommunicationCallAdapterArgs>\n : Partial<TeamsCallAdapterArgs>;\n\ntype AdapterOf<AdapterKind extends 'AzureCommunication' | 'Teams'> = AdapterKind extends 'AzureCommunication'\n ? CallAdapter\n : never | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallAdapter;\n\n/**\n * @private\n */\nconst useAzureCommunicationCallAdapterGeneric = <\n AdapterKind extends 'AzureCommunication' | 'Teams',\n Adapter extends AdapterOf<AdapterKind>\n>(\n args: PartialArgsType<Adapter>,\n afterCreate?: (adapter: Adapter) => Promise<Adapter>,\n beforeDispose?: (adapter: Adapter) => Promise<void>,\n adapterKind: AdapterKind = 'AzureCommunication' as AdapterKind\n): Adapter | undefined => {\n const { credential, locator, userId } = args;\n const displayName = 'displayName' in args ? args.displayName : undefined;\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = 'alternateCallerId' in args ? args.alternateCallerId : undefined;\n /* @conditional-compile-remove(rooms) */\n const options = 'options' in args ? args.options : undefined;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<Adapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<Adapter | undefined>(undefined);\n\n const afterCreateRef = useRef<((adapter: Adapter) => Promise<Adapter>) | undefined>(undefined);\n const beforeDisposeRef = useRef<((adapter: Adapter) => 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 || !locator || !userId) {\n return;\n }\n\n if (adapterKind === 'AzureCommunication' && !displayName) {\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: Adapter | undefined = undefined;\n if (adapterKind === 'AzureCommunication') {\n // This is just the type check to ensure that displayName is defined.\n if (!displayName) {\n throw new Error('Unreachable code, displayName already checked above.');\n }\n // This is just the type check to ensure that roleHint is defined.\n /* @conditional-compile-remove(rooms) */\n if (options && !('roleHint' in options)) {\n throw new Error('Unreachable code, provided a options without roleHint.');\n }\n newAdapter = (await createAzureCommunicationCallAdapter({\n credential,\n displayName: displayName,\n locator,\n userId: userId as CommunicationUserIdentifier,\n /* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,\n /* @conditional-compile-remove(rooms) */ options\n })) as Adapter;\n } else if (adapterKind === 'Teams') {\n // This is just the type check to ensure that roleHint is defined.\n /* @conditional-compile-remove(teams-identity-support)) */\n if (options && !('onFetchProfile' in options)) {\n throw new Error('Unreachable code, provided a options without roleHint.');\n }\n /* @conditional-compile-remove(teams-identity-support) */\n newAdapter = (await createTeamsCallAdapter({\n credential,\n locator: locator as TeamsMeetingLinkLocator,\n userId: userId as MicrosoftTeamsUserIdentifier,\n options\n })) as Adapter;\n } else {\n throw new Error('Unreachable code, unknown adapterKind');\n }\n\n if (!newAdapter) {\n throw Error('Unreachable code! Get undefined adapter');\n }\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 beforeDisposeRef,\n credential,\n locator,\n adapterKind,\n userId,\n displayName,\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId,\n /* @conditional-compile-remove(rooms) */\n /* @conditional-compile-remove(teams-identity-support) */\n 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 * 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 return useAzureCommunicationCallAdapterGeneric(args, afterCreate, beforeDispose, 'AzureCommunication');\n};\n\n/* @conditional-compile-remove(teams-identity-support) */\n/**\n * A custom React hook to simplify the creation of {@link TeamsCallAdapter}.\n *\n * Similar to {@link createTeamsAzureCommunicationCallAdapter}, 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 * @beta\n */\nexport const useTeamsCallAdapter = (\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<TeamsCallAdapterArgs>,\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: TeamsCallAdapter) => Promise<TeamsCallAdapter>,\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: TeamsCallAdapter) => Promise<void>\n): TeamsCallAdapter | undefined => {\n return useAzureCommunicationCallAdapterGeneric(args, afterCreate, beforeDispose, 'Teams');\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?: AzureCommunicationCallAdapterOptions\n) => Promise<CallAdapter> = async (\n callClient: StatefulCallClient,\n callAgent: CallAgent,\n locator: CallAdapterLocator,\n options?\n): Promise<CallAdapter> => {\n const deviceManager = (await callClient.getDeviceManager()) as StatefulDeviceManager;\n /* @conditional-compile-remove(unsupported-browser) */\n await callClient.feature(Features.DebugInfo).getEnvironmentInfo();\n return new AzureCommunicationCallAdapter(\n callClient,\n locator,\n callAgent,\n deviceManager,\n /* @conditional-compile-remove(rooms) */ options\n );\n};\n\n/* @conditional-compile-remove(teams-identity-support) */\n/**\n * Create a {@link TeamsCallAdapter} 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 * @beta\n */\nexport const createTeamsCallAdapterFromClient = async (\n callClient: StatefulCallClient,\n callAgent: TeamsCallAgent,\n locator: CallAdapterLocator,\n options?: TeamsAdapterOptions\n): Promise<TeamsCallAdapter> => {\n const deviceManager = (await callClient.getDeviceManager()) as StatefulDeviceManager;\n /* @conditional-compile-remove(unsupported-browser) */\n await callClient.feature(Features.DebugInfo).getEnvironmentInfo();\n return new AzureCommunicationCallAdapter(callClient, locator, callAgent, deviceManager, options);\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,5 +1,6 @@
1
1
  import { CallState, DeviceManagerState } from "../../../../../calling-stateful-client/src";
2
2
  import { TeamsCall } from '@azure/communication-calling';
3
+ import { BackgroundBlurConfig, BackgroundReplacementConfig } from '@azure/communication-calling-effects';
3
4
  import { EnvironmentInfo } from '@azure/communication-calling';
4
5
  import type { AudioDeviceInfo, VideoDeviceInfo, Call, PermissionConstraints, RemoteParticipant, StartCallOptions, MediaDiagnosticChangedEventArgs, NetworkDiagnosticChangedEventArgs, PropertyChangedEvent } from '@azure/communication-calling';
5
6
  import { CreateVideoStreamViewResult, VideoStreamOptions } from "../../../../../react-components/src";
@@ -64,6 +65,10 @@ export declare type CallAdapterClientState = {
64
65
  * control bar with the CallComposite.
65
66
  */
66
67
  cameraStatus?: 'On' | 'Off';
68
+ /**
69
+ * Default set of background images for background replacement effect.
70
+ */
71
+ videoBackgroundImages?: VideoBackgroundImage[];
67
72
  };
68
73
  /**
69
74
  * {@link CommonCallAdapter} state.
@@ -166,6 +171,25 @@ export declare type NetworkDiagnosticChangedEvent = NetworkDiagnosticChangedEven
166
171
  * @public
167
172
  */
168
173
  export declare type DiagnosticChangedEventListner = (event: MediaDiagnosticChangedEvent | NetworkDiagnosticChangedEvent) => void;
174
+ /**
175
+ * Contains the attibutes of a background image like url, name etc.
176
+ *
177
+ * @beta
178
+ */
179
+ export interface VideoBackgroundImage {
180
+ /**
181
+ * key for unique identification of the custom background
182
+ */
183
+ key: string;
184
+ /**
185
+ * URL of the uploaded background image.
186
+ */
187
+ url: string;
188
+ /**
189
+ * Image name to be displayed.
190
+ */
191
+ tooltipText?: string;
192
+ }
169
193
  /**
170
194
  * Functionality for managing the current call.
171
195
  *
@@ -287,6 +311,24 @@ export interface CallAdapterCallOperations {
287
311
  * Continues into a call when the browser version is not supported.
288
312
  */
289
313
  allowUnsupportedBrowserVersion(): void;
314
+ /**
315
+ * Start the blur video background effect.
316
+ *
317
+ * @beta
318
+ */
319
+ blurVideoBackground(backgroundBlurConfig?: BackgroundBlurConfig): Promise<void>;
320
+ /**
321
+ * Start the video background replacement effect.
322
+ *
323
+ * @beta
324
+ */
325
+ replaceVideoBackground(backgroundReplacementConfig: BackgroundReplacementConfig): Promise<void>;
326
+ /**
327
+ * Stop the video background effect.
328
+ *
329
+ * @beta
330
+ */
331
+ stopVideoBackgroundEffect(): Promise<void>;
290
332
  }
291
333
  /**
292
334
  * Functionality for managing devices within a call.
@@ -1 +1 @@
1
- {"version":3,"file":"CallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/CallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAmDlC;;;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';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCall } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\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\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 CommonCallAdapter} state for pure UI purposes.\n *\n * @public\n */\nexport type CallAdapterUiState = {\n isLocalPreviewMicrophoneEnabled: boolean;\n page: CallCompositePage;\n /* @conditional-compile-remove(unsupported-browser) */\n unsupportedBrowserVersionsAllowed?: boolean;\n};\n\n/**\n * {@link CommonCallAdapter} 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(unsupported-browser) */\n /**\n * Environment information about system the adapter is made on\n */\n environmentInfo?: EnvironmentInfo;\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 * State to track whether the local participant's camera is on. To be used when creating a custom\n * control bar with the CallComposite.\n */\n cameraStatus?: 'On' | 'Off';\n};\n\n/**\n * {@link CommonCallAdapter} 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 CallAdapterCallOperations {\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 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 /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Continues into a call when the browser version is not supported.\n */\n allowUnsupportedBrowserVersion(): 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// This type remains for non-breaking change reason\n/**\n * Functionality for managing the current call or start a new call\n * @deprecated CallAdapter interface will be flatten, consider using CallAdapter directly\n * @public\n */\nexport interface CallAdapterCallManagement extends CallAdapterCallOperations {\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 * 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\n// TODO: Flatten the adapter structure\n/**\n * {@link CallComposite} Adapter interface.\n *\n * @public\n */\nexport interface CommonCallAdapter\n extends AdapterState<CallAdapterState>,\n Disposable,\n CallAdapterCallOperations,\n CallAdapterDeviceManagement,\n CallAdapterSubscribers {\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): 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): void;\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): void;\n}\n\n/**\n * An Adapter interface specific for Azure Communication identity which extends {@link CommonCallAdapter}.\n *\n * @public\n */\nexport interface CallAdapter extends CommonCallAdapter {\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 * 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\n/* @conditional-compile-remove(teams-identity-support) */\n/**\n * An Adapter interface specific for Teams identity which extends {@link CommonCallAdapter}.\n *\n * @beta\n */\nexport interface TeamsCallAdapter extends CommonCallAdapter {\n /**\n * Join the call with microphone initially on/off.\n *\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @beta\n */\n joinCall(microphoneOn?: boolean): TeamsCall | undefined;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @beta\n */\n startCall(participants: string[], options?: StartCallOptions): TeamsCall | 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): TeamsCall | undefined;\n}\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;AAqDlC;;;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';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCall } from '@azure/communication-calling';\n/* @conditional-compile-remove(video-background-effects) */\nimport { BackgroundBlurConfig, BackgroundReplacementConfig } from '@azure/communication-calling-effects';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\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\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 CommonCallAdapter} state for pure UI purposes.\n *\n * @public\n */\nexport type CallAdapterUiState = {\n isLocalPreviewMicrophoneEnabled: boolean;\n page: CallCompositePage;\n /* @conditional-compile-remove(unsupported-browser) */\n unsupportedBrowserVersionsAllowed?: boolean;\n};\n\n/**\n * {@link CommonCallAdapter} 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(unsupported-browser) */\n /**\n * Environment information about system the adapter is made on\n */\n environmentInfo?: EnvironmentInfo;\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 * State to track whether the local participant's camera is on. To be used when creating a custom\n * control bar with the CallComposite.\n */\n cameraStatus?: 'On' | 'Off';\n /* @conditional-compile-remove(video-background-effects) */\n /**\n * Default set of background images for background replacement effect.\n */\n videoBackgroundImages?: VideoBackgroundImage[];\n};\n\n/**\n * {@link CommonCallAdapter} 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/* @conditional-compile-remove(video-background-effects) */\n/**\n * Contains the attibutes of a background image like url, name etc.\n *\n * @beta\n */\nexport interface VideoBackgroundImage {\n /**\n * key for unique identification of the custom background\n */\n key: string;\n /**\n * URL of the uploaded background image.\n */\n url: string;\n /**\n * Image name to be displayed.\n */\n tooltipText?: string;\n}\n\n/**\n * Functionality for managing the current call.\n *\n * @public\n */\nexport interface CallAdapterCallOperations {\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 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 /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Continues into a call when the browser version is not supported.\n */\n allowUnsupportedBrowserVersion(): void;\n /* @conditional-compile-remove(video-background-effects) */\n /**\n * Start the blur video background effect.\n *\n * @beta\n */\n blurVideoBackground(backgroundBlurConfig?: BackgroundBlurConfig): Promise<void>;\n /* @conditional-compile-remove(video-background-effects) */\n /**\n * Start the video background replacement effect.\n *\n * @beta\n */\n replaceVideoBackground(backgroundReplacementConfig: BackgroundReplacementConfig): Promise<void>;\n /* @conditional-compile-remove(video-background-effects) */\n /**\n * Stop the video background effect.\n *\n * @beta\n */\n stopVideoBackgroundEffect(): 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// This type remains for non-breaking change reason\n/**\n * Functionality for managing the current call or start a new call\n * @deprecated CallAdapter interface will be flatten, consider using CallAdapter directly\n * @public\n */\nexport interface CallAdapterCallManagement extends CallAdapterCallOperations {\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 * 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\n// TODO: Flatten the adapter structure\n/**\n * {@link CallComposite} Adapter interface.\n *\n * @public\n */\nexport interface CommonCallAdapter\n extends AdapterState<CallAdapterState>,\n Disposable,\n CallAdapterCallOperations,\n CallAdapterDeviceManagement,\n CallAdapterSubscribers {\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): 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): void;\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): void;\n}\n\n/**\n * An Adapter interface specific for Azure Communication identity which extends {@link CommonCallAdapter}.\n *\n * @public\n */\nexport interface CallAdapter extends CommonCallAdapter {\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 * 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\n/* @conditional-compile-remove(teams-identity-support) */\n/**\n * An Adapter interface specific for Teams identity which extends {@link CommonCallAdapter}.\n *\n * @beta\n */\nexport interface TeamsCallAdapter extends CommonCallAdapter {\n /**\n * Join the call with microphone initially on/off.\n *\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @beta\n */\n joinCall(microphoneOn?: boolean): TeamsCall | undefined;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @beta\n */\n startCall(participants: string[], options?: StartCallOptions): TeamsCall | 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): TeamsCall | undefined;\n}\n\"../../../../../calling-stateful-client/src\"\"../../../../../react-components/src\""]}