@100mslive/react-native-room-kit 1.1.7 → 1.1.9-beta.0

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 (319) hide show
  1. package/lib/commonjs/HMSInstanceSetup.js +11 -5
  2. package/lib/commonjs/HMSInstanceSetup.js.map +1 -1
  3. package/lib/commonjs/HMSRoomSetup.js +8 -0
  4. package/lib/commonjs/HMSRoomSetup.js.map +1 -1
  5. package/lib/commonjs/Icons/AddImage/assets/add-image.png +0 -0
  6. package/lib/commonjs/Icons/AddImage/assets/add-image@2x.png +0 -0
  7. package/lib/commonjs/Icons/AddImage/assets/add-image@3x.png +0 -0
  8. package/lib/commonjs/Icons/AddImage/index.js +33 -0
  9. package/lib/commonjs/Icons/AddImage/index.js.map +1 -0
  10. package/lib/commonjs/Icons/BlurPeople/assets/blur-people.png +0 -0
  11. package/lib/commonjs/Icons/BlurPeople/assets/blur-people@2x.png +0 -0
  12. package/lib/commonjs/Icons/BlurPeople/assets/blur-people@3x.png +0 -0
  13. package/lib/commonjs/Icons/BlurPeople/index.js +33 -0
  14. package/lib/commonjs/Icons/BlurPeople/index.js.map +1 -0
  15. package/lib/commonjs/Icons/CrossCircle/assets/cross-circle-large.png +0 -0
  16. package/lib/commonjs/Icons/CrossCircle/assets/cross-circle-large@2x.png +0 -0
  17. package/lib/commonjs/Icons/CrossCircle/assets/cross-circle-large@3x.png +0 -0
  18. package/lib/commonjs/Icons/CrossCircle/index.js +7 -2
  19. package/lib/commonjs/Icons/CrossCircle/index.js.map +1 -1
  20. package/lib/commonjs/Icons/Pencil/assets/pencil-board.png +0 -0
  21. package/lib/commonjs/Icons/Pencil/assets/pencil-board@2x.png +0 -0
  22. package/lib/commonjs/Icons/Pencil/assets/pencil-board@3x.png +0 -0
  23. package/lib/commonjs/Icons/Pencil/index.js +2 -1
  24. package/lib/commonjs/Icons/Pencil/index.js.map +1 -1
  25. package/lib/commonjs/Icons/VirtualBackground/assets/virtual-background.png +0 -0
  26. package/lib/commonjs/Icons/VirtualBackground/assets/virtual-background@2x.png +0 -0
  27. package/lib/commonjs/Icons/VirtualBackground/assets/virtual-background@3x.png +0 -0
  28. package/lib/commonjs/Icons/VirtualBackground/index.js +33 -0
  29. package/lib/commonjs/Icons/VirtualBackground/index.js.map +1 -0
  30. package/lib/commonjs/Icons/index.js +33 -0
  31. package/lib/commonjs/Icons/index.js.map +1 -1
  32. package/lib/commonjs/components/Chat/ChatMessage.js +13 -1
  33. package/lib/commonjs/components/Chat/ChatMessage.js.map +1 -1
  34. package/lib/commonjs/components/DisplayView.js +2 -1
  35. package/lib/commonjs/components/DisplayView.js.map +1 -1
  36. package/lib/commonjs/components/Footer.js +1 -1
  37. package/lib/commonjs/components/Footer.js.map +1 -1
  38. package/lib/commonjs/components/FullScreenWhiteboard.js +58 -0
  39. package/lib/commonjs/components/FullScreenWhiteboard.js.map +1 -0
  40. package/lib/commonjs/components/GridView.js +6 -4
  41. package/lib/commonjs/components/GridView.js.map +1 -1
  42. package/lib/commonjs/components/HLSChatView.js +7 -2
  43. package/lib/commonjs/components/HLSChatView.js.map +1 -1
  44. package/lib/commonjs/components/HLSDescriptionPane.js +3 -29
  45. package/lib/commonjs/components/HLSDescriptionPane.js.map +1 -1
  46. package/lib/commonjs/components/HLSPlayerContainer.js +4 -1
  47. package/lib/commonjs/components/HLSPlayerContainer.js.map +1 -1
  48. package/lib/commonjs/components/HMSHLSMessage.js +14 -1
  49. package/lib/commonjs/components/HMSHLSMessage.js.map +1 -1
  50. package/lib/commonjs/components/HMSManageCameraRotation.js +11 -4
  51. package/lib/commonjs/components/HMSManageCameraRotation.js.map +1 -1
  52. package/lib/commonjs/components/HMSManageLocalVideo.js +11 -4
  53. package/lib/commonjs/components/HMSManageLocalVideo.js.map +1 -1
  54. package/lib/commonjs/components/HMSManageVirtualBackground.js +55 -0
  55. package/lib/commonjs/components/HMSManageVirtualBackground.js.map +1 -0
  56. package/lib/commonjs/components/HMSOverlayMessageView.js +14 -1
  57. package/lib/commonjs/components/HMSOverlayMessageView.js.map +1 -1
  58. package/lib/commonjs/components/HMSRoomOptions.js +2 -1
  59. package/lib/commonjs/components/HMSRoomOptions.js.map +1 -1
  60. package/lib/commonjs/components/MeetingScreenContent.js +22 -2
  61. package/lib/commonjs/components/MeetingScreenContent.js.map +1 -1
  62. package/lib/commonjs/components/Preview.js +8 -3
  63. package/lib/commonjs/components/Preview.js.map +1 -1
  64. package/lib/commonjs/components/RoomSettingsModalContent.js +91 -6
  65. package/lib/commonjs/components/RoomSettingsModalContent.js.map +1 -1
  66. package/lib/commonjs/components/TilesContainer.js +4 -4
  67. package/lib/commonjs/components/TilesContainer.js.map +1 -1
  68. package/lib/commonjs/components/VirtualBackgroundBottomSheet.js +52 -0
  69. package/lib/commonjs/components/VirtualBackgroundBottomSheet.js.map +1 -0
  70. package/lib/commonjs/components/VirtualBackgroundModalContent.js +364 -0
  71. package/lib/commonjs/components/VirtualBackgroundModalContent.js.map +1 -0
  72. package/lib/commonjs/components/WebrtcView.js +2 -2
  73. package/lib/commonjs/components/WebrtcView.js.map +1 -1
  74. package/lib/commonjs/components/Whiteboard.js +72 -0
  75. package/lib/commonjs/components/Whiteboard.js.map +1 -0
  76. package/lib/commonjs/components/WhiteboardContainer.js +35 -0
  77. package/lib/commonjs/components/WhiteboardContainer.js.map +1 -0
  78. package/lib/commonjs/components/WhiteboardFullScreenButton.js +42 -0
  79. package/lib/commonjs/components/WhiteboardFullScreenButton.js.map +1 -0
  80. package/lib/commonjs/hooks-util.js +36 -6
  81. package/lib/commonjs/hooks-util.js.map +1 -1
  82. package/lib/commonjs/modules/imagePickerWrapper.js +19 -0
  83. package/lib/commonjs/modules/imagePickerWrapper.js.map +1 -0
  84. package/lib/commonjs/modules/videoPluginWrapper.js +13 -0
  85. package/lib/commonjs/modules/videoPluginWrapper.js.map +1 -0
  86. package/lib/commonjs/redux/actionTypes.js +6 -0
  87. package/lib/commonjs/redux/actionTypes.js.map +1 -1
  88. package/lib/commonjs/redux/actions/index.js +27 -3
  89. package/lib/commonjs/redux/actions/index.js.map +1 -1
  90. package/lib/commonjs/redux/reducers/appState.js +17 -1
  91. package/lib/commonjs/redux/reducers/appState.js.map +1 -1
  92. package/lib/commonjs/redux/reducers/hmsStates.js +13 -1
  93. package/lib/commonjs/redux/reducers/hmsStates.js.map +1 -1
  94. package/lib/commonjs/utils/functions.js +33 -1
  95. package/lib/commonjs/utils/functions.js.map +1 -1
  96. package/lib/commonjs/utils/types.js +1 -0
  97. package/lib/commonjs/utils/types.js.map +1 -1
  98. package/lib/module/HMSInstanceSetup.js +12 -6
  99. package/lib/module/HMSInstanceSetup.js.map +1 -1
  100. package/lib/module/HMSRoomSetup.js +10 -2
  101. package/lib/module/HMSRoomSetup.js.map +1 -1
  102. package/lib/module/Icons/AddImage/assets/add-image.png +0 -0
  103. package/lib/module/Icons/AddImage/assets/add-image@2x.png +0 -0
  104. package/lib/module/Icons/AddImage/assets/add-image@3x.png +0 -0
  105. package/lib/module/Icons/AddImage/index.js +25 -0
  106. package/lib/module/Icons/AddImage/index.js.map +1 -0
  107. package/lib/module/Icons/BlurPeople/assets/blur-people.png +0 -0
  108. package/lib/module/Icons/BlurPeople/assets/blur-people@2x.png +0 -0
  109. package/lib/module/Icons/BlurPeople/assets/blur-people@3x.png +0 -0
  110. package/lib/module/Icons/BlurPeople/index.js +25 -0
  111. package/lib/module/Icons/BlurPeople/index.js.map +1 -0
  112. package/lib/module/Icons/CrossCircle/assets/cross-circle-large.png +0 -0
  113. package/lib/module/Icons/CrossCircle/assets/cross-circle-large@2x.png +0 -0
  114. package/lib/module/Icons/CrossCircle/assets/cross-circle-large@3x.png +0 -0
  115. package/lib/module/Icons/CrossCircle/index.js +7 -2
  116. package/lib/module/Icons/CrossCircle/index.js.map +1 -1
  117. package/lib/module/Icons/Pencil/assets/pencil-board.png +0 -0
  118. package/lib/module/Icons/Pencil/assets/pencil-board@2x.png +0 -0
  119. package/lib/module/Icons/Pencil/assets/pencil-board@3x.png +0 -0
  120. package/lib/module/Icons/Pencil/index.js +2 -1
  121. package/lib/module/Icons/Pencil/index.js.map +1 -1
  122. package/lib/module/Icons/VirtualBackground/assets/virtual-background.png +0 -0
  123. package/lib/module/Icons/VirtualBackground/assets/virtual-background@2x.png +0 -0
  124. package/lib/module/Icons/VirtualBackground/assets/virtual-background@3x.png +0 -0
  125. package/lib/module/Icons/VirtualBackground/index.js +25 -0
  126. package/lib/module/Icons/VirtualBackground/index.js.map +1 -0
  127. package/lib/module/Icons/index.js +3 -0
  128. package/lib/module/Icons/index.js.map +1 -1
  129. package/lib/module/components/Chat/ChatMessage.js +15 -3
  130. package/lib/module/components/Chat/ChatMessage.js.map +1 -1
  131. package/lib/module/components/DisplayView.js +2 -1
  132. package/lib/module/components/DisplayView.js.map +1 -1
  133. package/lib/module/components/Footer.js +1 -1
  134. package/lib/module/components/Footer.js.map +1 -1
  135. package/lib/module/components/FullScreenWhiteboard.js +48 -0
  136. package/lib/module/components/FullScreenWhiteboard.js.map +1 -0
  137. package/lib/module/components/GridView.js +6 -4
  138. package/lib/module/components/GridView.js.map +1 -1
  139. package/lib/module/components/HLSChatView.js +7 -2
  140. package/lib/module/components/HLSChatView.js.map +1 -1
  141. package/lib/module/components/HLSDescriptionPane.js +2 -28
  142. package/lib/module/components/HLSDescriptionPane.js.map +1 -1
  143. package/lib/module/components/HLSPlayerContainer.js +4 -1
  144. package/lib/module/components/HLSPlayerContainer.js.map +1 -1
  145. package/lib/module/components/HMSHLSMessage.js +15 -2
  146. package/lib/module/components/HMSHLSMessage.js.map +1 -1
  147. package/lib/module/components/HMSManageCameraRotation.js +11 -4
  148. package/lib/module/components/HMSManageCameraRotation.js.map +1 -1
  149. package/lib/module/components/HMSManageLocalVideo.js +11 -4
  150. package/lib/module/components/HMSManageLocalVideo.js.map +1 -1
  151. package/lib/module/components/HMSManageVirtualBackground.js +46 -0
  152. package/lib/module/components/HMSManageVirtualBackground.js.map +1 -0
  153. package/lib/module/components/HMSOverlayMessageView.js +15 -2
  154. package/lib/module/components/HMSOverlayMessageView.js.map +1 -1
  155. package/lib/module/components/HMSRoomOptions.js +2 -1
  156. package/lib/module/components/HMSRoomOptions.js.map +1 -1
  157. package/lib/module/components/MeetingScreenContent.js +23 -3
  158. package/lib/module/components/MeetingScreenContent.js.map +1 -1
  159. package/lib/module/components/Preview.js +8 -3
  160. package/lib/module/components/Preview.js.map +1 -1
  161. package/lib/module/components/RoomSettingsModalContent.js +94 -9
  162. package/lib/module/components/RoomSettingsModalContent.js.map +1 -1
  163. package/lib/module/components/TilesContainer.js +4 -4
  164. package/lib/module/components/TilesContainer.js.map +1 -1
  165. package/lib/module/components/VirtualBackgroundBottomSheet.js +43 -0
  166. package/lib/module/components/VirtualBackgroundBottomSheet.js.map +1 -0
  167. package/lib/module/components/VirtualBackgroundModalContent.js +355 -0
  168. package/lib/module/components/VirtualBackgroundModalContent.js.map +1 -0
  169. package/lib/module/components/WebrtcView.js +2 -2
  170. package/lib/module/components/WebrtcView.js.map +1 -1
  171. package/lib/module/components/Whiteboard.js +64 -0
  172. package/lib/module/components/Whiteboard.js.map +1 -0
  173. package/lib/module/components/WhiteboardContainer.js +27 -0
  174. package/lib/module/components/WhiteboardContainer.js.map +1 -0
  175. package/lib/module/components/WhiteboardFullScreenButton.js +33 -0
  176. package/lib/module/components/WhiteboardFullScreenButton.js.map +1 -0
  177. package/lib/module/hooks-util.js +36 -6
  178. package/lib/module/hooks-util.js.map +1 -1
  179. package/lib/module/modules/imagePickerWrapper.js +14 -0
  180. package/lib/module/modules/imagePickerWrapper.js.map +1 -0
  181. package/lib/module/modules/videoPluginWrapper.js +8 -0
  182. package/lib/module/modules/videoPluginWrapper.js.map +1 -0
  183. package/lib/module/redux/actionTypes.js +6 -0
  184. package/lib/module/redux/actionTypes.js.map +1 -1
  185. package/lib/module/redux/actions/index.js +20 -0
  186. package/lib/module/redux/actions/index.js.map +1 -1
  187. package/lib/module/redux/reducers/appState.js +17 -1
  188. package/lib/module/redux/reducers/appState.js.map +1 -1
  189. package/lib/module/redux/reducers/hmsStates.js +13 -1
  190. package/lib/module/redux/reducers/hmsStates.js.map +1 -1
  191. package/lib/module/utils/functions.js +29 -1
  192. package/lib/module/utils/functions.js.map +1 -1
  193. package/lib/module/utils/types.js +1 -0
  194. package/lib/module/utils/types.js.map +1 -1
  195. package/lib/typescript/HMSInstanceSetup.d.ts.map +1 -1
  196. package/lib/typescript/HMSRoomSetup.d.ts.map +1 -1
  197. package/lib/typescript/Icons/AddImage/index.d.ts +7 -0
  198. package/lib/typescript/Icons/AddImage/index.d.ts.map +1 -0
  199. package/lib/typescript/Icons/BlurPeople/index.d.ts +7 -0
  200. package/lib/typescript/Icons/BlurPeople/index.d.ts.map +1 -0
  201. package/lib/typescript/Icons/CrossCircle/index.d.ts +1 -0
  202. package/lib/typescript/Icons/CrossCircle/index.d.ts.map +1 -1
  203. package/lib/typescript/Icons/Pencil/index.d.ts +1 -0
  204. package/lib/typescript/Icons/Pencil/index.d.ts.map +1 -1
  205. package/lib/typescript/Icons/VirtualBackground/index.d.ts +7 -0
  206. package/lib/typescript/Icons/VirtualBackground/index.d.ts.map +1 -0
  207. package/lib/typescript/Icons/index.d.ts +3 -0
  208. package/lib/typescript/Icons/index.d.ts.map +1 -1
  209. package/lib/typescript/components/Chat/ChatMessage.d.ts.map +1 -1
  210. package/lib/typescript/components/DisplayView.d.ts.map +1 -1
  211. package/lib/typescript/components/Footer.d.ts.map +1 -1
  212. package/lib/typescript/components/FullScreenWhiteboard.d.ts +3 -0
  213. package/lib/typescript/components/FullScreenWhiteboard.d.ts.map +1 -0
  214. package/lib/typescript/components/GridView.d.ts.map +1 -1
  215. package/lib/typescript/components/HLSChatView.d.ts.map +1 -1
  216. package/lib/typescript/components/HLSDescriptionPane.d.ts.map +1 -1
  217. package/lib/typescript/components/HLSPlayerContainer.d.ts.map +1 -1
  218. package/lib/typescript/components/HMSHLSMessage.d.ts.map +1 -1
  219. package/lib/typescript/components/HMSManageCameraRotation.d.ts +8 -1
  220. package/lib/typescript/components/HMSManageCameraRotation.d.ts.map +1 -1
  221. package/lib/typescript/components/HMSManageLocalVideo.d.ts +8 -1
  222. package/lib/typescript/components/HMSManageLocalVideo.d.ts.map +1 -1
  223. package/lib/typescript/components/HMSManageVirtualBackground.d.ts +8 -0
  224. package/lib/typescript/components/HMSManageVirtualBackground.d.ts.map +1 -0
  225. package/lib/typescript/components/HMSOverlayMessageView.d.ts.map +1 -1
  226. package/lib/typescript/components/HMSRoomOptions.d.ts.map +1 -1
  227. package/lib/typescript/components/MeetingScreenContent.d.ts.map +1 -1
  228. package/lib/typescript/components/Preview.d.ts.map +1 -1
  229. package/lib/typescript/components/RoomSettingsModalContent.d.ts.map +1 -1
  230. package/lib/typescript/components/TilesContainer.d.ts.map +1 -1
  231. package/lib/typescript/components/VirtualBackgroundBottomSheet.d.ts +3 -0
  232. package/lib/typescript/components/VirtualBackgroundBottomSheet.d.ts.map +1 -0
  233. package/lib/typescript/components/VirtualBackgroundModalContent.d.ts +6 -0
  234. package/lib/typescript/components/VirtualBackgroundModalContent.d.ts.map +1 -0
  235. package/lib/typescript/components/WebrtcView.d.ts.map +1 -1
  236. package/lib/typescript/components/Whiteboard.d.ts +6 -0
  237. package/lib/typescript/components/Whiteboard.d.ts.map +1 -0
  238. package/lib/typescript/components/WhiteboardContainer.d.ts +6 -0
  239. package/lib/typescript/components/WhiteboardContainer.d.ts.map +1 -0
  240. package/lib/typescript/components/WhiteboardFullScreenButton.d.ts +5 -0
  241. package/lib/typescript/components/WhiteboardFullScreenButton.d.ts.map +1 -0
  242. package/lib/typescript/hooks-util.d.ts.map +1 -1
  243. package/lib/typescript/modules/imagePickerWrapper.d.ts +6 -0
  244. package/lib/typescript/modules/imagePickerWrapper.d.ts.map +1 -0
  245. package/lib/typescript/modules/videoPluginWrapper.d.ts +19 -0
  246. package/lib/typescript/modules/videoPluginWrapper.d.ts.map +1 -0
  247. package/lib/typescript/redux/actionTypes.d.ts +4 -0
  248. package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
  249. package/lib/typescript/redux/actions/index.d.ts +22 -1
  250. package/lib/typescript/redux/actions/index.d.ts.map +1 -1
  251. package/lib/typescript/redux/index.d.ts +4 -0
  252. package/lib/typescript/redux/index.d.ts.map +1 -1
  253. package/lib/typescript/redux/reducers/appState.d.ts +2 -0
  254. package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
  255. package/lib/typescript/redux/reducers/hmsStates.d.ts +13 -2
  256. package/lib/typescript/redux/reducers/hmsStates.d.ts.map +1 -1
  257. package/lib/typescript/redux/reducers/index.d.ts +4 -0
  258. package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
  259. package/lib/typescript/utils/functions.d.ts +2 -0
  260. package/lib/typescript/utils/functions.d.ts.map +1 -1
  261. package/lib/typescript/utils/types.d.ts +1 -0
  262. package/lib/typescript/utils/types.d.ts.map +1 -1
  263. package/package.json +10 -3
  264. package/src/HMSInstanceSetup.tsx +17 -4
  265. package/src/HMSRoomSetup.tsx +21 -0
  266. package/src/Icons/AddImage/assets/add-image.png +0 -0
  267. package/src/Icons/AddImage/assets/add-image@2x.png +0 -0
  268. package/src/Icons/AddImage/assets/add-image@3x.png +0 -0
  269. package/src/Icons/AddImage/index.tsx +33 -0
  270. package/src/Icons/BlurPeople/assets/blur-people.png +0 -0
  271. package/src/Icons/BlurPeople/assets/blur-people@2x.png +0 -0
  272. package/src/Icons/BlurPeople/assets/blur-people@3x.png +0 -0
  273. package/src/Icons/BlurPeople/index.tsx +33 -0
  274. package/src/Icons/CrossCircle/assets/cross-circle-large.png +0 -0
  275. package/src/Icons/CrossCircle/assets/cross-circle-large@2x.png +0 -0
  276. package/src/Icons/CrossCircle/assets/cross-circle-large@3x.png +0 -0
  277. package/src/Icons/CrossCircle/index.tsx +19 -3
  278. package/src/Icons/Pencil/assets/pencil-board.png +0 -0
  279. package/src/Icons/Pencil/assets/pencil-board@2x.png +0 -0
  280. package/src/Icons/Pencil/assets/pencil-board@3x.png +0 -0
  281. package/src/Icons/Pencil/index.tsx +9 -2
  282. package/src/Icons/VirtualBackground/assets/virtual-background.png +0 -0
  283. package/src/Icons/VirtualBackground/assets/virtual-background@2x.png +0 -0
  284. package/src/Icons/VirtualBackground/assets/virtual-background@3x.png +0 -0
  285. package/src/Icons/VirtualBackground/index.tsx +33 -0
  286. package/src/Icons/index.ts +3 -0
  287. package/src/components/Chat/ChatMessage.tsx +19 -2
  288. package/src/components/DisplayView.tsx +3 -0
  289. package/src/components/Footer.tsx +5 -2
  290. package/src/components/FullScreenWhiteboard.tsx +59 -0
  291. package/src/components/GridView.tsx +14 -5
  292. package/src/components/HLSChatView.tsx +7 -4
  293. package/src/components/HLSDescriptionPane.tsx +2 -33
  294. package/src/components/HLSPlayerContainer.tsx +15 -7
  295. package/src/components/HMSHLSMessage.tsx +16 -1
  296. package/src/components/HMSManageCameraRotation.tsx +18 -4
  297. package/src/components/HMSManageLocalVideo.tsx +20 -4
  298. package/src/components/HMSManageVirtualBackground.tsx +76 -0
  299. package/src/components/HMSOverlayMessageView.tsx +16 -1
  300. package/src/components/HMSRoomOptions.tsx +3 -0
  301. package/src/components/MeetingScreenContent.tsx +28 -2
  302. package/src/components/Preview.tsx +12 -5
  303. package/src/components/RoomSettingsModalContent.tsx +108 -2
  304. package/src/components/TilesContainer.tsx +7 -5
  305. package/src/components/VirtualBackgroundBottomSheet.tsx +62 -0
  306. package/src/components/VirtualBackgroundModalContent.tsx +500 -0
  307. package/src/components/WebrtcView.tsx +11 -4
  308. package/src/components/Whiteboard.tsx +101 -0
  309. package/src/components/WhiteboardContainer.tsx +35 -0
  310. package/src/components/WhiteboardFullScreenButton.tsx +52 -0
  311. package/src/hooks-util.ts +41 -9
  312. package/src/modules/imagePickerWrapper.ts +20 -0
  313. package/src/modules/videoPluginWrapper.ts +32 -0
  314. package/src/redux/actionTypes.ts +8 -0
  315. package/src/redux/actions/index.ts +22 -0
  316. package/src/redux/reducers/appState.ts +16 -0
  317. package/src/redux/reducers/hmsStates.ts +29 -1
  318. package/src/utils/{functions.ts → functions.tsx} +34 -0
  319. package/src/utils/types.ts +1 -0
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { View, StyleSheet } from 'react-native';
3
+ import { useSelector } from 'react-redux';
3
4
  import type { HMSHLSPlayer } from '@100mslive/react-native-hms';
