fcr-ui-scene 3.1.1 → 3.3.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 (372) hide show
  1. package/installer/icons/favicon.ico +0 -0
  2. package/installer/icons/favicon.png +0 -0
  3. package/installer/mac/entitlements.mac.plist +16 -0
  4. package/lib/base.d.ts +0 -1
  5. package/lib/base.js +16 -0
  6. package/lib/common/device-store.d.ts +4 -5
  7. package/lib/common/device-store.js +178 -86
  8. package/lib/common/device-stream-store.d.ts +3 -2
  9. package/lib/common/device-stream-store.js +94 -72
  10. package/lib/common/event-store.d.ts +20 -3
  11. package/lib/common/event-store.js +43 -5
  12. package/lib/common/security-store.d.ts +16 -16
  13. package/lib/common/security-store.js +278 -124
  14. package/lib/electron/app.js +13 -5
  15. package/lib/electron/bootstrap-dev.d.ts +1 -0
  16. package/lib/electron/bootstrap-dev.js +51 -0
  17. package/lib/electron/bootstrap-sdk.d.ts +1 -0
  18. package/lib/electron/bootstrap-sdk.js +56 -0
  19. package/lib/electron/bootstrap.d.ts +1 -0
  20. package/lib/electron/bootstrap.js +56 -0
  21. package/lib/electron/default-options.js +1 -1
  22. package/lib/electron/dev.d.ts +1 -0
  23. package/lib/electron/dev.js +51 -0
  24. package/lib/electron/injections.d.ts +3 -4
  25. package/lib/electron/injections.js +46 -33
  26. package/lib/electron/logger.d.ts +6 -0
  27. package/lib/electron/logger.js +66 -0
  28. package/lib/electron/main.js +15 -11
  29. package/lib/electron/plugins/meeting-state.d.ts +2 -0
  30. package/lib/electron/plugins/meeting-state.js +39 -0
  31. package/lib/electron/preload.js +2 -1
  32. package/lib/electron/tools.js +9 -0
  33. package/lib/electron/window.d.ts +1 -1
  34. package/lib/electron/window.js +14 -2
  35. package/lib/fragments/control-bar/context.d.ts +0 -1
  36. package/lib/fragments/control-bar/control-bar-store.d.ts +34 -1
  37. package/lib/fragments/control-bar/control-bar-store.js +394 -81
  38. package/lib/fragments/control-bar/device/index.js +12 -3
  39. package/lib/fragments/control-bar/index.css +15 -10
  40. package/lib/fragments/control-bar/index.js +19 -1
  41. package/lib/fragments/control-bar/meeting-details/meeting-detail.css +109 -0
  42. package/lib/fragments/control-bar/meeting-details/meeting-details-portal.d.ts +3 -0
  43. package/lib/fragments/control-bar/meeting-details/meeting-details-portal.js +60 -0
  44. package/lib/fragments/control-bar/meeting-details/meeting-details.d.ts +2 -0
  45. package/lib/fragments/control-bar/meeting-details/meeting-details.js +179 -0
  46. package/lib/fragments/control-bar/more-actions/index.css +53 -0
  47. package/lib/fragments/control-bar/more-actions/index.js +77 -37
  48. package/lib/fragments/control-bar/security-content/index.css +10 -0
  49. package/lib/fragments/control-bar/security-content/index.js +43 -18
  50. package/lib/fragments/control-bar/view.js +8 -2
  51. package/lib/fragments/live-streaming/context.d.ts +0 -1
  52. package/lib/fragments/live-streaming/store.js +27 -17
  53. package/lib/fragments/share-screen-selection/context.d.ts +0 -1
  54. package/lib/fragments/share-screen-selection/selection-store.d.ts +0 -1
  55. package/lib/fragments/share-screen-selection/selection-store.js +34 -33
  56. package/lib/fragments/share-screen-selection/view.js +7 -0
  57. package/lib/fragments/toolbar/components/color-picker/components/color.js +2 -0
  58. package/lib/fragments/toolbar/components/color-picker/components/panel.js +4 -0
  59. package/lib/fragments/toolbar/components/color-picker/components/picker.js +2 -0
  60. package/lib/fragments/toolbar/components/color-picker/index.js +5 -1
  61. package/lib/fragments/toolbar/components/color-picker.js +3 -1
  62. package/lib/fragments/toolbar/components/eraser-picker.js +4 -13
  63. package/lib/fragments/toolbar/components/extension-toolbar-item.js +5 -0
  64. package/lib/fragments/toolbar/components/extra-tool-picker.js +4 -0
  65. package/lib/fragments/toolbar/components/pen-picker.js +2 -0
  66. package/lib/fragments/toolbar/components/screen-capture-picker.js +2 -0
  67. package/lib/fragments/toolbar/components/shape-picker.js +2 -0
  68. package/lib/fragments/toolbar/hooks.d.ts +1 -1
  69. package/lib/fragments/toolbar/hooks.js +13 -8
  70. package/lib/fragments/toolbar/store.d.ts +4 -4
  71. package/lib/fragments/toolbar/store.js +20 -2
  72. package/lib/fragments/toolbar/view.js +2 -0
  73. package/lib/global.d.ts +1 -0
  74. package/lib/hooks/meeting-time.d.ts +2 -2
  75. package/lib/login-confirm-dialog.d.ts +12 -0
  76. package/lib/login-confirm-dialog.js +80 -0
  77. package/lib/modules/action-bar/action-bar-collapes-items.js +14 -5
  78. package/lib/modules/action-bar/chat/index.js +6 -6
  79. package/lib/modules/action-bar/context.d.ts +0 -1
  80. package/lib/modules/action-bar/device/index.css +7 -2
  81. package/lib/modules/action-bar/device/index.d.ts +2 -2
  82. package/lib/modules/action-bar/device/index.js +6 -4
  83. package/lib/modules/action-bar/index.css +63 -12
  84. package/lib/modules/action-bar/index.d.ts +3 -2
  85. package/lib/modules/action-bar/index.dev.js +8 -7
  86. package/lib/modules/action-bar/index.js +21 -0
  87. package/lib/modules/action-bar/item-placement.d.ts +1 -2
  88. package/lib/modules/action-bar/item.js +5 -0
  89. package/lib/modules/action-bar/leave/assign-host.d.ts +3 -1
  90. package/lib/modules/action-bar/leave/assign-host.js +7 -7
  91. package/lib/modules/action-bar/leave/index.js +35 -7
  92. package/lib/modules/action-bar/leave/leave-meeting.d.ts +11 -1
  93. package/lib/modules/action-bar/leave/leave-meeting.js +25 -16
  94. package/lib/modules/action-bar/more/poppover-content.d.ts +0 -1
  95. package/lib/modules/action-bar/more/poppover-content.js +14 -4
  96. package/lib/modules/action-bar/participants/index.css +12 -0
  97. package/lib/modules/action-bar/participants/index.js +21 -14
  98. package/lib/modules/action-bar/screen-share/index.js +5 -1
  99. package/lib/modules/action-bar/screen-share/submenu.js +17 -22
  100. package/lib/modules/action-bar/security/drop-menu.js +124 -14
  101. package/lib/modules/action-bar/security/index.js +1 -1
  102. package/lib/modules/action-bar/settings/index.js +1 -1
  103. package/lib/modules/action-bar/store.d.ts +45 -21
  104. package/lib/modules/action-bar/store.js +544 -134
  105. package/lib/modules/action-bar/view.js +65 -42
  106. package/lib/modules/audio-stream/index.js +12 -6
  107. package/lib/modules/chat/chat-bar/index.js +46 -27
  108. package/lib/modules/chat/chat-select/index.css +19 -4
  109. package/lib/modules/chat/chat-select/index.d.ts +0 -1
  110. package/lib/modules/chat/chat-select/index.js +29 -3
  111. package/lib/modules/chat/chat.d.ts +2 -3
  112. package/lib/modules/chat/chat.js +210 -107
  113. package/lib/modules/chat/contex.d.ts +0 -1
  114. package/lib/modules/chat/demo-wrapper.d.ts +0 -1
  115. package/lib/modules/chat/index.css +49 -0
  116. package/lib/modules/chat/index.d.ts +3 -3
  117. package/lib/modules/chat/index.dev.js +4 -4
  118. package/lib/modules/chat/index.js +32 -11
  119. package/lib/modules/chat/message-list.js +81 -49
  120. package/lib/modules/chat/store.d.ts +50 -4
  121. package/lib/modules/chat/store.js +303 -124
  122. package/lib/modules/chat/util.js +1 -1
  123. package/lib/modules/connection-gateway/components/phone/components/callinfo/index.js +2 -0
  124. package/lib/modules/connection-gateway/components/phone/index.js +2 -0
  125. package/lib/modules/connection-gateway/index.d.ts +3 -2
  126. package/lib/modules/connection-gateway/index.js +2 -0
  127. package/lib/modules/connection-gateway/store.d.ts +6 -4
  128. package/lib/modules/connection-gateway/store.js +46 -15
  129. package/lib/modules/device-pretest/audio-preview/microphone-detection.d.ts +1 -0
  130. package/lib/modules/device-pretest/audio-preview/microphone-detection.js +3 -2
  131. package/lib/modules/device-pretest/audio-preview/speaker-control.d.ts +0 -1
  132. package/lib/modules/device-pretest/audio-preview/speaker-control.js +1 -1
  133. package/lib/modules/device-pretest/context.d.ts +0 -1
  134. package/lib/modules/device-pretest/index.css +0 -4
  135. package/lib/modules/device-pretest/index.d.ts +0 -1
  136. package/lib/modules/device-pretest/index.js +2 -1
  137. package/lib/modules/device-pretest/settings/beauty.js +19 -6
  138. package/lib/modules/device-pretest/settings/video-effect.d.ts +0 -1
  139. package/lib/modules/device-pretest/settings/video-settings-basic.js +1 -0
  140. package/lib/modules/device-pretest/settings/virtual-background-setting.js +2 -0
  141. package/lib/modules/device-pretest/store.js +34 -19
  142. package/lib/modules/dialog/components/chat/electron.js +3 -2
  143. package/lib/modules/dialog/components/chat/index.js +1 -1
  144. package/lib/modules/dialog/components/confirm/electron.js +7 -5
  145. package/lib/modules/dialog/components/confirm/index.js +16 -2
  146. package/lib/modules/dialog/components/connection-gateway/electron.js +4 -2
  147. package/lib/modules/dialog/components/connection-gateway/index.css +0 -2
  148. package/lib/modules/dialog/components/device-setting/electron.d.ts +2 -0
  149. package/lib/modules/dialog/components/device-setting/electron.js +74 -0
  150. package/lib/modules/dialog/components/device-setting/index.css +26 -0
  151. package/lib/modules/dialog/components/device-setting/index.d.ts +4 -0
  152. package/lib/modules/dialog/components/device-setting/index.js +60 -0
  153. package/lib/modules/dialog/components/operation-waiting-room/electron.d.ts +5 -0
  154. package/lib/modules/dialog/components/operation-waiting-room/electron.js +89 -0
  155. package/lib/modules/dialog/components/operation-waiting-room/index.css +44 -0
  156. package/lib/modules/dialog/components/operation-waiting-room/index.d.ts +5 -0
  157. package/lib/modules/dialog/components/operation-waiting-room/index.js +156 -0
  158. package/lib/modules/dialog/components/participant/electron.js +8 -2
  159. package/lib/modules/dialog/components/remove-admit-waiting-room/electron.d.ts +5 -0
  160. package/lib/modules/dialog/components/remove-admit-waiting-room/electron.js +89 -0
  161. package/lib/modules/dialog/components/remove-admit-waiting-room/index.css +50 -0
  162. package/lib/modules/dialog/components/remove-admit-waiting-room/index.d.ts +5 -0
  163. package/lib/modules/dialog/components/remove-admit-waiting-room/index.js +90 -0
  164. package/lib/modules/dialog/components/share-screen-selection/index.js +1 -1
  165. package/lib/modules/dialog/components/whiteboard/index.js +2 -1
  166. package/lib/modules/dialog/context.d.ts +0 -1
  167. package/lib/modules/dialog/dialogs.d.ts +0 -2
  168. package/lib/modules/dialog/dialogs.js +62 -103
  169. package/lib/modules/dialog/index.css +7 -6
  170. package/lib/modules/dialog/index.d.ts +1 -1
  171. package/lib/modules/dialog/index.js +17 -0
  172. package/lib/modules/dialog/store.d.ts +6 -2
  173. package/lib/modules/dialog/store.js +52 -9
  174. package/lib/modules/dialog/view.js +2 -0
  175. package/lib/modules/event-notification/context.d.ts +2 -0
  176. package/lib/modules/event-notification/context.js +9 -0
  177. package/lib/modules/event-notification/index.css +58 -0
  178. package/lib/modules/event-notification/index.d.ts +13 -0
  179. package/lib/modules/event-notification/index.js +48 -0
  180. package/lib/modules/event-notification/store.d.ts +17 -0
  181. package/lib/modules/event-notification/store.js +133 -0
  182. package/lib/modules/event-notification/view.d.ts +5 -0
  183. package/lib/modules/event-notification/view.js +114 -0
  184. package/lib/modules/event-toast/context.d.ts +0 -1
  185. package/lib/modules/event-toast/store.js +16 -0
  186. package/lib/modules/invite/context.d.ts +0 -1
  187. package/lib/modules/invite/index.css +4 -4
  188. package/lib/modules/invite/index.d.ts +2 -2
  189. package/lib/modules/invite/pstn-invite.js +4 -1
  190. package/lib/modules/invite/store.d.ts +2 -2
  191. package/lib/modules/invite/store.js +27 -7
  192. package/lib/modules/invite/voip-invite.d.ts +0 -1
  193. package/lib/modules/invite/voip-invite.js +1 -1
  194. package/lib/modules/layout/components/Aside.d.ts +0 -1
  195. package/lib/modules/layout/components/Aside.js +4 -1
  196. package/lib/modules/layout/components/Carousel.js +6 -5
  197. package/lib/modules/layout/components/Gallery.js +16 -9
  198. package/lib/modules/layout/components/Layout.js +82 -57
  199. package/lib/modules/layout/components/index.css +42 -5
  200. package/lib/modules/layout/components/index.js +3 -0
  201. package/lib/modules/layout/context.d.ts +0 -1
  202. package/lib/modules/layout/index.css +30 -0
  203. package/lib/modules/layout/index.dev.js +11 -11
  204. package/lib/modules/layout/index.js +0 -6
  205. package/lib/modules/layout/member-window/index.css +5 -5
  206. package/lib/modules/layout/member-window/index.d.ts +7 -7
  207. package/lib/modules/layout/member-window/index.js +59 -13
  208. package/lib/modules/layout/store.d.ts +61 -50
  209. package/lib/modules/layout/store.js +517 -342
  210. package/lib/modules/layout/type.d.ts +2 -1
  211. package/lib/modules/layout/video-window-datasource.d.ts +14 -8
  212. package/lib/modules/layout/video-window-datasource.js +129 -78
  213. package/lib/modules/live-streaming/context.d.ts +0 -1
  214. package/lib/modules/live-streaming/index.d.ts +2 -2
  215. package/lib/modules/live-streaming/index.dev.js +5 -4
  216. package/lib/modules/live-streaming/store.d.ts +2 -2
  217. package/lib/modules/live-streaming/store.js +32 -11
  218. package/lib/modules/participant/attendee/index.d.ts +12 -3
  219. package/lib/modules/participant/attendee/index.js +142 -30
  220. package/lib/modules/participant/context.d.ts +0 -1
  221. package/lib/modules/participant/index.css +20 -0
  222. package/lib/modules/participant/index.d.ts +5 -2
  223. package/lib/modules/participant/index.dev.js +14 -12
  224. package/lib/modules/participant/index.js +27 -0
  225. package/lib/modules/participant/member-list-data-source.d.ts +3 -3
  226. package/lib/modules/participant/member-list-data-source.js +29 -3
  227. package/lib/modules/participant/room-control-drop-menu/index.css +37 -0
  228. package/lib/modules/participant/room-control-drop-menu/index.js +35 -1
  229. package/lib/modules/participant/store.d.ts +59 -34
  230. package/lib/modules/participant/store.js +541 -222
  231. package/lib/modules/participant/view.d.ts +6 -6
  232. package/lib/modules/participant/view.js +138 -34
  233. package/lib/modules/setting/audio-settings/audio-settings.js +16 -12
  234. package/lib/modules/setting/audio-settings/index.css +2 -2
  235. package/lib/modules/setting/context.d.ts +0 -1
  236. package/lib/modules/setting/general-settings/general-settings.js +2 -1
  237. package/lib/modules/setting/general-settings/index.css +2 -2
  238. package/lib/modules/setting/index.css +1 -5
  239. package/lib/modules/setting/index.d.ts +2 -2
  240. package/lib/modules/setting/index.dev.js +14 -12
  241. package/lib/modules/setting/index.js +16 -0
  242. package/lib/modules/setting/minutes-settings/index.css +65 -0
  243. package/lib/modules/setting/minutes-settings/minutes-settings.d.ts +4 -0
  244. package/lib/modules/setting/minutes-settings/minutes-settings.js +159 -0
  245. package/lib/modules/setting/state/index.css +0 -4
  246. package/lib/modules/setting/state/index.js +11 -1
  247. package/lib/modules/setting/storage-settings/storage-settings.js +1 -1
  248. package/lib/modules/setting/store.d.ts +7 -5
  249. package/lib/modules/setting/store.js +69 -46
  250. package/lib/modules/setting/translate-settings/index.css +45 -0
  251. package/lib/modules/setting/translate-settings/language-select.d.ts +12 -0
  252. package/lib/modules/setting/translate-settings/language-select.js +50 -0
  253. package/lib/modules/setting/translate-settings/translate-settings.d.ts +4 -0
  254. package/lib/modules/setting/translate-settings/translate-settings.js +139 -0
  255. package/lib/modules/setting/video-settings/index.css +15 -6
  256. package/lib/modules/setting/video-settings/video-settings-basic.js +3 -2
  257. package/lib/modules/setting/video-settings/video-settings.js +5 -1
  258. package/lib/modules/setting/view.js +34 -2
  259. package/lib/modules/share-screen/index.d.ts +4 -2
  260. package/lib/modules/share-screen/index.dev.js +17 -14
  261. package/lib/modules/share-screen/index.js +2 -0
  262. package/lib/modules/share-screen/selection/index.css +2 -0
  263. package/lib/modules/share-screen/selection/index.js +44 -6
  264. package/lib/modules/share-screen/share-state-bar/index.css +49 -11
  265. package/lib/modules/share-screen/share-state-bar/index.d.ts +0 -1
  266. package/lib/modules/share-screen/share-state-bar/index.js +51 -20
  267. package/lib/modules/share-screen/store.d.ts +23 -13
  268. package/lib/modules/share-screen/store.js +733 -606
  269. package/lib/modules/state-bar/context.d.ts +0 -1
  270. package/lib/modules/state-bar/index.css +2 -2
  271. package/lib/modules/state-bar/index.d.ts +2 -2
  272. package/lib/modules/state-bar/index.dev.js +12 -10
  273. package/lib/modules/state-bar/layout-config.js +2 -0
  274. package/lib/modules/state-bar/live-streaming-state.js +3 -0
  275. package/lib/modules/state-bar/meeting-detail.css +6 -4
  276. package/lib/modules/state-bar/meeting-details.js +29 -3
  277. package/lib/modules/state-bar/meeting-network-state.css +14 -3
  278. package/lib/modules/state-bar/meeting-network-state.js +10 -4
  279. package/lib/modules/state-bar/recording.js +9 -11
  280. package/lib/modules/state-bar/store.d.ts +7 -5
  281. package/lib/modules/state-bar/store.js +68 -8
  282. package/lib/modules/state-bar/view.js +4 -8
  283. package/lib/modules/video-window/context.d.ts +0 -1
  284. package/lib/modules/video-window/deviceState/index.d.ts +3 -3
  285. package/lib/modules/video-window/index.css +1 -0
  286. package/lib/modules/video-window/members/index.js +7 -4
  287. package/lib/modules/video-window/store.d.ts +5 -4
  288. package/lib/modules/video-window/store.js +49 -17
  289. package/lib/modules/video-window/topControl/index.js +7 -0
  290. package/lib/modules/video-window/view.js +2 -0
  291. package/lib/modules/waiting-room-layout/context.d.ts +2 -0
  292. package/lib/modules/waiting-room-layout/context.js +9 -0
  293. package/lib/modules/waiting-room-layout/index.css +71 -0
  294. package/lib/modules/waiting-room-layout/index.d.ts +8 -0
  295. package/lib/modules/waiting-room-layout/index.js +47 -0
  296. package/lib/modules/waiting-room-layout/store.d.ts +30 -0
  297. package/lib/modules/waiting-room-layout/store.js +189 -0
  298. package/lib/modules/waiting-room-layout/type.d.ts +0 -0
  299. package/lib/modules/waiting-room-layout/type.js +1 -0
  300. package/lib/modules/waiting-room-layout/view.d.ts +3 -0
  301. package/lib/modules/waiting-room-layout/view.js +67 -0
  302. package/lib/modules/whiteboard/app.js +2 -8
  303. package/lib/modules/whiteboard/components/control-bar/index.css +3 -0
  304. package/lib/modules/whiteboard/components/control-bar/store.d.ts +0 -1
  305. package/lib/modules/whiteboard/components/control-bar/store.js +29 -29
  306. package/lib/modules/whiteboard/components/loading/index.js +2 -2
  307. package/lib/modules/whiteboard/components/multi-window/index.js +8 -3
  308. package/lib/modules/whiteboard/components/pagination/store.d.ts +0 -1
  309. package/lib/modules/whiteboard/components/progress/electron.js +3 -2
  310. package/lib/modules/whiteboard/components/progress/style.css +4 -3
  311. package/lib/modules/whiteboard/components/switch-theme/index.css +4 -0
  312. package/lib/modules/whiteboard/components/switch-theme/index.d.ts +2 -1
  313. package/lib/modules/whiteboard/components/switch-theme/index.js +29 -17
  314. package/lib/modules/whiteboard/components/switch-theme/item.d.ts +1 -0
  315. package/lib/modules/whiteboard/components/switch-theme/item.js +11 -2
  316. package/lib/modules/whiteboard/components/switch-theme/libs.d.ts +2 -1
  317. package/lib/modules/whiteboard/components/switch-theme/libs.js +21 -20
  318. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.js +2 -0
  319. package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.js +3 -1
  320. package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.js +11 -9
  321. package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.js +4 -0
  322. package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +5 -0
  323. package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +2 -0
  324. package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +18 -12
  325. package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +3 -3
  326. package/lib/modules/whiteboard/components/toolbar/hooks/index.js +16 -11
  327. package/lib/modules/whiteboard/components/toolbar/index.js +9 -0
  328. package/lib/modules/whiteboard/components/toolbar/store.d.ts +8 -7
  329. package/lib/modules/whiteboard/components/toolbar/store.js +25 -4
  330. package/lib/modules/whiteboard/context.d.ts +7 -3
  331. package/lib/modules/whiteboard/context.js +6 -4
  332. package/lib/modules/whiteboard/index.d.ts +6 -8
  333. package/lib/modules/whiteboard/index.js +310 -255
  334. package/lib/modules/whiteboard/type.d.ts +4 -12
  335. package/lib/modules/whiteboard/type.js +6 -16
  336. package/lib/modules/whiteboard/utils.d.ts +1 -0
  337. package/lib/modules/whiteboard/utils.js +12 -1
  338. package/lib/plugins/browser-runtime-plugin.js +2 -1
  339. package/lib/plugins/module-dev-plugin.js +12 -10
  340. package/lib/plugins/multi-lang-plugin.d.ts +1 -5
  341. package/lib/plugins/multi-lang-plugin.js +2 -0
  342. package/lib/runtime.d.ts +3 -5
  343. package/lib/translations/enUS.d.ts +590 -0
  344. package/lib/translations/enUS.js +608 -6
  345. package/lib/translations/zhCN.d.ts +588 -0
  346. package/lib/translations/zhCN.js +604 -4
  347. package/lib/type.d.ts +6 -2
  348. package/lib/ui-manager.d.ts +7 -3
  349. package/lib/ui-manager.js +597 -143
  350. package/lib/ui-scene.d.ts +1 -0
  351. package/lib/ui-scene.js +32 -22
  352. package/lib/utilities/board-context.d.ts +0 -1
  353. package/lib/utilities/constant.d.ts +47 -5
  354. package/lib/utilities/constant.js +44 -1
  355. package/lib/utilities/copyText.js +1 -1
  356. package/lib/utilities/extract.js +26 -3
  357. package/lib/utilities/hooks.js +2 -0
  358. package/lib/utilities/parameters.js +2 -2
  359. package/lib/utilities/renderer-event.js +28 -0
  360. package/lib/utilities/renderer.d.ts +1 -0
  361. package/lib/utilities/renderer.js +15 -6
  362. package/lib/utilities/tools.js +5 -2
  363. package/lib/utilities/ui-resources.d.ts +2 -2
  364. package/lib/utilities/ui-resources.js +20 -3
  365. package/lib/utilities/video-track-render-context.d.ts +0 -1
  366. package/package.json +17 -16
  367. package/public/assets/fcr_defaultpage.png +0 -0
  368. package/public/assets/login_confirm.png +0 -0
  369. package/public/index.html +29 -11
  370. package/lib/modules/device-pretest/settings/index.css +0 -15
  371. package/lib/modules/participant/attendee/participants-more-action.d.ts +0 -18
  372. package/lib/modules/participant/attendee/participants-more-action.js +0 -275
