@stream-io/video-react-sdk 0.0.1-alpha.100

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 (454) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/LICENSE +219 -0
  3. package/README.md +5 -0
  4. package/dist/css/styles.css +2244 -0
  5. package/dist/css/styles.css.map +1 -0
  6. package/dist/index.d.ts +6 -0
  7. package/dist/index.js +15 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/src/components/Avatar/Avatar.d.ts +14 -0
  10. package/dist/src/components/Avatar/Avatar.js +11 -0
  11. package/dist/src/components/Avatar/Avatar.js.map +1 -0
  12. package/dist/src/components/Avatar/index.d.ts +1 -0
  13. package/dist/src/components/Avatar/index.js +2 -0
  14. package/dist/src/components/Avatar/index.js.map +1 -0
  15. package/dist/src/components/Button/CompositeButton.d.ts +16 -0
  16. package/dist/src/components/Button/CompositeButton.js +13 -0
  17. package/dist/src/components/Button/CompositeButton.js.map +1 -0
  18. package/dist/src/components/Button/CopyToClipboardButton.d.ts +27 -0
  19. package/dist/src/components/Button/CopyToClipboardButton.js +54 -0
  20. package/dist/src/components/Button/CopyToClipboardButton.js.map +1 -0
  21. package/dist/src/components/Button/IconButton.d.ts +7 -0
  22. package/dist/src/components/Button/IconButton.js +26 -0
  23. package/dist/src/components/Button/IconButton.js.map +1 -0
  24. package/dist/src/components/Button/TextButton.d.ts +2 -0
  25. package/dist/src/components/Button/TextButton.js +17 -0
  26. package/dist/src/components/Button/TextButton.js.map +1 -0
  27. package/dist/src/components/Button/index.d.ts +4 -0
  28. package/dist/src/components/Button/index.js +5 -0
  29. package/dist/src/components/Button/index.js.map +1 -0
  30. package/dist/src/components/CallControls/AcceptCallButton.d.ts +7 -0
  31. package/dist/src/components/CallControls/AcceptCallButton.js +27 -0
  32. package/dist/src/components/CallControls/AcceptCallButton.js.map +1 -0
  33. package/dist/src/components/CallControls/CallControls.d.ts +5 -0
  34. package/dist/src/components/CallControls/CallControls.js +5 -0
  35. package/dist/src/components/CallControls/CallControls.js.map +1 -0
  36. package/dist/src/components/CallControls/CallStatsButton.d.ts +2 -0
  37. package/dist/src/components/CallControls/CallStatsButton.js +8 -0
  38. package/dist/src/components/CallControls/CallStatsButton.js.map +1 -0
  39. package/dist/src/components/CallControls/CancelCallButton.d.ts +7 -0
  40. package/dist/src/components/CallControls/CancelCallButton.js +27 -0
  41. package/dist/src/components/CallControls/CancelCallButton.js.map +1 -0
  42. package/dist/src/components/CallControls/ReactionsButton.d.ts +11 -0
  43. package/dist/src/components/CallControls/ReactionsButton.js +32 -0
  44. package/dist/src/components/CallControls/ReactionsButton.js.map +1 -0
  45. package/dist/src/components/CallControls/RecordCallButton.d.ts +5 -0
  46. package/dist/src/components/CallControls/RecordCallButton.js +55 -0
  47. package/dist/src/components/CallControls/RecordCallButton.js.map +1 -0
  48. package/dist/src/components/CallControls/ScreenShareButton.d.ts +5 -0
  49. package/dist/src/components/CallControls/ScreenShareButton.js +54 -0
  50. package/dist/src/components/CallControls/ScreenShareButton.js.map +1 -0
  51. package/dist/src/components/CallControls/ToggleAudioButton.d.ts +9 -0
  52. package/dist/src/components/CallControls/ToggleAudioButton.js +73 -0
  53. package/dist/src/components/CallControls/ToggleAudioButton.js.map +1 -0
  54. package/dist/src/components/CallControls/ToggleAudioOutputButton.d.ts +5 -0
  55. package/dist/src/components/CallControls/ToggleAudioOutputButton.js +9 -0
  56. package/dist/src/components/CallControls/ToggleAudioOutputButton.js.map +1 -0
  57. package/dist/src/components/CallControls/ToggleVideoButton.d.ts +10 -0
  58. package/dist/src/components/CallControls/ToggleVideoButton.js +70 -0
  59. package/dist/src/components/CallControls/ToggleVideoButton.js.map +1 -0
  60. package/dist/src/components/CallControls/index.d.ts +10 -0
  61. package/dist/src/components/CallControls/index.js +11 -0
  62. package/dist/src/components/CallControls/index.js.map +1 -0
  63. package/dist/src/components/CallParticipantsList/BlockedUserListing.d.ts +4 -0
  64. package/dist/src/components/CallParticipantsList/BlockedUserListing.js +18 -0
  65. package/dist/src/components/CallParticipantsList/BlockedUserListing.js.map +1 -0
  66. package/dist/src/components/CallParticipantsList/CallParticipantListHeader.d.ts +6 -0
  67. package/dist/src/components/CallParticipantsList/CallParticipantListHeader.js +7 -0
  68. package/dist/src/components/CallParticipantsList/CallParticipantListHeader.js.map +1 -0
  69. package/dist/src/components/CallParticipantsList/CallParticipantListing.d.ts +8 -0
  70. package/dist/src/components/CallParticipantsList/CallParticipantListing.js +4 -0
  71. package/dist/src/components/CallParticipantsList/CallParticipantListing.js.map +1 -0
  72. package/dist/src/components/CallParticipantsList/CallParticipantListingItem.d.ts +16 -0
  73. package/dist/src/components/CallParticipantsList/CallParticipantListingItem.js +85 -0
  74. package/dist/src/components/CallParticipantsList/CallParticipantListingItem.js.map +1 -0
  75. package/dist/src/components/CallParticipantsList/CallParticipantsList.d.ts +15 -0
  76. package/dist/src/components/CallParticipantsList/CallParticipantsList.js +81 -0
  77. package/dist/src/components/CallParticipantsList/CallParticipantsList.js.map +1 -0
  78. package/dist/src/components/CallParticipantsList/EmptyParticipantSearchList.d.ts +2 -0
  79. package/dist/src/components/CallParticipantsList/EmptyParticipantSearchList.js +5 -0
  80. package/dist/src/components/CallParticipantsList/EmptyParticipantSearchList.js.map +1 -0
  81. package/dist/src/components/CallParticipantsList/index.d.ts +3 -0
  82. package/dist/src/components/CallParticipantsList/index.js +4 -0
  83. package/dist/src/components/CallParticipantsList/index.js.map +1 -0
  84. package/dist/src/components/CallRecordingList/CallRecordingList.d.ts +20 -0
  85. package/dist/src/components/CallRecordingList/CallRecordingList.js +9 -0
  86. package/dist/src/components/CallRecordingList/CallRecordingList.js.map +1 -0
  87. package/dist/src/components/CallRecordingList/CallRecordingListHeader.d.ts +7 -0
  88. package/dist/src/components/CallRecordingList/CallRecordingListHeader.js +8 -0
  89. package/dist/src/components/CallRecordingList/CallRecordingListHeader.js.map +1 -0
  90. package/dist/src/components/CallRecordingList/CallRecordingListItem.d.ts +7 -0
  91. package/dist/src/components/CallRecordingList/CallRecordingListItem.js +11 -0
  92. package/dist/src/components/CallRecordingList/CallRecordingListItem.js.map +1 -0
  93. package/dist/src/components/CallRecordingList/EmptyCallRecordingListing.d.ts +2 -0
  94. package/dist/src/components/CallRecordingList/EmptyCallRecordingListing.js +5 -0
  95. package/dist/src/components/CallRecordingList/EmptyCallRecordingListing.js.map +1 -0
  96. package/dist/src/components/CallRecordingList/LoadingCallRecordingListing.d.ts +7 -0
  97. package/dist/src/components/CallRecordingList/LoadingCallRecordingListing.js +7 -0
  98. package/dist/src/components/CallRecordingList/LoadingCallRecordingListing.js.map +1 -0
  99. package/dist/src/components/CallRecordingList/index.d.ts +5 -0
  100. package/dist/src/components/CallRecordingList/index.js +6 -0
  101. package/dist/src/components/CallRecordingList/index.js.map +1 -0
  102. package/dist/src/components/CallStats/CallStats.d.ts +6 -0
  103. package/dist/src/components/CallStats/CallStats.js +69 -0
  104. package/dist/src/components/CallStats/CallStats.js.map +1 -0
  105. package/dist/src/components/CallStats/CallStatsLatencyChart.d.ts +7 -0
  106. package/dist/src/components/CallStats/CallStatsLatencyChart.js +39 -0
  107. package/dist/src/components/CallStats/CallStatsLatencyChart.js.map +1 -0
  108. package/dist/src/components/CallStats/index.d.ts +2 -0
  109. package/dist/src/components/CallStats/index.js +3 -0
  110. package/dist/src/components/CallStats/index.js.map +1 -0
  111. package/dist/src/components/Debug/DebugParticipantPublishQuality.d.ts +6 -0
  112. package/dist/src/components/Debug/DebugParticipantPublishQuality.js +46 -0
  113. package/dist/src/components/Debug/DebugParticipantPublishQuality.js.map +1 -0
  114. package/dist/src/components/Debug/DebugStatsView.d.ts +7 -0
  115. package/dist/src/components/Debug/DebugStatsView.js +51 -0
  116. package/dist/src/components/Debug/DebugStatsView.js.map +1 -0
  117. package/dist/src/components/Debug/useIsDebugMode.d.ts +5 -0
  118. package/dist/src/components/Debug/useIsDebugMode.js +18 -0
  119. package/dist/src/components/Debug/useIsDebugMode.js.map +1 -0
  120. package/dist/src/components/DeviceSettings/DeviceSelector.d.ts +7 -0
  121. package/dist/src/components/DeviceSettings/DeviceSelector.js +26 -0
  122. package/dist/src/components/DeviceSettings/DeviceSelector.js.map +1 -0
  123. package/dist/src/components/DeviceSettings/DeviceSelectorAudio.d.ts +9 -0
  124. package/dist/src/components/DeviceSettings/DeviceSelectorAudio.js +20 -0
  125. package/dist/src/components/DeviceSettings/DeviceSelectorAudio.js.map +1 -0
  126. package/dist/src/components/DeviceSettings/DeviceSelectorVideo.d.ts +5 -0
  127. package/dist/src/components/DeviceSettings/DeviceSelectorVideo.js +11 -0
  128. package/dist/src/components/DeviceSettings/DeviceSelectorVideo.js.map +1 -0
  129. package/dist/src/components/DeviceSettings/DeviceSettings.d.ts +2 -0
  130. package/dist/src/components/DeviceSettings/DeviceSettings.js +15 -0
  131. package/dist/src/components/DeviceSettings/DeviceSettings.js.map +1 -0
  132. package/dist/src/components/DeviceSettings/index.d.ts +4 -0
  133. package/dist/src/components/DeviceSettings/index.js +5 -0
  134. package/dist/src/components/DeviceSettings/index.js.map +1 -0
  135. package/dist/src/components/Icon/Icon.d.ts +5 -0
  136. package/dist/src/components/Icon/Icon.js +4 -0
  137. package/dist/src/components/Icon/Icon.js.map +1 -0
  138. package/dist/src/components/Icon/index.d.ts +1 -0
  139. package/dist/src/components/Icon/index.js +2 -0
  140. package/dist/src/components/Icon/index.js.map +1 -0
  141. package/dist/src/components/LoadingIndicator/LoadingIndicator.d.ts +11 -0
  142. package/dist/src/components/LoadingIndicator/LoadingIndicator.js +6 -0
  143. package/dist/src/components/LoadingIndicator/LoadingIndicator.js.map +1 -0
  144. package/dist/src/components/LoadingIndicator/index.d.ts +1 -0
  145. package/dist/src/components/LoadingIndicator/index.js +2 -0
  146. package/dist/src/components/LoadingIndicator/index.js.map +1 -0
  147. package/dist/src/components/Menu/GenericMenu.d.ts +3 -0
  148. package/dist/src/components/Menu/GenericMenu.js +20 -0
  149. package/dist/src/components/Menu/GenericMenu.js.map +1 -0
  150. package/dist/src/components/Menu/MenuToggle.d.ts +12 -0
  151. package/dist/src/components/Menu/MenuToggle.js +40 -0
  152. package/dist/src/components/Menu/MenuToggle.js.map +1 -0
  153. package/dist/src/components/Menu/index.d.ts +2 -0
  154. package/dist/src/components/Menu/index.js +3 -0
  155. package/dist/src/components/Menu/index.js.map +1 -0
  156. package/dist/src/components/Notification/Notification.d.ts +11 -0
  157. package/dist/src/components/Notification/Notification.js +25 -0
  158. package/dist/src/components/Notification/Notification.js.map +1 -0
  159. package/dist/src/components/Notification/PermissionNotification.d.ts +33 -0
  160. package/dist/src/components/Notification/PermissionNotification.js +26 -0
  161. package/dist/src/components/Notification/PermissionNotification.js.map +1 -0
  162. package/dist/src/components/Notification/SpeakingWhileMutedNotification.d.ts +3 -0
  163. package/dist/src/components/Notification/SpeakingWhileMutedNotification.js +47 -0
  164. package/dist/src/components/Notification/SpeakingWhileMutedNotification.js.map +1 -0
  165. package/dist/src/components/Notification/index.d.ts +3 -0
  166. package/dist/src/components/Notification/index.js +4 -0
  167. package/dist/src/components/Notification/index.js.map +1 -0
  168. package/dist/src/components/PendingCallPanel/PendingCallControls.d.ts +2 -0
  169. package/dist/src/components/PendingCallPanel/PendingCallControls.js +13 -0
  170. package/dist/src/components/PendingCallPanel/PendingCallControls.js.map +1 -0
  171. package/dist/src/components/PendingCallPanel/PendingCallPanel.d.ts +14 -0
  172. package/dist/src/components/PendingCallPanel/PendingCallPanel.js +43 -0
  173. package/dist/src/components/PendingCallPanel/PendingCallPanel.js.map +1 -0
  174. package/dist/src/components/PendingCallPanel/index.d.ts +2 -0
  175. package/dist/src/components/PendingCallPanel/index.js +3 -0
  176. package/dist/src/components/PendingCallPanel/index.js.map +1 -0
  177. package/dist/src/components/Permissions/PermissionRequests.d.ts +8 -0
  178. package/dist/src/components/Permissions/PermissionRequests.js +103 -0
  179. package/dist/src/components/Permissions/PermissionRequests.js.map +1 -0
  180. package/dist/src/components/Permissions/index.d.ts +1 -0
  181. package/dist/src/components/Permissions/index.js +2 -0
  182. package/dist/src/components/Permissions/index.js.map +1 -0
  183. package/dist/src/components/Reaction/Reaction.d.ts +10 -0
  184. package/dist/src/components/Reaction/Reaction.js +28 -0
  185. package/dist/src/components/Reaction/Reaction.js.map +1 -0
  186. package/dist/src/components/Reaction/index.d.ts +1 -0
  187. package/dist/src/components/Reaction/index.js +2 -0
  188. package/dist/src/components/Reaction/index.js.map +1 -0
  189. package/dist/src/components/Search/SearchInput.d.ts +14 -0
  190. package/dist/src/components/Search/SearchInput.js +34 -0
  191. package/dist/src/components/Search/SearchInput.js.map +1 -0
  192. package/dist/src/components/Search/SearchResults.d.ts +14 -0
  193. package/dist/src/components/Search/SearchResults.js +12 -0
  194. package/dist/src/components/Search/SearchResults.js.map +1 -0
  195. package/dist/src/components/Search/hooks/index.d.ts +1 -0
  196. package/dist/src/components/Search/hooks/index.js +2 -0
  197. package/dist/src/components/Search/hooks/index.js.map +1 -0
  198. package/dist/src/components/Search/hooks/useSearch.d.ts +15 -0
  199. package/dist/src/components/Search/hooks/useSearch.js +39 -0
  200. package/dist/src/components/Search/hooks/useSearch.js.map +1 -0
  201. package/dist/src/components/Search/index.d.ts +2 -0
  202. package/dist/src/components/Search/index.js +3 -0
  203. package/dist/src/components/Search/index.js.map +1 -0
  204. package/dist/src/components/StreamCall/CallParticipantsScreenView.d.ts +5 -0
  205. package/dist/src/components/StreamCall/CallParticipantsScreenView.js +34 -0
  206. package/dist/src/components/StreamCall/CallParticipantsScreenView.js.map +1 -0
  207. package/dist/src/components/StreamCall/CallParticipantsView.d.ts +5 -0
  208. package/dist/src/components/StreamCall/CallParticipantsView.js +10 -0
  209. package/dist/src/components/StreamCall/CallParticipantsView.js.map +1 -0
  210. package/dist/src/components/StreamCall/Stage.d.ts +8 -0
  211. package/dist/src/components/StreamCall/Stage.js +13 -0
  212. package/dist/src/components/StreamCall/Stage.js.map +1 -0
  213. package/dist/src/components/StreamCall/index.d.ts +3 -0
  214. package/dist/src/components/StreamCall/index.js +4 -0
  215. package/dist/src/components/StreamCall/index.js.map +1 -0
  216. package/dist/src/components/StreamTheme/StreamTheme.d.ts +5 -0
  217. package/dist/src/components/StreamTheme/StreamTheme.js +18 -0
  218. package/dist/src/components/StreamTheme/StreamTheme.js.map +1 -0
  219. package/dist/src/components/StreamTheme/index.d.ts +1 -0
  220. package/dist/src/components/StreamTheme/index.js +2 -0
  221. package/dist/src/components/StreamTheme/index.js.map +1 -0
  222. package/dist/src/components/Tooltip/Tooltip.d.ts +15 -0
  223. package/dist/src/components/Tooltip/Tooltip.js +22 -0
  224. package/dist/src/components/Tooltip/Tooltip.js.map +1 -0
  225. package/dist/src/components/Tooltip/WithTooltip.d.ts +5 -0
  226. package/dist/src/components/Tooltip/WithTooltip.js +23 -0
  227. package/dist/src/components/Tooltip/WithTooltip.js.map +1 -0
  228. package/dist/src/components/Tooltip/hooks/index.d.ts +1 -0
  229. package/dist/src/components/Tooltip/hooks/index.js +2 -0
  230. package/dist/src/components/Tooltip/hooks/index.js.map +1 -0
  231. package/dist/src/components/Tooltip/hooks/useEnterLeaveHandlers.d.ts +6 -0
  232. package/dist/src/components/Tooltip/hooks/useEnterLeaveHandlers.js +14 -0
  233. package/dist/src/components/Tooltip/hooks/useEnterLeaveHandlers.js.map +1 -0
  234. package/dist/src/components/Tooltip/index.d.ts +2 -0
  235. package/dist/src/components/Tooltip/index.js +3 -0
  236. package/dist/src/components/Tooltip/index.js.map +1 -0
  237. package/dist/src/components/Video/VideoPreview.d.ts +28 -0
  238. package/dist/src/components/Video/VideoPreview.js +75 -0
  239. package/dist/src/components/Video/VideoPreview.js.map +1 -0
  240. package/dist/src/components/Video/index.d.ts +4 -0
  241. package/dist/src/components/Video/index.js +5 -0
  242. package/dist/src/components/Video/index.js.map +1 -0
  243. package/dist/src/components/index.d.ts +16 -0
  244. package/dist/src/components/index.js +17 -0
  245. package/dist/src/components/index.js.map +1 -0
  246. package/dist/src/core/components/Audio/Audio.d.ts +6 -0
  247. package/dist/src/core/components/Audio/Audio.js +39 -0
  248. package/dist/src/core/components/Audio/Audio.js.map +1 -0
  249. package/dist/src/core/components/Audio/index.d.ts +1 -0
  250. package/dist/src/core/components/Audio/index.js +2 -0
  251. package/dist/src/core/components/Audio/index.js.map +1 -0
  252. package/dist/src/core/components/CallLayout/PaginatedGridLayout.d.ts +17 -0
  253. package/dist/src/core/components/CallLayout/PaginatedGridLayout.js +38 -0
  254. package/dist/src/core/components/CallLayout/PaginatedGridLayout.js.map +1 -0
  255. package/dist/src/core/components/CallLayout/SpeakerLayout.d.ts +8 -0
  256. package/dist/src/core/components/CallLayout/SpeakerLayout.js +74 -0
  257. package/dist/src/core/components/CallLayout/SpeakerLayout.js.map +1 -0
  258. package/dist/src/core/components/CallLayout/index.d.ts +2 -0
  259. package/dist/src/core/components/CallLayout/index.js +3 -0
  260. package/dist/src/core/components/CallLayout/index.js.map +1 -0
  261. package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.d.ts +18 -0
  262. package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.js +36 -0
  263. package/dist/src/core/components/ParticipantView/DefaultParticipantViewUI.js.map +1 -0
  264. package/dist/src/core/components/ParticipantView/ParticipantView.d.ts +79 -0
  265. package/dist/src/core/components/ParticipantView/ParticipantView.js +33 -0
  266. package/dist/src/core/components/ParticipantView/ParticipantView.js.map +1 -0
  267. package/dist/src/core/components/ParticipantView/index.d.ts +2 -0
  268. package/dist/src/core/components/ParticipantView/index.js +3 -0
  269. package/dist/src/core/components/ParticipantView/index.js.map +1 -0
  270. package/dist/src/core/components/StreamCall/StreamCall.d.ts +73 -0
  271. package/dist/src/core/components/StreamCall/StreamCall.js +60 -0
  272. package/dist/src/core/components/StreamCall/StreamCall.js.map +1 -0
  273. package/dist/src/core/components/StreamCall/index.d.ts +1 -0
  274. package/dist/src/core/components/StreamCall/index.js +2 -0
  275. package/dist/src/core/components/StreamCall/index.js.map +1 -0
  276. package/dist/src/core/components/Video/BaseVideo.d.ts +9 -0
  277. package/dist/src/core/components/Video/BaseVideo.js +48 -0
  278. package/dist/src/core/components/Video/BaseVideo.js.map +1 -0
  279. package/dist/src/core/components/Video/DefaultVideoPlaceholder.d.ts +6 -0
  280. package/dist/src/core/components/Video/DefaultVideoPlaceholder.js +9 -0
  281. package/dist/src/core/components/Video/DefaultVideoPlaceholder.js.map +1 -0
  282. package/dist/src/core/components/Video/Video.d.ts +13 -0
  283. package/dist/src/core/components/Video/Video.js +154 -0
  284. package/dist/src/core/components/Video/Video.js.map +1 -0
  285. package/dist/src/core/components/Video/index.d.ts +2 -0
  286. package/dist/src/core/components/Video/index.js +3 -0
  287. package/dist/src/core/components/Video/index.js.map +1 -0
  288. package/dist/src/core/components/index.d.ts +6 -0
  289. package/dist/src/core/components/index.js +6 -0
  290. package/dist/src/core/components/index.js.map +1 -0
  291. package/dist/src/core/contexts/MediaDevicesContext.d.ts +180 -0
  292. package/dist/src/core/contexts/MediaDevicesContext.js +177 -0
  293. package/dist/src/core/contexts/MediaDevicesContext.js.map +1 -0
  294. package/dist/src/core/contexts/index.d.ts +1 -0
  295. package/dist/src/core/contexts/index.js +2 -0
  296. package/dist/src/core/contexts/index.js.map +1 -0
  297. package/dist/src/core/hooks/index.d.ts +4 -0
  298. package/dist/src/core/hooks/index.js +5 -0
  299. package/dist/src/core/hooks/index.js.map +1 -0
  300. package/dist/src/core/hooks/useAudioPublisher.d.ts +12 -0
  301. package/dist/src/core/hooks/useAudioPublisher.js +95 -0
  302. package/dist/src/core/hooks/useAudioPublisher.js.map +1 -0
  303. package/dist/src/core/hooks/useDevices.d.ts +80 -0
  304. package/dist/src/core/hooks/useDevices.js +113 -0
  305. package/dist/src/core/hooks/useDevices.js.map +1 -0
  306. package/dist/src/core/hooks/useTrackElementVisibility.d.ts +6 -0
  307. package/dist/src/core/hooks/useTrackElementVisibility.js +27 -0
  308. package/dist/src/core/hooks/useTrackElementVisibility.js.map +1 -0
  309. package/dist/src/core/hooks/useVideoPublisher.d.ts +12 -0
  310. package/dist/src/core/hooks/useVideoPublisher.js +120 -0
  311. package/dist/src/core/hooks/useVideoPublisher.js.map +1 -0
  312. package/dist/src/core/index.d.ts +3 -0
  313. package/dist/src/core/index.js +4 -0
  314. package/dist/src/core/index.js.map +1 -0
  315. package/dist/src/hooks/index.d.ts +2 -0
  316. package/dist/src/hooks/index.js +3 -0
  317. package/dist/src/hooks/index.js.map +1 -0
  318. package/dist/src/hooks/useFloatingUIPreset.d.ts +9 -0
  319. package/dist/src/hooks/useFloatingUIPreset.js +30 -0
  320. package/dist/src/hooks/useFloatingUIPreset.js.map +1 -0
  321. package/dist/src/hooks/useScrollPosition.d.ts +6 -0
  322. package/dist/src/hooks/useScrollPosition.js +63 -0
  323. package/dist/src/hooks/useScrollPosition.js.map +1 -0
  324. package/dist/src/types/components.d.ts +7 -0
  325. package/dist/src/types/components.js +2 -0
  326. package/dist/src/types/components.js.map +1 -0
  327. package/dist/src/types/index.d.ts +1 -0
  328. package/dist/src/types/index.js +2 -0
  329. package/dist/src/types/index.js.map +1 -0
  330. package/dist/src/utilities/applyElementToRef.d.ts +2 -0
  331. package/dist/src/utilities/applyElementToRef.js +8 -0
  332. package/dist/src/utilities/applyElementToRef.js.map +1 -0
  333. package/dist/src/utilities/chunk.d.ts +1 -0
  334. package/dist/src/utilities/chunk.js +5 -0
  335. package/dist/src/utilities/chunk.js.map +1 -0
  336. package/dist/src/utilities/index.d.ts +3 -0
  337. package/dist/src/utilities/index.js +4 -0
  338. package/dist/src/utilities/index.js.map +1 -0
  339. package/dist/src/utilities/isComponentType.d.ts +2 -0
  340. package/dist/src/utilities/isComponentType.js +7 -0
  341. package/dist/src/utilities/isComponentType.js.map +1 -0
  342. package/index.ts +18 -0
  343. package/package.json +51 -0
  344. package/src/components/Avatar/Avatar.tsx +45 -0
  345. package/src/components/Avatar/index.ts +1 -0
  346. package/src/components/Button/CompositeButton.tsx +50 -0
  347. package/src/components/Button/CopyToClipboardButton.tsx +129 -0
  348. package/src/components/Button/IconButton.tsx +32 -0
  349. package/src/components/Button/TextButton.tsx +12 -0
  350. package/src/components/Button/index.ts +4 -0
  351. package/src/components/CallControls/AcceptCallButton.tsx +36 -0
  352. package/src/components/CallControls/CallControls.tsx +26 -0
  353. package/src/components/CallControls/CallStatsButton.tsx +20 -0
  354. package/src/components/CallControls/CancelCallButton.tsx +36 -0
  355. package/src/components/CallControls/ReactionsButton.tsx +74 -0
  356. package/src/components/CallControls/RecordCallButton.tsx +73 -0
  357. package/src/components/CallControls/ScreenShareButton.tsx +84 -0
  358. package/src/components/CallControls/ToggleAudioButton.tsx +123 -0
  359. package/src/components/CallControls/ToggleAudioOutputButton.tsx +21 -0
  360. package/src/components/CallControls/ToggleVideoButton.tsx +116 -0
  361. package/src/components/CallControls/index.ts +10 -0
  362. package/src/components/CallParticipantsList/BlockedUserListing.tsx +37 -0
  363. package/src/components/CallParticipantsList/CallParticipantListHeader.tsx +29 -0
  364. package/src/components/CallParticipantsList/CallParticipantListing.tsx +22 -0
  365. package/src/components/CallParticipantsList/CallParticipantListingItem.tsx +273 -0
  366. package/src/components/CallParticipantsList/CallParticipantsList.tsx +255 -0
  367. package/src/components/CallParticipantsList/EmptyParticipantSearchList.tsx +7 -0
  368. package/src/components/CallParticipantsList/index.ts +3 -0
  369. package/src/components/CallRecordingList/CallRecordingList.tsx +60 -0
  370. package/src/components/CallRecordingList/CallRecordingListHeader.tsx +29 -0
  371. package/src/components/CallRecordingList/CallRecordingListItem.tsx +67 -0
  372. package/src/components/CallRecordingList/EmptyCallRecordingListing.tsx +11 -0
  373. package/src/components/CallRecordingList/LoadingCallRecordingListing.tsx +21 -0
  374. package/src/components/CallRecordingList/index.ts +5 -0
  375. package/src/components/CallStats/CallStats.tsx +162 -0
  376. package/src/components/CallStats/CallStatsLatencyChart.tsx +58 -0
  377. package/src/components/CallStats/index.ts +2 -0
  378. package/src/components/Debug/DebugParticipantPublishQuality.tsx +62 -0
  379. package/src/components/Debug/DebugStatsView.tsx +108 -0
  380. package/src/components/Debug/useIsDebugMode.ts +24 -0
  381. package/src/components/DeviceSettings/DeviceSelector.tsx +106 -0
  382. package/src/components/DeviceSettings/DeviceSelectorAudio.tsx +57 -0
  383. package/src/components/DeviceSettings/DeviceSelectorVideo.tsx +22 -0
  384. package/src/components/DeviceSettings/DeviceSettings.tsx +39 -0
  385. package/src/components/DeviceSettings/index.ts +4 -0
  386. package/src/components/Icon/Icon.tsx +11 -0
  387. package/src/components/Icon/index.ts +1 -0
  388. package/src/components/LoadingIndicator/LoadingIndicator.tsx +28 -0
  389. package/src/components/LoadingIndicator/index.ts +1 -0
  390. package/src/components/Menu/GenericMenu.tsx +16 -0
  391. package/src/components/Menu/MenuToggle.tsx +81 -0
  392. package/src/components/Menu/index.ts +2 -0
  393. package/src/components/Notification/Notification.tsx +61 -0
  394. package/src/components/Notification/PermissionNotification.tsx +97 -0
  395. package/src/components/Notification/SpeakingWhileMutedNotification.tsx +61 -0
  396. package/src/components/Notification/index.ts +3 -0
  397. package/src/components/PendingCallPanel/PendingCallControls.tsx +27 -0
  398. package/src/components/PendingCallPanel/PendingCallPanel.tsx +93 -0
  399. package/src/components/PendingCallPanel/index.ts +2 -0
  400. package/src/components/Permissions/PermissionRequests.tsx +176 -0
  401. package/src/components/Permissions/index.ts +1 -0
  402. package/src/components/Reaction/Reaction.tsx +48 -0
  403. package/src/components/Reaction/index.ts +1 -0
  404. package/src/components/Search/SearchInput.tsx +56 -0
  405. package/src/components/Search/SearchResults.tsx +40 -0
  406. package/src/components/Search/hooks/index.ts +1 -0
  407. package/src/components/Search/hooks/useSearch.ts +52 -0
  408. package/src/components/Search/index.ts +2 -0
  409. package/src/components/StreamCall/CallParticipantsScreenView.tsx +125 -0
  410. package/src/components/StreamCall/CallParticipantsView.tsx +24 -0
  411. package/src/components/StreamCall/Stage.tsx +22 -0
  412. package/src/components/StreamCall/index.ts +4 -0
  413. package/src/components/StreamTheme/StreamTheme.tsx +19 -0
  414. package/src/components/StreamTheme/index.ts +1 -0
  415. package/src/components/Tooltip/Tooltip.tsx +51 -0
  416. package/src/components/Tooltip/WithTooltip.tsx +39 -0
  417. package/src/components/Tooltip/hooks/index.ts +1 -0
  418. package/src/components/Tooltip/hooks/useEnterLeaveHandlers.ts +28 -0
  419. package/src/components/Tooltip/index.ts +2 -0
  420. package/src/components/Video/VideoPreview.tsx +152 -0
  421. package/src/components/Video/index.ts +4 -0
  422. package/src/components/index.ts +16 -0
  423. package/src/core/components/Audio/Audio.tsx +42 -0
  424. package/src/core/components/Audio/index.ts +1 -0
  425. package/src/core/components/CallLayout/PaginatedGridLayout.tsx +159 -0
  426. package/src/core/components/CallLayout/SpeakerLayout.tsx +231 -0
  427. package/src/core/components/CallLayout/index.ts +2 -0
  428. package/src/core/components/ParticipantView/DefaultParticipantViewUI.tsx +160 -0
  429. package/src/core/components/ParticipantView/ParticipantView.tsx +156 -0
  430. package/src/core/components/ParticipantView/index.ts +2 -0
  431. package/src/core/components/StreamCall/StreamCall.tsx +157 -0
  432. package/src/core/components/StreamCall/index.ts +1 -0
  433. package/src/core/components/Video/BaseVideo.tsx +53 -0
  434. package/src/core/components/Video/DefaultVideoPlaceholder.tsx +36 -0
  435. package/src/core/components/Video/Video.tsx +252 -0
  436. package/src/core/components/Video/index.ts +2 -0
  437. package/src/core/components/index.ts +8 -0
  438. package/src/core/contexts/MediaDevicesContext.tsx +416 -0
  439. package/src/core/contexts/index.ts +1 -0
  440. package/src/core/hooks/index.ts +4 -0
  441. package/src/core/hooks/useAudioPublisher.ts +124 -0
  442. package/src/core/hooks/useDevices.ts +161 -0
  443. package/src/core/hooks/useTrackElementVisibility.ts +44 -0
  444. package/src/core/hooks/useVideoPublisher.ts +152 -0
  445. package/src/core/index.ts +3 -0
  446. package/src/hooks/index.ts +2 -0
  447. package/src/hooks/useFloatingUIPreset.ts +50 -0
  448. package/src/hooks/useScrollPosition.ts +95 -0
  449. package/src/types/components.ts +7 -0
  450. package/src/types/index.ts +1 -0
  451. package/src/utilities/applyElementToRef.ts +12 -0
  452. package/src/utilities/chunk.ts +8 -0
  453. package/src/utilities/index.ts +3 -0
  454. package/src/utilities/isComponentType.ts +9 -0