4
5
  import { Gesture, GestureDetector } from 'react-native-gesture-handler';
5
6
  import {
@@ -13,11 +14,16 @@ import {
13
14
  import { useHLSViewsConstraints } from '../hooks-util';
14
15
  import { HLSPlayer } from './HLSPlayer';
15
16
  import { HLSPlayerControls } from './HLSPlayerControls';
17
+ import { PipModes } from '../utils/types';
18
+ import type { RootState } from '../redux';
16
19
 
17
20
  export const _HLSPlayerContainer: React.FC = () => {
18
21
  const hlsPlayerRef =
19
22
  React.useRef<React.ElementRef<typeof HMSHLSPlayer>>(null);
20
23
  const { playerWrapperConstraints } = useHLSViewsConstraints();
24
+ const isPipModeActive = useSelector(
25
+ (state: RootState) => state.app.pipModeStatus === PipModes.ACTIVE
26
+ );
21
27
 
22
28
  const animatedValue = useSharedValue(1);
23
29
 
@@ -82,13 +88,15 @@ export const _HLSPlayerContainer: React.FC = () => {
82
88
  >
83
89
  <HLSPlayer ref={hlsPlayerRef} />
84
90
 
85
- <HLSPlayerControls
86
- playerRef={hlsPlayerRef}
87
- animatedValue={animatedValue}
88
- cancelCurrentControlAnimation={cancelCurrentControlAnimation}
89
- hideControlsAfterDelay={hideControlsAfterDelay}
90
- resetHideControlAnimation={resetHideControlAnimation}
91
- />
91
+ {isPipModeActive ? null : (
92
+ <HLSPlayerControls
93
+ playerRef={hlsPlayerRef}
94
+ animatedValue={animatedValue}
95
+ cancelCurrentControlAnimation={cancelCurrentControlAnimation}
96
+ hideControlsAfterDelay={hideControlsAfterDelay}
97
+ resetHideControlAnimation={resetHideControlAnimation}
98
+ />
99
+ )}
92
100
  </View>
93
101
  </GestureDetector>
94
102
  );
@@ -6,6 +6,7 @@ import {
6
6
  StyleSheet,
7
7
  Platform,
8
8
  TouchableOpacity,
9
+ Linking,
9
10
  } from 'react-native';
10
11
  import type { HMSMessage } from '@100mslive/react-native-hms';
11
12
 
@@ -19,6 +20,7 @@ import { PinIcon, ThreeDotsIcon } from '../Icons';
19
20
  import { setSelectedMessageForAction } from '../redux/actions';
20
21
  import { ModalTypes } from '../utils/types';
21
22
  import type { RootState } from '../redux';
23
+ import { splitLinksAndContent } from '../utils/functions';
22
24
 
23
25
  interface HMSHLSMessageProps {
24
26
  message: HMSMessage;
@@ -63,6 +65,9 @@ const _HMSHLSMessage: React.FC<HMSHLSMessageProps> = ({ message }) => {
63
65
  pinnedLabel: {
64
66
  color: '#ffffff',
65
67
  },
68
+ link: {
69
+ color: theme.palette.primary_bright,
70
+ },
66
71
  }),
67
72
  []
68
73
  );
@@ -81,6 +86,13 @@ const _HMSHLSMessage: React.FC<HMSHLSMessageProps> = ({ message }) => {
81
86
  message.sender &&
82
87
  message.sender.peerID !== localPeerId); // can remove participants
83
88
 
89
+ const handleLinkPress = async (url: string) => {
90
+ const canOpen = await Linking.canOpenURL(url);
91
+ if (canOpen) {
92
+ await Linking.openURL(url);
93
+ }
94
+ };
95
+
84
96
  return (
85
97
  <View style={styles.container}>
86
98
  {isPinned ? (
@@ -106,7 +118,10 @@ const _HMSHLSMessage: React.FC<HMSHLSMessageProps> = ({ message }) => {
106
118
  {' '}
107
119
  </Text>
108
120
 
109
- {message.message}
121
+ {splitLinksAndContent(message.message, {
122
+ pressHandler: handleLinkPress,
123
+ style: hmsRoomStyles.link,
124
+ })}
110
125
  </Text>
111
126
 
112
127
  {canTakeAction ? (
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useSelector } from 'react-redux';
3
+ import type { StyleProp, ViewStyle } from 'react-native';
3
4
 
4
5
  import { RotateCameraIcon } from '../Icons';
5
6
  import { useCanPublishVideo, useHMSActions } from '../hooks-sdk';
@@ -8,17 +9,25 @@ import { PressableIcon } from './PressableIcon';
8
9
  import { useHMSRoomStyle } from '../hooks-util';
9
10
  import { TestIds } from '../utils/constants';
10
11
 
11
- export const HMSManageCameraRotation = () => {
12
+ interface HMSManageCameraRotationProps extends RotateCameraButtonProps {}
13
+
14
+ export const HMSManageCameraRotation: React.FC<
15
+ HMSManageCameraRotationProps
16
+ > = ({ style }) => {
12
17
  const canPublishVideo = useCanPublishVideo();
13
18
 
14
19
  if (!canPublishVideo) {
15
20
  return null;
16
21
  }
17
22
 
18
- return <RotateCameraButton />;
23
+ return <RotateCameraButton style={style} />;
19
24
  };
20
25
 
21
- const RotateCameraButton = () => {
26
+ interface RotateCameraButtonProps {
27
+ style?: StyleProp<ViewStyle>;
28
+ }
29
+
30
+ const RotateCameraButton: React.FC<RotateCameraButtonProps> = ({ style }) => {
22
31
  const hmsActions = useHMSActions();
23
32
  // TODO: set initial `isLocalVideoMuted` state value as per initial track setting
24
33
  const isLocalVideoMuted = useSelector(
@@ -43,9 +52,14 @@ const RotateCameraButton = () => {
43
52
 
44
53
  return (
45
54
  <PressableIcon
46
- testID={isLocalVideoMuted ? TestIds.switch_camera_disabled : TestIds.switch_camera}
55
+ testID={
56
+ isLocalVideoMuted
57
+ ? TestIds.switch_camera_disabled
58
+ : TestIds.switch_camera
59
+ }
47
60
  onPress={handleVideoMuteTogglePress}
48
61
  disabled={isLocalVideoMuted}
62
+ style={style}
49
63
  >
50
64
  <RotateCameraIcon style={cameraIconStyles} />
51
65
  </PressableIcon>
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { useSelector } from 'react-redux';
3
+ import type { StyleProp, ViewStyle } from 'react-native';
3
4
 
4
5
  import type { RootState } from '../redux';
5
6
  import { useCanPublishVideo, useHMSActions } from '../hooks-sdk';
@@ -7,17 +8,27 @@ import { PressableIcon } from './PressableIcon';
7
8
  import { CameraIcon } from '../Icons';
8
9
  import { TestIds } from '../utils/constants';
9
10
 
10
- export const HMSManageLocalVideo = () => {
11
+ interface HMSManageLocalVideoProps extends ToggleVideoMuteButtonProps {}
12
+
13
+ export const HMSManageLocalVideo: React.FC<HMSManageLocalVideoProps> = ({
14
+ style,
15
+ }) => {
11
16
  const canPublishVideo = useCanPublishVideo();
12
17
 
13
18
  if (!canPublishVideo) {
14
19
  return null;
15
20
  }
16
21
 
17
- return <ToggleVideoMuteButton />;
22
+ return <ToggleVideoMuteButton style={style} />;
18
23
  };
19
24
 
20
- const ToggleVideoMuteButton = () => {
25
+ interface ToggleVideoMuteButtonProps {
26
+ style?: StyleProp<ViewStyle>;
27
+ }
28
+
29
+ const ToggleVideoMuteButton: React.FC<ToggleVideoMuteButtonProps> = ({
30
+ style,
31
+ }) => {
21
32
  const hmsActions = useHMSActions();
22
33
  // TODO: set initial `isLocalVideoMuted` state value as per initial track setting
23
34
  const isLocalVideoMuted = useSelector(
@@ -32,9 +43,14 @@ const ToggleVideoMuteButton = () => {
32
43
 
33
44
  return (
34
45
  <PressableIcon
35
- testID={!!isLocalVideoMuted ? TestIds.camera_muted_btn : TestIds.camera_unmuted_btn}
46
+ testID={
47
+ !!isLocalVideoMuted
48
+ ? TestIds.camera_muted_btn
49
+ : TestIds.camera_unmuted_btn
50
+ }
36
51
  onPress={handleVideoMuteTogglePress}
37
52
  active={isLocalVideoMuted}
53
+ style={style}
38
54
  >
39
55
  <CameraIcon muted={!!isLocalVideoMuted} />
40
56
  </PressableIcon>
@@ -0,0 +1,76 @@
1
+ import * as React from 'react';
2
+ import { useSelector } from 'react-redux';
3
+ import type { StyleProp, ViewStyle } from 'react-native';
4
+
5
+ import { VirtualBackgroundIcon } from '../Icons';
6
+ import { useCanPublishVideo } from '../hooks-sdk';
7
+ import type { RootState } from '../redux';
8
+ import { PressableIcon } from './PressableIcon';
9
+ import { useHMSRoomStyle, useModalType } from '../hooks-util';
10
+ import { VirtualBackgroundBottomSheet } from './VirtualBackgroundBottomSheet';
11
+ import { ModalTypes } from '../utils/types';
12
+
13
+ interface HMSManageVirtualBackgroundProps {
14
+ style?: StyleProp<ViewStyle>;
15
+ }
16
+
17
+ export const HMSManageVirtualBackground: React.FC<
18
+ HMSManageVirtualBackgroundProps
19
+ > = ({ style }) => {
20
+ const canPublishVideo = useCanPublishVideo();
21
+ const videoPluginExists = useSelector(
22
+ (state: RootState) => !!state.hmsStates.videoPlugin
23
+ );
24
+
25
+ if (!canPublishVideo || !videoPluginExists) {
26
+ return null;
27
+ }
28
+
29
+ return <VirtualBackgroundButton style={style} />;
30
+ };
31
+
32
+ interface VirtualBackgroundButtonProps {
33
+ style?: StyleProp<ViewStyle>;
34
+ }
35
+
36
+ const VirtualBackgroundButton: React.FC<VirtualBackgroundButtonProps> = ({
37
+ style,
38
+ }) => {
39
+ const { handleModalVisibleType } = useModalType();
40
+ const isLocalVideoMuted = useSelector(
41
+ (state: RootState) => state.hmsStates.isLocalVideoMuted
42
+ );
43
+ const videoPluginExists = useSelector(
44
+ (state: RootState) => !!state.hmsStates.videoPlugin
45
+ );
46
+
47
+ const handleVideoMuteTogglePress = async () => {
48
+ if (isLocalVideoMuted || !videoPluginExists) {
49
+ return;
50
+ }
51
+ handleModalVisibleType(ModalTypes.VIRTUAL_BACKGROUND);
52
+ };
53
+
54
+ const cameraIconStyles = useHMSRoomStyle(
55
+ (theme) => ({
56
+ tintColor: isLocalVideoMuted
57
+ ? theme.palette.on_surface_low
58
+ : theme.palette.on_surface_high,
59
+ }),
60
+ [isLocalVideoMuted]
61
+ );
62
+
63
+ return (
64
+ <React.Fragment>
65
+ <PressableIcon
66
+ onPress={handleVideoMuteTogglePress}
67
+ disabled={isLocalVideoMuted}
68
+ style={style}
69
+ >
70
+ <VirtualBackgroundIcon style={cameraIconStyles} />
71
+ </PressableIcon>
72
+
73
+ <VirtualBackgroundBottomSheet />
74
+ </React.Fragment>
75
+ );
76
+ };
@@ -6,6 +6,7 @@ import {
6
6
  StyleSheet,
7
7
  Platform,
8
8
  TouchableOpacity,
9
+ Linking,
9
10
  } from 'react-native';
10
11
  import type { HMSMessage } from '@100mslive/react-native-hms';
11
12
  import { Gesture, GestureDetector } from 'react-native-gesture-handler';
@@ -20,6 +21,7 @@ import { PinIcon, ThreeDotsIcon } from '../Icons';
20
21
  import { setSelectedMessageForAction } from '../redux/actions';
21
22
  import { ModalTypes } from '../utils/types';
22
23
  import type { RootState } from '../redux';
24
+ import { splitLinksAndContent } from '../utils/functions';
23
25
 
24
26
  interface HMSMessageProps {
25
27
  message: HMSMessage;
@@ -66,6 +68,9 @@ const _HMSOverlayMessageView: React.FC<HMSMessageProps> = ({ message }) => {
66
68
  pinnedLabel: {
67
69
  color: '#ffffff',
68
70
  },
71
+ link: {
72
+ color: _theme.palette.primary_bright,
73
+ },
69
74
  }),
70
75
  []
71
76
  );
@@ -84,6 +89,13 @@ const _HMSOverlayMessageView: React.FC<HMSMessageProps> = ({ message }) => {
84
89
  message.sender &&
85
90
  message.sender.peerID !== localPeerId); // can remove participants
86
91
 
92
+ const handleLinkPress = async (url: string) => {
93
+ const canOpen = await Linking.canOpenURL(url);
94
+ if (canOpen) {
95
+ await Linking.openURL(url);
96
+ }
97
+ };
98
+
87
99
  return (
88
100
  <View style={styles.container}>
89
101
  {isPinned ? (
@@ -126,7 +138,10 @@ const _HMSOverlayMessageView: React.FC<HMSMessageProps> = ({ message }) => {
126
138
  </View>
127
139
 
128
140
  <Text style={[styles.message, hmsRoomStyles.message]}>
129
- {message.message}
141
+ {splitLinksAndContent(message.message, {
142
+ pressHandler: handleLinkPress,
143
+ style: hmsRoomStyles.link,
144
+ })}
130
145
  </Text>
131
146
  </View>
132
147
  );
@@ -23,6 +23,7 @@ import { ChangeNameModalContent } from './ChangeNameModalContent';
23
23
  import { StopRecordingModalContent } from './StopRecordingModalContent';
24
24
  import { TestIds } from '../utils/constants';
25
25
  import { PollsAndQuizBottomSheet } from './PollsAndQuizBottomSheet';
26
+ import { VirtualBackgroundBottomSheet } from './VirtualBackgroundBottomSheet';
26
27
 
27
28
  interface HMSRoomOptionsProps {}
28
29
 
@@ -74,6 +75,8 @@ export const HMSRoomOptions: React.FC<HMSRoomOptionsProps> = () => {
74
75
 
75
76
  <PollsAndQuizBottomSheet />
76
77
 
78
+ <VirtualBackgroundBottomSheet />
79
+
77
80
  <BottomSheet
78
81
  isVisible={modalVisible === ModalTypes.CHANGE_NAME}
79
82
  dismissModal={dismissModal}
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback, useRef, useState, useEffect } from 'react';
2
- import { StyleSheet, View, Keyboard } from 'react-native';
2
+ import { StyleSheet, View, Keyboard, Platform } from 'react-native';
3
3
  import { useSelector } from 'react-redux';
4
4
  import {
5
5
  Easing,
@@ -21,6 +21,7 @@ import { useKeyboardState } from '../hooks-util';
21
21
  import { HMSStatusBar } from './StatusBar';
22
22
  import { AnimatedFooter } from './AnimatedFooter';
23
23
  import { AnimatedHeader } from './AnimatedHeader';
24
+ import { useIsLandscapeOrientation } from '../utils/dimension';
24
25
  // import { ReconnectionView } from './ReconnectionView';
25
26
 
26
27
  interface MeetingScreenContentProps {
@@ -33,9 +34,14 @@ export const MeetingScreenContent: React.FC<MeetingScreenContentProps> = ({
33
34
  const offset = useSharedValue(1);
34
35
  const timerIdRef = useRef<NodeJS.Timeout | null>(null);
35
36
  const [controlsHidden, setControlsHidden] = useState(false);
37
+ const isLandscapeOrientation = useIsLandscapeOrientation();
36
38
  const isPipModeActive = useSelector(
37
39
  (state: RootState) => state.app.pipModeStatus === PipModes.ACTIVE
38
40
  );
41
+ const whiteboardActive =
42
+ Platform.OS === 'android'
43
+ ? useSelector((state: RootState) => !!state.hmsStates.whiteboard)
44
+ : null;
39
45
  const { keyboardState } = useKeyboardState();
40
46
 
41
47
  const dismissKeyboard = useCallback(() => {
@@ -75,9 +81,28 @@ export const MeetingScreenContent: React.FC<MeetingScreenContentProps> = ({
75
81
  [dismissKeyboard, clearTimer]
76
82
  );
77
83
 
84
+ if (
85
+ !!whiteboardActive &&
86
+ (isLandscapeOrientation ? offset.value === 1 : offset.value < 1)
87
+ ) {
88
+ cancelAnimation(offset);
89
+ offset.value = withTiming(
90
+ isLandscapeOrientation ? 0 : 1,
91
+ { duration: 200, easing: Easing.ease },
92
+ (finished) => {
93
+ if (finished) {
94
+ runOnJS(setControlsHidden)(offset.value === 0);
95
+ }
96
+ }
97
+ );
98
+ }
99
+
78
100
  // Handles Auto hiding the controls for the first time
79
101
  // to make this feature discoverable
80
102
  useEffect(() => {
103
+ if (!!whiteboardActive) {
104
+ return;
105
+ }
81
106
  clearTimer();
82
107
  timerIdRef.current = setTimeout(() => {
83
108
  timerIdRef.current = null;
@@ -85,9 +110,10 @@ export const MeetingScreenContent: React.FC<MeetingScreenContentProps> = ({
85
110
  }, HeaderFooterHideDelayMs);
86
111
 
87
112
  return clearTimer;
88
- }, [clearTimer, toggleControls]);
113
+ }, [clearTimer, toggleControls, !!whiteboardActive]);
89
114
 
90
115
  const tapGesture = Gesture.Tap()
116
+ .enabled(Platform.select({ android: !whiteboardActive, default: true }))
91
117
  .onEnd(() => toggleControls())
92
118
  .requireExternalGestureToFail();
93
119
 
@@ -37,6 +37,7 @@ import { hexToRgbA } from '../utils/theme';
37
37
  import { HMSManageNoiseCancellation } from './HMSManageNoiseCancellation';
38
38
  import { useSelector } from 'react-redux';
39
39
  import type { RootState } from '../redux';
40
+ import { HMSManageVirtualBackground } from './HMSManageVirtualBackground';
40
41
 
41
42
  const backButtonEdges = ['top'] as const;
42
43
  const headerEdges = ['top', 'left', 'right'] as const;
@@ -174,11 +175,17 @@ export const Preview = ({
174
175
  <View style={styles.micAndCameraControls}>
175
176
  <HMSManageLocalAudio />
176
177
 
177
- <View style={styles.manageLocalButtonWrapper}>
178
- <HMSManageLocalVideo />
179
- </View>
178
+ <HMSManageLocalVideo
179
+ style={styles.manageLocalButtonWrapper}
180
+ />
180
181
 
181
- <HMSManageCameraRotation />
182
+ <HMSManageCameraRotation
183
+ style={styles.manageLocalButtonWrapper}
184
+ />
185
+
186
+ <HMSManageVirtualBackground
187
+ style={styles.manageLocalButtonWrapper}
188
+ />
182
189
  </View>
183
190
 
184
191
  {showNoiseCancellationButton && <HMSManageNoiseCancellation />}
@@ -242,7 +249,7 @@ const styles = StyleSheet.create({
242
249
  alignItems: 'center',
243
250
  },
244
251
  manageLocalButtonWrapper: {
245
- marginHorizontal: 16,
252
+ marginLeft: 16,
246
253
  },
247
254
  joinButtonRow: {
248
255
  marginVertical: 16,
@@ -3,7 +3,7 @@ import { View, StyleSheet, Text, TouchableOpacity } from 'react-native';
3
3
  import type { TouchableOpacityProps } from 'react-native';
4
4
  import type { HMSAudioMixingMode } from '@100mslive/react-native-hms';
5
5
  import { HMSRecordingState } from '@100mslive/react-native-hms';
6
- import { useSelector } from 'react-redux';
6
+ import { useDispatch, useSelector } from 'react-redux';
7
7
 
8
8
  import type { RootState } from '../redux';
9
9
  import { ModalTypes } from '../utils/types';
@@ -16,12 +16,14 @@ import {
16
16
  PollVoteIcon,
17
17
  RecordingIcon,
18
18
  ScreenShareIcon,
19
+ VirtualBackgroundIcon,
19
20
  WaveIcon,
20
21
  } from '../Icons';
21
22
  import { BottomSheet, useBottomSheetActions } from './BottomSheet';
22
23
  import {
23
24
  isPublishingAllowed,
24
25
  useHMSConferencingScreenConfig,
26
+ useHMSInstance,
25
27
  useHMSLayoutConfig,
26
28
  useHMSRoomColorPalette,
27
29
  useHMSRoomStyleSheet,
@@ -38,6 +40,8 @@ import { RoomSettingsModalDebugModeContent } from './RoomSettingsModalDebugModeC
38
40
  import { ParticipantsCount } from './ParticipantsCount';
39
41
  import { selectAllowedTracksToPublish } from '../hooks-sdk-selectors';
40
42
  import { TestIds } from '../utils/constants';
43
+ import { addNotification } from '../redux/actions';
44
+ import { NotificationTypes } from '../types';
41
45
 
42
46
  interface RoomSettingsModalContentProps {
43
47
  newAudioMixingMode: HMSAudioMixingMode;
@@ -56,6 +60,8 @@ export const RoomSettingsModalContent: React.FC<
56
60
  > = (props) => {
57
61
  const { closeRoomSettingsModal, setModalVisible } = props;
58
62
 
63
+ const hmsInstance = useHMSInstance();
64
+ const dispatch = useDispatch();
59
65
  const debugMode = useSelector((state: RootState) => state.user.debugMode);
60
66
 
61
67
  const hmsActions = useHMSActions();
@@ -76,6 +82,10 @@ export const RoomSettingsModalContent: React.FC<
76
82
  return permissions?.pollRead || permissions?.pollWrite;
77
83
  });
78
84
 
85
+ const whiteboardAdminPermission = useSelector((state: RootState) => {
86
+ return !!state.hmsStates.localPeer?.role?.permissions?.whiteboard?.admin;
87
+ });
88
+
79
89
  const { registerOnModalHideAction } = useBottomSheetActions();
80
90
 
81
91
  const { canShowParticipants, show } = useShowChatAndParticipants();
@@ -252,6 +262,27 @@ export const RoomSettingsModalContent: React.FC<
252
262
  };
253
263
  // #endregion
254
264
 
265
+ // #region Virtual Background
266
+ const videoPlugin = useSelector(
267
+ (state: RootState) => state.hmsStates.videoPlugin
268
+ );
269
+ const isLocalVideoMuted = useSelector(
270
+ (state: RootState) => state.hmsStates.isLocalVideoMuted
271
+ );
272
+ const virtualBackgroundApplied = useSelector(
273
+ (state: RootState) => state.app.selectedVirtualBackground !== null
274
+ );
275
+ const handleVirtualBackground = () => {
276
+ // Register callback to be called when bottom sheet is hiddden
277
+ registerOnModalHideAction(() => {
278
+ if (!videoPlugin || isLocalVideoMuted) return;
279
+ setModalVisible(ModalTypes.VIRTUAL_BACKGROUND);
280
+ });
281
+ // Close the current bottom sheet
282
+ closeRoomSettingsModal();
283
+ };
284
+ // #endregion
285
+
255
286
  const changeName = () => {
256
287
  // Register callback to be called when bottom sheet is hiddden
257
288
  registerOnModalHideAction(() => {
@@ -271,6 +302,61 @@ export const RoomSettingsModalContent: React.FC<
271
302
  closeRoomSettingsModal();
272
303
  };
273
304
 
305
+ const whiteboard = useSelector(
306
+ (state: RootState) => state.hmsStates.whiteboard
307
+ );
308
+ const screenShareNodesAvailable = useSelector(
309
+ (state: RootState) => state.app.screensharePeerTrackNodes.length > 0
310
+ );
311
+
312
+ const toggleWhiteboard = async () => {
313
+ if (!whiteboardAdminPermission) return;
314
+
315
+ if (whiteboard && whiteboard.isOwner) {
316
+ hmsInstance.interactivityCenter
317
+ .stopWhiteboard()
318
+ .then((success) => {
319
+ console.log('#stopWhiteboard stopped whiteboard ', success);
320
+ })
321
+ .catch((error) => {
322
+ console.log('#stopWhiteboard error ', error);
323
+ });
324
+ } else if (whiteboard && !whiteboard.isOwner) {
325
+ const uid = Math.random().toString(16).slice(2);
326
+ dispatch(
327
+ addNotification({
328
+ id: uid,
329
+ type: NotificationTypes.ERROR,
330
+ title:
331
+ 'Only the peer who started the whiteboard has the ability to close it!',
332
+ })
333
+ );
334
+ } else if (isLocalScreenShared || screenShareNodesAvailable) {
335
+ const uid = Math.random().toString(16).slice(2);
336
+ dispatch(
337
+ addNotification({
338
+ id: uid,
339
+ type: NotificationTypes.ERROR,
340
+ title: isLocalScreenShared
341
+ ? 'Discontinue screenshare to open the whiteboard!'
342
+ : "Can't open whiteboard while screenshare is happening!",
343
+ })
344
+ );
345
+ } else {
346
+ hmsInstance.interactivityCenter
347
+ .startWhiteboard('Interactive Session')
348
+ .then((success) => {
349
+ console.log('#startWhiteboard started whiteboard ', success);
350
+ })
351
+ .catch((error) => {
352
+ console.log('#startWhiteboard error ', error);
353
+ });
354
+ }
355
+
356
+ // Close the current bottom sheet
357
+ closeRoomSettingsModal();
358
+ };
359
+
274
360
  const canShowBRB = useHMSLayoutConfig(
275
361
  (layoutConfig) =>
276
362
  !!layoutConfig?.screens?.conferencing?.default?.elements?.brb
@@ -394,6 +480,17 @@ export const RoomSettingsModalContent: React.FC<
394
480
  isActive: false,
395
481
  hide: !canReadOrWritePoll,
396
482
  },
483
+ {
484
+ id: 'whiteboard',
485
+ icon: (
486
+ <PencilIcon type="board" style={{ width: 20, height: 20 }} />
487
+ ),
488
+ label: whiteboard ? 'Close Whiteboard' : 'Open Whiteboard',
489
+ pressHandler: toggleWhiteboard,
490
+ isActive: !!whiteboard && whiteboard.isOwner,
491
+ disabled: !!whiteboard && !whiteboard.isOwner,
492
+ hide: !whiteboardAdminPermission,
493
+ },
397
494
  {
398
495
  id: 'noise-cancellation',
399
496
  icon: <WaveIcon style={{ width: 20, height: 20 }} />,
@@ -405,6 +502,15 @@ export const RoomSettingsModalContent: React.FC<
405
502
  hide: !showNoiseCancellationButton,
406
503
  disabled: isLocalAudioMuted,
407
504
  },
505
+ {
506
+ id: 'virtual-background',
507
+ icon: <VirtualBackgroundIcon style={{ width: 20, height: 20 }} />,
508
+ label: 'Virtual Background',
509
+ pressHandler: handleVirtualBackground,
510
+ isActive: virtualBackgroundApplied,
511
+ hide: !videoPlugin,
512
+ disabled: isLocalVideoMuted,
513
+ },
408
514
  ].filter((itm) => !itm.hide),
409
515
  true
410
516
  ).map((itm, idx) => {
@@ -458,7 +564,7 @@ type SettingItemProps = {
458
564
  onPress(): void;
459
565
  disabled?: TouchableOpacityProps['disabled'];
460
566
  testID?: TouchableOpacityProps['testID'];
461
- isActive?: boolean;
567
+ isActive?: boolean | null;
462
568
  };
463
569
 
464
570
  const SettingItem: React.FC<SettingItemProps> = ({
@@ -25,13 +25,15 @@ const _TilesContainer: React.FC<TilesContainerProps> = ({
25
25
  const { width: safeWidth } = useSafeAreaFrame();
26
26
  const isLandscapeOrientation = useIsLandscapeOrientation();
27
27
 
28
- const screenshareTilesAvailable = useSelector(
29
- (state: RootState) => state.app.screensharePeerTrackNodes.length > 0
28
+ const screenshareTilesOrWhiteboardAcive = useSelector(
29
+ (state: RootState) =>
30
+ state.app.screensharePeerTrackNodes.length > 0 ||
31
+ !!state.hmsStates.whiteboard
30
32
  );
31
33
 
32
34
  const stylesConfig = computeTileWidthAndHeight(peerTrackNodes.length, {
33
35
  isLandscapeOrientation,
34
- type: screenshareTilesAvailable ? 'row' : 'default',
36
+ type: screenshareTilesOrWhiteboardAcive ? 'row' : 'default',
35
37
  });
36
38
 
37
39
  // In this layout, Tile will take as much height and width as possible
@@ -44,12 +46,12 @@ const _TilesContainer: React.FC<TilesContainerProps> = ({
44
46
  // If tile are growable, then we want whatever remaining space to be between them
45
47
  {
46
48
  justifyContent:
47
- screenshareTilesAvailable && peerTrackNodes.length === 1
49
+ screenshareTilesOrWhiteboardAcive && peerTrackNodes.length === 1
48
50
  ? 'center'
49
51
  : growableTileLayout
50
52
  ? 'space-between'
51
53
  : 'center',
52
- flexDirection: screenshareTilesAvailable
54
+ flexDirection: screenshareTilesOrWhiteboardAcive
53
55
  ? 'row'
54
56
  : isLandscapeOrientation
55
57
  ? 'row'