@@ -13,6 +13,22 @@ require("core-js/modules/es.number.constructor.js");
13
13
  require("core-js/modules/es.object.create.js");
14
14
  require("core-js/modules/es.object.define-property.js");
15
15
  require("core-js/modules/es.object.get-own-property-descriptor.js");
16
+ require("core-js/modules/esnext.function.metadata.js");
17
+ require("core-js/modules/esnext.map.delete-all.js");
18
+ require("core-js/modules/esnext.map.emplace.js");
19
+ require("core-js/modules/esnext.map.every.js");
20
+ require("core-js/modules/esnext.map.filter.js");
21
+ require("core-js/modules/esnext.map.find.js");
22
+ require("core-js/modules/esnext.map.find-key.js");
23
+ require("core-js/modules/esnext.map.includes.js");
24
+ require("core-js/modules/esnext.map.key-of.js");
25
+ require("core-js/modules/esnext.map.map-keys.js");
26
+ require("core-js/modules/esnext.map.map-values.js");
27
+ require("core-js/modules/esnext.map.merge.js");
28
+ require("core-js/modules/esnext.map.reduce.js");
29
+ require("core-js/modules/esnext.map.some.js");
30
+ require("core-js/modules/esnext.map.update.js");
31
+ require("core-js/modules/esnext.symbol.metadata.js");
16
32
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
17
33
  var _typeof = require("@babel/runtime/helpers/typeof");