@@ -0,0 +1,180 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { getAudioStream, getVideoStream } from '@stream-io/video-client';
3
+ type EnabledStateType = 'starting' | 'playing';
4
+ type DisabledStateType = 'uninitialized' | 'stopped';
5
+ type EnabledDeviceState<T extends EnabledStateType> = {
6
+ type: T;
7
+ enabled: true;
8
+ };
9
+ type DisabledDeviceState<T extends DisabledStateType> = {
10
+ type: T;
11
+ enabled: false;
12
+ };
13
+ type ErrorDeviceState = {
14
+ type: 'error';
15
+ message: string;
16
+ enabled: false;
17
+ };
18
+ type DeviceState = EnabledDeviceState<EnabledStateType> | DisabledDeviceState<DisabledStateType> | ErrorDeviceState;
19
+ /**
20
+ * Exclude types from documentation site, but we should still add doc comments
21
+ * @internal
22
+ */
23
+ export declare const DEVICE_STATE: {
24
+ starting: EnabledDeviceState<'starting'>;
25
+ playing: EnabledDeviceState<'playing'>;
26
+ stopped: DisabledDeviceState<'stopped'>;
27
+ uninitialized: DisabledDeviceState<'uninitialized'>;
28
+ error: ErrorDeviceState;
29
+ };
30
+ /**
31
+ * API to control device enablement, device selection and media stream access for a call.
32
+ * @category Device Management
33
+ */
34
+ export type MediaDevicesContextAPI = {
35
+ /**
36
+ * Deactivates MediaStream (stops and removes tracks) to be later garbage collected
37
+ *
38
+ * @param stream MediaStream
39
+ * @returns void
40
+ */
41
+ disposeOfMediaStream: (stream: MediaStream) => void;
42
+ /**
43
+ * Returns an 'audioinput' media stream with the given `deviceId`, if no `deviceId` is provided, it uses the first available device.
44
+ *
45
+ * @param deviceId
46
+ * @returns
47
+ */
48
+ getAudioStream: typeof getAudioStream;
49
+ /**
50
+ * Returns a 'videoinput' media stream with the given `deviceId`, if no `deviceId` is provided, it uses the first available device.
51
+ *
52
+ * @param deviceId
53
+ * @returns
54
+ */
55
+ getVideoStream: typeof getVideoStream;
56
+ /**
57
+ * [Tells if the browser supports audio output change on 'audio' elements](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/setSinkId).
58
+ */
59
+ isAudioOutputChangeSupported: boolean;
60
+ /**
61
+ * Signals whether audio stream will be published when the call is joined.
62
+ */
63
+ initialAudioEnabled: boolean;
64
+ /**
65
+ * Signals whether audio stream will be published when the call is joined.
66
+ */
67
+ initialVideoState: DeviceState;
68
+ /**
69
+ * Publishes audio stream for currently selected audio input (microphone) device to other call participants.
70
+ */
71
+ publishAudioStream: () => Promise<void>;
72
+ /**
73
+ * Publishes video stream for currently selected video input (camera) device to other call participants.
74
+ */
75
+ publishVideoStream: () => Promise<void>;
76
+ /**
77
+ * Stops publishing audio stream for currently selected audio input (microphone) device to other call participants.
78
+ */
79
+ stopPublishingAudio: () => void;
80
+ /**
81
+ * Stops publishing video stream for currently selected video input (camera) device to other call participants.
82
+ */
83
+ stopPublishingVideo: () => void;
84
+ /**
85
+ * Sets the initialAudioEnabled flag to a given boolean value.
86
+ * The latest value set will be used to decide, whether audio stream will be published when joining a call.
87
+ * @param enabled
88
+ */
89
+ setInitialAudioEnabled: (enabled: boolean) => void;
90
+ /**
91
+ * Sets the initialVideoState to a given DeviceState value.
92
+ * The latest value set will be used to decide, whether video stream will be published when joining a call.
93
+ * @param enabled
94
+ */
95
+ setInitialVideoState: (state: DeviceState) => void;
96
+ /**
97
+ * Stores audio input device (microphone) id which is used to publish user's sound to other call participants.
98
+ */
99
+ selectedAudioInputDeviceId?: string;
100
+ /**
101
+ * Stores audio output device (speaker) id used to reproduce incoming audio from other call participants.
102
+ */
103
+ selectedAudioOutputDeviceId?: string;
104
+ /**
105
+ * Stores video input device (camera) id which is used to publish user's video to other call participants.
106
+ */
107
+ selectedVideoDeviceId?: string;
108
+ /**
109
+ * Function should be used to change selected device id.
110
+ * The change is later reflected in selectedAudioInputDeviceId, selectedAudioOutputDeviceId or selectedVideoDeviceId depending on kind parameter.
111
+ * @param kind
112
+ * @param deviceId
113
+ */
114
+ switchDevice: (kind: MediaDeviceKind, deviceId?: string) => void;
115
+ /**
116
+ * Sets the initialAudioEnabled flag by negating the current state value.
117
+ * The latest value set will be used to decide, whether audio stream will be published when joining a call.
118
+ * @param enabled
119
+ */
120
+ toggleInitialAudioMuteState: () => void;
121
+ /**
122
+ * Sets the initialVideoState by toggling the current state DeviceState value.
123
+ * The latest value set will be used to decide, whether video stream will be published when joining a call.
124
+ * @param enabled
125
+ */
126
+ toggleInitialVideoMuteState: () => void;
127
+ };
128
+ /**
129
+ * Configuration parameters for MediaDevicesProvider.
130
+ * @category Device Management
131
+ */
132
+ export type MediaDevicesProviderProps = {
133
+ /**
134
+ * Provides external control over the initial audio input (microphone) enablement. Overrides the default false.
135
+ */
136
+ initialAudioEnabled?: boolean;
137
+ /**
138
+ * Provides external control over the initial video input (camera) enablement. Overrides the default false.
139
+ */
140
+ initialVideoEnabled?: boolean;
141
+ /**
142
+ * Allows to override the default audio input (microphone) stream to be published. Overrides the default string 'default'.
143
+ */
144
+ initialAudioInputDeviceId?: string;
145
+ /**
146
+ * Allows to override the default audio output (speaker) device to reproduce incoming audio from the SFU. Overrides the default string 'default'.
147
+ */
148
+ initialAudioOutputDeviceId?: string;
149
+ /**
150
+ * Allows to override the default video input (camera) stream to be published. Overrides the default string 'default'.
151
+ */
152
+ initialVideoInputDeviceId?: string;
153
+ };
154
+ /**
155
+ * Context provider that internally puts in place mechanisms that:
156
+ * 1. fall back to selecting a default device when trying to switch to a non-existent device
157
+ * 2. fall back to a default device when an active device is disconnected
158
+ * 3. stop publishing a media stream when a non-default device is disconnected
159
+ * 4. republish a media stream from the newly connected default device
160
+ * 5. republish a media stream when a new device is selected
161
+ *
162
+ * Provides `MediaDevicesContextAPI` that allow the integrators to handle:
163
+ * 1. the initial device state enablement (for example apt for lobby scenario)
164
+ * 2. media stream retrieval and disposal
165
+ * 3. media stream publishing
166
+ * 4. specific device selection
167
+ * @param params
168
+ * @returns
169
+ *
170
+ * @category Device Management
171
+ */
172
+ export declare const MediaDevicesProvider: ({ children, initialAudioEnabled, initialVideoEnabled, initialVideoInputDeviceId, initialAudioOutputDeviceId, initialAudioInputDeviceId, }: PropsWithChildren<MediaDevicesProviderProps>) => JSX.Element;
173
+ /**
174
+ * Context consumer retrieving MediaDevicesContextAPI.
175
+ * @returns
176
+ *
177
+ * @category Device Management
178
+ */
179
+ export declare const useMediaDevices: () => MediaDevicesContextAPI;
180
+ export {};
@@ -0,0 +1,177 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { createContext, useCallback, useContext, useEffect, useState, } from 'react';
12
+ import { map } from 'rxjs';
13
+ import { CallingState, checkIfAudioOutputChangeSupported, disposeOfMediaStream, getAudioStream, getVideoStream, SfuModels, watchForDisconnectedAudioOutputDevice, } from '@stream-io/video-client';
14
+ import { useCall, useCallCallingState, useCallMetadata, useCallState, } from '@stream-io/video-react-bindings';
15
+ import { useAudioInputDeviceFallback, useAudioOutputDeviceFallback, useAudioPublisher, useVideoDeviceFallback, useVideoPublisher, } from '../hooks';
16
+ const DEVICE_STATE_TOGGLE = {
17
+ starting: 'stopped',
18
+ playing: 'stopped',
19
+ stopped: 'starting',
20
+ uninitialized: 'starting',
21
+ error: 'starting',
22
+ };
23
+ /**
24
+ * Exclude types from documentation site, but we should still add doc comments
25
+ * @internal
26
+ */
27
+ export const DEVICE_STATE = {
28
+ starting: { type: 'starting', enabled: true },
29
+ playing: { type: 'playing', enabled: true },
30
+ stopped: { type: 'stopped', enabled: false },
31
+ uninitialized: { type: 'uninitialized', enabled: false },
32
+ error: { type: 'error', message: '', enabled: false },
33
+ };
34
+ const DEFAULT_DEVICE_ID = 'default';
35
+ const MediaDevicesContext = createContext(null);
36
+ /**
37
+ * Context provider that internally puts in place mechanisms that:
38
+ * 1. fall back to selecting a default device when trying to switch to a non-existent device
39
+ * 2. fall back to a default device when an active device is disconnected
40
+ * 3. stop publishing a media stream when a non-default device is disconnected
41
+ * 4. republish a media stream from the newly connected default device
42
+ * 5. republish a media stream when a new device is selected
43
+ *
44
+ * Provides `MediaDevicesContextAPI` that allow the integrators to handle:
45
+ * 1. the initial device state enablement (for example apt for lobby scenario)
46
+ * 2. media stream retrieval and disposal
47
+ * 3. media stream publishing
48
+ * 4. specific device selection
49
+ * @param params
50
+ * @returns
51
+ *
52
+ * @category Device Management
53
+ */
54
+ export const MediaDevicesProvider = ({ children, initialAudioEnabled, initialVideoEnabled, initialVideoInputDeviceId = DEFAULT_DEVICE_ID, initialAudioOutputDeviceId = DEFAULT_DEVICE_ID, initialAudioInputDeviceId = DEFAULT_DEVICE_ID, }) => {
55
+ const call = useCall();
56
+ const callingState = useCallCallingState();
57
+ const callState = useCallState();
58
+ const metadata = useCallMetadata();
59
+ const { localParticipant$ } = callState;
60
+ const [selectedAudioInputDeviceId, selectAudioInputDeviceId] = useState(initialAudioInputDeviceId);
61
+ const [selectedAudioOutputDeviceId, selectAudioOutputDeviceId] = useState(initialAudioOutputDeviceId);
62
+ const [selectedVideoDeviceId, selectVideoDeviceId] = useState(initialVideoInputDeviceId);
63
+ const [isAudioOutputChangeSupported] = useState(() => checkIfAudioOutputChangeSupported());
64
+ const [initAudioEnabled, setInitialAudioEnabled] = useState(!!initialAudioEnabled);
65
+ const [initialVideoState, setInitialVideoState] = useState(() => initialVideoEnabled ? DEVICE_STATE.starting : DEVICE_STATE.uninitialized);
66
+ const settings = metadata === null || metadata === void 0 ? void 0 : metadata.settings;
67
+ useEffect(() => {
68
+ if (!settings ||
69
+ ![CallingState.IDLE, CallingState.RINGING].includes(callingState)) {
70
+ return;
71
+ }
72
+ const { audio, video } = settings;
73
+ if (typeof initialAudioEnabled === 'undefined' && audio.mic_default_on) {
74
+ setInitialAudioEnabled(audio.mic_default_on);
75
+ }
76
+ if (typeof initialVideoEnabled === 'undefined' && video.camera_default_on) {
77
+ setInitialVideoState(DEVICE_STATE.starting);
78
+ }
79
+ }, [callingState, initialAudioEnabled, initialVideoEnabled, settings]);
80
+ const publishVideoStream = useVideoPublisher({
81
+ initialVideoMuted: !initialVideoState.enabled,
82
+ videoDeviceId: selectedVideoDeviceId,
83
+ });
84
+ const publishAudioStream = useAudioPublisher({
85
+ initialAudioMuted: !initAudioEnabled,
86
+ audioDeviceId: selectedAudioInputDeviceId,
87
+ });
88
+ const stopPublishingAudio = useCallback(() => {
89
+ if (callingState === CallingState.IDLE ||
90
+ callingState === CallingState.RINGING) {
91
+ setInitialAudioEnabled(false);
92
+ }
93
+ else {
94
+ call === null || call === void 0 ? void 0 : call.stopPublish(SfuModels.TrackType.AUDIO);
95
+ }
96
+ }, [call, callingState]);
97
+ const stopPublishingVideo = useCallback(() => {
98
+ if (callingState === CallingState.IDLE ||
99
+ callingState === CallingState.RINGING) {
100
+ setInitialVideoState(DEVICE_STATE.stopped);
101
+ }
102
+ else {
103
+ call === null || call === void 0 ? void 0 : call.stopPublish(SfuModels.TrackType.VIDEO);
104
+ }
105
+ }, [call, callingState]);
106
+ const toggleInitialAudioMuteState = useCallback(() => setInitialAudioEnabled((prev) => {
107
+ return !prev;
108
+ }), []);
109
+ const toggleInitialVideoMuteState = useCallback(() => setInitialVideoState((prev) => {
110
+ const newType = DEVICE_STATE_TOGGLE[prev.type];
111
+ return DEVICE_STATE[newType];
112
+ }), []);
113
+ const switchDevice = useCallback((kind, deviceId) => {
114
+ if (kind === 'videoinput') {
115
+ selectVideoDeviceId(deviceId);
116
+ }
117
+ if (kind === 'audioinput') {
118
+ selectAudioInputDeviceId(deviceId);
119
+ }
120
+ if (kind === 'audiooutput') {
121
+ selectAudioOutputDeviceId(deviceId);
122
+ }
123
+ }, []);
124
+ useAudioInputDeviceFallback(() => switchDevice('audioinput', DEFAULT_DEVICE_ID), selectedAudioInputDeviceId);
125
+ useAudioOutputDeviceFallback(() => switchDevice('audiooutput', DEFAULT_DEVICE_ID), selectedAudioOutputDeviceId);
126
+ useVideoDeviceFallback(() => switchDevice('videoinput', DEFAULT_DEVICE_ID), selectedVideoDeviceId);
127
+ useEffect(() => {
128
+ if (!call || callingState !== CallingState.JOINED)
129
+ return;
130
+ call.setAudioOutputDevice(selectedAudioOutputDeviceId);
131
+ }, [call, callingState, selectedAudioOutputDeviceId]);
132
+ useEffect(() => {
133
+ if (!localParticipant$)
134
+ return;
135
+ const subscription = watchForDisconnectedAudioOutputDevice(localParticipant$.pipe(map((p) => p === null || p === void 0 ? void 0 : p.audioOutputDeviceId))).subscribe(() => __awaiter(void 0, void 0, void 0, function* () {
136
+ selectAudioOutputDeviceId(DEFAULT_DEVICE_ID);
137
+ }));
138
+ return () => {
139
+ subscription.unsubscribe();
140
+ };
141
+ }, [localParticipant$]);
142
+ const contextValue = {
143
+ disposeOfMediaStream,
144
+ getAudioStream,
145
+ getVideoStream,
146
+ isAudioOutputChangeSupported,
147
+ selectedAudioInputDeviceId,
148
+ selectedAudioOutputDeviceId,
149
+ selectedVideoDeviceId,
150
+ switchDevice,
151
+ initialAudioEnabled: initAudioEnabled,
152
+ initialVideoState,
153
+ setInitialAudioEnabled,
154
+ setInitialVideoState,
155
+ toggleInitialAudioMuteState,
156
+ toggleInitialVideoMuteState,
157
+ publishAudioStream,
158
+ publishVideoStream,
159
+ stopPublishingAudio,
160
+ stopPublishingVideo,
161
+ };
162
+ return (_jsx(MediaDevicesContext.Provider, Object.assign({ value: contextValue }, { children: children })));
163
+ };
164
+ /**
165
+ * Context consumer retrieving MediaDevicesContextAPI.
166
+ * @returns
167
+ *
168
+ * @category Device Management
169
+ */
170
+ export const useMediaDevices = () => {
171
+ const value = useContext(MediaDevicesContext);
172
+ if (!value) {
173
+ console.warn(`Null MediaDevicesContext`);
174
+ }
175
+ return value;
176
+ };
177
+ //# sourceMappingURL=MediaDevicesContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaDevicesContext.js","sourceRoot":"","sources":["../../../../src/core/contexts/MediaDevicesContext.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EACL,aAAa,EAEb,WAAW,EACX,UAAU,EACV,SAAS,EACT,QAAQ,GACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,iCAAiC,EACjC,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,SAAS,EACT,qCAAqC,GACtC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,eAAe,EACf,YAAY,GACb,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AA0BlB,MAAM,mBAAmB,GAAoD;IAC3E,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,UAAU;IACnB,aAAa,EAAE,UAAU;IACzB,KAAK,EAAE,UAAU;CAClB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAMrB;IACF,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE;IAC7C,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE;IAC3C,OAAO,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE;IAC5C,aAAa,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,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B;QACpB,2BAA2B;QAC3B,2BAA2B;QAC3B,kBAAkB;QAClB,kBAAkB;QAClB,mBAAmB;QACnB,mBAAmB;KACpB,CAAC;IAEF,OAAO,CACL,KAAC,mBAAmB,CAAC,QAAQ,kBAAC,KAAK,EAAE,YAAY,gBAC9C,QAAQ,IACoB,CAChC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,KAAK,GAAG,UAAU,CAAC,mBAAmB,CAAC,CAAC;IAC9C,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;KAC1C;IACD,OAAO,KAA+B,CAAC;AACzC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './MediaDevicesContext';
@@ -0,0 +1,2 @@
1
+ export * from './MediaDevicesContext';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/contexts/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './useAudioPublisher';
2
+ export * from './useDevices';
3
+ export * from './useVideoPublisher';
4
+ export * from './useTrackElementVisibility';
@@ -0,0 +1,5 @@
1
+ export * from './useAudioPublisher';
2
+ export * from './useDevices';
3
+ export * from './useVideoPublisher';
4
+ export * from './useTrackElementVisibility';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export type AudioPublisherInit = {
5
+ initialAudioMuted?: boolean;
6
+ audioDeviceId?: string;
7
+ };
8
+ /**
9
+ * @internal
10
+ * @category Device Management
11
+ */
12
+ export declare const useAudioPublisher: ({ initialAudioMuted, audioDeviceId, }: AudioPublisherInit) => () => Promise<void>;
@@ -0,0 +1,95 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { useCallback, useEffect } from 'react';
11
+ import { map } from 'rxjs';
12
+ import { CallingState, getAudioStream, OwnCapability, SfuModels, watchForAddedDefaultAudioDevice, watchForDisconnectedAudioDevice, } from '@stream-io/video-client';
13
+ import { useCall, useCallCallingState, useCallState, useLocalParticipant, } from '@stream-io/video-react-bindings';
14
+ /**
15
+ * @internal
16
+ * @category Device Management
17
+ */
18
+ export const useAudioPublisher = ({ initialAudioMuted, audioDeviceId, }) => {
19
+ const call = useCall();
20
+ const callState = useCallState();
21
+ const callingState = useCallCallingState();
22
+ const participant = useLocalParticipant();
23
+ const { localParticipant$ } = callState;
24
+ const isPublishingAudio = participant === null || participant === void 0 ? void 0 : participant.publishedTracks.includes(SfuModels.TrackType.AUDIO);
25
+ const publishAudioStream = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
26
+ if (!call)
27
+ return;
28
+ if (!call.permissionsContext.hasPermission(OwnCapability.SEND_AUDIO)) {
29
+ throw new Error(`No permission to publish audio`);
30
+ }
31
+ try {
32
+ const audioStream = yield getAudioStream({
33
+ deviceId: audioDeviceId,
34
+ });
35
+ yield call.publishAudioStream(audioStream);
36
+ }
37
+ catch (e) {
38
+ console.log('Failed to publish audio stream', e);
39
+ }
40
+ }), [audioDeviceId, call]);
41
+ useEffect(() => {
42
+ if (callingState === CallingState.JOINED && !initialAudioMuted) {
43
+ publishAudioStream().catch((e) => {
44
+ console.error('Failed to publish audio stream', e);
45
+ });
46
+ }
47
+ }, [callingState, initialAudioMuted, publishAudioStream]);
48
+ useEffect(() => {
49
+ if (!localParticipant$)
50
+ return;
51
+ const subscription = watchForDisconnectedAudioDevice(localParticipant$.pipe(map((p) => p === null || p === void 0 ? void 0 : p.audioDeviceId))).subscribe(() => __awaiter(void 0, void 0, void 0, function* () {
52
+ if (!call)
53
+ return;
54
+ call.setAudioDevice(undefined);
55
+ yield call.stopPublish(SfuModels.TrackType.AUDIO);
56
+ }));
57
+ return () => {
58
+ subscription.unsubscribe();
59
+ };
60
+ }, [localParticipant$, call]);
61
+ useEffect(() => {
62
+ if (!(participant === null || participant === void 0 ? void 0 : participant.audioStream) || !call || !isPublishingAudio)
63
+ return;
64
+ const [track] = participant.audioStream.getAudioTracks();
65
+ const selectedAudioDeviceId = track.getSettings().deviceId;
66
+ const republishDefaultDevice = watchForAddedDefaultAudioDevice().subscribe(() => __awaiter(void 0, void 0, void 0, function* () {
67
+ if (!(call &&
68
+ participant.audioStream &&
69
+ selectedAudioDeviceId === 'default'))
70
+ return;
71
+ // We need to stop the original track first in order
72
+ // we can retrieve the new default device stream
73
+ track.stop();
74
+ const audioStream = yield getAudioStream({
75
+ deviceId: 'default',
76
+ });
77
+ yield call.publishAudioStream(audioStream);
78
+ }));
79
+ const handleTrackEnded = () => __awaiter(void 0, void 0, void 0, function* () {
80
+ if (selectedAudioDeviceId === audioDeviceId) {
81
+ const audioStream = yield getAudioStream({
82
+ deviceId: audioDeviceId,
83
+ });
84
+ yield call.publishAudioStream(audioStream);
85
+ }
86
+ });
87
+ track.addEventListener('ended', handleTrackEnded);
88
+ return () => {
89
+ track.removeEventListener('ended', handleTrackEnded);
90
+ republishDefaultDevice.unsubscribe();
91
+ };
92
+ }, [audioDeviceId, call, participant === null || participant === void 0 ? void 0 : participant.audioStream, isPublishingAudio]);
93
+ return publishAudioStream;
94
+ };
95
+ //# sourceMappingURL=useAudioPublisher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAudioPublisher.js","sourceRoot":"","sources":["../../../../src/core/hooks/useAudioPublisher.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,cAAc,EACd,aAAa,EACb,SAAS,EACT,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,OAAO,EACP,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,GACpB,MAAM,iCAAiC,CAAC;AAUzC;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,EAChC,iBAAiB,EACjB,aAAa,GACM,EAAE,EAAE;IACvB,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC;IACvB,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,YAAY,GAAG,mBAAmB,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,mBAAmB,EAAE,CAAC;IAC1C,MAAM,EAAE,iBAAiB,EAAE,GAAG,SAAS,CAAC;IAExC,MAAM,iBAAiB,GAAG,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,eAAe,CAAC,QAAQ,CAC7D,SAAS,CAAC,SAAS,CAAC,KAAK,CAC1B,CAAC;IAEF,MAAM,kBAAkB,GAAG,WAAW,CAAC,GAAS,EAAE;QAChD,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,EAAE;YACpE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;SACnD;QAC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E,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAEvE,OAAO,kBAAkB,CAAC;AAC5B,CAAC,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { Observable } from 'rxjs';
2
+ /**
3
+ * Observes changes in connected devices and maintains an up-to-date array of connected MediaDeviceInfo objects.
4
+ * @param observeDevices
5
+ * @category Device Management
6
+ */
7
+ export declare const useDevices: (observeDevices: () => Observable<MediaDeviceInfo[]>) => MediaDeviceInfo[];
8
+ /**
9
+ * Observes changes and maintains an array of connected video input devices
10
+ * @category Device Management
11
+ */
12
+ export declare const useVideoDevices: () => MediaDeviceInfo[];
13
+ /**
14
+ * Observes changes and maintains an array of connected audio input devices
15
+ * @category Device Management
16
+ */
17
+ export declare const useAudioInputDevices: () => MediaDeviceInfo[];
18
+ /**
19
+ * Observes changes and maintains an array of connected audio output devices
20
+ * @category Device Management
21
+ */
22
+ export declare const useAudioOutputDevices: () => MediaDeviceInfo[];
23
+ /**
24
+ * Verifies that newly selected device id exists among the registered devices.
25
+ * If the selected device id is not found among existing devices, switches to the default device.
26
+ * @param devices$
27
+ * @param switchToDefaultDevice
28
+ * @param selectedDeviceId
29
+ * @category Device Management
30
+ */
31
+ export declare const useDeviceFallback: (devices$: Observable<MediaDeviceInfo[]>, switchToDefaultDevice: () => void, selectedDeviceId?: string) => void;
32
+ /**
33
+ * Verifies that newly selected video device id exists among the registered devices.
34
+ * If the selected device id is not found among existing devices, switches to the default video device.
35
+ * @param switchToDefaultDevice
36
+ * @param selectedDeviceId
37
+ * @category Device Management
38
+ */
39
+ export declare const useVideoDeviceFallback: (switchToDefaultDevice: () => void, selectedDeviceId?: string) => void;
40
+ /**
41
+ * Verifies that newly selected audio input device id exists among the registered devices.
42
+ * If the selected device id is not found among existing devices, switches to the default audio input device.
43
+ * @param switchToDefaultDevice
44
+ * @param selectedDeviceId
45
+ * @category Device Management
46
+ */
47
+ export declare const useAudioInputDeviceFallback: (switchToDefaultDevice: () => void, selectedDeviceId?: string) => void;
48
+ /**
49
+ * Verifies that newly selected audio output device id exists among the registered devices.
50
+ * If the selected device id is not found among existing devices, switches to the default audio output device.
51
+ * @param switchToDefaultDevice
52
+ * @param selectedDeviceId
53
+ * @category Device Management
54
+ */
55
+ export declare const useAudioOutputDeviceFallback: (switchToDefaultDevice: () => void, selectedDeviceId?: string) => void;
56
+ /**
57
+ * Observes devices of certain kind are made unavailable and executes onDisconnect callback
58
+ * @param observeDevices
59
+ * @param onDisconnect
60
+ * @category Device Management
61
+ */
62
+ export declare const useOnUnavailableDevices: (observeDevices: Observable<MediaDeviceInfo[]>, onDisconnect: () => void) => void;
63
+ /**
64
+ * Observes disconnect of all video devices and executes onDisconnect callback
65
+ * @param onDisconnect
66
+ * @category Device Management
67
+ */
68
+ export declare const useOnUnavailableVideoDevices: (onDisconnect: () => void) => void;
69
+ /**
70
+ * Observes disconnect of all audio input devices and executes onDisconnect callback
71
+ * @param onDisconnect
72
+ * @category Device Management
73
+ */
74
+ export declare const useOnUnavailableAudioInputDevices: (onDisconnect: () => void) => void;
75
+ /**
76
+ * Observes disconnect of all audio output devices and executes onDisconnect callback
77
+ * @param onDisconnect
78
+ * @category Device Management
79
+ */
80
+ export declare const useOnUnavailableAudioOutputDevices: (onDisconnect: () => void) => void;