18
34
  Object.defineProperty(exports, "__esModule", {
@@ -37,6 +53,17 @@ require("core-js/modules/es.promise.finally.js");
37
53
  require("core-js/modules/es.string.includes.js");
38
54
  require("core-js/modules/es.string.iterator.js");
39
55
  require("core-js/modules/es.weak-map.js");
56
+ require("core-js/modules/esnext.async-iterator.filter.js");
57
+ require("core-js/modules/esnext.async-iterator.find.js");
58
+ require("core-js/modules/esnext.async-iterator.for-each.js");
59
+ require("core-js/modules/esnext.async-iterator.some.js");
60
+ require("core-js/modules/esnext.iterator.constructor.js");
61
+ require("core-js/modules/esnext.iterator.filter.js");
62
+ require("core-js/modules/esnext.iterator.find.js");
63
+ require("core-js/modules/esnext.iterator.for-each.js");
64
+ require("core-js/modules/esnext.iterator.some.js");
65
+ require("core-js/modules/esnext.weak-map.delete-all.js");
66
+ require("core-js/modules/esnext.weak-map.emplace.js");
40
67
  require("core-js/modules/web.dom-collections.for-each.js");
41
68
  require("core-js/modules/web.dom-collections.iterator.js");
42
69
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -58,19 +85,18 @@ var _constant = require("../../utilities/constant");
58
85
  var _rendererEvent = require("../../utilities/renderer-event");
59
86
  var _platform = require("../../utilities/platform");
60
87
  var _i18n = require("agora-ui-foundation/lib/i18n");
61
- var _enums = require("agora-edu-core/lib/room-control/whiteboard-control/enums");
62
88
  var _decorator = require("agora-foundation/lib/decorator");
63
89
  var _type5 = require("../action-bar/type");
64
90
  var _tools = require("../../utilities/tools");
65
91
  var _react = require("react");
66
92
  var _type6 = require("agora-ui-foundation/lib/components/icon/type");
67
93
  var _icon = require("agora-ui-foundation/lib/components/icon");
68
- var _type7 = require("../whiteboard/type");
94
+ var _types = require("agora-edu-core/lib/room-control/whiteboard-control/types");
69
95
  var _jsxRuntime = require("react/jsx-runtime");
70
96
  var _ShareScreenStore;
71
- var _initProto, _init__shareSelectionDialogId, _init__controlBarDialogId, _init__videoWindowDialogId, _init__isHost, _init__shareLocked, _init__screenTrack, _init__shareAudioTrack, _init__localUser, _init_screenSharingState, _init_applicationCaptureSources, _init_screenCaptureSources, _init_hasScreenCapturePermission, _init_showConfirm, _init_shareControlBarActive, _init_withAudio, _init_currentShareAudioProcessingChannel, _init_currentShareId, _init_sharerId, _init_currentShareType, _init_currentSelection, _init_currentSelectionType, _init_shareWithAudio, _init_boardOwnerUser, _init_localUser, _init_localUserRole, _init_title, _handleChooseScreenDecs, _init_handleChooseScreen, _setShareWithAudioStateDecs, _setShareAudioProcessingChannelDecs, _handleCheckScreenCapturePermissionDecs, _handleToSettingDecs, _setShareWithAudioDecs, _muteLocalAudioDecs, _muteLocalVideoDecs, _handleShareScreenResourceDecs, _handleStartShareDecs, _handleShareStartWithAudioDecs, _handleShareStopWithAudioDecs, _handleStopShareDecs, _handleReplaceScreenDecs, _startPreviewDecs, _setShareControlBarActiveDecs, _setCurrentCameraIdDecs, _setCurrentSpeakerIdDecs, _setCurrentMicrophoneIdDecs, _setAllowChangeSelfNameDecs, _setAllowChatDecs, _setAllowJoinWithMuteAudioDecs, _setAllowShareScreenDecs, _setAllowUnmuteSelfVideoDecs, _setAllowUnmuteSelfAudioDecs, _setLockRoomEnabledDecs, _setWaitingRoomEnabledDecs, _openDialogDecs, _closeShareScreenSelectionDecs, _openControlBarDecs, _setControlBarWindowIdDecs, _openVideoWindowDialogDecs, _closeControlBarDecs, _closeVideoWindowDialogDecs, _handleScreenCaptureStateUpdatedDecs, _updateCameraListDecs, _updateMicrophoneListDecs, _updateSpeakerListDecs, _handleLiveStreamingStateUpdatedDecs, _setShareLockDecs, _refreshLocalUserDecs, _ref;
72
- function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
73
- function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
97
+ var _initProto, _init__shareSelectionDialogId, _init__controlBarDialogId, _init__videoWindowDialogId, _init__isHost, _init__shareLocked, _init__screenTrack, _init__shareAudioTrack, _init__localUser, _init_screenSharingState, _init_applicationCaptureSources, _init_screenCaptureSources, _init_hasScreenCapturePermission, _init_showConfirm, _init_shareControlBarActive, _init_withAudio, _init_currentShareAudioProcessingChannel, _init_currentShareId, _init_sharerId, _init_currentShareType, _init_currentSelection, _init_currentSelectionType, _init_shareWithAudio, _init_boardOwnerUser, _init_localUser, _init_localUserRole, _init_title, _init_localMicrophoneMute, _handleChooseScreenDecs, _init_handleChooseScreen, _setShareWithAudioStateDecs, _setShareAudioProcessingChannelDecs, _sendLocalAudioStateEventDecs, _handleCheckScreenCapturePermissionDecs, _handleToSettingDecs, _muteLocalAudioDecs, _muteLocalVideoDecs, _handleShareStartWithAudioDecs, _handleShareStopWithAudioDecs, _startPreviewDecs, _setShareControlBarActiveDecs, _setCurrentCameraIdDecs, _setCurrentSpeakerIdDecs, _setCurrentMicrophoneIdDecs, _setAllowChangeSelfNameDecs, _setAllowChatDecs, _setAllowJoinWithMuteAudioDecs, _setAllowShareScreenDecs, _setAllowUnmuteSelfVideoDecs, _setAllowUnmuteSelfAudioDecs, _setLockRoomEnabledDecs, _openDialogDecs, _closeShareScreenSelectionDecs, _openControlBarDecs, _setControlBarWindowIdDecs, _openVideoWindowDialogDecs, _closeControlBarDecs, _closeVideoWindowDialogDecs, _setShareWithAudioDecs, _setWithAudioStateDecs, _handleShareScreenResourceDecs, _handleStartShareDecs, _handleReplaceScreenDecs, _handleStopShareDecs, _handleScreenCaptureStateUpdatedDecs, _updateCameraListDecs, _updateMicrophoneListDecs, _updateSpeakerListDecs, _handleLiveStreamingStateUpdatedDecs, _setShareLockDecs, _refreshLocalUserDecs, _ref;
98
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
99
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
74
100
  function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
75
101
  function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
76
102
  function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
@@ -105,7 +131,8 @@ var _W = /*#__PURE__*/new WeakMap();
105
131
  var _X = /*#__PURE__*/new WeakMap();
106
132
  var _Y = /*#__PURE__*/new WeakMap();
107
133
  var _Z = /*#__PURE__*/new WeakMap();
108
- _ref = (_handleChooseScreenDecs = [_mobx.action, _mobx.action.bound], _setShareWithAudioStateDecs = [_mobx.action, _mobx.action.bound], _setShareAudioProcessingChannelDecs = [_mobx.action, _mobx.action.bound], _handleCheckScreenCapturePermissionDecs = [_mobx.action, _mobx.action.bound], _handleToSettingDecs = [_mobx.action, _mobx.action.bound], _setShareWithAudioDecs = [_mobx.action, _mobx.action.bound], _muteLocalAudioDecs = [_mobx.action, _mobx.action.bound], _muteLocalVideoDecs = [_mobx.action, _mobx.action.bound], _handleShareScreenResourceDecs = [_mobx.action, _mobx.action.bound], _handleStartShareDecs = [_mobx.action, _mobx.action.bound], _handleShareStartWithAudioDecs = [_mobx.action, _mobx.action.bound], _handleShareStopWithAudioDecs = [_mobx.action, _mobx.action.bound], _handleStopShareDecs = [_mobx.action, _mobx.action.bound], _handleReplaceScreenDecs = [_mobx.action, _mobx.action.bound], _startPreviewDecs = [_mobx.action, _mobx.action.bound], _setShareControlBarActiveDecs = [_mobx.action, _mobx.action.bound], _setCurrentCameraIdDecs = [_mobx.action, _mobx.action.bound], _setCurrentSpeakerIdDecs = [_mobx.action, _mobx.action.bound], _setCurrentMicrophoneIdDecs = [_mobx.action, _mobx.action.bound], _setAllowChangeSelfNameDecs = [_mobx.action, _mobx.action.bound], _setAllowChatDecs = [_mobx.action, _mobx.action.bound], _setAllowJoinWithMuteAudioDecs = [_mobx.action, _mobx.action.bound], _setAllowShareScreenDecs = [_mobx.action, _mobx.action.bound], _setAllowUnmuteSelfVideoDecs = [_mobx.action, _mobx.action.bound], _setAllowUnmuteSelfAudioDecs = [_mobx.action, _mobx.action.bound], _setLockRoomEnabledDecs = [_mobx.action, _mobx.action.bound], _setWaitingRoomEnabledDecs = [_mobx.action, _mobx.action.bound], _openDialogDecs = [_mobx.action, _mobx.action.bound], _closeShareScreenSelectionDecs = [_mobx.action, _mobx.action.bound], _openControlBarDecs = [_mobx.action, _mobx.action.bound], _setControlBarWindowIdDecs = [_mobx.action, _mobx.action.bound], _openVideoWindowDialogDecs = [_mobx.action, _mobx.action.bound], _closeControlBarDecs = [_mobx.action, _mobx.action.bound], _closeVideoWindowDialogDecs = [_mobx.action, _mobx.action.bound], _handleScreenCaptureStateUpdatedDecs = [_mobx.action, _mobx.action.bound], _updateCameraListDecs = [_mobx.action, _mobx.action.bound], _updateMicrophoneListDecs = [_mobx.action, _mobx.action.bound], _updateSpeakerListDecs = [_mobx.action, _mobx.action.bound], _handleLiveStreamingStateUpdatedDecs = [_mobx.action, _mobx.action.bound], _setShareLockDecs = [_mobx.action, _mobx.action.bound], _refreshLocalUserDecs = [_mobx.action, _mobx.action.bound], "logger");
134
+ var _a = /*#__PURE__*/new WeakMap();
135
+ _ref = (_handleChooseScreenDecs = [_mobx.action, _mobx.action.bound], _setShareWithAudioStateDecs = [_mobx.action, _mobx.action.bound], _setShareAudioProcessingChannelDecs = [_mobx.action, _mobx.action.bound], _sendLocalAudioStateEventDecs = [_mobx.action, _mobx.action.bound], _handleCheckScreenCapturePermissionDecs = [_mobx.action, _mobx.action.bound], _handleToSettingDecs = [_mobx.action, _mobx.action.bound], _muteLocalAudioDecs = [_mobx.action, _mobx.action.bound], _muteLocalVideoDecs = [_mobx.action, _mobx.action.bound], _handleShareStartWithAudioDecs = [_mobx.action, _mobx.action.bound], _handleShareStopWithAudioDecs = [_mobx.action, _mobx.action.bound], _startPreviewDecs = [_mobx.action, _mobx.action.bound], _setShareControlBarActiveDecs = [_mobx.action, _mobx.action.bound], _setCurrentCameraIdDecs = [_mobx.action, _mobx.action.bound], _setCurrentSpeakerIdDecs = [_mobx.action, _mobx.action.bound], _setCurrentMicrophoneIdDecs = [_mobx.action, _mobx.action.bound], _setAllowChangeSelfNameDecs = [_mobx.action, _mobx.action.bound], _setAllowChatDecs = [_mobx.action, _mobx.action.bound], _setAllowJoinWithMuteAudioDecs = [_mobx.action, _mobx.action.bound], _setAllowShareScreenDecs = [_mobx.action, _mobx.action.bound], _setAllowUnmuteSelfVideoDecs = [_mobx.action, _mobx.action.bound], _setAllowUnmuteSelfAudioDecs = [_mobx.action, _mobx.action.bound], _setLockRoomEnabledDecs = [_mobx.action, _mobx.action.bound], _openDialogDecs = [_mobx.action, _mobx.action.bound], _closeShareScreenSelectionDecs = [_mobx.action, _mobx.action.bound], _openControlBarDecs = [_mobx.action, _mobx.action.bound], _setControlBarWindowIdDecs = [_mobx.action, _mobx.action.bound], _openVideoWindowDialogDecs = [_mobx.action, _mobx.action.bound], _closeControlBarDecs = [_mobx.action, _mobx.action.bound], _closeVideoWindowDialogDecs = [_mobx.action, _mobx.action.bound], _setShareWithAudioDecs = [_mobx.action, _mobx.action.bound], _setWithAudioStateDecs = [_mobx.action, _mobx.action.bound], _handleShareScreenResourceDecs = [_mobx.action, _mobx.action.bound], _handleStartShareDecs = [_mobx.action, _mobx.action.bound], _handleReplaceScreenDecs = [_mobx.action, _mobx.action.bound], _handleStopShareDecs = [_mobx.action, _mobx.action.bound], _handleScreenCaptureStateUpdatedDecs = [_mobx.action, _mobx.action.bound], _updateCameraListDecs = [_mobx.action, _mobx.action.bound], _updateMicrophoneListDecs = [_mobx.action, _mobx.action.bound], _updateSpeakerListDecs = [_mobx.action, _mobx.action.bound], _handleLiveStreamingStateUpdatedDecs = [_mobx.action, _mobx.action.bound], _setShareLockDecs = [_mobx.action, _mobx.action.bound], _refreshLocalUserDecs = [_mobx.action, _mobx.action.bound], "logger");
109
136
  var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
110
137
  function ShareScreenStore(_ref2) {
111
138
  var _this = this,
@@ -116,7 +143,8 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
116
143
  securityStore = _ref2.securityStore,
117
144
  uiEventStore = _ref2.uiEventStore,
118
145
  deviceStore = _ref2.deviceStore,
119
- deviceStreamStore = _ref2.deviceStreamStore;
146
+ deviceStreamStore = _ref2.deviceStreamStore,
147
+ config = _ref2.config;
120
148
  (0, _classCallCheck2["default"])(this, ShareScreenStore);
121
149
  (0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.getLogger)()));
122
150
  (0, _defineProperty2["default"])(this, "_disposers", []);
@@ -124,8 +152,10 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
124
152
  (0, _defineProperty2["default"])(this, "_currentShareStreamId", '');
125
153
  (0, _defineProperty2["default"])(this, "_connectType", _type5.ConnectType.NONE);
126
154
  (0, _defineProperty2["default"])(this, "_removeScreenStreamFailed", false);
155
+ (0, _defineProperty2["default"])(this, "_isReplaceScreen", false);
156
+ (0, _defineProperty2["default"])(this, "_previewDom", null);
127
157
  (0, _defineProperty2["default"])(this, "_observer", {
128
- onScreenCaptureStateUpdated: this._handleScreenCaptureStateUpdated
158
+ onScreenCaptureStateUpdated: (0, _env.isElectron)() ? this._handleScreenCaptureStateUpdated : this._handleWebScreenCaptureStateUpdated
129
159
  });
130
160
  (0, _defineProperty2["default"])(this, "_deviceStoreObserver", {
131
161
  onCameraListUpdated: this._updateCameraList,
@@ -136,11 +166,11 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
136
166
  onLiveStreamingStateUpdated: this._handleLiveStreamingStateUpdated
137
167
  });
138
168
  (0, _defineProperty2["default"])(this, "_uiEventObserver", {
139
- onEvent: this.onUiEvent.bind(this)
169
+ onEvent: this._onUiEvent.bind(this)
140
170
  });
141
171
  (0, _defineProperty2["default"])(this, "_streamObserver", {
142
172
  onStreamsAdded: this._refreshLocalUser.bind(this),
143
- onStreamsRemoved: this._refreshLocalUser.bind(this),
173
+ onStreamsRemoved: this._onStreamRemoved.bind(this),
144
174
  onStreamsUpdated: this._refreshLocalUser.bind(this)
145
175
  });
146
176
  _classPrivateFieldInitSpec(this, _A, _init__shareSelectionDialogId(this, ''));
@@ -165,21 +195,21 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
165
195
  _classPrivateFieldInitSpec(this, _T, _init_currentSelection(this, ''));
166
196
  _classPrivateFieldInitSpec(this, _U, _init_currentSelectionType(this, _type2.AgoraRtcScreenCaptureType.WINDOW));
167
197
  _classPrivateFieldInitSpec(this, _V, _init_shareWithAudio(this, false));
168
- _classPrivateFieldInitSpec(this, _W, _init_boardOwnerUser(this, null));
198
+ _classPrivateFieldInitSpec(this, _W, _init_boardOwnerUser(this, undefined));
169
199
  _classPrivateFieldInitSpec(this, _X, _init_localUser(this, null));
170
200
  _classPrivateFieldInitSpec(this, _Y, _init_localUserRole(this, _type.FcrUserRole.PARTICIPANT));
171
201
  _classPrivateFieldInitSpec(this, _Z, _init_title(this, 'Whiteboard'));
202
+ _classPrivateFieldInitSpec(this, _a, _init_localMicrophoneMute(this, false));
172
203
  (0, _defineProperty2["default"])(this, "handleChooseScreen", _init_handleChooseScreen(this, function (id) {
173
204
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _type2.AgoraRtcScreenCaptureType.WINDOW;
174
205
  _this.currentSelection = id;
175
206
  _this.currentSelectionType = type;
176
207
  }));
208
+ this._config = config;
177
209
  this._roomControl = roomControl;
178
210
  this._mediaControl = mediaControl;
179
211
  this._streamControl = roomControl.getStreamControl();
180
212
  this._userControl = roomControl.getUserControl();
181
- this.handleShareScreenResource = this.handleShareScreenResource.bind(this);
182
- this.handleStopShare = this.handleStopShare.bind(this);
183
213
  this._deviceStore = deviceStore;
184
214
  this._deviceStreamStore = deviceStreamStore;
185
215
  this._securityStore = securityStore;
@@ -201,9 +231,15 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
201
231
  });
202
232
  }
203
233
  });
204
- this._roomControl.getWhiteboardControl().addObserver({
205
- onBoardActiveInfoUpdated: function onBoardActiveInfoUpdated(isActive) {
206
- isActive && _this.closeShareScreenSelection();
234
+ this._roomControl.getBoardControl().addObserver({
235
+ onActive: function onActive(ownerId) {
236
+ _this.handleStopShare();
237
+ (0, _env.isElectron)() && _this._closeCapture();
238
+ _this.closeShareScreenSelection();
239
+ _this.boardOwnerUser = _this._userControl.getUser(ownerId);
240
+ },
241
+ onInactive: function onInactive(reason) {
242
+ _this.boardOwnerUser = undefined;
207
243
  }
208
244
  });
209
245
  this._refreshLocalUser();
@@ -421,6 +457,14 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
421
457
  set: function set(v) {
422
458
  _classPrivateFieldSet(_Z, this, v);
423
459
  }
460
+ }, {
461
+ key: "localMicrophoneMute",
462
+ get: function get() {
463
+ return _classPrivateFieldGet(_a, this);
464
+ },
465
+ set: function set(v) {
466
+ _classPrivateFieldSet(_a, this, v);
467
+ }
424
468
  }, {
425
469
  key: "localVideoState",
426
470
  get: function get() {
@@ -454,6 +498,12 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
454
498
  value: function handlerBoardShareStop() {
455
499
  this._uiEventStore.sendEvent(_constant.UIAction.CLOSE_WHITEBOARD);
456
500
  }
501
+ }, {
502
+ key: "sendLocalAudioStateEvent",
503
+ value: function sendLocalAudioStateEvent() {
504
+ this.muteLocalAudio(false);
505
+ return;
506
+ }
457
507
  }, {
458
508
  key: "release",
459
509
  value: function release() {
@@ -475,55 +525,10 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
475
525
  value: function handleToSetting() {
476
526
  this.showConfirm = false;
477
527
  }
478
- }, {
479
- key: "setShareWithAudio",
480
- value: function setShareWithAudio(withAudio) {
481
- var _this2 = this;
482
- var confirmAudioShareWhileMicOff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
483
- this.withAudio = withAudio;
484
- if (confirmAudioShareWhileMicOff && withAudio && !this.localAudioState) {
485
- var dialogKey = this._uiEventStore.openConfirmDialog({
486
- title: (0, _i18n.transI18n)('fmt_screenshare_tips_share_audio_micon'),
487
- content: (0, _i18n.transI18n)('fmt_screenshare_tips_share_audio_turnonmic'),
488
- cancelText: (0, _i18n.transI18n)('fmt_screenshare_button_giveup_shareaudio'),
489
- okText: (0, _i18n.transI18n)('fmt_screenshare_button_confirm_shareaudio'),
490
- cancelButtonProps: {
491
- type: 'gray',
492
- shape: 'rounded'
493
- },
494
- okButtonProps: {
495
- type: 'primary',
496
- shape: 'rounded'
497
- },
498
- closeIcon: null,
499
- closable: false,
500
- onOk: function onOk() {
501
- // 开启麦克风
502
- _this2.muteLocalAudio(false);
503
- _this2.setShareWithAudio(withAudio, false);
504
- _this2._uiEventStore.closeDialog(dialogKey);
505
- },
506
- onCancel: function onCancel() {
507
- (0, _rendererEvent.sendEvent)({
508
- action: _constant.RendererEventAction.SET_SHARE_WITH_AUDIO_CONTROL_BAR,
509
- payload: {
510
- withAudio: false
511
- }
512
- });
513
- _this2._uiEventStore.closeDialog(dialogKey);
514
- }
515
- });
516
- return;
517
- }
518
- this._streamControl.updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this._currentShareStreamId, {
519
- audioPrivilege: withAudio ? _type.FcrStreamPrivilegeOperation.HAS_PRIVILEGE : _type.FcrStreamPrivilegeOperation.NOPRIVILEGE,
520
- videoPrivilege: _type.FcrStreamPrivilegeOperation.NOOPERATION
521
- }));
522
- }
523
528
  }, {
524
529
  key: "muteLocalAudio",
525
530
  value: function () {
526
- var _muteLocalAudio = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(mute, confirmAudioShareWhileMicOff) {
531
+ var _muteLocalAudio = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(mute, confirmAudioShareWhileMicOff) {
527
532
  return _regenerator["default"].wrap(function _callee$(_context) {
528
533
  while (1) switch (_context.prev = _context.next) {
529
534
  case 0:
@@ -543,7 +548,7 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
543
548
  }, {
544
549
  key: "muteLocalVideo",
545
550
  value: function () {
546
- var _muteLocalVideo = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(mute) {
551
+ var _muteLocalVideo = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(mute) {
547
552
  return _regenerator["default"].wrap(function _callee2$(_context2) {
548
553
  while (1) switch (_context2.prev = _context2.next) {
549
554
  case 0:
@@ -561,78 +566,219 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
561
566
  return muteLocalVideo;
562
567
  }()
563
568
  }, {
564
- key: "onUiEvent",
565
- value: function () {
566
- var _onUiEvent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(event, params) {
567
- return _regenerator["default"].wrap(function _callee3$(_context3) {
568
- while (1) switch (_context3.prev = _context3.next) {
569
- case 0:
570
- _context3.t0 = event;
571
- _context3.next = _context3.t0 === _constant.UIAction.START_SHARE_SCREEN ? 3 : _context3.t0 === _constant.UIAction.STOP_SHARE_SCREEN ? 5 : _context3.t0 === _constant.UIAction.SHOW_TOAST ? 7 : _context3.t0 === _constant.UIAction.STOP_SCREEN_CAPTURE ? 9 : _context3.t0 === _constant.UIAction.ENGINE_RECONNECTED ? 11 : _context3.t0 === _constant.UIAction.WHITEBOARD_CHANGED ? 13 : 15;
572
- break;
573
- case 3:
574
- this.handleShareScreenResource();
575
- return _context3.abrupt("break", 15);
576
- case 5:
577
- this.handleStopShare();
578
- return _context3.abrupt("break", 15);
579
- case 7:
580
- if ((0, _env.isElectron)() && this.shareControlBarActive) {
581
- (0, _rendererEvent.sendEvent)({
582
- action: _constant.RendererEventAction.SHOW_TOAST,
583
- payload: params
584
- });
585
- }
586
- return _context3.abrupt("break", 15);
587
- case 9:
588
- this._closeCapture();
589
- return _context3.abrupt("break", 15);
590
- case 11:
591
- if (this._removeScreenStreamFailed) {
592
- this._removeScreenStream();
593
- this._removeScreenStreamFailed = false;
594
- }
595
- return _context3.abrupt("break", 15);
596
- case 13:
597
- if (params.action === _type7.WhiteboardBaseEvents.SET_OWNER_USER_ID) {
598
- this.boardOwnerUser = this._userControl.getUser(params.payload);
599
- }
600
- return _context3.abrupt("break", 15);
601
- case 15:
602
- case "end":
603
- return _context3.stop();
569
+ key: "handleShareStartWithAudio",
570
+ value: function handleShareStartWithAudio() {
571
+ var isMac = navigator.userAgent.indexOf('Mac') > -1;
572
+ this._shareAudioTrack = this._mediaControl.getLoopbackTrack(isMac ? 'BlackHole 2ch' : '');
573
+ if (this._mediaControl.isCapabilitySupported(_agoraEduCore.FcrCapability.CAPTURING_LOOPBACK)) {
574
+ this._shareAudioTrack.start();
575
+ }
576
+ }
577
+ }, {
578
+ key: "handleShareStopWithAudio",
579
+ value: function handleShareStopWithAudio() {
580
+ if (!this._shareAudioTrack) {
581
+ return;
582
+ }
583
+ if (this._mediaControl.isCapabilitySupported(_agoraEduCore.FcrCapability.CAPTURING_LOOPBACK)) {
584
+ this._shareAudioTrack.stop();
585
+ }
586
+ }
587
+ }, {
588
+ key: "startPreview",
589
+ value: function startPreview(dom) {
590
+ this._previewDom = dom;
591
+ if (dom) {
592
+ var _this$_screenTrack;
593
+ (_this$_screenTrack = this._screenTrack) === null || _this$_screenTrack === void 0 || _this$_screenTrack.startPreview({
594
+ renderMode: 1,
595
+ isMirror: false
596
+ }, dom);
597
+ } else {
598
+ var _this$_screenTrack2;
599
+ (_this$_screenTrack2 = this._screenTrack) === null || _this$_screenTrack2 === void 0 || _this$_screenTrack2.stopPreview(dom);
600
+ this._previewDom = null;
601
+ }
602
+ }
603
+ }, {
604
+ key: "setShareControlBarActive",
605
+ value: function setShareControlBarActive(active) {
606
+ this.shareControlBarActive = active;
607
+ }
608
+ }, {
609
+ key: "setCurrentCameraId",
610
+ value: function setCurrentCameraId(deviceId) {
611
+ this._deviceStore.setCameraId(deviceId);
612
+ }
613
+ }, {
614
+ key: "setCurrentSpeakerId",
615
+ value: function setCurrentSpeakerId(deviceId) {
616
+ this._deviceStore.setSpeakerId(deviceId);
617
+ }
618
+ }, {
619
+ key: "setCurrentMicrophoneId",
620
+ value: function setCurrentMicrophoneId(deviceId) {
621
+ this._deviceStore.setMicrophoneId(deviceId);
622
+ }
623
+
624
+ // security
625
+ }, {
626
+ key: "setAllowChangeSelfName",
627
+ value: function setAllowChangeSelfName(allow) {
628
+ this._securityStore.setAllowChangeSelfName();
629
+ }
630
+ }, {
631
+ key: "setAllowChat",
632
+ value: function setAllowChat(allow) {
633
+ this._securityStore.setAllowChat(allow);
634
+ }
635
+ }, {
636
+ key: "setAllowJoinWithMuteAudio",
637
+ value: function setAllowJoinWithMuteAudio(allow) {
638
+ this._securityStore.setAllowJoinWithMuteAudio(allow);
639
+ }
640
+ }, {
641
+ key: "setAllowShareScreen",
642
+ value: function setAllowShareScreen(allow) {
643
+ this._securityStore.setAllowShareScreen(allow);
644
+ }
645
+ }, {
646
+ key: "setAllowUnmuteSelfVideo",
647
+ value: function setAllowUnmuteSelfVideo(allow) {
648
+ this._securityStore.setAllowUnmuteSelfVideo(allow);
649
+ }
650
+ }, {
651
+ key: "setAllowUnmuteSelfAudio",
652
+ value: function setAllowUnmuteSelfAudio(allow) {
653
+ this._securityStore.setAllowUnmuteSelfAudio(allow);
654
+ }
655
+ }, {
656
+ key: "setLockRoomEnabled",
657
+ value: function setLockRoomEnabled(lock) {
658
+ this._securityStore.setLockRoomEnabled(lock);
659
+ }
660
+
661
+ // @action.bound
662
+ // setWaitingRoomEnabled(allow: boolean) {
663
+ // this._securityStore.setWaitingRoomEnabled();
664
+ // }
665
+ }, {
666
+ key: "openDialog",
667
+ value: function openDialog(item) {
668
+ this._uiEventStore.openDialog(item, '', {
669
+ controlBarWindowId: this._controlBarWindowId
670
+ });
671
+ }
672
+ }, {
673
+ key: "closeDialog",
674
+ value: function closeDialog(item) {
675
+ this._uiEventStore.closeDialog("".concat(item, "_").concat(item));
676
+ }
677
+ }, {
678
+ key: "openLiveStreamingDialog",
679
+ value: function openLiveStreamingDialog() {
680
+ this._uiEventStore.openLiveStreamingDialog();
681
+ }
682
+ }, {
683
+ key: "closeShareScreenSelection",
684
+ value: function closeShareScreenSelection() {
685
+ this._uiEventStore.closeDialog(this._shareSelectionDialogId);
686
+ this._shareSelectionDialogId = '';
687
+ }
688
+ }, {
689
+ key: "openControlBar",
690
+ value: function openControlBar() {
691
+ this._controlBarDialogId = this._uiEventStore.openDialog(_constant.DialogKey.CONTROL_BAR);
692
+ }
693
+ }, {
694
+ key: "setControlBarWindowId",
695
+ value: function setControlBarWindowId(id) {
696
+ this._controlBarWindowId = id;
697
+ }
698
+ }, {
699
+ key: "openVideoWindowDialog",
700
+ value: function openVideoWindowDialog() {
701
+ this._videoWindowDialogId = this._uiEventStore.openDialog(_constant.DialogKey.VIDEO_WINDOW);
702
+ }
703
+ }, {
704
+ key: "closeControlBar",
705
+ value: function closeControlBar() {
706
+ if (!this._controlBarDialogId) return;
707
+ this.setControlBarWindowId(-1);
708
+ this._uiEventStore.closeDialog(this._controlBarDialogId);
709
+ this._controlBarDialogId = '';
710
+ }
711
+ }, {
712
+ key: "closeVideoWindowDialog",
713
+ value: function closeVideoWindowDialog() {
714
+ this._uiEventStore.closeDialog(this._videoWindowDialogId);
715
+ this._videoWindowDialogId = '';
716
+ }
717
+ }, {
718
+ key: "setShareWithAudio",
719
+ value: function setShareWithAudio(withAudio) {
720
+ var _this2 = this;
721
+ var confirmAudioShareWhileMicOff = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
722
+ var dialogKey = !this.localAudioState && withAudio && this._uiEventStore.openConfirmDialog({
723
+ title: (0, _i18n.transI18n)('fmt_screenshare_tips_share_audio_micon'),
724
+ content: (0, _i18n.transI18n)('fmt_screenshare_tips_share_audio_turnonmic'),
725
+ onOk: function onOk() {
726
+ _this2._deviceStore.setMicrophoneEnabled(true);
727
+ _this2._setWithAudioState(withAudio);
728
+ if (withAudio) {
729
+ _this2.handleShareStartWithAudio();
730
+ } else {
731
+ _this2.handleShareStopWithAudio();
604
732
  }
605
- }, _callee3, this);
606
- }));
607
- function onUiEvent(_x4, _x5) {
608
- return _onUiEvent.apply(this, arguments);
733
+ dialogKey && _this2._uiEventStore.closeDialog(dialogKey);
734
+ },
735
+ onCancel: function onCancel() {
736
+ dialogKey && _this2._uiEventStore.closeDialog(dialogKey);
737
+ },
738
+ okText: (0, _i18n.transI18n)('fmt_screenshare_continue_share')
739
+ });
740
+ if (dialogKey) return;
741
+ this._setWithAudioState(withAudio);
742
+ if (withAudio) {
743
+ this.handleShareStartWithAudio();
744
+ } else {
745
+ this.handleShareStopWithAudio();
609
746
  }
610
- return onUiEvent;
611
- }()
747
+ }
748
+ }, {
749
+ key: "_setWithAudioState",
750
+ value: function _setWithAudioState(withAudio) {
751
+ this.withAudio = withAudio;
752
+ this._streamControl.updatePublishPrivilegeOfStreams((0, _defineProperty2["default"])({}, this._currentShareStreamId, {
753
+ audioPrivilege: withAudio ? _agoraEduCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE : _agoraEduCore.FcrStreamPrivilegeOperation.NOPRIVILEGE,
754
+ videoPrivilege: _agoraEduCore.FcrStreamPrivilegeOperation.NOOPERATION
755
+ }));
756
+ }
612
757
  }, {
613
758
  key: "handleShareScreenResource",
614
759
  value: function () {
615
- var _handleShareScreenResource = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
760
+ var _handleShareScreenResource = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
616
761
  var windowList, displayList, NORMAL_HEIGHT, WINDOWS_HEIGHT, NORMAL_WIDTH, shareSelectionHeight, _window$runtime$brows, mainWidowX, mainWindowY, mainWidth, mainHeight, offsetForToast;
617
- return _regenerator["default"].wrap(function _callee4$(_context4) {
618
- while (1) switch (_context4.prev = _context4.next) {
762
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
763
+ while (1) switch (_context3.prev = _context3.next) {
619
764
  case 0:
620
765
  this._removeReactions();
621
766
  this.showConfirm = false;
622
- if (!this._mediaControl.isCapabilitySupported(_agoraEduCore.FcrCapability.ENUMERATING_SCREEN)) {
623
- _context4.next = 20;
767
+ this._addReactions();
768
+ if (!(this._mediaControl.isCapabilitySupported(_agoraEduCore.FcrCapability.ENUMERATING_SCREEN) && (0, _env.isElectron)())) {
769
+ _context3.next = 20;
624
770
  break;
625
771
  }
626
- _context4.next = 5;
772
+ _context3.next = 6;
627
773
  return this._mediaControl.getWindowList();
628
- case 5:
629
- windowList = _context4.sent.filter(function (item) {
774
+ case 6:
775
+ windowList = _context3.sent.filter(function (item) {
630
776
  return item.title !== 'AgoraHighLighter' || item.isCurrent;
631
777
  });
632
- _context4.next = 8;
778
+ _context3.next = 9;
633
779
  return this._mediaControl.getDisplayList();
634
- case 8:
635
- displayList = _context4.sent;
780
+ case 9:
781
+ displayList = _context3.sent;
636
782
  this.applicationCaptureSources = windowList.filter(function (item) {
637
783
  return !item.isCurrent;
638
784
  });
@@ -653,7 +799,6 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
653
799
  shareSelectionHeight = !(0, _platform.isWindows)() ? NORMAL_HEIGHT : NORMAL_HEIGHT + WINDOWS_HEIGHT;
654
800
  _window$runtime$brows = window.runtime.browserWindow.getBounds(), mainWidowX = _window$runtime$brows.x, mainWindowY = _window$runtime$brows.y, mainWidth = _window$runtime$brows.width, mainHeight = _window$runtime$brows.height;
655
801
  offsetForToast = 50;
656
- this._addReactions();
657
802
  this._shareSelectionDialogId = this._uiEventStore.openDialog(_constant.DialogKey.SHARE_SCREEN, 'screen-selection', {
658
803
  frame: false,
659
804
  titleBarStyle: 'hidden',
@@ -663,16 +808,17 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
663
808
  height: shareSelectionHeight,
664
809
  x: mainWidowX + Math.floor(mainWidth / 2) - Math.floor(NORMAL_WIDTH / 2),
665
810
  y: mainWindowY + Math.floor(mainHeight / 2) - Math.floor(shareSelectionHeight / 2) + offsetForToast,
666
- controlBarDialogId: this._controlBarDialogId
811
+ controlBarDialogId: this._controlBarDialogId,
812
+ transparent: true
667
813
  });
668
- return _context4.abrupt("return");
814
+ return _context3.abrupt("return");
669
815
  case 20:
670
816
  this.handleStartShare();
671
817
  case 21:
672
818
  case "end":
673
- return _context4.stop();
819
+ return _context3.stop();
674
820
  }
675
- }, _callee4, this);
821
+ }, _callee3, this);
676
822
  }));
677
823
  function handleShareScreenResource() {
678
824
  return _handleShareScreenResource.apply(this, arguments);
@@ -682,225 +828,179 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
682
828
  }, {
683
829
  key: "handleStartShare",
684
830
  value: function () {
685
- var _handleStartShare = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {
686
- var _this3 = this;
831
+ var _handleStartShare = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
687
832
  var id,
688
833
  type,
689
834
  withAudio,
690
835
  audioProcessingChannel,
836
+ excludeWindows,
691
837
  _this$_localUser4,
692
838
  _this$_localUser5,
693
- res,
694
- streamUuid,
695
839
  screenTrack,
696
- excludeWindows,
697
- _args5 = arguments;
698
- return _regenerator["default"].wrap(function _callee5$(_context5) {
699
- while (1) switch (_context5.prev = _context5.next) {
840
+ _args4 = arguments;
841
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
842
+ while (1) switch (_context4.prev = _context4.next) {
700
843
  case 0:
701
- id = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : 'default';
702
- type = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : _type2.AgoraRtcScreenCaptureType.DISPLAY;
703
- withAudio = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : false;
704
- audioProcessingChannel = _args5.length > 3 && _args5[3] !== undefined ? _args5[3] : _shareAudio.AudioProcessingChannel.MONO;
705
- this._uiEventStore.sendEvent(_constant.UIAction.SET_CURRENT_SHARE_SCREEN, {
706
- id: id,
707
- type: type
708
- });
844
+ id = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : 'default';
845
+ type = _args4.length > 1 && _args4[1] !== undefined ? _args4[1] : _type2.AgoraRtcScreenCaptureType.DISPLAY;
846
+ withAudio = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : false;
847
+ audioProcessingChannel = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : _shareAudio.AudioProcessingChannel.MONO;
848
+ excludeWindows = [];
849
+ withAudio = (0, _env.isElectron)() ? withAudio : true; // electron 取 withAudio,web 默认为 true
850
+ if ((0, _env.isElectron)()) this.closeShareScreenSelection();
709
851
  if (!(id.split('-')[0] === 'whiteboard')) {
710
- _context5.next = 10;
852
+ _context4.next = 12;
711
853
  break;
712
854
  }
713
855
  if (!(!this._securityStore.hasStartBoardPermission() && !((_this$_localUser4 = this._localUser) !== null && _this$_localUser4 !== void 0 && _this$_localUser4.isHost) && !((_this$_localUser5 = this._localUser) !== null && _this$_localUser5 !== void 0 && _this$_localUser5.isCoHost))) {
714
- _context5.next = 8;
856
+ _context4.next = 10;
715
857
  break;
716
858
  }
717
- return _context5.abrupt("return", this._showToast((0, _i18n.transI18n)('fmt_screenshare_tips_hostprohibits'), 'error'));
718
- case 8:
719
- this._uiEventStore.sendEvent(_constant.UIAction.OPEN_WHITEBOARD);
720
- return _context5.abrupt("return");
859
+ return _context4.abrupt("return", this._showToast((0, _i18n.transI18n)('fmt_screenshare_tips_hostprohibits'), 'error'));
721
860
  case 10:
722
- if ((0, _env.isElectron)()) {
723
- this.closeShareScreenSelection();
861
+ this._uiEventStore.sendEvent(_constant.UIAction.OPEN_WHITEBOARD);
862
+ return _context4.abrupt("return");
863
+ case 12:
864
+ if (!(this.screenSharingState === _agoraEduCore.FcrMediaSourceState.STARTED)) {
865
+ _context4.next = 16;
866
+ break;
724
867
  }
725
- _context5.t0 = this._mediaControl.isCapabilitySupported(_agoraEduCore.FcrCapability.ENUMERATING_SCREEN);
726
- if (!_context5.t0) {
727
- _context5.next = 16;
868
+ this.handleReplaceScreen(id, type, withAudio, audioProcessingChannel);
869
+ this._setShareLock(false);
870
+ return _context4.abrupt("return");
871
+ case 16:
872
+ this._uiEventStore.sendEvent(_constant.UIAction.SET_CURRENT_SHARE_SCREEN, {
873
+ id: id,
874
+ type: type
875
+ });
876
+ _context4.t0 = this._mediaControl.isCapabilitySupported(_agoraEduCore.FcrCapability.ENUMERATING_SCREEN);
877
+ if (!_context4.t0) {
878
+ _context4.next = 22;
728
879
  break;
729
880
  }
730
- _context5.next = 15;
881
+ _context4.next = 21;
731
882
  return this._validateShareStart(id, type);
732
- case 15:
733
- _context5.t0 = !_context5.sent;
734
- case 16:
735
- if (!_context5.t0) {
736
- _context5.next = 18;
883
+ case 21:
884
+ _context4.t0 = !_context4.sent;
885
+ case 22:
886
+ if (!_context4.t0) {
887
+ _context4.next = 24;
737
888
  break;
738
889
  }
739
- return _context5.abrupt("return");
740
- case 18:
890
+ return _context4.abrupt("return");
891
+ case 24:
741
892
  if (!this._shareLocked) {
742
- _context5.next = 21;
893
+ _context4.next = 26;
743
894
  break;
744
895
  }
745
- this._showToast((0, _i18n.transI18n)('fmt_screenshare_tips_enablecollection'), 'error');
746
- return _context5.abrupt("return");
747
- case 21:
896
+ return _context4.abrupt("return", this._showToast((0, _i18n.transI18n)('fmt_screenshare_tips_enablecollection'), 'error'));
897
+ case 26:
748
898
  this._setShareLock(true);
749
899
  this.currentShareId = id;
750
900
  this.currentShareType = type;
751
901
  this.withAudio = withAudio;
752
-
753
- // if (!this._hasScreenSharePermission() || !(await this._checkScreenSharingPreemption())) {
902
+ if (withAudio) this.handleShareStartWithAudio();
754
903
  if (this._hasScreenSharePermission()) {
755
- _context5.next = 28;
756
- break;
757
- }
758
- this._setShareLock(false);
759
- return _context5.abrupt("return");
760
- case 28:
761
- if (!(this.screenSharingState === _agoraEduCore.FcrMediaSourceState.STARTED)) {
762
- _context5.next = 32;
904
+ _context4.next = 34;
763
905
  break;
764
906
  }
765
- this.handleReplaceScreen(id, type, withAudio, audioProcessingChannel);
766
907
  this._setShareLock(false);
767
- return _context5.abrupt("return");
768
- case 32:
769
- this.logger.debug('performance: createScreenStream ', new Date().getTime());
770
- _context5.next = 35;
771
- return this._streamControl.createScreenStream({
772
- streamType: withAudio ? _type3.AgoraRteMediaStreamType.BOTH : _type3.AgoraRteMediaStreamType.VIDEO
773
- })["finally"](function () {
774
- _this3._setShareLock(false);
775
- });
776
- case 35:
777
- res = _context5.sent;
778
- streamUuid = res.data.streamUuid;
779
- this.logger.debug('performance: createScreenStream end ', new Date().getTime());
780
- this._currentShareStreamId = streamUuid;
781
- if (withAudio) {
782
- this.handleShareStartWithAudio();
783
- }
784
- screenTrack = this._mediaControl.getScreenVideoTrack(id);
785
- this._screenTrack = screenTrack;
786
- excludeWindows = [];
908
+ return _context4.abrupt("return");
909
+ case 34:
910
+ this.openControlBar();
787
911
  if (!(0, _env.isElectron)()) {
788
- _context5.next = 51;
912
+ _context4.next = 43;
789
913
  break;
790
914
  }
915
+ _context4.next = 38;
916
+ return this._createScreenStream();
917
+ case 38:
791
918
  window.runtime.browserWindow.setFullScreen(false);
792
- this.logger.debug('performance: open control bar ', new Date().getTime());
793
- this.openControlBar();
794
919
  this.openVideoWindowDialog();
795
- _context5.next = 50;
920
+ _context4.next = 42;
796
921
  return this._getExcludeWindows();
797
- case 50:
798
- excludeWindows = _context5.sent;
799
- case 51:
800
- screenTrack.addObserver(this._observer);
801
- screenTrack.start(type, {
802
- // preview: true,
803
- withAudio: withAudio,
804
- excludeWindows: excludeWindows
805
- });
806
- case 53:
807
- case "end":
808
- return _context5.stop();
809
- }
810
- }, _callee5, this);
811
- }));
812
- function handleStartShare() {
813
- return _handleStartShare.apply(this, arguments);
814
- }
815
- return handleStartShare;
816
- }()
817
- }, {
818
- key: "handleShareStartWithAudio",
819
- value: function handleShareStartWithAudio() {
820
- var isMac = navigator.userAgent.indexOf('Mac') > -1;
821
- this._shareAudioTrack = this._mediaControl.getLoopbackAudioTrack(isMac ? 'BlackHole 2ch' : '');
822
- if (this._mediaControl.isCapabilitySupported(_agoraEduCore.FcrCapability.CAPTURING_LOOPBACK)) {
823
- this._shareAudioTrack.start();
824
- }
825
- }
826
- }, {
827
- key: "handleShareStopWithAudio",
828
- value: function handleShareStopWithAudio() {
829
- if (!this._shareAudioTrack) {
830
- return;
831
- }
832
- if (this._mediaControl.isCapabilitySupported(_agoraEduCore.FcrCapability.CAPTURING_LOOPBACK)) {
833
- this._shareAudioTrack.stop();
922
+ case 42:
923
+ excludeWindows = _context4.sent;
924
+ case 43:
925
+ screenTrack = this._mediaControl.getScreenTrack(id);
926
+ this._screenTrack = screenTrack;
927
+ screenTrack.addObserver(this._observer);
928
+ screenTrack.start(type, {
929
+ // preview: true,
930
+ withAudio: withAudio,
931
+ excludeWindows: excludeWindows
932
+ });
933
+ case 47:
934
+ case "end":
935
+ return _context4.stop();
936
+ }
937
+ }, _callee4, this);
938
+ }));
939
+ function handleStartShare() {
940
+ return _handleStartShare.apply(this, arguments);
834
941
  }
835
- }
836
- }, {
837
- key: "handleStopShare",
838
- value: function handleStopShare() {
839
- var _this$_screenTrack, _this$_screenTrack2;
840
- this._closeCapture();
841
- this._removeScreenStream();
842
- (_this$_screenTrack = this._screenTrack) === null || _this$_screenTrack === void 0 || _this$_screenTrack.stopPreview();
843
- (_this$_screenTrack2 = this._screenTrack) === null || _this$_screenTrack2 === void 0 || _this$_screenTrack2.stop();
844
- this.currentShareId = '';
845
- this._removeReactions();
846
- }
942
+ return handleStartShare;
943
+ }()
847
944
  }, {
848
945
  key: "handleReplaceScreen",
849
946
  value: function handleReplaceScreen() {
850
- var _this4 = this;
947
+ var _this3 = this;
851
948
  var id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'default';
852
949
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _type2.AgoraRtcScreenCaptureType.WINDOW;
853
950
  var withAudio = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
854
951
  var audioProcessingChannel = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : _shareAudio.AudioProcessingChannel.MONO;
952
+ withAudio = (0, _env.isElectron)() ? withAudio : true; // electron 取 withAudio,web 默认为 true
855
953
  if (this.withAudio && !withAudio) {
856
954
  this.handleShareStopWithAudio();
857
955
  }
858
956
  this.withAudio = withAudio;
859
957
  var screenTrack = this._screenTrack;
958
+ this._isReplaceScreen = true;
860
959
  if (screenTrack) {
861
960
  var observer = {
862
961
  onScreenCaptureStateUpdated: function () {
863
- var _onScreenCaptureStateUpdated = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(sourceId, state) {
962
+ var _onScreenCaptureStateUpdated = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(sourceId, state) {
864
963
  var newScreenTrack, excludeWindows;
865
- return _regenerator["default"].wrap(function _callee6$(_context6) {
866
- while (1) switch (_context6.prev = _context6.next) {
964
+ return _regenerator["default"].wrap(function _callee5$(_context5) {
965
+ while (1) switch (_context5.prev = _context5.next) {
867
966
  case 0:
868
967
  if (!(state === _agoraEduCore.FcrMediaSourceState.STOPPED)) {
869
- _context6.next = 17;
968
+ _context5.next = 18;
870
969
  break;
871
970
  }
872
- screenTrack.removeObserver(_this4._observer);
971
+ _this3._initToolbar();
972
+ screenTrack.removeObserver(_this3._observer);
873
973
  screenTrack.removeObserver(observer);
874
- newScreenTrack = _this4._mediaControl.getScreenVideoTrack(id);
974
+ newScreenTrack = _this3._mediaControl.getScreenTrack(id);
875
975
  if (withAudio) {
876
- _this4.handleShareStartWithAudio();
976
+ _this3.handleShareStartWithAudio();
877
977
  }
878
- _this4._screenTrack = newScreenTrack;
978
+ _this3._screenTrack = newScreenTrack;
879
979
  excludeWindows = [];
880
980
  if (!(0, _env.isElectron)()) {
881
- _context6.next = 11;
981
+ _context5.next = 12;
882
982
  break;
883
983
  }
884
- _context6.next = 10;
885
- return _this4._getExcludeWindows();
886
- case 10:
887
- excludeWindows = _context6.sent;
984
+ _context5.next = 11;
985
+ return _this3._getExcludeWindows();
888
986
  case 11:
889
- newScreenTrack.addObserver(_this4._observer);
987
+ excludeWindows = _context5.sent;
988
+ case 12:
989
+ newScreenTrack.addObserver(_this3._observer);
890
990
  newScreenTrack.start(type, {
891
991
  // preview: true,
892
992
  withAudio: withAudio,
893
993
  excludeWindows: excludeWindows
894
994
  });
895
- if (_this4._currentShareStreamId) {
896
- _this4._streamControl.bindLocalStreams([{
897
- streamId: _this4._currentShareStreamId,
995
+ if (_this3._currentShareStreamId) {
996
+ _this3._streamControl.bindLocalStreams([{
997
+ streamId: _this3._currentShareStreamId,
898
998
  audioSourceId: 'default',
899
999
  videoSourceId: id
900
1000
  }]);
901
1001
  }
902
- _this4.currentShareId = id;
903
- _this4.currentShareType = type;
1002
+ _this3.currentShareId = id;
1003
+ _this3.currentShareType = type;
904
1004
  (0, _rendererEvent.sendEvent)({
905
1005
  action: _constant.RendererEventAction.START_SHARE_SCREEN,
906
1006
  payload: {
@@ -909,13 +1009,13 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
909
1009
  withAudio: withAudio
910
1010
  }
911
1011
  });
912
- case 17:
1012
+ case 18:
913
1013
  case "end":
914
- return _context6.stop();
1014
+ return _context5.stop();
915
1015
  }
916
- }, _callee6);
1016
+ }, _callee5);
917
1017
  }));
918
- function onScreenCaptureStateUpdated(_x6, _x7) {
1018
+ function onScreenCaptureStateUpdated(_x4, _x5) {
919
1019
  return _onScreenCaptureStateUpdated.apply(this, arguments);
920
1020
  }
921
1021
  return onScreenCaptureStateUpdated;
@@ -923,163 +1023,112 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
923
1023
  };
924
1024
  screenTrack.addObserver(observer);
925
1025
  screenTrack.stop();
926
- screenTrack.stopPreview();
927
- }
928
- }
929
- }, {
930
- key: "startPreview",
931
- value: function startPreview(dom) {
932
- if (dom) {
933
- var _this$_screenTrack3;
934
- (_this$_screenTrack3 = this._screenTrack) === null || _this$_screenTrack3 === void 0 || _this$_screenTrack3.startPreview({
935
- renderMode: 1,
936
- isMirror: false
937
- }, dom);
938
- } else {
939
- var _this$_screenTrack4;
940
- (_this$_screenTrack4 = this._screenTrack) === null || _this$_screenTrack4 === void 0 || _this$_screenTrack4.stopPreview();
1026
+ this._previewDom && screenTrack.stopPreview(this._previewDom);
941
1027
  }
942
1028
  }
943
1029
  }, {
944
- key: "setShareControlBarActive",
945
- value: function setShareControlBarActive(active) {
946
- this.shareControlBarActive = active;
947
- }
948
- }, {
949
- key: "setCurrentCameraId",
950
- value: function setCurrentCameraId(deviceId) {
951
- this._deviceStore.setCameraId(deviceId);
952
- }
953
- }, {
954
- key: "setCurrentSpeakerId",
955
- value: function setCurrentSpeakerId(deviceId) {
956
- this._deviceStore.setSpeakerId(deviceId);
957
- }
958
- }, {
959
- key: "setCurrentMicrophoneId",
960
- value: function setCurrentMicrophoneId(deviceId) {
961
- this._deviceStore.setMicrophoneId(deviceId);
962
- }
963
-
964
- // security
965
- }, {
966
- key: "setAllowChangeSelfName",
967
- value: function setAllowChangeSelfName(allow) {
968
- this._securityStore.setAllowChangeSelfName();
969
- }
970
- }, {
971
- key: "setAllowChat",
972
- value: function setAllowChat(allow) {
973
- this._securityStore.setAllowChat(allow);
974
- }
975
- }, {
976
- key: "setAllowJoinWithMuteAudio",
977
- value: function setAllowJoinWithMuteAudio(allow) {
978
- this._securityStore.setAllowJoinWithMuteAudio(allow);
979
- }
980
- }, {
981
- key: "setAllowShareScreen",
982
- value: function setAllowShareScreen(allow) {
983
- this._securityStore.setAllowShareScreen(allow);
984
- }
985
- }, {
986
- key: "setAllowUnmuteSelfVideo",
987
- value: function setAllowUnmuteSelfVideo(allow) {
988
- this._securityStore.setAllowUnmuteSelfVideo(allow);
989
- }
990
- }, {
991
- key: "setAllowUnmuteSelfAudio",
992
- value: function setAllowUnmuteSelfAudio(allow) {
993
- this._securityStore.setAllowUnmuteSelfAudio(allow);
994
- }
995
- }, {
996
- key: "setLockRoomEnabled",
997
- value: function setLockRoomEnabled(lock) {
998
- this._securityStore.setLockRoomEnabled(lock);
999
- }
1000
- }, {
1001
- key: "setWaitingRoomEnabled",
1002
- value: function setWaitingRoomEnabled(allow) {
1003
- this._securityStore.setWaitingRoomEnabled();
1004
- }
1005
- }, {
1006
- key: "openDialog",
1007
- value: function openDialog(item) {
1008
- this._uiEventStore.openDialog(item, '', {
1009
- controlBarWindowId: this._controlBarWindowId
1010
- });
1011
- }
1012
- }, {
1013
- key: "closeDialog",
1014
- value: function closeDialog(item) {
1015
- this._uiEventStore.closeDialog("".concat(item, "_").concat(item));
1016
- }
1017
- }, {
1018
- key: "openLiveStreamingDialog",
1019
- value: function openLiveStreamingDialog() {
1020
- this._uiEventStore.openLiveStreamingDialog();
1021
- }
1022
- }, {
1023
- key: "closeShareScreenSelection",
1024
- value: function closeShareScreenSelection() {
1025
- this._uiEventStore.closeDialog(this._shareSelectionDialogId);
1026
- this._shareSelectionDialogId = '';
1027
- }
1028
- }, {
1029
- key: "openControlBar",
1030
- value: function openControlBar() {
1031
- this._controlBarDialogId = this._uiEventStore.openDialog(_constant.DialogKey.CONTROL_BAR);
1032
- }
1033
- }, {
1034
- key: "setControlBarWindowId",
1035
- value: function setControlBarWindowId(id) {
1036
- this._controlBarWindowId = id;
1037
- }
1038
- }, {
1039
- key: "openVideoWindowDialog",
1040
- value: function openVideoWindowDialog() {
1041
- this._videoWindowDialogId = this._uiEventStore.openDialog(_constant.DialogKey.VIDEO_WINDOW);
1030
+ key: "handleStopShare",
1031
+ value: function handleStopShare() {
1032
+ var _this$_screenTrack3, _this$_screenTrack4;
1033
+ this._closeCapture();
1034
+ this._removeScreenStream();
1035
+ this._previewDom && ((_this$_screenTrack3 = this._screenTrack) === null || _this$_screenTrack3 === void 0 ? void 0 : _this$_screenTrack3.stopPreview(this._previewDom));
1036
+ (_this$_screenTrack4 = this._screenTrack) === null || _this$_screenTrack4 === void 0 || _this$_screenTrack4.stop();
1037
+ this.currentShareId = '';
1038
+ this._removeReactions();
1042
1039
  }
1043
1040
  }, {
1044
- key: "closeControlBar",
1045
- value: function closeControlBar() {
1046
- this.setControlBarWindowId(-1);
1047
- this._uiEventStore.closeDialog(this._controlBarDialogId);
1048
- this._controlBarDialogId = '';
1049
- }
1041
+ key: "_createScreenStream",
1042
+ value: function () {
1043
+ var _createScreenStream2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
1044
+ var _this4 = this;
1045
+ var streamType, streamId;
1046
+ return _regenerator["default"].wrap(function _callee6$(_context6) {
1047
+ while (1) switch (_context6.prev = _context6.next) {
1048
+ case 0:
1049
+ this.logger.debug('performance: createScreenStream ', new Date().getTime());
1050
+ streamType = this.withAudio ? _type3.AgoraRteMediaStreamType.BOTH : _type3.AgoraRteMediaStreamType.VIDEO;
1051
+ _context6.next = 4;
1052
+ return this._streamControl.addLocalScreenStream({
1053
+ streamType: streamType
1054
+ })["finally"](function () {
1055
+ _this4._setShareLock(false);
1056
+ });
1057
+ case 4:
1058
+ streamId = _context6.sent;
1059
+ this.logger.debug('performance: createScreenStream end ', new Date().getTime());
1060
+ this._currentShareStreamId = streamId;
1061
+ case 7:
1062
+ case "end":
1063
+ return _context6.stop();
1064
+ }
1065
+ }, _callee6, this);
1066
+ }));
1067
+ function _createScreenStream() {
1068
+ return _createScreenStream2.apply(this, arguments);
1069
+ }
1070
+ return _createScreenStream;
1071
+ }()
1050
1072
  }, {
1051
- key: "closeVideoWindowDialog",
1052
- value: function closeVideoWindowDialog() {
1053
- this._uiEventStore.closeDialog(this._videoWindowDialogId);
1054
- this._videoWindowDialogId = '';
1055
- }
1073
+ key: "_handleWebScreenCaptureStateUpdated",
1074
+ value: function () {
1075
+ var _handleWebScreenCaptureStateUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(sourceId, state) {
1076
+ return _regenerator["default"].wrap(function _callee7$(_context7) {
1077
+ while (1) switch (_context7.prev = _context7.next) {
1078
+ case 0:
1079
+ this.screenSharingState = state;
1080
+ if (state === _agoraEduCore.FcrMediaSourceState.STARTED) {
1081
+ this._setShareLock(true);
1082
+ this._createScreenStream();
1083
+ this._isReplaceScreen = false;
1084
+ }
1085
+ if (state === _agoraEduCore.FcrMediaSourceState.STOPPED) {
1086
+ this._setShareLock(false);
1087
+ !this._isReplaceScreen && this.handleStopShare();
1088
+ this._isReplaceScreen = false;
1089
+ }
1090
+ if (state === _agoraEduCore.FcrMediaSourceState.ERROR) {
1091
+ this._setShareLock(false);
1092
+ this._isReplaceScreen = false;
1093
+ }
1094
+ case 4:
1095
+ case "end":
1096
+ return _context7.stop();
1097
+ }
1098
+ }, _callee7, this);
1099
+ }));
1100
+ function _handleWebScreenCaptureStateUpdated(_x6, _x7) {
1101
+ return _handleWebScreenCaptureStateUpdated2.apply(this, arguments);
1102
+ }
1103
+ return _handleWebScreenCaptureStateUpdated;
1104
+ }()
1056
1105
  }, {
1057
1106
  key: "_handleScreenCaptureStateUpdated",
1058
1107
  value: function () {
1059
- var _handleScreenCaptureStateUpdated2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(sourceId, state) {
1108
+ var _handleScreenCaptureStateUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(sourceId, state) {
1060
1109
  var _this$_screenTrack5, _this$_screenTrack6, _this$_screenTrack7;
1061
- return _regenerator["default"].wrap(function _callee7$(_context7) {
1062
- while (1) switch (_context7.prev = _context7.next) {
1110
+ return _regenerator["default"].wrap(function _callee8$(_context8) {
1111
+ while (1) switch (_context8.prev = _context8.next) {
1063
1112
  case 0:
1064
1113
  if (state === _agoraEduCore.FcrMediaSourceState.STOPPED) {
1065
- (_this$_screenTrack5 = this._screenTrack) === null || _this$_screenTrack5 === void 0 || _this$_screenTrack5.stopPreview();
1114
+ this._previewDom && ((_this$_screenTrack5 = this._screenTrack) === null || _this$_screenTrack5 === void 0 ? void 0 : _this$_screenTrack5.stopPreview(this._previewDom));
1066
1115
  (_this$_screenTrack6 = this._screenTrack) === null || _this$_screenTrack6 === void 0 || _this$_screenTrack6.removeObserver(this._observer);
1067
1116
  (_this$_screenTrack7 = this._screenTrack) === null || _this$_screenTrack7 === void 0 || _this$_screenTrack7.stop();
1068
1117
  }
1069
1118
  if (!(state === _agoraEduCore.FcrMediaSourceState.ERROR)) {
1070
- _context7.next = 5;
1119
+ _context8.next = 5;
1071
1120
  break;
1072
1121
  }
1073
1122
  this.handleStopShare();
1074
1123
  this.screenSharingState = _agoraEduCore.FcrMediaSourceState.STOPPED;
1075
- return _context7.abrupt("return");
1124
+ return _context8.abrupt("return");
1076
1125
  case 5:
1077
1126
  this.screenSharingState = state;
1078
1127
  case 6:
1079
1128
  case "end":
1080
- return _context7.stop();
1129
+ return _context8.stop();
1081
1130
  }
1082
- }, _callee7, this);
1131
+ }, _callee8, this);
1083
1132
  }));
1084
1133
  function _handleScreenCaptureStateUpdated(_x8, _x9) {
1085
1134
  return _handleScreenCaptureStateUpdated2.apply(this, arguments);
@@ -1133,9 +1182,9 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1133
1182
  (0, _rendererEvent.sendEvent)({
1134
1183
  action: _constant.RendererEventAction.CHANGE_LIVE_STREAMING_INFO,
1135
1184
  payload: {
1136
- videoSteamingUrl: liveStreamingConfig.pushStreamingUrl,
1137
- videoStreamingKey: liveStreamingConfig.pushStreamingKey,
1138
- playUrl: liveStreamingConfig.pullStreamingUrl
1185
+ videoSteamingUrl: liveStreamingConfig === null || liveStreamingConfig === void 0 ? void 0 : liveStreamingConfig.pushStreamingUrl,
1186
+ videoStreamingKey: liveStreamingConfig === null || liveStreamingConfig === void 0 ? void 0 : liveStreamingConfig.pushStreamingKey,
1187
+ playUrl: liveStreamingConfig === null || liveStreamingConfig === void 0 ? void 0 : liveStreamingConfig.pullStreamingUrl
1139
1188
  }
1140
1189
  });
1141
1190
  }
@@ -1156,35 +1205,35 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1156
1205
  }, {
1157
1206
  key: "_removeScreenStream",
1158
1207
  value: function () {
1159
- var _removeScreenStream2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {
1160
- var streamId;
1161
- return _regenerator["default"].wrap(function _callee8$(_context8) {
1162
- while (1) switch (_context8.prev = _context8.next) {
1208
+ var _removeScreenStream2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9() {
1209
+ var streamId, _this$_streamControl;
1210
+ return _regenerator["default"].wrap(function _callee9$(_context9) {
1211
+ while (1) switch (_context9.prev = _context9.next) {
1163
1212
  case 0:
1164
1213
  streamId = this._currentShareStreamId;
1165
1214
  if (streamId) {
1166
- _context8.next = 3;
1215
+ _context9.next = 3;
1167
1216
  break;
1168
1217
  }
1169
- return _context8.abrupt("return");
1218
+ return _context9.abrupt("return");
1170
1219
  case 3:
1171
- _context8.prev = 3;
1172
- _context8.next = 6;
1173
- return this._streamControl.removeScreenStream();
1220
+ _context9.prev = 3;
1221
+ _context9.next = 6;
1222
+ return (_this$_streamControl = this._streamControl) === null || _this$_streamControl === void 0 ? void 0 : _this$_streamControl.removeScreenStream();
1174
1223
  case 6:
1175
1224
  this._currentShareStreamId = '';
1176
- _context8.next = 13;
1225
+ _context9.next = 13;
1177
1226
  break;
1178
1227
  case 9:
1179
- _context8.prev = 9;
1180
- _context8.t0 = _context8["catch"](3);
1228
+ _context9.prev = 9;
1229
+ _context9.t0 = _context9["catch"](3);
1181
1230
  this._removeScreenStreamFailed = true;
1182
- this.logger.error('removeScreenStream error', _context8.t0);
1231
+ this.logger.error('removeScreenStream error', _context9.t0);
1183
1232
  case 13:
1184
1233
  case "end":
1185
- return _context8.stop();
1234
+ return _context9.stop();
1186
1235
  }
1187
- }, _callee8, this, [[3, 9]]);
1236
+ }, _callee9, this, [[3, 9]]);
1188
1237
  }));
1189
1238
  function _removeScreenStream() {
1190
1239
  return _removeScreenStream2.apply(this, arguments);
@@ -1207,28 +1256,31 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1207
1256
  }, {
1208
1257
  key: "_refreshLocalUser",
1209
1258
  value: function _refreshLocalUser(_, events) {
1210
- var _isReplaced$operatorU, _this$_localUser6, _userControl$getLocal, _userControl$getLocal2, _userControl$getLocal3, _userControl$getLocal4;
1259
+ var _isReplaced$operatorU, _this$_localUser6;
1211
1260
  var isReplaced = events && events.find(function (event) {
1212
1261
  var _event$cause;
1213
- return ((_event$cause = event.cause) === null || _event$cause === void 0 || (_event$cause = _event$cause.data) === null || _event$cause === void 0 ? void 0 : _event$cause.reason) === _enums.FcrBoardActiveInfoReason.REPLACE;
1262
+ return ((_event$cause = event.cause) === null || _event$cause === void 0 || (_event$cause = _event$cause.data) === null || _event$cause === void 0 ? void 0 : _event$cause.reason) === _types.FcrBoardInactiveReason.SEIZE;
1214
1263
  });
1215
1264
  if (isReplaced && ((_isReplaced$operatorU = isReplaced.operatorUser) === null || _isReplaced$operatorU === void 0 ? void 0 : _isReplaced$operatorU.userId) !== ((_this$_localUser6 = this._localUser) === null || _this$_localUser6 === void 0 ? void 0 : _this$_localUser6.userId)) {
1216
1265
  this._currentShareStreamId = '';
1217
1266
  }
1218
- var userControl = this._roomControl.getUserControl();
1219
- var localUserUid = (_userControl$getLocal = userControl.getLocalUser()) === null || _userControl$getLocal === void 0 ? void 0 : _userControl$getLocal.userId;
1267
+ var _this$_roomControl$ge = this._roomControl.getUserControl().getLocalUser(),
1268
+ userId = _this$_roomControl$ge.userId,
1269
+ userRole = _this$_roomControl$ge.userRole;
1220
1270
  var hasVideo = this._deviceStore.cameraEnabled;
1221
1271
  var hasAudio = this._deviceStore.microphoneEnabled;
1222
- this.localUserRole = (_userControl$getLocal2 = userControl.getLocalUser()) === null || _userControl$getLocal2 === void 0 ? void 0 : _userControl$getLocal2.userRole;
1272
+ var isHost = userRole === _type.FcrUserRole.HOST;
1273
+ var isCoHost = userRole === _type.FcrUserRole.COHOST;
1274
+ this.localMicrophoneMute = !hasAudio;
1223
1275
  this._localUser = {
1224
- userId: localUserUid,
1276
+ userId: userId,
1225
1277
  hasVideo: hasVideo,
1226
1278
  hasAudio: hasAudio,
1227
- isHost: ((_userControl$getLocal3 = userControl.getLocalUser()) === null || _userControl$getLocal3 === void 0 ? void 0 : _userControl$getLocal3.userRole) === _type.FcrUserRole.HOST,
1228
- isCoHost: ((_userControl$getLocal4 = userControl.getLocalUser()) === null || _userControl$getLocal4 === void 0 ? void 0 : _userControl$getLocal4.userRole) === _type.FcrUserRole.COHOST,
1279
+ isHost: isHost,
1280
+ isCoHost: isCoHost,
1229
1281
  volume: this._deviceStore.microphoneVolumeLevel
1230
1282
  };
1231
- var streams = this._streamControl.getStreamsByUserId(localUserUid);
1283
+ var streams = this._streamControl.getStreamsByUserId(userId);
1232
1284
  var loopbackAudioStream = streams.find(function (stream) {
1233
1285
  return stream.audioSourceType === _type4.AgoraRteAudioSourceType.LOOPBACK;
1234
1286
  });
@@ -1241,7 +1293,7 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1241
1293
 
1242
1294
  var hasPstnStream = streams.some(function (_ref3) {
1243
1295
  var connectorType = _ref3.connectorType;
1244
- return connectorType === _type.FcrRoomConnectorType.PSTN;
1296
+ return connectorType === _agoraEduCore.FcrRoomConnectorType.PSTN;
1245
1297
  });
1246
1298
  this._connectType = hasPstnStream ? _type5.ConnectType.PHONE : this._deviceStore.currentDeviceId ? _type5.ConnectType.COMPUTER : _type5.ConnectType.NONE;
1247
1299
  (0, _rendererEvent.sendEvent)({
@@ -1249,6 +1301,11 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1249
1301
  payload: this._connectType
1250
1302
  });
1251
1303
  }
1304
+ }, {
1305
+ key: "_onStreamRemoved",
1306
+ value: function _onStreamRemoved(roomId, events) {
1307
+ this._refreshLocalUser(roomId, events);
1308
+ }
1252
1309
  }, {
1253
1310
  key: "_addEventListeners",
1254
1311
  value: function _addEventListeners() {
@@ -1286,128 +1343,20 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1286
1343
  this._disposers.push((0, _mobx.reaction)(function () {
1287
1344
  return _this6.shareControlBarActive;
1288
1345
  }, /*#__PURE__*/function () {
1289
- var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(active) {
1290
- var cameraList, microphoneList, speakerList, localUser, scheduleInfo, liveStreamingConfig;
1291
- return _regenerator["default"].wrap(function _callee9$(_context9) {
1292
- while (1) switch (_context9.prev = _context9.next) {
1346
+ var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10(active) {
1347
+ return _regenerator["default"].wrap(function _callee10$(_context10) {
1348
+ while (1) switch (_context10.prev = _context10.next) {
1293
1349
  case 0:
1294
- if (!active) {
1295
- _context9.next = 60;
1296
- break;
1350
+ if (active) {
1351
+ _this6._initToolbar();
1352
+ } else {
1353
+ _this6._deviceStore.removeObserver(_this6._deviceStoreObserver);
1297
1354
  }
1298
- _this6._deviceStore.addObserver(_this6._deviceStoreObserver);
1299
- cameraList = _this6._deviceStore.cameraList;
1300
- microphoneList = _this6._deviceStore.microphoneList;
1301
- speakerList = _this6._deviceStore.speakerList;
1302
- localUser = _this6._roomControl.getUserControl().getLocalUser();
1303
- scheduleInfo = _this6._roomControl.getScheduleInfo();
1304
- liveStreamingConfig = _this6._roomControl.getLiveStreamingConfig();
1305
- _context9.t0 = _rendererEvent.sendEvent;
1306
- _context9.t1 = _constant.RendererEventAction.INIT_CONTROL_BAR;
1307
- _context9.t2 = _shareAudio.AudioProcessingChannel.MONO;
1308
- _context9.t3 = _this6.currentShareId;
1309
- _context9.t4 = _this6.currentShareType;
1310
- _context9.t5 = _this6.withAudio;
1311
- _context9.t6 = cameraList;
1312
- _context9.t7 = _this6._deviceStore.cameraId;
1313
- _context9.t8 = !_this6.localVideoState;
1314
- _context9.t9 = microphoneList;
1315
- _context9.t10 = speakerList;
1316
- _context9.t11 = _this6._deviceStore.microphoneId;
1317
- _context9.t12 = _this6._deviceStore.speakerId;
1318
- _context9.t13 = !_this6.localAudioState;
1319
- _context9.t14 = _this6._deviceStore.microphoneVolumeLevel;
1320
- _context9.t15 = (scheduleInfo === null || scheduleInfo === void 0 ? void 0 : scheduleInfo.duration) || 0;
1321
- _context9.t16 = (scheduleInfo === null || scheduleInfo === void 0 ? void 0 : scheduleInfo.startTime) || new Date().getTime();
1322
- _context9.t17 = localUser.userRole === _type.FcrUserRole.HOST;
1323
- _context9.t18 = localUser.userRole === _type.FcrUserRole.HOST;
1324
- _context9.t19 = _this6._securityStore.allowChangeSelfName();
1325
- _context9.t20 = _this6._securityStore.allowChat();
1326
- _context9.t21 = _this6._securityStore.allowJoinWithMuteAudio();
1327
- _context9.t22 = _this6._securityStore.allowScreenShareAndBoard();
1328
- _context9.t23 = _this6._securityStore.allowUnmuteSelfVideo();
1329
- _context9.t24 = _this6._securityStore.allowUnmuteSelfAudio();
1330
- _context9.t25 = _this6._securityStore.isLockRoomEnabled();
1331
- _context9.t26 = _this6._securityStore.isWaitingRoomEnabled();
1332
- _context9.t27 = liveStreamingConfig.pushStreamingUrl;
1333
- _context9.t28 = liveStreamingConfig.pushStreamingUrl;
1334
- _context9.t29 = liveStreamingConfig.pullStreamingUrl;
1335
- _context9.t30 = _this6._roomControl.getLiveStreamingState();
1336
- _context9.t31 = _this6._securityStore.hasStartCloudRecordingPermission();
1337
- _context9.t32 = _this6._securityStore.hasStartLiveStreamingPermission();
1338
- _context9.t33 = _this6._securityStore.hasStopLiveStreamingPermission();
1339
- _context9.t34 = _this6._securityStore.hasGetLiveStreamingLinkPermission();
1340
- _context9.next = 45;
1341
- return _this6._mediaControl.getWindowList();
1342
- case 45:
1343
- _context9.t35 = _context9.sent;
1344
- _context9.t36 = _this6._connectType;
1345
- _context9.t37 = _this6._securityStore.hasEnableStartScreenSharePermission();
1346
- _context9.t38 = _this6._securityStore.hasPermissionToControlAllowSendAll();
1347
- _context9.t39 = _this6._securityStore.hasEnableStartAudioPermission();
1348
- _context9.t40 = _this6._securityStore.hasEnableChangeNamePermission();
1349
- _context9.t41 = _this6._securityStore.hasEnableStartVideoPermission();
1350
- _context9.t42 = _this6._securityStore.hasLockRoomPermission();
1351
- _context9.t43 = {
1352
- currentShareAudioProcessingChannel: _context9.t2,
1353
- currentShareId: _context9.t3,
1354
- currentShareType: _context9.t4,
1355
- shareWithAudio: _context9.t5,
1356
- cameraList: _context9.t6,
1357
- currentCameraId: _context9.t7,
1358
- isMuteVideo: _context9.t8,
1359
- microphoneList: _context9.t9,
1360
- speakerList: _context9.t10,
1361
- currentMicrophoneId: _context9.t11,
1362
- currentSpeakerId: _context9.t12,
1363
- isMuteAudio: _context9.t13,
1364
- localAudioVolume: _context9.t14,
1365
- duration: _context9.t15,
1366
- startTime: _context9.t16,
1367
- isHost: _context9.t17,
1368
- showSecurity: _context9.t18,
1369
- allowChangeSelfName: _context9.t19,
1370
- allowChat: _context9.t20,
1371
- allowJoinWithMuteAudio: _context9.t21,
1372
- allowShareScreen: _context9.t22,
1373
- allowUnmuteSelfVideo: _context9.t23,
1374
- allowUnmuteSelfAudio: _context9.t24,
1375
- isLockRoomEnabled: _context9.t25,
1376
- isWaitingRoomEnabled: _context9.t26,
1377
- videoSteamingUrl: _context9.t27,
1378
- videoStreamingKey: _context9.t28,
1379
- playUrl: _context9.t29,
1380
- liveStreamingState: _context9.t30,
1381
- isStartError: false,
1382
- hasStartCloudRecordingPermission: _context9.t31,
1383
- hasStartLiveStreamingPermission: _context9.t32,
1384
- hasStopLiveStreamingPermission: _context9.t33,
1385
- hasGetLiveStreamingLinkPermission: _context9.t34,
1386
- allApplicationWindows: _context9.t35,
1387
- connectType: _context9.t36,
1388
- hasEnableStartScreenSharePermission: _context9.t37,
1389
- hasPermissionToControlAllowSendAll: _context9.t38,
1390
- hasEnableStartAudioPermission: _context9.t39,
1391
- hasEnableChangeNamePermission: _context9.t40,
1392
- hasEnableStartVideoPermission: _context9.t41,
1393
- hasLockRoomPermission: _context9.t42
1394
- };
1395
- _context9.t44 = {
1396
- action: _context9.t1,
1397
- payload: _context9.t43
1398
- };
1399
- (0, _context9.t0)(_context9.t44);
1400
- window.runtime.browserWindow.setFullScreen(false);
1401
- window.runtime.browserWindow.hide();
1402
- _context9.next = 61;
1403
- break;
1404
- case 60:
1405
- _this6._deviceStore.removeObserver(_this6._deviceStoreObserver);
1406
- case 61:
1355
+ case 1:
1407
1356
  case "end":
1408
- return _context9.stop();
1357
+ return _context10.stop();
1409
1358
  }
1410
- }, _callee9);
1359
+ }, _callee10);
1411
1360
  }));
1412
1361
  return function (_x10) {
1413
1362
  return _ref4.apply(this, arguments);
@@ -1492,6 +1441,48 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1492
1441
  }));
1493
1442
  });
1494
1443
  }
1444
+ }, {
1445
+ key: "_onUiEvent",
1446
+ value: function () {
1447
+ var _onUiEvent2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11(event, params) {
1448
+ return _regenerator["default"].wrap(function _callee11$(_context11) {
1449
+ while (1) switch (_context11.prev = _context11.next) {
1450
+ case 0:
1451
+ _context11.t0 = event;
1452
+ _context11.next = _context11.t0 === _constant.UIAction.START_SHARE_SCREEN ? 3 : _context11.t0 === _constant.UIAction.SHOW_TOAST ? 5 : _context11.t0 === _constant.UIAction.STOP_SCREEN_CAPTURE ? 7 : _context11.t0 === _constant.UIAction.ENGINE_RECONNECTED ? 9 : 11;
1453
+ break;
1454
+ case 3:
1455
+ this.handleShareScreenResource();
1456
+ return _context11.abrupt("break", 11);
1457
+ case 5:
1458
+ if ((0, _env.isElectron)() && this.shareControlBarActive) {
1459
+ (0, _rendererEvent.sendEvent)({
1460
+ action: _constant.RendererEventAction.SHOW_TOAST,
1461
+ payload: params
1462
+ });
1463
+ }
1464
+ return _context11.abrupt("break", 11);
1465
+ case 7:
1466
+ this._closeCapture();
1467
+ // this.handleStopShare();
1468
+ return _context11.abrupt("break", 11);
1469
+ case 9:
1470
+ if (this._removeScreenStreamFailed) {
1471
+ this._removeScreenStream();
1472
+ this._removeScreenStreamFailed = false;
1473
+ }
1474
+ return _context11.abrupt("break", 11);
1475
+ case 11:
1476
+ case "end":
1477
+ return _context11.stop();
1478
+ }
1479
+ }, _callee11, this);
1480
+ }));
1481
+ function _onUiEvent(_x11, _x12) {
1482
+ return _onUiEvent2.apply(this, arguments);
1483
+ }
1484
+ return _onUiEvent;
1485
+ }()
1495
1486
  }, {
1496
1487
  key: "_removeReactions",
1497
1488
  value: function _removeReactions() {
@@ -1513,34 +1504,34 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1513
1504
  }, {
1514
1505
  key: "_validateWindow",
1515
1506
  value: function () {
1516
- var _validateWindow2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(id) {
1507
+ var _validateWindow2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12(id) {
1517
1508
  var window;
1518
- return _regenerator["default"].wrap(function _callee10$(_context10) {
1519
- while (1) switch (_context10.prev = _context10.next) {
1509
+ return _regenerator["default"].wrap(function _callee12$(_context12) {
1510
+ while (1) switch (_context12.prev = _context12.next) {
1520
1511
  case 0:
1521
- _context10.next = 2;
1512
+ _context12.next = 2;
1522
1513
  return this._mediaControl.getWindowList();
1523
1514
  case 2:
1524
- window = _context10.sent.filter(function (item) {
1515
+ window = _context12.sent.filter(function (item) {
1525
1516
  return item.title !== 'AgoraHighLighter' && item.title !== 'Development HTML';
1526
1517
  }).find(function (item) {
1527
1518
  return item.id === id;
1528
1519
  });
1529
1520
  if (window) {
1530
- _context10.next = 6;
1521
+ _context12.next = 6;
1531
1522
  break;
1532
1523
  }
1533
1524
  this._showToast((0, _i18n.transI18n)('fmt_screenshare_tips_faild_reselect'), 'error');
1534
- return _context10.abrupt("return", false);
1525
+ return _context12.abrupt("return", false);
1535
1526
  case 6:
1536
- return _context10.abrupt("return", true);
1527
+ return _context12.abrupt("return", true);
1537
1528
  case 7:
1538
1529
  case "end":
1539
- return _context10.stop();
1530
+ return _context12.stop();
1540
1531
  }
1541
- }, _callee10, this);
1532
+ }, _callee12, this);
1542
1533
  }));
1543
- function _validateWindow(_x11) {
1534
+ function _validateWindow(_x13) {
1544
1535
  return _validateWindow2.apply(this, arguments);
1545
1536
  }
1546
1537
  return _validateWindow;
@@ -1548,32 +1539,32 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1548
1539
  }, {
1549
1540
  key: "_validateDisplay",
1550
1541
  value: function () {
1551
- var _validateDisplay2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(id) {
1542
+ var _validateDisplay2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee13(id) {
1552
1543
  var displayList;
1553
- return _regenerator["default"].wrap(function _callee11$(_context11) {
1554
- while (1) switch (_context11.prev = _context11.next) {
1544
+ return _regenerator["default"].wrap(function _callee13$(_context13) {
1545
+ while (1) switch (_context13.prev = _context13.next) {
1555
1546
  case 0:
1556
- _context11.next = 2;
1547
+ _context13.next = 2;
1557
1548
  return this._mediaControl.getDisplayList();
1558
1549
  case 2:
1559
- displayList = _context11.sent.find(function (item) {
1550
+ displayList = _context13.sent.find(function (item) {
1560
1551
  return item.id === id;
1561
1552
  });
1562
1553
  if (displayList) {
1563
- _context11.next = 6;
1554
+ _context13.next = 6;
1564
1555
  break;
1565
1556
  }
1566
1557
  this._showToast((0, _i18n.transI18n)('fmt_screenshare_tips_faild_screenselect'), 'error');
1567
- return _context11.abrupt("return", false);
1558
+ return _context13.abrupt("return", false);
1568
1559
  case 6:
1569
- return _context11.abrupt("return", true);
1560
+ return _context13.abrupt("return", true);
1570
1561
  case 7:
1571
1562
  case "end":
1572
- return _context11.stop();
1563
+ return _context13.stop();
1573
1564
  }
1574
- }, _callee11, this);
1565
+ }, _callee13, this);
1575
1566
  }));
1576
- function _validateDisplay(_x12) {
1567
+ function _validateDisplay(_x14) {
1577
1568
  return _validateDisplay2.apply(this, arguments);
1578
1569
  }
1579
1570
  return _validateDisplay;
@@ -1581,50 +1572,50 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1581
1572
  }, {
1582
1573
  key: "_validateShareStart",
1583
1574
  value: function () {
1584
- var _validateShareStart2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(id, type) {
1585
- return _regenerator["default"].wrap(function _callee12$(_context12) {
1586
- while (1) switch (_context12.prev = _context12.next) {
1575
+ var _validateShareStart2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee14(id, type) {
1576
+ return _regenerator["default"].wrap(function _callee14$(_context14) {
1577
+ while (1) switch (_context14.prev = _context14.next) {
1587
1578
  case 0:
1588
- _context12.t0 = type === _type2.AgoraRtcScreenCaptureType.WINDOW;
1589
- if (!_context12.t0) {
1590
- _context12.next = 5;
1579
+ _context14.t0 = type === _type2.AgoraRtcScreenCaptureType.WINDOW;
1580
+ if (!_context14.t0) {
1581
+ _context14.next = 5;
1591
1582
  break;
1592
1583
  }
1593
- _context12.next = 4;
1584
+ _context14.next = 4;
1594
1585
  return this._validateWindow(id);
1595
1586
  case 4:
1596
- _context12.t0 = !_context12.sent;
1587
+ _context14.t0 = !_context14.sent;
1597
1588
  case 5:
1598
- if (!_context12.t0) {
1599
- _context12.next = 7;
1589
+ if (!_context14.t0) {
1590
+ _context14.next = 7;
1600
1591
  break;
1601
1592
  }
1602
- return _context12.abrupt("return", false);
1593
+ return _context14.abrupt("return", false);
1603
1594
  case 7:
1604
- _context12.t1 = type === _type2.AgoraRtcScreenCaptureType.DISPLAY;
1605
- if (!_context12.t1) {
1606
- _context12.next = 12;
1595
+ _context14.t1 = type === _type2.AgoraRtcScreenCaptureType.DISPLAY;
1596
+ if (!_context14.t1) {
1597
+ _context14.next = 12;
1607
1598
  break;
1608
1599
  }
1609
- _context12.next = 11;
1600
+ _context14.next = 11;
1610
1601
  return this._validateDisplay(id);
1611
1602
  case 11:
1612
- _context12.t1 = !_context12.sent;
1603
+ _context14.t1 = !_context14.sent;
1613
1604
  case 12:
1614
- if (!_context12.t1) {
1615
- _context12.next = 14;
1605
+ if (!_context14.t1) {
1606
+ _context14.next = 14;
1616
1607
  break;
1617
1608
  }
1618
- return _context12.abrupt("return", false);
1609
+ return _context14.abrupt("return", false);
1619
1610
  case 14:
1620
- return _context12.abrupt("return", true);
1611
+ return _context14.abrupt("return", true);
1621
1612
  case 15:
1622
1613
  case "end":
1623
- return _context12.stop();
1614
+ return _context14.stop();
1624
1615
  }
1625
- }, _callee12, this);
1616
+ }, _callee14, this);
1626
1617
  }));
1627
- function _validateShareStart(_x13, _x14) {
1618
+ function _validateShareStart(_x15, _x16) {
1628
1619
  return _validateShareStart2.apply(this, arguments);
1629
1620
  }
1630
1621
  return _validateShareStart;
@@ -1641,14 +1632,14 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1641
1632
  }, {
1642
1633
  key: "_getExcludeWindows",
1643
1634
  value: function () {
1644
- var _getExcludeWindows2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13() {
1635
+ var _getExcludeWindows2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee15() {
1645
1636
  var excludeWindows, windowId, _windowId$split, _windowId$split2, videoWindowId, _windowId$split3, _windowId$split4, controlBarWindowId;
1646
- return _regenerator["default"].wrap(function _callee13$(_context13) {
1647
- while (1) switch (_context13.prev = _context13.next) {
1637
+ return _regenerator["default"].wrap(function _callee15$(_context15) {
1638
+ while (1) switch (_context15.prev = _context15.next) {
1648
1639
  case 0:
1649
1640
  excludeWindows = [];
1650
1641
  windowId = '';
1651
- _context13.next = 4;
1642
+ _context15.next = 4;
1652
1643
  return (0, _tools.waitUntil)(function () {
1653
1644
  var _getControlBarMediaSo;
1654
1645
  windowId = (_getControlBarMediaSo = (0, _rendererEvent.getControlBarMediaSourceId)()) !== null && _getControlBarMediaSo !== void 0 ? _getControlBarMediaSo : '';
@@ -1657,7 +1648,7 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1657
1648
  case 4:
1658
1649
  _windowId$split = windowId.split(':'), _windowId$split2 = (0, _slicedToArray2["default"])(_windowId$split, 2), videoWindowId = _windowId$split2[1];
1659
1650
  excludeWindows.push(videoWindowId);
1660
- _context13.next = 8;
1651
+ _context15.next = 8;
1661
1652
  return (0, _tools.waitUntil)(function () {
1662
1653
  var _getVideoWindowMediaS;
1663
1654
  windowId = (_getVideoWindowMediaS = (0, _rendererEvent.getVideoWindowMediaSourceId)()) !== null && _getVideoWindowMediaS !== void 0 ? _getVideoWindowMediaS : '';
@@ -1667,22 +1658,157 @@ var ShareScreenStore = exports["default"] = /*#__PURE__*/function () {
1667
1658
  _windowId$split3 = windowId.split(':'), _windowId$split4 = (0, _slicedToArray2["default"])(_windowId$split3, 2), controlBarWindowId = _windowId$split4[1];
1668
1659
  this.logger.info('exclude win:', videoWindowId, controlBarWindowId);
1669
1660
  excludeWindows.push(controlBarWindowId);
1670
- return _context13.abrupt("return", excludeWindows);
1661
+ return _context15.abrupt("return", excludeWindows);
1671
1662
  case 12:
1672
1663
  case "end":
1673
- return _context13.stop();
1664
+ return _context15.stop();
1674
1665
  }
1675
- }, _callee13, this);
1666
+ }, _callee15, this);
1676
1667
  }));
1677
1668
  function _getExcludeWindows() {
1678
1669
  return _getExcludeWindows2.apply(this, arguments);
1679
1670
  }
1680
1671
  return _getExcludeWindows;
1681
1672
  }()
1673
+ }, {
1674
+ key: "_initToolbar",
1675
+ value: function () {
1676
+ var _initToolbar2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee16() {
1677
+ var cameraList, microphoneList, speakerList, localUser, scheduleInfo, liveStreamingConfig;
1678
+ return _regenerator["default"].wrap(function _callee16$(_context16) {
1679
+ while (1) switch (_context16.prev = _context16.next) {
1680
+ case 0:
1681
+ this._deviceStore.addObserver(this._deviceStoreObserver);
1682
+ cameraList = this._deviceStore.cameraList;
1683
+ microphoneList = this._deviceStore.microphoneList;
1684
+ speakerList = this._deviceStore.speakerList;
1685
+ localUser = this._roomControl.getUserControl().getLocalUser();
1686
+ scheduleInfo = this._roomControl.getRoomSchedule();
1687
+ liveStreamingConfig = this._roomControl.getLiveStreamingConfig();
1688
+ _context16.t0 = _rendererEvent.sendEvent;
1689
+ _context16.t1 = _constant.RendererEventAction.INIT_CONTROL_BAR;
1690
+ _context16.t2 = _shareAudio.AudioProcessingChannel.MONO;
1691
+ _context16.t3 = this.currentShareId;
1692
+ _context16.t4 = this.currentShareType;
1693
+ _context16.t5 = this.withAudio;
1694
+ _context16.t6 = cameraList;
1695
+ _context16.t7 = this._deviceStore.cameraId;
1696
+ _context16.t8 = !this.localVideoState;
1697
+ _context16.t9 = microphoneList;
1698
+ _context16.t10 = speakerList;
1699
+ _context16.t11 = this._deviceStore.microphoneId;
1700
+ _context16.t12 = this._deviceStore.speakerId;
1701
+ _context16.t13 = !this.localAudioState;
1702
+ _context16.t14 = this._deviceStore.microphoneVolumeLevel;
1703
+ _context16.t15 = localUser.userName;
1704
+ _context16.t16 = this._config.inviteLink;
1705
+ _context16.t17 = this._roomControl.getRoomInfo();
1706
+ _context16.t18 = (scheduleInfo === null || scheduleInfo === void 0 ? void 0 : scheduleInfo.duration) || 0;
1707
+ _context16.t19 = (scheduleInfo === null || scheduleInfo === void 0 ? void 0 : scheduleInfo.startTime) || new Date().getTime();
1708
+ _context16.t20 = localUser.userRole === _type.FcrUserRole.HOST;
1709
+ _context16.t21 = localUser.userRole === _type.FcrUserRole.HOST;
1710
+ _context16.t22 = this._securityStore.allowChangeSelfName();
1711
+ _context16.t23 = this._securityStore.allowChat();
1712
+ _context16.t24 = this._securityStore.allowJoinWithMuteAudio();
1713
+ _context16.t25 = this._securityStore.allowScreenShareAndBoard();
1714
+ _context16.t26 = this._securityStore.allowBoardWrite();
1715
+ _context16.t27 = this._securityStore.allowUnmuteSelfVideo();
1716
+ _context16.t28 = this._securityStore.allowUnmuteSelfAudio();
1717
+ _context16.t29 = this._securityStore.isLockRoomEnabled();
1718
+ _context16.t30 = this._securityStore.isWaitingRoomEnabled();
1719
+ _context16.t31 = liveStreamingConfig === null || liveStreamingConfig === void 0 ? void 0 : liveStreamingConfig.pushStreamingUrl;
1720
+ _context16.t32 = liveStreamingConfig === null || liveStreamingConfig === void 0 ? void 0 : liveStreamingConfig.pushStreamingUrl;
1721
+ _context16.t33 = liveStreamingConfig === null || liveStreamingConfig === void 0 ? void 0 : liveStreamingConfig.pullStreamingUrl;
1722
+ _context16.t34 = this._roomControl.getLiveStreamingState();
1723
+ _context16.t35 = this._securityStore.hasStartCloudRecordingPermission();
1724
+ _context16.t36 = this._securityStore.hasStartLiveStreamingPermission();
1725
+ _context16.t37 = this._securityStore.hasStopLiveStreamingPermission();
1726
+ _context16.t38 = this._securityStore.hasGetLiveStreamingLinkPermission();
1727
+ _context16.next = 48;
1728
+ return this._mediaControl.getWindowList();
1729
+ case 48:
1730
+ _context16.t39 = _context16.sent;
1731
+ _context16.t40 = this._connectType;
1732
+ _context16.t41 = this._securityStore.hasEnableStartScreenSharePermission();
1733
+ _context16.t42 = this._securityStore.hasPermissionToControlAllowSendAll();
1734
+ _context16.t43 = this._securityStore.hasEnableStartAudioPermission();
1735
+ _context16.t44 = this._securityStore.hasEnableChangeNamePermission();
1736
+ _context16.t45 = this._securityStore.hasEnableStartVideoPermission();
1737
+ _context16.t46 = this._securityStore.hasLockRoomPermission();
1738
+ _context16.t47 = this._securityStore.hasAllowWriteBoardPermission();
1739
+ _context16.t48 = this._securityStore.hasWaitingRoomPermission();
1740
+ _context16.t49 = {
1741
+ currentShareAudioProcessingChannel: _context16.t2,
1742
+ currentShareId: _context16.t3,
1743
+ currentShareType: _context16.t4,
1744
+ shareWithAudio: _context16.t5,
1745
+ cameraList: _context16.t6,
1746
+ currentCameraId: _context16.t7,
1747
+ isMuteVideo: _context16.t8,
1748
+ microphoneList: _context16.t9,
1749
+ speakerList: _context16.t10,
1750
+ currentMicrophoneId: _context16.t11,
1751
+ currentSpeakerId: _context16.t12,
1752
+ isMuteAudio: _context16.t13,
1753
+ localAudioVolume: _context16.t14,
1754
+ userName: _context16.t15,
1755
+ inviteLink: _context16.t16,
1756
+ roomInfo: _context16.t17,
1757
+ duration: _context16.t18,
1758
+ startTime: _context16.t19,
1759
+ isHost: _context16.t20,
1760
+ showSecurity: _context16.t21,
1761
+ allowChangeSelfName: _context16.t22,
1762
+ allowChat: _context16.t23,
1763
+ allowJoinWithMuteAudio: _context16.t24,
1764
+ allowShareScreen: _context16.t25,
1765
+ allowBoardWrite: _context16.t26,
1766
+ allowUnmuteSelfVideo: _context16.t27,
1767
+ allowUnmuteSelfAudio: _context16.t28,
1768
+ isLockRoomEnabled: _context16.t29,
1769
+ isWaitingRoomEnabled: _context16.t30,
1770
+ videoSteamingUrl: _context16.t31,
1771
+ videoStreamingKey: _context16.t32,
1772
+ playUrl: _context16.t33,
1773
+ liveStreamingState: _context16.t34,
1774
+ isStartError: false,
1775
+ hasStartCloudRecordingPermission: _context16.t35,
1776
+ hasStartLiveStreamingPermission: _context16.t36,
1777
+ hasStopLiveStreamingPermission: _context16.t37,
1778
+ hasGetLiveStreamingLinkPermission: _context16.t38,
1779
+ allApplicationWindows: _context16.t39,
1780
+ connectType: _context16.t40,
1781
+ hasEnableStartScreenSharePermission: _context16.t41,
1782
+ hasPermissionToControlAllowSendAll: _context16.t42,
1783
+ hasEnableStartAudioPermission: _context16.t43,
1784
+ hasEnableChangeNamePermission: _context16.t44,
1785
+ hasEnableStartVideoPermission: _context16.t45,
1786
+ hasLockRoomPermission: _context16.t46,
1787
+ hasAllowWriteBoardPermission: _context16.t47,
1788
+ hasWaitingRoomPermission: _context16.t48
1789
+ };
1790
+ _context16.t50 = {
1791
+ action: _context16.t1,
1792
+ payload: _context16.t49
1793
+ };
1794
+ (0, _context16.t0)(_context16.t50);
1795
+ window.runtime.browserWindow.setFullScreen(false);
1796
+ window.runtime.browserWindow.hide();
1797
+ case 63:
1798
+ case "end":
1799
+ return _context16.stop();
1800
+ }
1801
+ }, _callee16, this);
1802
+ }));
1803
+ function _initToolbar() {
1804
+ return _initToolbar2.apply(this, arguments);
1805
+ }
1806
+ return _initToolbar;
1807
+ }()
1682
1808
  }]);
1683
1809
  }();
1684
1810
  _ShareScreenStore = ShareScreenStore;
1685
- var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_ShareScreenStore, [[_mobx.observable, 1, "_shareSelectionDialogId"], [_mobx.observable, 1, "_controlBarDialogId"], [_mobx.observable, 1, "_videoWindowDialogId"], [_mobx.observable, 1, "_isHost"], [_mobx.observable, 1, "_shareLocked"], [_mobx.observable, 1, "_screenTrack"], [_mobx.observable, 1, "_shareAudioTrack"], [_mobx.observable, 1, "_localUser"], [_mobx.observable, 1, "screenSharingState"], [_mobx.observable, 1, "applicationCaptureSources"], [_mobx.observable, 1, "screenCaptureSources"], [_mobx.observable, 1, "hasScreenCapturePermission"], [_mobx.observable, 1, "showConfirm"], [_mobx.observable, 1, "shareControlBarActive"], [_mobx.observable, 1, "withAudio"], [_mobx.observable, 1, "currentShareAudioProcessingChannel"], [_mobx.observable, 1, "currentShareId"], [_mobx.observable, 1, "sharerId"], [_mobx.observable, 1, "currentShareType"], [_mobx.observable, 1, "currentSelection"], [_mobx.observable, 1, "currentSelectionType"], [_mobx.observable, 1, "shareWithAudio"], [_mobx.observable, 1, "boardOwnerUser"], [_mobx.observable, 1, "localUser"], [_mobx.observable, 1, "localUserRole"], [_mobx.observable, 1, "title"], [_mobx.computed, 3, "localVideoState"], [_mobx.computed, 3, "localAudioState"], [_mobx.computed, 3, "localAudioVolume"], [_setShareWithAudioStateDecs, 18, "setShareWithAudioState"], [_setShareAudioProcessingChannelDecs, 18, "setShareAudioProcessingChannel"], [_decorator.bound, 2, "handlerBoardShareStop"], [_decorator.bound, 2, "release"], [_handleCheckScreenCapturePermissionDecs, 18, "handleCheckScreenCapturePermission"], [_handleToSettingDecs, 18, "handleToSetting"], [_setShareWithAudioDecs, 18, "setShareWithAudio"], [_muteLocalAudioDecs, 18, "muteLocalAudio"], [_muteLocalVideoDecs, 18, "muteLocalVideo"], [_handleShareScreenResourceDecs, 18, "handleShareScreenResource"], [_handleStartShareDecs, 18, "handleStartShare"], [_handleShareStartWithAudioDecs, 18, "handleShareStartWithAudio"], [_handleShareStopWithAudioDecs, 18, "handleShareStopWithAudio"], [_handleStopShareDecs, 18, "handleStopShare"], [_handleReplaceScreenDecs, 18, "handleReplaceScreen"], [_startPreviewDecs, 18, "startPreview"], [_setShareControlBarActiveDecs, 18, "setShareControlBarActive"], [_setCurrentCameraIdDecs, 18, "setCurrentCameraId"], [_setCurrentSpeakerIdDecs, 18, "setCurrentSpeakerId"], [_setCurrentMicrophoneIdDecs, 18, "setCurrentMicrophoneId"], [_setAllowChangeSelfNameDecs, 18, "setAllowChangeSelfName"], [_setAllowChatDecs, 18, "setAllowChat"], [_setAllowJoinWithMuteAudioDecs, 18, "setAllowJoinWithMuteAudio"], [_setAllowShareScreenDecs, 18, "setAllowShareScreen"], [_setAllowUnmuteSelfVideoDecs, 18, "setAllowUnmuteSelfVideo"], [_setAllowUnmuteSelfAudioDecs, 18, "setAllowUnmuteSelfAudio"], [_setLockRoomEnabledDecs, 18, "setLockRoomEnabled"], [_setWaitingRoomEnabledDecs, 18, "setWaitingRoomEnabled"], [_openDialogDecs, 18, "openDialog"], [_decorator.bound, 2, "closeDialog"], [_decorator.bound, 2, "openLiveStreamingDialog"], [_closeShareScreenSelectionDecs, 18, "closeShareScreenSelection"], [_openControlBarDecs, 18, "openControlBar"], [_setControlBarWindowIdDecs, 18, "setControlBarWindowId"], [_openVideoWindowDialogDecs, 18, "openVideoWindowDialog"], [_closeControlBarDecs, 18, "closeControlBar"], [_closeVideoWindowDialogDecs, 18, "closeVideoWindowDialog"], [_handleScreenCaptureStateUpdatedDecs, 18, "_handleScreenCaptureStateUpdated"], [_updateCameraListDecs, 18, "_updateCameraList"], [_updateMicrophoneListDecs, 18, "_updateMicrophoneList"], [_updateSpeakerListDecs, 18, "_updateSpeakerList"], [_handleLiveStreamingStateUpdatedDecs, 18, "_handleLiveStreamingStateUpdated"], [_setShareLockDecs, 18, "_setShareLock"], [_decorator.bound, 2, "_syncShareStreamState"], [_refreshLocalUserDecs, 18, "_refreshLocalUser"], [_handleChooseScreenDecs, 16, "handleChooseScreen"]], []).e, 28);
1811
+ var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_ShareScreenStore, [[_mobx.observable, 1, "_shareSelectionDialogId"], [_mobx.observable, 1, "_controlBarDialogId"], [_mobx.observable, 1, "_videoWindowDialogId"], [_mobx.observable, 1, "_isHost"], [_mobx.observable, 1, "_shareLocked"], [_mobx.observable, 1, "_screenTrack"], [_mobx.observable, 1, "_shareAudioTrack"], [_mobx.observable, 1, "_localUser"], [_mobx.observable, 1, "screenSharingState"], [_mobx.observable, 1, "applicationCaptureSources"], [_mobx.observable, 1, "screenCaptureSources"], [_mobx.observable, 1, "hasScreenCapturePermission"], [_mobx.observable, 1, "showConfirm"], [_mobx.observable, 1, "shareControlBarActive"], [_mobx.observable, 1, "withAudio"], [_mobx.observable, 1, "currentShareAudioProcessingChannel"], [_mobx.observable, 1, "currentShareId"], [_mobx.observable, 1, "sharerId"], [_mobx.observable, 1, "currentShareType"], [_mobx.observable, 1, "currentSelection"], [_mobx.observable, 1, "currentSelectionType"], [_mobx.observable, 1, "shareWithAudio"], [_mobx.observable, 1, "boardOwnerUser"], [_mobx.observable, 1, "localUser"], [_mobx.observable, 1, "localUserRole"], [_mobx.observable, 1, "title"], [_mobx.observable, 1, "localMicrophoneMute"], [_mobx.computed, 3, "localVideoState"], [_mobx.computed, 3, "localAudioState"], [_mobx.computed, 3, "localAudioVolume"], [_setShareWithAudioStateDecs, 18, "setShareWithAudioState"], [_setShareAudioProcessingChannelDecs, 18, "setShareAudioProcessingChannel"], [_decorator.bound, 2, "handlerBoardShareStop"], [_sendLocalAudioStateEventDecs, 18, "sendLocalAudioStateEvent"], [_decorator.bound, 2, "release"], [_handleCheckScreenCapturePermissionDecs, 18, "handleCheckScreenCapturePermission"], [_handleToSettingDecs, 18, "handleToSetting"], [_muteLocalAudioDecs, 18, "muteLocalAudio"], [_muteLocalVideoDecs, 18, "muteLocalVideo"], [_handleShareStartWithAudioDecs, 18, "handleShareStartWithAudio"], [_handleShareStopWithAudioDecs, 18, "handleShareStopWithAudio"], [_startPreviewDecs, 18, "startPreview"], [_setShareControlBarActiveDecs, 18, "setShareControlBarActive"], [_setCurrentCameraIdDecs, 18, "setCurrentCameraId"], [_setCurrentSpeakerIdDecs, 18, "setCurrentSpeakerId"], [_setCurrentMicrophoneIdDecs, 18, "setCurrentMicrophoneId"], [_setAllowChangeSelfNameDecs, 18, "setAllowChangeSelfName"], [_setAllowChatDecs, 18, "setAllowChat"], [_setAllowJoinWithMuteAudioDecs, 18, "setAllowJoinWithMuteAudio"], [_setAllowShareScreenDecs, 18, "setAllowShareScreen"], [_setAllowUnmuteSelfVideoDecs, 18, "setAllowUnmuteSelfVideo"], [_setAllowUnmuteSelfAudioDecs, 18, "setAllowUnmuteSelfAudio"], [_setLockRoomEnabledDecs, 18, "setLockRoomEnabled"], [_openDialogDecs, 18, "openDialog"], [_decorator.bound, 2, "closeDialog"], [_decorator.bound, 2, "openLiveStreamingDialog"], [_closeShareScreenSelectionDecs, 18, "closeShareScreenSelection"], [_openControlBarDecs, 18, "openControlBar"], [_setControlBarWindowIdDecs, 18, "setControlBarWindowId"], [_openVideoWindowDialogDecs, 18, "openVideoWindowDialog"], [_closeControlBarDecs, 18, "closeControlBar"], [_closeVideoWindowDialogDecs, 18, "closeVideoWindowDialog"], [_setShareWithAudioDecs, 18, "setShareWithAudio"], [_setWithAudioStateDecs, 18, "_setWithAudioState"], [_handleShareScreenResourceDecs, 18, "handleShareScreenResource"], [_handleStartShareDecs, 18, "handleStartShare"], [_handleReplaceScreenDecs, 18, "handleReplaceScreen"], [_handleStopShareDecs, 18, "handleStopShare"], [_decorator.bound, 2, "_handleWebScreenCaptureStateUpdated"], [_handleScreenCaptureStateUpdatedDecs, 18, "_handleScreenCaptureStateUpdated"], [_updateCameraListDecs, 18, "_updateCameraList"], [_updateMicrophoneListDecs, 18, "_updateMicrophoneList"], [_updateSpeakerListDecs, 18, "_updateSpeakerList"], [_handleLiveStreamingStateUpdatedDecs, 18, "_handleLiveStreamingStateUpdated"], [_setShareLockDecs, 18, "_setShareLock"], [_decorator.bound, 2, "_syncShareStreamState"], [_refreshLocalUserDecs, 18, "_refreshLocalUser"], [_handleChooseScreenDecs, 16, "handleChooseScreen"]], []).e, 29);
1686
1812
  _init__shareSelectionDialogId = _applyDecs$e[0];
1687
1813
  _init__controlBarDialogId = _applyDecs$e[1];
1688
1814
  _init__videoWindowDialogId = _applyDecs$e[2];
@@ -1709,6 +1835,7 @@ _init_boardOwnerUser = _applyDecs$e[22];
1709
1835
  _init_localUser = _applyDecs$e[23];
1710
1836
  _init_localUserRole = _applyDecs$e[24];
1711
1837
  _init_title = _applyDecs$e[25];
1712
- _init_handleChooseScreen = _applyDecs$e[26];
1713
- _initProto = _applyDecs$e[27];
1838
+ _init_localMicrophoneMute = _applyDecs$e[26];
1839
+ _init_handleChooseScreen = _applyDecs$e[27];
1840
+ _initProto = _applyDecs$e[28];
1714
1841
  var StoreContext = exports.StoreContext = /*#__PURE__*/(0, _react.createContext)(null);