fcr-ui-scene 3.7.2 → 3.7.4-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (301) hide show
  1. package/lib/creator.d.ts +2 -0
  2. package/lib/creator.js +37 -44
  3. package/lib/electron/app.js +7 -0
  4. package/lib/electron/injections.d.ts +1 -1
  5. package/lib/electron/injections.js +5 -3
  6. package/lib/electron/main.js +3 -1
  7. package/lib/fragments/annotation/index.d.ts +1 -0
  8. package/lib/fragments/annotation/index.js +13 -7
  9. package/lib/fragments/annotation/libs.d.ts +7 -6
  10. package/lib/fragments/annotation/libs.js +9 -8
  11. package/lib/fragments/annotation/store.d.ts +8 -4
  12. package/lib/fragments/annotation/store.js +351 -267
  13. package/lib/fragments/annotation/toolbar/components/color-tool/index.js +4 -0
  14. package/lib/fragments/annotation/toolbar/components/graphic-tool/index.js +4 -0
  15. package/lib/fragments/annotation/toolbar/components/item/item.d.ts +2 -0
  16. package/lib/fragments/annotation/toolbar/components/item/item.js +2 -4
  17. package/lib/fragments/annotation/toolbar/components/item/style.css +4 -2
  18. package/lib/fragments/annotation/toolbar/components/pen-tool/index.js +4 -0
  19. package/lib/fragments/annotation/utils.d.ts +1 -0
  20. package/lib/fragments/annotation/utils.js +27 -0
  21. package/lib/fragments/annotation/view.js +1 -6
  22. package/lib/fragments/base.js +5 -3
  23. package/lib/fragments/whiteboard/cursor.css +77 -0
  24. package/lib/fragments/whiteboard/index.d.ts +11 -0
  25. package/lib/fragments/whiteboard/index.js +91 -0
  26. package/lib/fragments/whiteboard/store.d.ts +31 -0
  27. package/lib/fragments/whiteboard/store.js +480 -0
  28. package/lib/fragments/whiteboard/style.css +4 -0
  29. package/lib/fragments/whiteboard/view.d.ts +4 -0
  30. package/lib/fragments/whiteboard/view.js +31 -0
  31. package/lib/global.css +6 -0
  32. package/lib/index.d.ts +1 -0
  33. package/lib/index.js +1 -0
  34. package/lib/modules/action-bar/components/apps/index.js +15 -5
  35. package/lib/modules/action-bar/components/leave/index.js +4 -11
  36. package/lib/modules/action-bar/components/screen-share/submenu.js +2 -2
  37. package/lib/modules/action-bar/index.d.ts +2 -0
  38. package/lib/modules/action-bar/index.js +2 -1
  39. package/lib/modules/action-bar/store.d.ts +6 -2
  40. package/lib/modules/action-bar/store.js +56 -93
  41. package/lib/modules/action-bar/view.d.ts +1 -0
  42. package/lib/modules/action-bar/view.js +3 -2
  43. package/lib/modules/annotation/annotation-toolbar-store.d.ts +4 -11
  44. package/lib/modules/annotation/annotation-toolbar-store.js +48 -90
  45. package/lib/modules/annotation/index.d.ts +2 -0
  46. package/lib/modules/annotation/index.js +2 -2
  47. package/lib/modules/annotation/store.d.ts +11 -49
  48. package/lib/modules/annotation/store.js +144 -429
  49. package/lib/modules/annotation/view.js +3 -6
  50. package/lib/modules/audio-stream/index.js +1 -2
  51. package/lib/modules/chat/components/chat-select/index.js +3 -0
  52. package/lib/modules/components/control-bar/components/loading/index.css +76 -0
  53. package/lib/modules/components/control-bar/components/loading/index.d.ts +8 -0
  54. package/lib/modules/components/control-bar/components/loading/index.js +64 -0
  55. package/lib/modules/components/control-bar/components/loading/loading.png +0 -0
  56. package/lib/modules/components/control-bar/components/progress/index.d.ts +5 -0
  57. package/lib/modules/components/control-bar/components/progress/index.js +43 -0
  58. package/lib/modules/components/control-bar/components/progress/style.css +51 -0
  59. package/lib/modules/components/control-bar/components/switch-theme/index.css +99 -0
  60. package/lib/modules/components/control-bar/components/switch-theme/index.d.ts +9 -0
  61. package/lib/modules/components/control-bar/components/switch-theme/index.js +94 -0
  62. package/lib/modules/components/control-bar/components/switch-theme/item.d.ts +9 -0
  63. package/lib/modules/components/control-bar/components/switch-theme/item.js +54 -0
  64. package/lib/modules/components/control-bar/components/switch-theme/libs.d.ts +4 -0
  65. package/lib/modules/components/control-bar/components/switch-theme/libs.js +31 -0
  66. package/lib/modules/components/control-bar/index.css +87 -0
  67. package/lib/modules/components/control-bar/index.d.ts +20 -0
  68. package/lib/modules/components/control-bar/index.js +276 -0
  69. package/lib/modules/components/device-control/store.js +2 -2
  70. package/lib/modules/components/leave-meeting/components/index.css +0 -9
  71. package/lib/modules/components/leave-meeting/index.d.ts +2 -1
  72. package/lib/modules/components/leave-meeting/index.js +19 -8
  73. package/lib/modules/components/leave-meeting/portal.d.ts +6 -0
  74. package/lib/modules/components/leave-meeting/portal.js +29 -0
  75. package/lib/modules/components/leave-meeting/style.css +9 -0
  76. package/lib/modules/components/member-window/components/member-actions/components/more-actions.d.ts +5 -2
  77. package/lib/modules/components/member-window/components/member-actions/components/more-actions.js +19 -9
  78. package/lib/modules/components/member-window/components/member-actions/components/share-status.js +4 -4
  79. package/lib/modules/components/member-window/components/member-actions/index.js +13 -6
  80. package/lib/modules/components/member-window/components/member-actions/provider.d.ts +1 -0
  81. package/lib/modules/components/member-window/components/member-actions/provider.js +4 -3
  82. package/lib/modules/components/member-window/components/member-actions/store.d.ts +2 -1
  83. package/lib/modules/components/member-window/components/member-actions/store.js +5 -1
  84. package/lib/modules/components/member-window/components/video-player/components/local-video-player-with-zoom.d.ts +6 -4
  85. package/lib/modules/components/member-window/components/video-player/components/local-video-player-with-zoom.js +77 -41
  86. package/lib/modules/components/member-window/components/video-player/components/remote-video-player-with-zoom.d.ts +3 -3
  87. package/lib/modules/components/member-window/components/video-player/index.d.ts +3 -3
  88. package/lib/modules/components/member-window/index.css +4 -0
  89. package/lib/modules/components/member-window/types.d.ts +9 -5
  90. package/lib/modules/components/toolbar/components/capture-tool/index.d.ts +9 -0
  91. package/lib/modules/components/toolbar/components/capture-tool/index.js +68 -0
  92. package/lib/modules/components/toolbar/components/clean-tool/index.d.ts +11 -0
  93. package/lib/modules/components/toolbar/components/clean-tool/index.js +71 -0
  94. package/lib/modules/components/toolbar/components/color-tool/color-panel/index.d.ts +11 -0
  95. package/lib/modules/components/toolbar/components/color-tool/color-panel/index.js +77 -0
  96. package/lib/modules/components/toolbar/components/color-tool/index.d.ts +14 -0
  97. package/lib/modules/components/toolbar/components/color-tool/index.js +66 -0
  98. package/lib/modules/components/toolbar/components/graphic-tool/graphic-panel/index.d.ts +11 -0
  99. package/lib/modules/components/toolbar/components/graphic-tool/graphic-panel/index.js +64 -0
  100. package/lib/modules/components/toolbar/components/graphic-tool/graphic-panel/libs.d.ts +12 -0
  101. package/lib/modules/components/toolbar/components/graphic-tool/graphic-panel/libs.js +65 -0
  102. package/lib/modules/components/toolbar/components/graphic-tool/index.d.ts +15 -0
  103. package/lib/modules/components/toolbar/components/graphic-tool/index.js +82 -0
  104. package/lib/modules/components/toolbar/components/group-tool/index.d.ts +5 -0
  105. package/lib/modules/components/toolbar/components/group-tool/index.js +43 -0
  106. package/lib/modules/components/toolbar/components/icons/fold-icon.d.ts +2 -0
  107. package/lib/modules/components/toolbar/components/icons/fold-icon.js +41 -0
  108. package/lib/modules/components/toolbar/components/icons/move-icon.d.ts +1 -0
  109. package/lib/modules/components/toolbar/components/icons/move-icon.js +66 -0
  110. package/lib/modules/components/toolbar/components/item/index.d.ts +25 -0
  111. package/lib/modules/components/toolbar/components/item/index.js +165 -0
  112. package/lib/modules/components/toolbar/components/item/style.css +94 -0
  113. package/lib/modules/components/toolbar/components/multiple-color-tool/index.d.ts +12 -0
  114. package/lib/modules/components/toolbar/components/multiple-color-tool/index.js +75 -0
  115. package/lib/modules/components/toolbar/components/panel/index.d.ts +9 -0
  116. package/lib/modules/components/toolbar/components/panel/index.js +28 -0
  117. package/lib/modules/components/toolbar/components/panel/style.css +86 -0
  118. package/lib/modules/components/toolbar/components/pen-tool/index.d.ts +13 -0
  119. package/lib/modules/components/toolbar/components/pen-tool/index.js +62 -0
  120. package/lib/modules/components/toolbar/components/pen-tool/pen-panel/index.d.ts +8 -0
  121. package/lib/modules/components/toolbar/components/pen-tool/pen-panel/index.js +39 -0
  122. package/lib/modules/components/toolbar/components/save-draft/index.d.ts +7 -0
  123. package/lib/modules/components/toolbar/components/save-draft/index.js +59 -0
  124. package/lib/modules/components/toolbar/components/vertical-frame/index.d.ts +8 -0
  125. package/lib/modules/components/toolbar/components/vertical-frame/index.js +179 -0
  126. package/lib/modules/components/toolbar/hooks/use-resize-visible.d.ts +4 -0
  127. package/lib/modules/components/toolbar/hooks/use-resize-visible.js +59 -0
  128. package/lib/modules/components/toolbar/index.d.ts +29 -0
  129. package/lib/modules/components/toolbar/index.js +258 -0
  130. package/lib/modules/components/toolbar/style.css +85 -0
  131. package/lib/modules/components/toolbar/types.d.ts +13 -0
  132. package/lib/modules/components/toolbar/types.js +6 -0
  133. package/lib/modules/control-bar/components/more-actions/index.js +0 -6
  134. package/lib/modules/control-bar/components/share-state-nav/index.js +3 -2
  135. package/lib/modules/control-bar/index.js +2 -1
  136. package/lib/modules/control-bar/store.d.ts +15 -12
  137. package/lib/modules/control-bar/store.js +68 -29
  138. package/lib/modules/control-bar/view.js +33 -67
  139. package/lib/modules/device-pretest/store.js +4 -2
  140. package/lib/modules/dialog/components/dialog-container/component/body.js +3 -24
  141. package/lib/modules/dialog/components/dialog-container/index.d.ts +4 -0
  142. package/lib/modules/dialog/components/dialog-container/index.js +67 -44
  143. package/lib/modules/dialog/components/normal-window/index.js +4 -0
  144. package/lib/modules/dialog/dialogs/control-bar/index.d.ts +1 -0
  145. package/lib/modules/dialog/dialogs/control-bar/index.js +26 -35
  146. package/lib/modules/dialog/dialogs/participant/components/title.js +1 -1
  147. package/lib/modules/dialog/dialogs/sub-window/index.d.ts +2 -0
  148. package/lib/modules/dialog/dialogs/sub-window/index.js +102 -0
  149. package/lib/modules/dialog/dialogs/video-window/index.d.ts +1 -0
  150. package/lib/modules/dialog/dialogs/video-window/index.js +31 -25
  151. package/lib/modules/dialog/dialogs/whiteboard/index.js +0 -1
  152. package/lib/modules/dialog/hooks/use-popover-watcher.js +1 -2
  153. package/lib/modules/dialog/hooks/useElectron.d.ts +13 -0
  154. package/lib/modules/dialog/hooks/useElectron.js +66 -13
  155. package/lib/modules/dialog/index.d.ts +6 -3
  156. package/lib/modules/dialog/index.js +5 -3
  157. package/lib/modules/dialog/level-config.js +1 -1
  158. package/lib/modules/dialog/store.d.ts +23 -9
  159. package/lib/modules/dialog/store.js +84 -12
  160. package/lib/modules/dialog/type.d.ts +8 -0
  161. package/lib/modules/event-confirm/components/window/index.d.ts +5 -2
  162. package/lib/modules/event-confirm/components/window/index.js +38 -14
  163. package/lib/modules/event-confirm/index.css +3 -2
  164. package/lib/modules/event-confirm/store.d.ts +10 -5
  165. package/lib/modules/event-confirm/store.js +68 -20
  166. package/lib/modules/event-confirm/view.js +10 -8
  167. package/lib/modules/event-sound/index.d.ts +1 -0
  168. package/lib/modules/event-sound/index.js +11 -24
  169. package/lib/modules/interpreter/interpreter-list/interpreter-item/components/pick-user/index.js +1 -2
  170. package/lib/modules/interpreter/store.js +11 -13
  171. package/lib/modules/invite/components/pstn-invite.js +0 -1
  172. package/lib/modules/layout/components/CommonVideoRenderer.js +26 -26
  173. package/lib/modules/layout/components/who-is-speaking.js +3 -6
  174. package/lib/modules/layout/index.d.ts +3 -1
  175. package/lib/modules/layout/index.js +2 -1
  176. package/lib/modules/layout/store.d.ts +7 -59
  177. package/lib/modules/layout/store.js +133 -45
  178. package/lib/modules/layout/type.d.ts +55 -0
  179. package/lib/modules/participant/components/can-moveable/index.js +0 -1
  180. package/lib/modules/participant/components/participants/components/participants/components/attendee/index.js +4 -2
  181. package/lib/modules/participant/components/participants/components/participants/components/participants-more/index.js +14 -2
  182. package/lib/modules/participant/components/participants/components/participants/components/user-row/index.d.ts +1 -1
  183. package/lib/modules/participant/components/participants/components/participants/components/user-row/index.js +3 -2
  184. package/lib/modules/participant/components/participants/components/participants/index.js +3 -2
  185. package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-actions-popover/index.d.ts +1 -0
  186. package/lib/modules/participant/components/participants/components/render-user/components/user-action/components/move-actions-popover/index.js +3 -1
  187. package/lib/modules/participant/components/participants/components/render-user/components/user-action/index.js +4 -2
  188. package/lib/modules/participant/components/participants/components/render-user/index.d.ts +4 -2
  189. package/lib/modules/participant/components/participants/components/render-user/index.js +5 -3
  190. package/lib/modules/participant/components/participants/index.js +5 -2
  191. package/lib/modules/participant/components/participants/types.d.ts +3 -0
  192. package/lib/modules/participant/index.d.ts +2 -0
  193. package/lib/modules/participant/index.js +2 -1
  194. package/lib/modules/participant/member-list-data-source.js +3 -5
  195. package/lib/modules/participant/store.d.ts +5 -1
  196. package/lib/modules/participant/store.js +51 -44
  197. package/lib/modules/secondary-window/index.d.ts +50 -0
  198. package/lib/modules/secondary-window/index.js +113 -0
  199. package/lib/modules/secondary-window/store.d.ts +76 -0
  200. package/lib/modules/secondary-window/store.js +407 -0
  201. package/lib/modules/secondary-window/type.d.ts +110 -0
  202. package/lib/modules/secondary-window/type.js +35 -0
  203. package/lib/modules/secondary-window/view.d.ts +6 -0
  204. package/lib/modules/secondary-window/view.js +257 -0
  205. package/lib/modules/setting/audio-settings/audio-settings.js +4 -2
  206. package/lib/modules/setting/config.d.ts +4 -0
  207. package/lib/modules/setting/config.js +6 -3
  208. package/lib/modules/setting/general-settings/general-settings.js +9 -0
  209. package/lib/modules/setting/state/index.js +0 -10
  210. package/lib/modules/setting/store.d.ts +9 -3
  211. package/lib/modules/setting/store.js +110 -77
  212. package/lib/modules/setting/view.js +3 -2
  213. package/lib/modules/share-screen/components/control-bar/index.d.ts +14 -1
  214. package/lib/modules/share-screen/components/control-bar/index.js +17 -12
  215. package/lib/modules/share-screen/components/selection/index.js +16 -23
  216. package/lib/modules/share-screen/index.d.ts +4 -1
  217. package/lib/modules/share-screen/index.js +6 -3
  218. package/lib/modules/share-screen/store.d.ts +18 -19
  219. package/lib/modules/share-screen/store.js +101 -151
  220. package/lib/modules/share-screen/types.d.ts +7 -8
  221. package/lib/modules/state-bar/index.d.ts +2 -0
  222. package/lib/modules/state-bar/index.js +2 -1
  223. package/lib/modules/state-bar/live-streaming-state.js +0 -1
  224. package/lib/modules/state-bar/store.d.ts +5 -2
  225. package/lib/modules/state-bar/store.js +14 -7
  226. package/lib/modules/state-bar/view.js +3 -3
  227. package/lib/modules/video-window/components/members/index.js +10 -15
  228. package/lib/modules/video-window/store.d.ts +1 -0
  229. package/lib/modules/video-window/store.js +8 -3
  230. package/lib/modules/whiteboard/components/control-bar/store.d.ts +3 -0
  231. package/lib/modules/whiteboard/components/control-bar/store.js +20 -11
  232. package/lib/modules/whiteboard/components/toolbar/store.d.ts +2 -2
  233. package/lib/modules/whiteboard/components/toolbar/store.js +2 -2
  234. package/lib/modules/whiteboard/index.d.ts +20 -17
  235. package/lib/modules/whiteboard/index.js +167 -132
  236. package/lib/plugins/module-dev-plugin.js +4 -0
  237. package/lib/providers/ability-provider.js +2 -0
  238. package/lib/providers/annotation-provider.js +3 -3
  239. package/lib/providers/device-privilege-provider.js +13 -12
  240. package/lib/providers/device-provider.d.ts +40 -31
  241. package/lib/providers/device-provider.js +657 -713
  242. package/lib/providers/device-stream-provider.js +4 -4
  243. package/lib/providers/interpreter-provider.js +7 -9
  244. package/lib/providers/multi-display-provider.d.ts +90 -0
  245. package/lib/providers/multi-display-provider.js +593 -0
  246. package/lib/providers/privilege-provider.d.ts +3 -11
  247. package/lib/providers/privilege-provider.js +3 -12
  248. package/lib/providers/renderer-provider.d.ts +3 -3
  249. package/lib/providers/renderer-provider.js +20 -32
  250. package/lib/providers/room-provider.js +21 -16
  251. package/lib/providers/screen-share-provider.d.ts +15 -11
  252. package/lib/providers/screen-share-provider.js +118 -99
  253. package/lib/providers/sharing-provider.d.ts +7 -1
  254. package/lib/providers/sharing-provider.js +39 -3
  255. package/lib/providers/whiteboard-provider.d.ts +24 -0
  256. package/lib/providers/whiteboard-provider.js +128 -0
  257. package/lib/runtime.d.ts +1 -0
  258. package/lib/scenes/main-scene.d.ts +6 -0
  259. package/lib/scenes/main-scene.js +44 -2
  260. package/lib/scenes/waiting-scene.d.ts +0 -2
  261. package/lib/scenes/waiting-scene.js +0 -6
  262. package/lib/schema.d.ts +3 -3
  263. package/lib/schema.js +1 -1
  264. package/lib/shared-data-source/confirm-data.d.ts +19 -0
  265. package/lib/shared-data-source/confirm-data.js +119 -15
  266. package/lib/shared-data-source/member-data.d.ts +2 -2
  267. package/lib/shared-data-source/screen-share-data.d.ts +35 -28
  268. package/lib/shared-data-source/screen-share-data.js +19 -8
  269. package/lib/shared-data-source/setting.js +4 -3
  270. package/lib/shared-data-source/video-window.js +1 -2
  271. package/lib/shared-data-source/whiteboard-data.d.ts +70 -0
  272. package/lib/shared-data-source/whiteboard-data.js +348 -0
  273. package/lib/translations/enUS.d.ts +1 -0
  274. package/lib/translations/enUS.js +2 -1
  275. package/lib/translations/zhCN.d.ts +1 -0
  276. package/lib/translations/zhCN.js +2 -1
  277. package/lib/ui-scene.d.ts +1 -0
  278. package/lib/ui-scene.js +77 -24
  279. package/lib/utilities/constant.d.ts +9 -2
  280. package/lib/utilities/constant.js +10 -3
  281. package/lib/utilities/debug.d.ts +4 -0
  282. package/lib/utilities/debug.js +40 -0
  283. package/lib/utilities/default-config.d.ts +4 -0
  284. package/lib/utilities/default-config.js +8 -4
  285. package/lib/utilities/dialog-utils.d.ts +3 -2
  286. package/lib/utilities/dialog-utils.js +56 -15
  287. package/lib/utilities/meeting-detail.js +4 -1
  288. package/lib/utilities/package-info.d.ts +3 -0
  289. package/lib/utilities/package-info.js +15 -0
  290. package/lib/utilities/renderer-event.d.ts +4 -6
  291. package/lib/utilities/renderer-event.js +23 -43
  292. package/lib/utilities/renderer.d.ts +1 -1
  293. package/lib/utilities/renderer.js +44 -10
  294. package/lib/utilities/shared-storage.d.ts +18 -0
  295. package/lib/utilities/shared-storage.js +63 -0
  296. package/lib/utilities/tools.js +2 -1
  297. package/lib/waiting-room-control-manager.js +6 -6
  298. package/package.json +6 -7
  299. package/public/index.html +5 -0
  300. package/lib/electron/tools.d.ts +0 -5
  301. package/lib/electron/tools.js +0 -62
@@ -28,6 +28,7 @@ require("core-js/modules/es.array.for-each.js");
28
28
  require("core-js/modules/es.array.iterator.js");
29
29
  require("core-js/modules/es.array.map.js");
30
30
  require("core-js/modules/es.array.push.js");
31
+ require("core-js/modules/es.array.reduce.js");
31
32
  require("core-js/modules/es.array.slice.js");
32
33
  require("core-js/modules/es.array.some.js");
33
34
  require("core-js/modules/es.array.sort.js");
@@ -47,6 +48,7 @@ require("core-js/modules/esnext.iterator.filter.js");
47
48
  require("core-js/modules/esnext.iterator.find.js");
48
49
  require("core-js/modules/esnext.iterator.for-each.js");
49
50
  require("core-js/modules/esnext.iterator.map.js");
51
+ require("core-js/modules/esnext.iterator.reduce.js");
50
52
  require("core-js/modules/esnext.iterator.some.js");
51
53
  require("core-js/modules/esnext.map.delete-all.js");
52
54
  require("core-js/modules/esnext.map.emplace.js");
@@ -105,7 +107,7 @@ var _imports = require("fcr-core/lib/imports");
105
107
  var _base = require("../base");
106
108
  var _env = require("agora-foundation/lib/utilities/env");
107
109
  var _fcrCore = require("fcr-core");
108
- var _type = require("agora-rte-sdk/lib/core/rtc/type");
110
+ var _type = require("fcr-core/lib/type");
109
111
  var _localVideoPlayer = require("agora-ui-foundation/lib/components/local-video-player");
110
112
  var _i18n = require("agora-ui-foundation/lib/i18n");
111
113
  var _mobx = require("mobx");
@@ -114,7 +116,7 @@ var _type2 = require("../type");
114
116
  var _tools = require("../utilities/tools");
115
117
  var _logger = require("../utilities/logger");
116
118
  var _FcrUIDeviceProviderImpl;
117
- var _initProto, _init__microphoneDevice, _init__microphone, _init__speakerDevice, _init__speaker, _init_currentIsMirror, _init_showForceOpenEffectDialog, _init_cameraId, _init_cameraEnabled, _init_showCameraPreview, _init_microphoneEnabled, _init_cameraList, _init_microphoneList, _init_microphoneVolumeLevel, _init_speakerList, _init_isLocalMirrorEnabled, _init_isLocalEditBeautyOptions, _init_speakerVolumeLevel, _init_speakerVolume, _init_microphoneVolume, _init_virtualBackgroundName, _init_enableBeauty, _init_beautyKey, _init_beautyOptions, _init_virtualBackgroundList, _init_soundEffectList, _init_microphoneDetecting, _init_speakerDetecting, _init_connectType, _init_isMainRoomAudioOff, _initDeviceListDecs, _startPlayLocalVideoDecs, _stopPlayLocalVideoDecs, _handleSpeakerDetectingChangedDecs, _startSpeakerTestDecs, _stopSpeakerTestDecs, _setCurrentIsMirrorDecs, _toggleLocalMirrorPreviewDecs, _setBeautyOptionsDecs, _handleCancelForceOpenVideoEffectDecs, _handleForceOpenVideoEffectDecs, _setCameraEnabledDecs, _handleMicrophoneAudioTrackDecs, _setMicrophoneEnabledDecs, _handleMicrophoneEnabledChangedDecs, _toggleLocalMirrorDecs, _resetMirrorDecs, _handleMicrophoneDetectingChangedDecs, _startMicrophoneTestDecs, _stopMicrophoneTestDecs, _enableVirtualBackgroundDecs, _setEditBeautyKeyDecs, _enableBeautyEffectDecs, _setCameraIdDecs, _setSpeakerIdDecs, _setMicrophoneIdDecs, _setSpeakerVolumeDecs, _setMicrophoneVolumeDecs, _loadUiResourcesDecs, _setConnectTypeDecs, _updateVirtualBackgroundListDecs, _handleSystemSelectedSpeakerChangedDecs, _handleSystemSelectedMicrophoneChangedDecs, _correctSystemSelectedMicrophoneDeviceIdDecs, _handleSpeakerTestVolumeIndicationUpdatedDecs, _handleSpeakerVolumeUpdatedDecs, _handleMicrophoneVolumeIndicationUpdatedDecs, _handleSpeakerAddedDecs, _handleSpeakerRemovedDecs, _handleSpeakerListUpdatedDecs, _setMainRoomAudioOffDecs, _ref;
119
+ var _initProto, _init__microphoneDevice, _init__microphone, _init__speakerDevice, _init__speaker, _init__cameraDevice, _init_currentIsMirror, _init_showForceOpenEffectDialog, _init_cameraEnabled, _init_showCameraPreview, _init_microphoneEnabled, _init_cameraList, _init_microphoneList, _init_microphoneVolumeLevel, _init_speakerList, _init_isLocalMirrorEnabled, _init_isLocalEditBeautyOptions, _init_speakerVolumeLevel, _init_speakerVolume, _init_microphoneVolume, _init_virtualBackgroundName, _init_enableBeauty, _init_beautyKey, _init_beautyOptions, _init_virtualBackgroundList, _init_soundEffectList, _init_microphoneDetecting, _init_speakerDetecting, _init_connectType, _init_isMainRoomAudioOff, _startPlayLocalVideoDecs, _stopPlayLocalVideoDecs, _startSpeakerTestDecs, _stopSpeakerTestDecs, _setCurrentIsMirrorDecs, _toggleLocalMirrorPreviewDecs, _setBeautyOptionsDecs, _handleCancelForceOpenVideoEffectDecs, _handleForceOpenVideoEffectDecs, _setCameraEnabledDecs, _handleCameraEnabledChangedDecs, _setMicrophoneEnabledDecs, _toggleLocalMirrorDecs, _resetMirrorDecs, _startMicrophoneTestDecs, _stopMicrophoneTestDecs, _enableVirtualBackgroundDecs, _setEditBeautyKeyDecs, _enableBeautyEffectDecs, _setCameraIdDecs, _setMainRoomAudioOffDecs, _setSpeakerIdDecs, _setMicrophoneIdDecs, _setSpeakerVolumeDecs, _setMicrophoneVolumeDecs, _startOrStopCameraDecs, _setShowCameraPreviewDecs, _loadUiResourcesDecs, _loadZipResourcesDecs, _setConnectTypeDecs, _toggleLocalCameraPreviewDecs, _getLoopbackDeviceIdDecs, _initDeviceListDecs, _handleMicrophoneAudioTrackDecs, _handleMicrophoneEnabledChangedDecs, _handleCameraVideoTrackDecs, _handleSpeakerDetectingChangedDecs, _stopSelectedSpeakerTestDecs, _handleMicrophoneDetectingChangedDecs, _stopMicrophoneTestDecs2, _updateVirtualBackgroundListDecs, _handleSystemSelectedSpeakerChangedDecs, _handleSystemSelectedMicrophoneChangedDecs, _correctSystemSelectedMicrophoneDeviceIdDecs, _handleSelectedSpeakerVolumeUpdatedDecs, _handleSpeakerTestVolumeIndicationUpdatedDecs, _handleMicrophoneVolumeIndicationUpdatedDecs, _handleSpeakerAddedDecs, _handleSpeakerRemovedDecs, _handleSpeakerListUpdatedDecs, _getMicrophoneListDecs, _getSpeakerListDecs, _formatDeviceListDecs, _loadBuiltinResourcesDecs, _ref;
118
120
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
119
121
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
120
122
  function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
@@ -127,6 +129,9 @@ function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.descr
127
129
  function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); return e; }
128
130
  // device id for default device (follow system)
129
131
  var DEFAULT_DEVICE_ID = exports.DEFAULT_DEVICE_ID = 'default';
132
+ var getDeviceVolumeLevel = function getDeviceVolumeLevel(volume) {
133
+ return Math.floor(volume / 255 * 100);
134
+ };
130
135
  var _A = /*#__PURE__*/new WeakMap();
131
136
  var _B = /*#__PURE__*/new WeakMap();
132
137
  var _C = /*#__PURE__*/new WeakMap();
@@ -156,7 +161,7 @@ var _Z = /*#__PURE__*/new WeakMap();
156
161
  var _a = /*#__PURE__*/new WeakMap();
157
162
  var _b = /*#__PURE__*/new WeakMap();
158
163
  var _c = /*#__PURE__*/new WeakMap();
159
- _ref = (_initDeviceListDecs = [_mobx.action, _mobx.action.bound], _startPlayLocalVideoDecs = [_mobx.action, _mobx.action.bound], _stopPlayLocalVideoDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerDetectingChangedDecs = [_mobx.action, _mobx.action.bound], _startSpeakerTestDecs = [_mobx.action, _mobx.action.bound], _stopSpeakerTestDecs = [_mobx.action, _mobx.action.bound], _setCurrentIsMirrorDecs = [_mobx.action, _mobx.action.bound], _toggleLocalMirrorPreviewDecs = [_mobx.action, _mobx.action.bound], _setBeautyOptionsDecs = [_mobx.action, _mobx.action.bound], _handleCancelForceOpenVideoEffectDecs = [_mobx.action, _mobx.action.bound], _handleForceOpenVideoEffectDecs = [_mobx.action, _mobx.action.bound], _setCameraEnabledDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneAudioTrackDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneEnabledDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneEnabledChangedDecs = [_mobx.action, _mobx.action.bound], _toggleLocalMirrorDecs = [_mobx.action, _mobx.action.bound], _resetMirrorDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneDetectingChangedDecs = [_mobx.action, _mobx.action.bound], _startMicrophoneTestDecs = [_mobx.action, _mobx.action.bound], _stopMicrophoneTestDecs = [_mobx.action, _mobx.action.bound], _enableVirtualBackgroundDecs = [_mobx.action, _mobx.action.bound], _setEditBeautyKeyDecs = [_mobx.action, _mobx.action.bound], _enableBeautyEffectDecs = [_mobx.action, _mobx.action.bound], _setCameraIdDecs = [_mobx.action, _mobx.action.bound], _setSpeakerIdDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneIdDecs = [_mobx.action, _mobx.action.bound], _setSpeakerVolumeDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneVolumeDecs = [_mobx.action, _mobx.action.bound], _loadUiResourcesDecs = [_mobx.action, _mobx.action.bound], _setConnectTypeDecs = [_mobx.action, _mobx.action.bound], _updateVirtualBackgroundListDecs = [_mobx.action, _mobx.action.bound], _handleSystemSelectedSpeakerChangedDecs = [_mobx.action, _mobx.action.bound], _handleSystemSelectedMicrophoneChangedDecs = [_mobx.action, _mobx.action.bound], _correctSystemSelectedMicrophoneDeviceIdDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerTestVolumeIndicationUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerVolumeUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneVolumeIndicationUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerAddedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerRemovedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerListUpdatedDecs = [_mobx.action, _mobx.action.bound], _setMainRoomAudioOffDecs = [_mobx.action, _mobx.action.bound], "logger");
164
+ _ref = (_startPlayLocalVideoDecs = [_mobx.action, _mobx.action.bound], _stopPlayLocalVideoDecs = [_mobx.action, _mobx.action.bound], _startSpeakerTestDecs = [_mobx.action, _mobx.action.bound], _stopSpeakerTestDecs = [_mobx.action, _mobx.action.bound], _setCurrentIsMirrorDecs = [_mobx.action, _mobx.action.bound], _toggleLocalMirrorPreviewDecs = [_mobx.action, _mobx.action.bound], _setBeautyOptionsDecs = [_mobx.action, _mobx.action.bound], _handleCancelForceOpenVideoEffectDecs = [_mobx.action, _mobx.action.bound], _handleForceOpenVideoEffectDecs = [_mobx.action, _mobx.action.bound], _setCameraEnabledDecs = [_mobx.action, _mobx.action.bound], _handleCameraEnabledChangedDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneEnabledDecs = [_mobx.action, _mobx.action.bound], _toggleLocalMirrorDecs = [_mobx.action, _mobx.action.bound], _resetMirrorDecs = [_mobx.action, _mobx.action.bound], _startMicrophoneTestDecs = [_mobx.action, _mobx.action.bound], _stopMicrophoneTestDecs = [_mobx.action, _mobx.action.bound], _enableVirtualBackgroundDecs = [_mobx.action, _mobx.action.bound], _setEditBeautyKeyDecs = [_mobx.action, _mobx.action.bound], _enableBeautyEffectDecs = [_mobx.action, _mobx.action.bound], _setCameraIdDecs = [_mobx.action, _mobx.action.bound], _setMainRoomAudioOffDecs = [_mobx.action, _mobx.action.bound], _setSpeakerIdDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneIdDecs = [_mobx.action, _mobx.action.bound], _setSpeakerVolumeDecs = [_mobx.action, _mobx.action.bound], _setMicrophoneVolumeDecs = [_mobx.action, _mobx.action.bound], _startOrStopCameraDecs = [_mobx.action, _mobx.action.bound], _setShowCameraPreviewDecs = [_mobx.action, _mobx.action.bound], _loadUiResourcesDecs = [_mobx.action, _mobx.action.bound], _loadZipResourcesDecs = [_mobx.action, _mobx.action.bound], _setConnectTypeDecs = [_mobx.action, _mobx.action.bound], _toggleLocalCameraPreviewDecs = [_mobx.action, _mobx.action.bound], _getLoopbackDeviceIdDecs = [_mobx.action, _mobx.action.bound], _initDeviceListDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneAudioTrackDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneEnabledChangedDecs = [_mobx.action, _mobx.action.bound], _handleCameraVideoTrackDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerDetectingChangedDecs = [_mobx.action, _mobx.action.bound], _stopSelectedSpeakerTestDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneDetectingChangedDecs = [_mobx.action, _mobx.action.bound], _stopMicrophoneTestDecs2 = [_mobx.action, _mobx.action.bound], _updateVirtualBackgroundListDecs = [_mobx.action, _mobx.action.bound], _handleSystemSelectedSpeakerChangedDecs = [_mobx.action, _mobx.action.bound], _handleSystemSelectedMicrophoneChangedDecs = [_mobx.action, _mobx.action.bound], _correctSystemSelectedMicrophoneDeviceIdDecs = [_mobx.action, _mobx.action.bound], _handleSelectedSpeakerVolumeUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerTestVolumeIndicationUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleMicrophoneVolumeIndicationUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerAddedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerRemovedDecs = [_mobx.action, _mobx.action.bound], _handleSpeakerListUpdatedDecs = [_mobx.action, _mobx.action.bound], _getMicrophoneListDecs = [_mobx.action, _mobx.action.bound], _getSpeakerListDecs = [_mobx.action, _mobx.action.bound], _formatDeviceListDecs = [_mobx.action, _mobx.action.bound], _loadBuiltinResourcesDecs = [_mobx.action, _mobx.action.bound], "logger");
160
165
  var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/function () {
161
166
  function FcrUIDeviceProviderImpl(_eventProvider, _mediaControl, _sharedSettingDataSource) {
162
167
  var _this = this;
@@ -169,9 +174,11 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
169
174
  (0, _defineProperty2["default"])(this, "_hasExecutedOpenCamera", false);
170
175
  (0, _defineProperty2["default"])(this, "_hasExecutedConnectAudio", false);
171
176
  (0, _defineProperty2["default"])(this, "_isAudioConnected", false);
177
+ (0, _defineProperty2["default"])(this, "_cameraVideoTrack", null);
172
178
  (0, _defineProperty2["default"])(this, "_microphoneAudioTrack", null);
173
179
  (0, _defineProperty2["default"])(this, "_localVideoViewSet", new Set());
174
- (0, _defineProperty2["default"])(this, "_videoRotation", _type.AgoraRtcVideoOrientation.VIDEO_ORIENTATION_0);
180
+ (0, _defineProperty2["default"])(this, "_videoRotation", _type.FcrVideoOrientation.VIDEO_ORIENTATION_0);
181
+ (0, _defineProperty2["default"])(this, "_released", false);
175
182
  // 强制开启美颜
176
183
  (0, _defineProperty2["default"])(this, "_isForceEnableBeauty", false);
177
184
  // 强制开启虚拟背景
@@ -183,43 +190,38 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
183
190
  onVolumeIndicationUpdated: this._handleMicrophoneVolumeIndicationUpdated
184
191
  });
185
192
  (0, _defineProperty2["default"])(this, "_mediaControlObserver", {
186
- onCameraAdded: this._handleCameraListUpdated,
187
- onCameraRemoved: this._handleCameraListUpdated,
193
+ onCameraAdded: this._handleCameraAdded,
194
+ onCameraRemoved: this._handleCameraRemoved,
188
195
  onMicrophoneAdded: this._handleMicrophoneAdded,
189
196
  onMicrophoneRemoved: this._handleMicrophoneRemoved,
190
197
  onSpeakerAdded: this._handleSpeakerAdded,
191
198
  onSpeakerRemoved: this._handleSpeakerRemoved,
192
199
  onSpeakerTestVolumeIndicationUpdated: this._handleSpeakerTestVolumeIndicationUpdated,
193
- onSelectedSpeakerVolumeUpdated: this._handleSpeakerVolumeUpdated,
200
+ onSelectedSpeakerVolumeUpdated: this._handleSelectedSpeakerVolumeUpdated,
194
201
  onSystemSelectedSpeakerChanged: this._handleSystemSelectedSpeakerChanged,
195
202
  onSystemSelectedMicrophoneChanged: this._handleSystemSelectedMicrophoneChanged
196
203
  });
197
204
  (0, _defineProperty2["default"])(this, "_defaultMirror", true);
198
205
  (0, _defineProperty2["default"])(this, "_volumeIndicationInterval", 200);
199
- // real microphone device id
200
206
  _classPrivateFieldInitSpec(this, _A, _init__microphoneDevice(this, {
201
207
  id: null
202
208
  }));
203
209
  _classPrivateFieldInitSpec(this, _B, _init__microphone(this, {
204
210
  id: DEFAULT_DEVICE_ID
205
211
  }));
206
- // real speaker device id
207
- // @observable private accessor _speakerDeviceId = '';
208
212
  _classPrivateFieldInitSpec(this, _C, _init__speakerDevice(this, {
209
213
  id: null
210
214
  }));
211
215
  _classPrivateFieldInitSpec(this, _D, _init__speaker(this, {
212
216
  id: DEFAULT_DEVICE_ID
213
217
  }));
218
+ _classPrivateFieldInitSpec(this, _E, _init__cameraDevice(this, {
219
+ id: null
220
+ }));
214
221
  // 是否开启镜像
215
- _classPrivateFieldInitSpec(this, _E, _init_currentIsMirror(this, true));
222
+ _classPrivateFieldInitSpec(this, _F, _init_currentIsMirror(this, true));
216
223
  // 是否展示展示强制开启特效弹窗
217
- _classPrivateFieldInitSpec(this, _F, _init_showForceOpenEffectDialog(this, false));
218
- // selected camera id, it is the real device id
219
- _classPrivateFieldInitSpec(this, _G, _init_cameraId(this, ''));
220
- // selected microphone id, for ui display, could be 'default' or real device id
221
- // selected speaker id, for ui display, could be 'default' or real device id
222
- // @observable accessor speakerId = DEFAULT_DEVICE_ID;
224
+ _classPrivateFieldInitSpec(this, _G, _init_showForceOpenEffectDialog(this, false));
223
225
  _classPrivateFieldInitSpec(this, _H, _init_cameraEnabled(this, false));
224
226
  _classPrivateFieldInitSpec(this, _I, _init_showCameraPreview(this, false));
225
227
  _classPrivateFieldInitSpec(this, _J, _init_microphoneEnabled(this, false));
@@ -252,8 +254,10 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
252
254
  this._mediaControl = _mediaControl;
253
255
  this._sharedSettingDataSource = _sharedSettingDataSource;
254
256
  this._disposer.push((0, _mobx.reaction)(function () {
255
- return _this.cameraId;
256
- }, this._handleCameraChanged), (0, _mobx.reaction)(function () {
257
+ return _this.cameraEnabled;
258
+ }, this._handleCameraEnabledChanged), (0, _mobx.reaction)(function () {
259
+ return _this._cameraDevice;
260
+ }, this._handleCameraDeviceIdChanged), (0, _mobx.reaction)(function () {
257
261
  return _this.microphoneEnabled;
258
262
  }, this._handleMicrophoneEnabledChanged), (0, _mobx.reaction)(function () {
259
263
  return _this._microphone;
@@ -269,6 +273,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
269
273
  return _this.microphoneDetecting;
270
274
  }, this._handleMicrophoneDetectingChanged));
271
275
  this._mediaControl.addObserver(this._mediaControlObserver);
276
+ this._initDeviceList();
272
277
  (0, _mobx.runInAction)(function () {
273
278
  _this.speakerVolume = _this._mediaControl.getSelectedSpeakerVolume();
274
279
  });
@@ -306,7 +311,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
306
311
  _classPrivateFieldSet(_D, this, v);
307
312
  }
308
313
  }, {
309
- key: "currentIsMirror",
314
+ key: "_cameraDevice",
310
315
  get: function get() {
311
316
  return _classPrivateFieldGet(_E, this);
312
317
  },
@@ -314,7 +319,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
314
319
  _classPrivateFieldSet(_E, this, v);
315
320
  }
316
321
  }, {
317
- key: "showForceOpenEffectDialog",
322
+ key: "currentIsMirror",
318
323
  get: function get() {
319
324
  return _classPrivateFieldGet(_F, this);
320
325
  },
@@ -322,7 +327,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
322
327
  _classPrivateFieldSet(_F, this, v);
323
328
  }
324
329
  }, {
325
- key: "cameraId",
330
+ key: "showForceOpenEffectDialog",
326
331
  get: function get() {
327
332
  return _classPrivateFieldGet(_G, this);
328
333
  },
@@ -617,6 +622,11 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
617
622
  this.setConnectType(_type2.FcrUIConnectType.NONE);
618
623
  this._observable.notifyObservers('onAudioDisconnected');
619
624
  }
625
+ }, {
626
+ key: "cameraId",
627
+ get: function get() {
628
+ return this._cameraDevice.id || '';
629
+ }
620
630
  }, {
621
631
  key: "speakerId",
622
632
  get: function get() {
@@ -654,7 +664,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
654
664
  key: "currentDeviceId",
655
665
  get: function get() {
656
666
  return {
657
- cameraDeviceId: this.cameraId,
667
+ cameraDeviceId: this._cameraDevice.id || '',
658
668
  microphoneDeviceId: this._microphoneDevice.id || '',
659
669
  speakerDeviceId: this._speakerDevice.id || ''
660
670
  };
@@ -669,6 +679,25 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
669
679
  get: function get() {
670
680
  return !this._sharedSettingDataSource.media.microphoneExpectedOff && this._sharedSettingDataSource.media.autoConnectAudio;
671
681
  }
682
+ }, {
683
+ key: "release",
684
+ value: function release() {
685
+ var _this$_cameraVideoTra, _this$_microphoneAudi;
686
+ this._released = true;
687
+ this._mediaControl.removeObserver(this._mediaControlObserver);
688
+ this._toggleLocalCameraPreview(false);
689
+ this._localVideoViewSet.clear();
690
+ (_this$_cameraVideoTra = this._cameraVideoTrack) === null || _this$_cameraVideoTra === void 0 || _this$_cameraVideoTra.stop();
691
+ this._cameraVideoTrack = null;
692
+ this._stopSelectedSpeakerTest();
693
+ this._stopMicrophoneTest();
694
+ (_this$_microphoneAudi = this._microphoneAudioTrack) === null || _this$_microphoneAudi === void 0 || _this$_microphoneAudi.stop();
695
+ this._microphoneAudioTrack = null;
696
+ this._disposer.forEach(function (disposer) {
697
+ return disposer();
698
+ });
699
+ this._disposer = [];
700
+ }
672
701
  }, {
673
702
  key: "getScreenTrack",
674
703
  value: function getScreenTrack(id) {
@@ -679,11 +708,6 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
679
708
  value: function getLoopbackTrack(id) {
680
709
  return this._mediaControl.getLoopbackTrack(id);
681
710
  }
682
- }, {
683
- key: "checkLoopbackDevice",
684
- value: function checkLoopbackDevice() {
685
- return this._mediaControl.checkLoopbackDevice();
686
- }
687
711
  }, {
688
712
  key: "isCapabilitySupported",
689
713
  value: function isCapabilitySupported(type) {
@@ -702,81 +726,13 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
702
726
  }, {
703
727
  key: "cameraTrack",
704
728
  get: function get() {
705
- return this._mediaControl.getCameraTrack(this.cameraId);
729
+ return this._cameraVideoTrack;
706
730
  }
707
731
  }, {
708
732
  key: "microphoneTrack",
709
733
  get: function get() {
710
- return this._microphoneDevice.id ? this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id) : null;
734
+ return this._microphoneAudioTrack;
711
735
  }
712
- }, {
713
- key: "initDeviceList",
714
- value: function () {
715
- var _initDeviceList = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
716
- var _this2 = this;
717
- return _regenerator["default"].wrap(function (_context5) {
718
- while (1) switch (_context5.prev = _context5.next) {
719
- case 0:
720
- return _context5.abrupt("return", Promise.all([this._mediaControl.getCameraList().then(function (list) {
721
- (0, _mobx.runInAction)(function () {
722
- _this2.logger.info('[FcrDeviceStore] init camera list:', list);
723
- _this2.cameraList = list;
724
- if (_this2.cameraList.length > 0) {
725
- var defaultCameraDeviceId = _this2.cameraList[0].deviceId;
726
- _this2.logger.info('[FcrDeviceStore] select default camera id:', defaultCameraDeviceId);
727
- _this2.setCameraId(defaultCameraDeviceId);
728
- }
729
- });
730
- }), this._getMicrophoneList().then(/*#__PURE__*/function () {
731
- var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(microphoneList) {
732
- return _regenerator["default"].wrap(function (_context3) {
733
- while (1) switch (_context3.prev = _context3.next) {
734
- case 0:
735
- _this2.microphoneList = microphoneList;
736
- _this2.logger.info('[FcrDeviceStore] init microphone list:', microphoneList);
737
- // 默认跟随系统
738
- _context3.next = 1;
739
- return _this2.setMicrophoneId(DEFAULT_DEVICE_ID);
740
- case 1:
741
- case "end":
742
- return _context3.stop();
743
- }
744
- }, _callee3);
745
- }));
746
- return function (_x) {
747
- return _ref2.apply(this, arguments);
748
- };
749
- }()), this._getSpeakerList().then(/*#__PURE__*/function () {
750
- var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(speakerList) {
751
- return _regenerator["default"].wrap(function (_context4) {
752
- while (1) switch (_context4.prev = _context4.next) {
753
- case 0:
754
- _this2.speakerList = speakerList;
755
- _this2.logger.info('[FcrDeviceStore] init speaker list:', speakerList);
756
- // 默认跟随系统
757
- _context4.next = 1;
758
- return _this2.setSpeakerId(DEFAULT_DEVICE_ID);
759
- case 1:
760
- case "end":
761
- return _context4.stop();
762
- }
763
- }, _callee4);
764
- }));
765
- return function (_x2) {
766
- return _ref3.apply(this, arguments);
767
- };
768
- }())]));
769
- case 1:
770
- case "end":
771
- return _context5.stop();
772
- }
773
- }, _callee5, this);
774
- }));
775
- function initDeviceList() {
776
- return _initDeviceList.apply(this, arguments);
777
- }
778
- return initDeviceList;
779
- }()
780
736
  }, {
781
737
  key: "addObserver",
782
738
  value: function addObserver(observer) {
@@ -791,9 +747,8 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
791
747
  key: "startPlayLocalVideo",
792
748
  value: function startPlayLocalVideo(view) {
793
749
  var isMirror = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.currentIsMirror;
794
- if (!this.cameraId || !view) return;
750
+ if (!this._cameraVideoTrack || !view) return;
795
751
  this._localVideoViewSet.add(view);
796
- this._cameraVideoTrack = this._mediaControl.getCameraTrack(this.cameraId);
797
752
  this._cameraVideoTrack.startPreview({
798
753
  renderMode: _fcrCore.FcrVideoRenderMode.HIDDEN,
799
754
  isMirror: isMirror
@@ -803,40 +758,10 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
803
758
  }, {
804
759
  key: "stopPlayLocalVideo",
805
760
  value: function stopPlayLocalVideo(view) {
806
- var _this$_cameraVideoTra;
761
+ var _this$_cameraVideoTra2;
807
762
  if (!view) return;
808
763
  this._localVideoViewSet["delete"](view);
809
- (_this$_cameraVideoTra = this._cameraVideoTrack) === null || _this$_cameraVideoTra === void 0 || _this$_cameraVideoTra.stopPreview(view);
810
- }
811
- }, {
812
- key: "_handleSpeakerDetectingChanged",
813
- value: function _handleSpeakerDetectingChanged() {
814
- var _this3 = this;
815
- if (this.microphoneEnabled) {
816
- if (this.speakerDetecting) {
817
- var _this$_microphoneAudi;
818
- (_this$_microphoneAudi = this._microphoneAudioTrack) === null || _this$_microphoneAudi === void 0 || _this$_microphoneAudi.stop();
819
- } else {
820
- var _this$_microphoneAudi2;
821
- (_this$_microphoneAudi2 = this._microphoneAudioTrack) === null || _this$_microphoneAudi2 === void 0 || _this$_microphoneAudi2.start();
822
- }
823
- }
824
- this._playAudioTimer && clearInterval(this._playAudioTimer);
825
- if (this.speakerDetecting) {
826
- var startSelectedSpeakerTest = function startSelectedSpeakerTest() {
827
- var _this3$soundEffectLis, _this3$soundEffectLis2;
828
- var soundUrl = (0, _env.isElectron)() ? (_this3$soundEffectLis = _this3.soundEffectList.get('speaker_test')) === null || _this3$soundEffectLis === void 0 ? void 0 : _this3$soundEffectLis.md5Url : (_this3$soundEffectLis2 = _this3.soundEffectList.get('speaker_test')) === null || _this3$soundEffectLis2 === void 0 ? void 0 : _this3$soundEffectLis2.url;
829
- _this3._mediaControl.startSelectedSpeakerTest(soundUrl || '', _this3._volumeIndicationInterval);
830
- };
831
- startSelectedSpeakerTest();
832
- var sleep = 3000;
833
- this._playAudioTimer = setInterval(function () {
834
- startSelectedSpeakerTest();
835
- }, sleep);
836
- } else {
837
- this._mediaControl.stopSelectedSpeakerTest();
838
- this.speakerVolumeLevel = 0;
839
- }
764
+ (_this$_cameraVideoTra2 = this._cameraVideoTrack) === null || _this$_cameraVideoTra2 === void 0 || _this$_cameraVideoTra2.stopPreview(view);
840
765
  }
841
766
  }, {
842
767
  key: "startSpeakerTest",
@@ -856,12 +781,12 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
856
781
  }, {
857
782
  key: "toggleLocalMirrorPreview",
858
783
  value: function toggleLocalMirrorPreview(mirror) {
859
- var _this4 = this;
784
+ var _this2 = this;
860
785
  this.setCurrentIsMirror(mirror);
861
786
  this._localVideoViewSet.forEach(function (view) {
862
- var _this4$_cameraVideoTr, _this4$_cameraVideoTr2;
863
- (_this4$_cameraVideoTr = _this4._cameraVideoTrack) === null || _this4$_cameraVideoTr === void 0 || _this4$_cameraVideoTr.stopPreview(view);
864
- (_this4$_cameraVideoTr2 = _this4._cameraVideoTrack) === null || _this4$_cameraVideoTr2 === void 0 || _this4$_cameraVideoTr2.startPreview({
787
+ var _this2$_cameraVideoTr, _this2$_cameraVideoTr2;
788
+ (_this2$_cameraVideoTr = _this2._cameraVideoTrack) === null || _this2$_cameraVideoTr === void 0 || _this2$_cameraVideoTr.stopPreview(view);
789
+ (_this2$_cameraVideoTr2 = _this2._cameraVideoTrack) === null || _this2$_cameraVideoTr2 === void 0 || _this2$_cameraVideoTr2.startPreview({
865
790
  renderMode: _fcrCore.FcrVideoRenderMode.HIDDEN,
866
791
  isMirror: mirror
867
792
  }, view);
@@ -871,8 +796,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
871
796
  key: "setBeautyOptions",
872
797
  value: function setBeautyOptions(beautyOption) {
873
798
  Object.assign(this.beautyOptions, beautyOption);
874
- if (!this.cameraId) return;
875
- this._cameraVideoTrack = this._mediaControl.getCameraTrack(this.cameraId);
799
+ if (!this._cameraVideoTrack) return;
876
800
  this._cameraVideoTrack.getVideoEffectEnhancer().setBeautyOptions({
877
801
  lighteningContrastLevel: (0, _tools.convertToFixedNumber)(this.beautyOptions.lighteningContrastLevel),
878
802
  lighteningLevel: (0, _tools.convertToFixedNumber)(this.beautyOptions.lighteningLevel),
@@ -889,66 +813,54 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
889
813
  }, {
890
814
  key: "handleForceOpenVideoEffect",
891
815
  value: function handleForceOpenVideoEffect() {
816
+ var _this3 = this;
817
+ var reset = function reset() {
818
+ _this3.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.NONE;
819
+ _this3.showForceOpenEffectDialog = false;
820
+ };
892
821
  if (this.lastEnableVideoEffectType === _type2.FcrUIVideoEffectType.BEAUTY) {
893
822
  this._isForceEnableBeauty = true;
894
823
  this.enableBeautyEffect(true);
895
- this.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.NONE;
896
- this.showForceOpenEffectDialog = false;
824
+ reset();
897
825
  return;
898
826
  }
899
827
  if (this.lastEnableVideoEffectType === _type2.FcrUIVideoEffectType.VIRTUAL_BACKGROUND) {
900
828
  this._isForceEnableVirtualBackground = true;
901
829
  this.enableVirtualBackground(true);
902
- this.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.NONE;
903
- this.showForceOpenEffectDialog = false;
830
+ reset();
904
831
  return;
905
832
  }
906
833
  }
907
834
  }, {
908
835
  key: "setVideoOrientation",
909
836
  value: function setVideoOrientation() {
910
- var _this$_cameraVideoTra2;
911
- if (this._videoRotation === _type.AgoraRtcVideoOrientation.VIDEO_ORIENTATION_270) {
912
- this._videoRotation = _type.AgoraRtcVideoOrientation.VIDEO_ORIENTATION_0;
837
+ var _this$_cameraVideoTra3;
838
+ if (this._videoRotation === _type.FcrVideoOrientation.VIDEO_ORIENTATION_270) {
839
+ this._videoRotation = _type.FcrVideoOrientation.VIDEO_ORIENTATION_0;
913
840
  } else {
914
841
  this._videoRotation = this._videoRotation + 1;
915
842
  }
916
- (_this$_cameraVideoTra2 = this._cameraVideoTrack) === null || _this$_cameraVideoTra2 === void 0 || _this$_cameraVideoTra2.setVideoOrientation(this._videoRotation);
843
+ (_this$_cameraVideoTra3 = this._cameraVideoTrack) === null || _this$_cameraVideoTra3 === void 0 || _this$_cameraVideoTra3.setVideoOrientation(this._videoRotation);
917
844
  }
918
845
  }, {
919
846
  key: "setCameraEnabled",
920
847
  value: function setCameraEnabled(enable) {
921
- if (enable) {
922
- this._hasExecutedOpenCamera = true;
923
- }
924
- this.startOrStopCamera(enable);
925
- this.setShowCameraPreview(enable);
926
848
  this.cameraEnabled = enable;
927
849
  }
928
850
  }, {
929
- key: "_handleMicrophoneAudioTrack",
930
- value: function _handleMicrophoneAudioTrack() {
931
- var microphoneTrack = this._microphoneAudioTrack;
932
- if (!microphoneTrack) return;
933
- if (this.microphoneEnabled) {
934
- var _this$_microphoneAudi3;
935
- (_this$_microphoneAudi3 = this._microphoneAudioTrack) === null || _this$_microphoneAudi3 === void 0 || _this$_microphoneAudi3.start();
936
- } else {
937
- var _this$_microphoneAudi4;
938
- (_this$_microphoneAudi4 = this._microphoneAudioTrack) === null || _this$_microphoneAudi4 === void 0 || _this$_microphoneAudi4.stop();
939
- this.microphoneVolumeLevel = 0;
851
+ key: "_handleCameraEnabledChanged",
852
+ value: function _handleCameraEnabledChanged() {
853
+ if (this.cameraEnabled) {
854
+ this._hasExecutedOpenCamera = true;
940
855
  }
856
+ this._handleCameraVideoTrack();
857
+ this.setShowCameraPreview(this.cameraEnabled);
941
858
  }
942
859
  }, {
943
860
  key: "setMicrophoneEnabled",
944
861
  value: function setMicrophoneEnabled(enable) {
945
862
  this.microphoneEnabled = enable;
946
863
  }
947
- }, {
948
- key: "_handleMicrophoneEnabledChanged",
949
- value: function _handleMicrophoneEnabledChanged() {
950
- this._handleMicrophoneAudioTrack();
951
- }
952
864
  }, {
953
865
  key: "toggleLocalMirror",
954
866
  value: function toggleLocalMirror(enable) {
@@ -962,18 +874,6 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
962
874
  this.isLocalMirrorEnabled = false;
963
875
  this.setCurrentIsMirror(false);
964
876
  }
965
- }, {
966
- key: "_handleMicrophoneDetectingChanged",
967
- value: function _handleMicrophoneDetectingChanged() {
968
- if (this.microphoneDetecting) {
969
- var _this$_microphoneAudi5;
970
- (_this$_microphoneAudi5 = this._microphoneAudioTrack) === null || _this$_microphoneAudi5 === void 0 || _this$_microphoneAudi5.startTest(this._volumeIndicationInterval);
971
- } else {
972
- var _this$_microphoneAudi6;
973
- (_this$_microphoneAudi6 = this._microphoneAudioTrack) === null || _this$_microphoneAudi6 === void 0 || _this$_microphoneAudi6.stopTest();
974
- this.microphoneVolumeLevel = 0;
975
- }
976
- }
977
877
  }, {
978
878
  key: "startMicrophoneTest",
979
879
  value: function startMicrophoneTest() {
@@ -987,28 +887,33 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
987
887
  }, {
988
888
  key: "enableVirtualBackground",
989
889
  value: function enableVirtualBackground(enable, source) {
990
- if (!this.cameraId) return;
991
- this._cameraVideoTrack = this._mediaControl.getCameraTrack(this.cameraId);
890
+ if (!this._cameraVideoTrack) return;
891
+ if (!enable) {
892
+ this.virtualBackgroundName = 'None';
893
+ } else {
894
+ if (source) {
895
+ this.virtualBackgroundName = source.name;
896
+ }
897
+ }
898
+ var videoEffectEnhancer = this._cameraVideoTrack.getVideoEffectEnhancer();
992
899
  if (source) {
993
- this.virtualBackgroundName = source.name;
994
- this._cameraVideoTrack.getVideoEffectEnhancer().setVirtualBackgroundOptions({
900
+ videoEffectEnhancer.setVirtualBackgroundOptions({
995
901
  source: source === null || source === void 0 ? void 0 : source.path,
996
902
  type: source === null || source === void 0 ? void 0 : source.type
997
903
  });
998
904
  }
999
905
  if (!enable) {
1000
- this.virtualBackgroundName = 'None';
1001
906
  this._isForceEnableVirtualBackground = false;
1002
- this._cameraVideoTrack.getVideoEffectEnhancer().disableVirtualBackground();
1003
- return;
1004
- }
1005
- if (this._cameraVideoTrack.getVideoEffectEnhancer().checkSatisfyVirtualBackgroundRequirements() || this._isForceEnableVirtualBackground) {
1006
- this._cameraVideoTrack.getVideoEffectEnhancer().enableVirtualBackground();
1007
- return;
907
+ videoEffectEnhancer.disableVirtualBackground();
908
+ } else {
909
+ var isSatisfyVirtualBackgroundRequirements = videoEffectEnhancer.checkSatisfyVirtualBackgroundRequirements() || this._isForceEnableVirtualBackground;
910
+ if (isSatisfyVirtualBackgroundRequirements) {
911
+ videoEffectEnhancer.enableVirtualBackground();
912
+ } else {
913
+ this.showForceOpenEffectDialog = true;
914
+ this.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.VIRTUAL_BACKGROUND;
915
+ }
1008
916
  }
1009
- this.showForceOpenEffectDialog = true;
1010
- this.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.VIRTUAL_BACKGROUND;
1011
- return;
1012
917
  }
1013
918
  }, {
1014
919
  key: "setEditBeautyKey",
@@ -1019,220 +924,103 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1019
924
  }, {
1020
925
  key: "enableBeautyEffect",
1021
926
  value: function enableBeautyEffect(enable) {
1022
- if (!this.cameraId) return;
1023
- this._cameraVideoTrack = this._mediaControl.getCameraTrack(this.cameraId);
1024
- if (!enable) {
927
+ if (!this._cameraVideoTrack) return;
928
+ var videoEffectEnhancer = this._cameraVideoTrack.getVideoEffectEnhancer();
929
+ if (enable) {
930
+ var isSatisfyBeautyRequirements = videoEffectEnhancer.checkSatisfyBeautyRequirements() || this._isForceEnableBeauty;
931
+ 1;
932
+ if (isSatisfyBeautyRequirements) {
933
+ this.enableBeauty = true;
934
+ this.setBeautyOptions(this.beautyOptions);
935
+ videoEffectEnhancer.enableBeauty();
936
+ } else {
937
+ this.showForceOpenEffectDialog = true;
938
+ this.enableBeauty = false;
939
+ this.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.BEAUTY;
940
+ }
941
+ } else {
1025
942
  this.enableBeauty = false;
1026
943
  this.setEditBeautyKey('none');
1027
944
  this._isForceEnableBeauty = false;
1028
- this._cameraVideoTrack.getVideoEffectEnhancer().disableBeauty();
1029
- return;
945
+ videoEffectEnhancer.disableBeauty();
1030
946
  }
1031
- if (this._cameraVideoTrack.getVideoEffectEnhancer().checkSatisfyBeautyRequirements() || this._isForceEnableBeauty) {
1032
- this.enableBeauty = true;
1033
- this.setBeautyOptions(this.beautyOptions);
1034
- this._cameraVideoTrack.getVideoEffectEnhancer().enableBeauty();
1035
- return;
1036
- }
1037
- this.showForceOpenEffectDialog = true;
1038
- this.enableBeauty = false;
1039
- this.lastEnableVideoEffectType = _type2.FcrUIVideoEffectType.BEAUTY;
1040
- return;
1041
947
  }
1042
948
 
1043
949
  // 高保真
1044
950
  }, {
1045
951
  key: "enableAudioHiFiMode",
1046
952
  value: function enableAudioHiFiMode(enable) {
1047
- if (!this._microphoneDevice.id) return;
1048
- var microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
953
+ if (!this._microphoneAudioTrack) return;
1049
954
  if (enable) {
1050
- microphoneAudioTrack.getAudioEffectEnhancer().enableHiFiMode();
955
+ this._microphoneAudioTrack.getAudioEffectEnhancer().enableHiFiMode();
1051
956
  return;
957
+ } else {
958
+ this._microphoneAudioTrack.getAudioEffectEnhancer().disableHiFiMode();
1052
959
  }
1053
- microphoneAudioTrack.getAudioEffectEnhancer().disableHiFiMode();
1054
960
  }
1055
961
 
1056
962
  // 回声消除
1057
963
  }, {
1058
964
  key: "enableAudioEchoCancellation",
1059
965
  value: function enableAudioEchoCancellation(enable) {
1060
- if (!this._microphoneDevice.id) return;
1061
- var microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
966
+ if (!this._microphoneAudioTrack) return;
1062
967
  if (enable) {
1063
- microphoneAudioTrack.getAudioEffectEnhancer().enableEchoCancellation();
1064
- return;
968
+ this._microphoneAudioTrack.getAudioEffectEnhancer().enableEchoCancellation();
969
+ } else {
970
+ this._microphoneAudioTrack.getAudioEffectEnhancer().disableEchoCancellation();
1065
971
  }
1066
- microphoneAudioTrack.getAudioEffectEnhancer().disableEchoCancellation();
1067
972
  }
1068
973
 
1069
974
  // 立体声
1070
975
  }, {
1071
976
  key: "enableAudioStereo",
1072
977
  value: function enableAudioStereo(enable) {
1073
- if (!this._microphoneDevice.id) return;
1074
- var microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
978
+ if (!this._microphoneAudioTrack) return;
1075
979
  if (enable) {
1076
- microphoneAudioTrack.getAudioEffectEnhancer().enableStereoMode();
1077
- return;
980
+ this._microphoneAudioTrack.getAudioEffectEnhancer().enableStereoMode();
981
+ } else {
982
+ this._microphoneAudioTrack.getAudioEffectEnhancer().disableStereoMode();
1078
983
  }
1079
- microphoneAudioTrack.getAudioEffectEnhancer().disableStereoMode();
1080
984
  }
1081
985
 
1082
986
  // 噪音抑制等级
1083
987
  }, {
1084
988
  key: "setNoiseLevel",
1085
989
  value: function setNoiseLevel(level) {
1086
- if (!this._microphoneDevice.id) return;
1087
- var microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
990
+ if (!this._microphoneAudioTrack) return;
1088
991
  if (level === _type2.FcrUIAiDenoiseLevel.CLOSE) {
1089
- microphoneAudioTrack.getAudioEffectEnhancer().disableAiDenoiser();
992
+ this._microphoneAudioTrack.getAudioEffectEnhancer().disableAiDenoiser();
1090
993
  } else {
1091
- microphoneAudioTrack.getAudioEffectEnhancer().enableAiDenoiser();
1092
- microphoneAudioTrack.getAudioEffectEnhancer().setAiDenoiseLevel(level);
994
+ this._microphoneAudioTrack.getAudioEffectEnhancer().enableAiDenoiser();
995
+ this._microphoneAudioTrack.getAudioEffectEnhancer().setAiDenoiseLevel(level);
1093
996
  }
1094
997
  }
1095
998
  }, {
1096
999
  key: "setCameraId",
1097
1000
  value: function setCameraId(cameraId) {
1098
- if (this.cameraId === cameraId) return;
1099
- var enable = this.showCameraPreview;
1100
- var cameraTrack = this._mediaControl.getCameraTrack(this.cameraId);
1101
- // stop current camera track
1102
- cameraTrack === null || cameraTrack === void 0 || cameraTrack.stopTest();
1103
- cameraTrack === null || cameraTrack === void 0 || cameraTrack.stop();
1104
- if (cameraId) {
1105
- var _cameraTrack = this._mediaControl.getCameraTrack(cameraId);
1106
- if (enable) {
1107
- _cameraTrack.start();
1108
- }
1109
- this._cameraVideoTrack = _cameraTrack;
1110
- }
1111
- this.cameraId = cameraId;
1112
- this._observable.notifyObservers('onCameraChanged', cameraId);
1113
- }
1114
- }, {
1115
- key: "_handleMicrophoneIdChanged",
1116
- value: function () {
1117
- var _handleMicrophoneIdChanged2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6() {
1118
- return _regenerator["default"].wrap(function (_context6) {
1119
- while (1) switch (_context6.prev = _context6.next) {
1120
- case 0:
1121
- if (!this.followSystemMicrophoneDevice) {
1122
- this._microphoneDevice = {
1123
- id: this._microphone.id
1124
- };
1125
- } else {
1126
- this._correctSystemSelectedMicrophoneDeviceId();
1127
- }
1128
- this._mediaControl.observeSystemSelectedMicrophoneChanged(this.followSystemMicrophoneDevice);
1129
- case 1:
1130
- case "end":
1131
- return _context6.stop();
1132
- }
1133
- }, _callee6, this);
1134
- }));
1135
- function _handleMicrophoneIdChanged() {
1136
- return _handleMicrophoneIdChanged2.apply(this, arguments);
1137
- }
1138
- return _handleMicrophoneIdChanged;
1139
- }()
1140
- }, {
1141
- key: "_handleMicrophoneDeviceIdChanged",
1142
- value: function _handleMicrophoneDeviceIdChanged() {
1143
- if (!this._microphoneDevice.id) {
1144
- this.logger.debug('setSelectedMicrophone failed');
1145
- this._microphone.id = DEFAULT_DEVICE_ID;
1146
- } else {
1147
- var _this$_microphoneAudi7, _this$_microphoneAudi8;
1148
- (_this$_microphoneAudi7 = this._microphoneAudioTrack) === null || _this$_microphoneAudi7 === void 0 || _this$_microphoneAudi7.removeObserver(this._microphoneObserver);
1149
- (_this$_microphoneAudi8 = this._microphoneAudioTrack) === null || _this$_microphoneAudi8 === void 0 || _this$_microphoneAudi8.stop();
1150
- this._microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
1151
- this._microphoneAudioTrack.addObserver(this._microphoneObserver);
1152
- this._handleMicrophoneAudioTrack();
1153
- this._observable.notifyObservers('onMicrophoneChanged', this._microphoneDevice.id);
1154
- this.setNoiseLevel(this._sharedSettingDataSource.setting.noiseReduce);
1155
- }
1001
+ this._cameraDevice = {
1002
+ id: cameraId
1003
+ };
1156
1004
  }
1157
1005
  }, {
1158
- key: "_handleSpeakerDeviceIdChanged",
1159
- value: function _handleSpeakerDeviceIdChanged() {
1160
- if (!this._speakerDevice.id) {
1161
- this.logger.debug('setSelectedSpeaker failed');
1162
- this._speaker.id = DEFAULT_DEVICE_ID;
1163
- } else {
1164
- this._mediaControl.setSelectedSpeaker(this._speakerDevice.id);
1165
- this._observable.notifyObservers('onSpeakerChanged', this._speakerDevice.id);
1166
- }
1006
+ key: "setMainRoomAudioOff",
1007
+ value: function setMainRoomAudioOff(enable) {
1008
+ this.isMainRoomAudioOff = enable;
1167
1009
  }
1168
- }, {
1169
- key: "_handleSpeakerIdChanged",
1170
- value: function () {
1171
- var _handleSpeakerIdChanged2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7() {
1172
- return _regenerator["default"].wrap(function (_context7) {
1173
- while (1) switch (_context7.prev = _context7.next) {
1174
- case 0:
1175
- if (!this.followSystemSpeakerDevice) {
1176
- this._speakerDevice = {
1177
- id: this._speaker.id
1178
- };
1179
- } else {
1180
- this._correctSystemSpeakerDeviceId();
1181
- }
1182
- this._mediaControl.observeSystemSelectedSpeakerChanged(this.followSystemSpeakerDevice);
1183
- case 1:
1184
- case "end":
1185
- return _context7.stop();
1186
- }
1187
- }, _callee7, this);
1188
- }));
1189
- function _handleSpeakerIdChanged() {
1190
- return _handleSpeakerIdChanged2.apply(this, arguments);
1191
- }
1192
- return _handleSpeakerIdChanged;
1193
- }()
1194
1010
  }, {
1195
1011
  key: "setSpeakerId",
1196
- value: function () {
1197
- var _setSpeakerId = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(speakerId) {
1198
- return _regenerator["default"].wrap(function (_context8) {
1199
- while (1) switch (_context8.prev = _context8.next) {
1200
- case 0:
1201
- this._speaker = {
1202
- id: speakerId
1203
- };
1204
- case 1:
1205
- case "end":
1206
- return _context8.stop();
1207
- }
1208
- }, _callee8, this);
1209
- }));
1210
- function setSpeakerId(_x3) {
1211
- return _setSpeakerId.apply(this, arguments);
1212
- }
1213
- return setSpeakerId;
1214
- }()
1012
+ value: function setSpeakerId(speakerId) {
1013
+ this._speaker = {
1014
+ id: speakerId
1015
+ };
1016
+ }
1215
1017
  }, {
1216
1018
  key: "setMicrophoneId",
1217
- value: function () {
1218
- var _setMicrophoneId = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(microphoneId) {
1219
- return _regenerator["default"].wrap(function (_context9) {
1220
- while (1) switch (_context9.prev = _context9.next) {
1221
- case 0:
1222
- this._microphone = {
1223
- id: microphoneId
1224
- };
1225
- case 1:
1226
- case "end":
1227
- return _context9.stop();
1228
- }
1229
- }, _callee9, this);
1230
- }));
1231
- function setMicrophoneId(_x4) {
1232
- return _setMicrophoneId.apply(this, arguments);
1233
- }
1234
- return setMicrophoneId;
1235
- }()
1019
+ value: function setMicrophoneId(microphoneId) {
1020
+ this._microphone = {
1021
+ id: microphoneId
1022
+ };
1023
+ }
1236
1024
  }, {
1237
1025
  key: "setSpeakerVolume",
1238
1026
  value: function setSpeakerVolume(value) {
@@ -1242,25 +1030,14 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1242
1030
  }, {
1243
1031
  key: "setMicrophoneVolume",
1244
1032
  value: function setMicrophoneVolume(value) {
1245
- var _this$_microphoneAudi9;
1033
+ var _this$_microphoneAudi2;
1246
1034
  this.microphoneVolume = value;
1247
- (_this$_microphoneAudi9 = this._microphoneAudioTrack) === null || _this$_microphoneAudi9 === void 0 || _this$_microphoneAudi9.adjustVolume(value);
1035
+ (_this$_microphoneAudi2 = this._microphoneAudioTrack) === null || _this$_microphoneAudi2 === void 0 || _this$_microphoneAudi2.adjustVolume(value);
1248
1036
  }
1249
1037
  }, {
1250
1038
  key: "startOrStopCamera",
1251
1039
  value: function startOrStopCamera(enable) {
1252
- var cameraTrack = this._cameraVideoTrack;
1253
- var localVideoViewSet = this._localVideoViewSet;
1254
- if (enable) {
1255
- cameraTrack === null || cameraTrack === void 0 || cameraTrack.start();
1256
- } else {
1257
- if (localVideoViewSet.size > 0 && cameraTrack) {
1258
- localVideoViewSet.forEach(function (view) {
1259
- cameraTrack.stopPreview(view);
1260
- });
1261
- }
1262
- cameraTrack === null || cameraTrack === void 0 || cameraTrack.stop();
1263
- }
1040
+ this._handleCameraVideoTrack(enable);
1264
1041
  }
1265
1042
  }, {
1266
1043
  key: "setShowCameraPreview",
@@ -1270,14 +1047,14 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1270
1047
  }, {
1271
1048
  key: "loadUiResources",
1272
1049
  value: function () {
1273
- var _loadUiResources = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee0(uiResource) {
1274
- var _this5 = this;
1050
+ var _loadUiResources = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(uiResource) {
1051
+ var _this4 = this;
1275
1052
  var _uiResource$virtualBa, _uiResource$virtualBa2, _uiResource$soundEffe, images, videos, soundEffects, newList, imageInfoList, videoInfoList, _uiResource$virtualBa3, _uiResource$virtualBa4, _uiResource$soundEffe2, _images, _videos, _soundEffects, handleResourceReady;
1276
- return _regenerator["default"].wrap(function (_context0) {
1277
- while (1) switch (_context0.prev = _context0.next) {
1053
+ return _regenerator["default"].wrap(function (_context3) {
1054
+ while (1) switch (_context3.prev = _context3.next) {
1278
1055
  case 0:
1279
1056
  if ((0, _env.isElectron)()) {
1280
- _context0.next = 1;
1057
+ _context3.next = 1;
1281
1058
  break;
1282
1059
  }
1283
1060
  images = (uiResource === null || uiResource === void 0 || (_uiResource$virtualBa = uiResource.virtualBackgroundImages) === null || _uiResource$virtualBa === void 0 ? void 0 : _uiResource$virtualBa.filter(function (url) {
@@ -1309,7 +1086,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1309
1086
  }) || [];
1310
1087
  newList = newList.concat(videoInfoList);
1311
1088
  (0, _mobx.runInAction)(function () {
1312
- _this5._updateVirtualBackgroundList(newList);
1089
+ _this4._updateVirtualBackgroundList(newList);
1313
1090
  var soundEffectInfoList = soundEffects.map(function (url) {
1314
1091
  return {
1315
1092
  url: url,
@@ -1317,13 +1094,13 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1317
1094
  };
1318
1095
  }) || [];
1319
1096
  soundEffectInfoList.forEach(function (item) {
1320
- _this5.soundEffectList.set((0, _tools.getFileNameWithoutExtension)(item.url), item);
1097
+ _this4.soundEffectList.set((0, _tools.getFileNameWithoutExtension)(item.url), item);
1321
1098
  });
1322
1099
  });
1323
- _context0.next = 3;
1100
+ _context3.next = 3;
1324
1101
  break;
1325
1102
  case 1:
1326
- _context0.next = 2;
1103
+ _context3.next = 2;
1327
1104
  return this._loadBuiltinResources();
1328
1105
  case 2:
1329
1106
  _images = (uiResource === null || uiResource === void 0 || (_uiResource$virtualBa3 = uiResource.virtualBackgroundImages) === null || _uiResource$virtualBa3 === void 0 ? void 0 : _uiResource$virtualBa3.filter(function (url) {
@@ -1337,7 +1114,7 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1337
1114
  })) || [];
1338
1115
  handleResourceReady = function handleResourceReady(filePathList, type) {
1339
1116
  if (type === 'image' || type === 'video') {
1340
- var list = _this5.virtualBackgroundList.slice();
1117
+ var list = _this4.virtualBackgroundList.slice();
1341
1118
  var resourceType = type === 'image' ? _virtualBackdoundResources.VirtualOption.IMG : _virtualBackdoundResources.VirtualOption.VIDEO;
1342
1119
  list = filePathList.map(function (resource) {
1343
1120
  return {
@@ -1347,12 +1124,12 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1347
1124
  url: URL.createObjectURL(window.runtime.fileToBlob(resource, type))
1348
1125
  };
1349
1126
  });
1350
- var _newList = _this5.virtualBackgroundList.concat(list);
1351
- _this5._updateVirtualBackgroundList(_newList);
1127
+ var _newList = _this4.virtualBackgroundList.concat(list);
1128
+ _this4._updateVirtualBackgroundList(_newList);
1352
1129
  } else if (type === 'audio') {
1353
1130
  filePathList.forEach(function (resource) {
1354
1131
  var key = (0, _tools.getFileNameWithoutExtension)(resource);
1355
- _this5.soundEffectList.set(key, {
1132
+ _this4.soundEffectList.set(key, {
1356
1133
  md5Url: resource,
1357
1134
  url: URL.createObjectURL(window.runtime.fileToBlob(resource, type))
1358
1135
  });
@@ -1364,11 +1141,11 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1364
1141
  this.loadZipResources(_soundEffects, 'audio', handleResourceReady);
1365
1142
  case 3:
1366
1143
  case "end":
1367
- return _context0.stop();
1144
+ return _context3.stop();
1368
1145
  }
1369
- }, _callee0, this);
1146
+ }, _callee3, this);
1370
1147
  }));
1371
- function loadUiResources(_x5) {
1148
+ function loadUiResources(_x) {
1372
1149
  return _loadUiResources.apply(this, arguments);
1373
1150
  }
1374
1151
  return loadUiResources;
@@ -1376,42 +1153,42 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1376
1153
  }, {
1377
1154
  key: "loadZipResources",
1378
1155
  value: function () {
1379
- var _loadZipResources = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10(zipUrls, type, callback) {
1380
- var _this6 = this;
1156
+ var _loadZipResources = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(zipUrls, type, callback) {
1157
+ var _this5 = this;
1381
1158
  var ps;
1382
- return _regenerator["default"].wrap(function (_context10) {
1383
- while (1) switch (_context10.prev = _context10.next) {
1159
+ return _regenerator["default"].wrap(function (_context5) {
1160
+ while (1) switch (_context5.prev = _context5.next) {
1384
1161
  case 0:
1385
1162
  ps = zipUrls.map(/*#__PURE__*/function () {
1386
- var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee1(url) {
1163
+ var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(url) {
1387
1164
  var filePathList;
1388
- return _regenerator["default"].wrap(function (_context1) {
1389
- while (1) switch (_context1.prev = _context1.next) {
1165
+ return _regenerator["default"].wrap(function (_context4) {
1166
+ while (1) switch (_context4.prev = _context4.next) {
1390
1167
  case 0:
1391
- _context1.next = 1;
1392
- return _this6._fetchZipAndUnzip(url, type);
1168
+ _context4.next = 1;
1169
+ return _this5._fetchZipAndUnzip(url, type);
1393
1170
  case 1:
1394
- filePathList = _context1.sent;
1171
+ filePathList = _context4.sent;
1395
1172
  callback(filePathList, type);
1396
1173
  case 2:
1397
1174
  case "end":
1398
- return _context1.stop();
1175
+ return _context4.stop();
1399
1176
  }
1400
- }, _callee1);
1177
+ }, _callee4);
1401
1178
  }));
1402
- return function (_x9) {
1403
- return _ref4.apply(this, arguments);
1179
+ return function (_x5) {
1180
+ return _ref2.apply(this, arguments);
1404
1181
  };
1405
1182
  }());
1406
- _context10.next = 1;
1183
+ _context5.next = 1;
1407
1184
  return Promise.allSettled(ps);
1408
1185
  case 1:
1409
1186
  case "end":
1410
- return _context10.stop();
1187
+ return _context5.stop();
1411
1188
  }
1412
- }, _callee10);
1189
+ }, _callee5);
1413
1190
  }));
1414
- function loadZipResources(_x6, _x7, _x8) {
1191
+ function loadZipResources(_x2, _x3, _x4) {
1415
1192
  return _loadZipResources.apply(this, arguments);
1416
1193
  }
1417
1194
  return loadZipResources;
@@ -1425,52 +1202,302 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1425
1202
  return this._mediaControl.disableAGC();
1426
1203
  }
1427
1204
  }
1428
- }, {
1429
- key: "release",
1430
- value: function release() {
1431
- var _this7 = this,
1432
- _this$_cameraVideoTra3,
1433
- _this$_microphoneAudi0;
1434
- this._mediaControl.removeObserver(this._mediaControlObserver);
1435
- if (this._localVideoViewSet.size > 0) {
1436
- this._localVideoViewSet.forEach(function (view) {
1437
- var _this7$_cameraVideoTr;
1438
- (_this7$_cameraVideoTr = _this7._cameraVideoTrack) === null || _this7$_cameraVideoTr === void 0 || _this7$_cameraVideoTr.stopPreview(view);
1439
- });
1440
- this._localVideoViewSet.clear();
1441
- }
1442
- this.speakerDetecting = false;
1443
- this.microphoneDetecting = false;
1444
- (_this$_cameraVideoTra3 = this._cameraVideoTrack) === null || _this$_cameraVideoTra3 === void 0 || _this$_cameraVideoTra3.stop();
1445
- (_this$_microphoneAudi0 = this._microphoneAudioTrack) === null || _this$_microphoneAudi0 === void 0 || _this$_microphoneAudi0.stop();
1446
- this._cameraVideoTrack = undefined;
1447
- this._microphoneAudioTrack = null;
1448
- this._disposer.forEach(function (disposer) {
1449
- return disposer();
1450
- });
1451
- }
1452
1205
  }, {
1453
1206
  key: "setConnectType",
1454
1207
  value: function setConnectType(connectType) {
1455
1208
  this.connectType = connectType;
1456
1209
  }
1210
+ }, {
1211
+ key: "toggleLocalCameraPreview",
1212
+ value: function toggleLocalCameraPreview(enabled) {
1213
+ return this._toggleLocalCameraPreview(enabled);
1214
+ }
1215
+ }, {
1216
+ key: "getLoopbackDeviceId",
1217
+ value: function getLoopbackDeviceId() {
1218
+ if ((0, _env.isElectron)()) {
1219
+ var loopbackList = this._mediaControl.getLoopbackList();
1220
+ if (loopbackList.length > 0) {
1221
+ return loopbackList[0].deviceId;
1222
+ }
1223
+ return null;
1224
+ } else {
1225
+ return 'default';
1226
+ }
1227
+ }
1228
+ }, {
1229
+ key: "_initDeviceList",
1230
+ value: function _initDeviceList() {
1231
+ var _this6 = this;
1232
+ // this.toggleAGC(true);
1233
+ Promise.all([this._mediaControl.getCameraList().then(function (list) {
1234
+ if (_this6._released) return;
1235
+ _this6.cameraList = list;
1236
+ _this6.logger.info("[FcrDeviceStore] init camera list: ".concat((0, _imports.jsonstring)(list)));
1237
+ if (_this6.cameraList.length > 0) {
1238
+ var defaultCameraDeviceId = _this6.cameraList[0].deviceId;
1239
+ _this6.logger.info('[FcrDeviceStore] select default camera id:', defaultCameraDeviceId);
1240
+ _this6.setCameraId(defaultCameraDeviceId);
1241
+ }
1242
+ }), this._getMicrophoneList().then(/*#__PURE__*/function () {
1243
+ var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(microphoneList) {
1244
+ return _regenerator["default"].wrap(function (_context6) {
1245
+ while (1) switch (_context6.prev = _context6.next) {
1246
+ case 0:
1247
+ if (!_this6._released) {
1248
+ _context6.next = 1;
1249
+ break;
1250
+ }
1251
+ return _context6.abrupt("return");
1252
+ case 1:
1253
+ _this6.microphoneList = microphoneList;
1254
+ _this6.logger.info("[FcrDeviceStore] init microphone list: ".concat((0, _imports.jsonstring)(microphoneList)));
1255
+ if (_this6.microphoneList.length > 0) {
1256
+ // 默认跟随系统
1257
+ _this6.setMicrophoneId(DEFAULT_DEVICE_ID);
1258
+ }
1259
+ case 2:
1260
+ case "end":
1261
+ return _context6.stop();
1262
+ }
1263
+ }, _callee6);
1264
+ }));
1265
+ return function (_x6) {
1266
+ return _ref3.apply(this, arguments);
1267
+ };
1268
+ }()), this._getSpeakerList().then(/*#__PURE__*/function () {
1269
+ var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(speakerList) {
1270
+ return _regenerator["default"].wrap(function (_context7) {
1271
+ while (1) switch (_context7.prev = _context7.next) {
1272
+ case 0:
1273
+ if (!_this6._released) {
1274
+ _context7.next = 1;
1275
+ break;
1276
+ }
1277
+ return _context7.abrupt("return");
1278
+ case 1:
1279
+ _this6.speakerList = speakerList;
1280
+ _this6.logger.info("[FcrDeviceStore] init speaker list: ".concat((0, _imports.jsonstring)(speakerList)));
1281
+ if (_this6.speakerList.length > 0) {
1282
+ // 默认跟随系统
1283
+ _this6.setSpeakerId(DEFAULT_DEVICE_ID);
1284
+ }
1285
+ case 2:
1286
+ case "end":
1287
+ return _context7.stop();
1288
+ }
1289
+ }, _callee7);
1290
+ }));
1291
+ return function (_x7) {
1292
+ return _ref4.apply(this, arguments);
1293
+ };
1294
+ }())]);
1295
+ }
1296
+ }, {
1297
+ key: "_handleMicrophoneAudioTrack",
1298
+ value: function _handleMicrophoneAudioTrack() {
1299
+ if (!this._microphoneAudioTrack) {
1300
+ this.logger.warn('microphone audio track is not set');
1301
+ return;
1302
+ }
1303
+ if (this.microphoneEnabled) {
1304
+ this._microphoneAudioTrack.start();
1305
+ } else {
1306
+ this._microphoneAudioTrack.stop();
1307
+ this.microphoneVolumeLevel = 0;
1308
+ }
1309
+ }
1310
+ }, {
1311
+ key: "_handleMicrophoneEnabledChanged",
1312
+ value: function _handleMicrophoneEnabledChanged() {
1313
+ this._handleMicrophoneAudioTrack();
1314
+ }
1315
+ }, {
1316
+ key: "_handleCameraVideoTrack",
1317
+ value: function _handleCameraVideoTrack() {
1318
+ var enable = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.cameraEnabled;
1319
+ var cameraTrack = this._cameraVideoTrack;
1320
+ if (!cameraTrack) {
1321
+ this.logger.warn('camera video track is not set');
1322
+ return;
1323
+ }
1324
+ if (enable) {
1325
+ cameraTrack.start();
1326
+ } else {
1327
+ this._toggleLocalCameraPreview(enable);
1328
+ cameraTrack.stop();
1329
+ }
1330
+ }
1331
+ }, {
1332
+ key: "_handleCameraDeviceIdChanged",
1333
+ value: function _handleCameraDeviceIdChanged() {
1334
+ if (!this._cameraDevice.id) {
1335
+ this.logger.warn('camera id is not set');
1336
+ return;
1337
+ } else {
1338
+ var _this$_cameraVideoTra4, _this$_cameraVideoTra5;
1339
+ (_this$_cameraVideoTra4 = this._cameraVideoTrack) === null || _this$_cameraVideoTra4 === void 0 || _this$_cameraVideoTra4.stopTest();
1340
+ (_this$_cameraVideoTra5 = this._cameraVideoTrack) === null || _this$_cameraVideoTra5 === void 0 || _this$_cameraVideoTra5.stop();
1341
+ this._cameraVideoTrack = this._mediaControl.getCameraTrack(this._cameraDevice.id);
1342
+ this._handleCameraVideoTrack();
1343
+ if (this.showCameraPreview) {
1344
+ this.logger.debug("start camera video track showCameraPreview:".concat(this.showCameraPreview, ",cameraEnabled:").concat(this.cameraEnabled));
1345
+ this._cameraVideoTrack.start();
1346
+ }
1347
+ this._observable.notifyObservers('onCameraChanged', this._cameraDevice.id);
1348
+ }
1349
+ this._toggleLocalCameraPreview(this.showCameraPreview);
1350
+ }
1351
+ }, {
1352
+ key: "_handleSpeakerDetectingChanged",
1353
+ value: function _handleSpeakerDetectingChanged() {
1354
+ var _this7 = this;
1355
+ if (this.microphoneEnabled) {
1356
+ if (this.speakerDetecting) {
1357
+ var _this$_microphoneAudi3;
1358
+ (_this$_microphoneAudi3 = this._microphoneAudioTrack) === null || _this$_microphoneAudi3 === void 0 || _this$_microphoneAudi3.stop();
1359
+ } else {
1360
+ var _this$_microphoneAudi4;
1361
+ (_this$_microphoneAudi4 = this._microphoneAudioTrack) === null || _this$_microphoneAudi4 === void 0 || _this$_microphoneAudi4.start();
1362
+ }
1363
+ }
1364
+ if (this.speakerDetecting) {
1365
+ var startSelectedSpeakerTest = function startSelectedSpeakerTest() {
1366
+ var _this7$soundEffectLis, _this7$soundEffectLis2;
1367
+ var soundUrl = (0, _env.isElectron)() ? (_this7$soundEffectLis = _this7.soundEffectList.get('speaker_test')) === null || _this7$soundEffectLis === void 0 ? void 0 : _this7$soundEffectLis.md5Url : (_this7$soundEffectLis2 = _this7.soundEffectList.get('speaker_test')) === null || _this7$soundEffectLis2 === void 0 ? void 0 : _this7$soundEffectLis2.url;
1368
+ _this7._mediaControl.startSelectedSpeakerTest(soundUrl || '', _this7._volumeIndicationInterval);
1369
+ };
1370
+ startSelectedSpeakerTest();
1371
+ var sleep = 3000;
1372
+ this._playAudioTimer && clearInterval(this._playAudioTimer);
1373
+ this._playAudioTimer = setInterval(function () {
1374
+ startSelectedSpeakerTest();
1375
+ }, sleep);
1376
+ } else {
1377
+ this._stopSelectedSpeakerTest();
1378
+ }
1379
+ }
1380
+ }, {
1381
+ key: "_stopSelectedSpeakerTest",
1382
+ value: function _stopSelectedSpeakerTest() {
1383
+ this._playAudioTimer && clearInterval(this._playAudioTimer);
1384
+ this._mediaControl.stopSelectedSpeakerTest();
1385
+ this.speakerVolumeLevel = 0;
1386
+ }
1387
+ }, {
1388
+ key: "_handleMicrophoneDetectingChanged",
1389
+ value: function _handleMicrophoneDetectingChanged() {
1390
+ if (this.microphoneDetecting) {
1391
+ var _this$_microphoneAudi5;
1392
+ (_this$_microphoneAudi5 = this._microphoneAudioTrack) === null || _this$_microphoneAudi5 === void 0 || _this$_microphoneAudi5.startTest(this._volumeIndicationInterval);
1393
+ } else {
1394
+ this._stopMicrophoneTest();
1395
+ }
1396
+ }
1397
+ }, {
1398
+ key: "_stopMicrophoneTest",
1399
+ value: function _stopMicrophoneTest() {
1400
+ var _this$_microphoneAudi6;
1401
+ (_this$_microphoneAudi6 = this._microphoneAudioTrack) === null || _this$_microphoneAudi6 === void 0 || _this$_microphoneAudi6.stopTest();
1402
+ this.microphoneVolumeLevel = 0;
1403
+ }
1404
+ }, {
1405
+ key: "_handleMicrophoneIdChanged",
1406
+ value: function () {
1407
+ var _handleMicrophoneIdChanged2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8() {
1408
+ return _regenerator["default"].wrap(function (_context8) {
1409
+ while (1) switch (_context8.prev = _context8.next) {
1410
+ case 0:
1411
+ if (!this.followSystemMicrophoneDevice) {
1412
+ this._microphoneDevice = {
1413
+ id: this._microphone.id
1414
+ };
1415
+ } else {
1416
+ this._correctSystemSelectedMicrophoneDeviceId();
1417
+ }
1418
+ this._mediaControl.observeSystemSelectedMicrophoneChanged(this.followSystemMicrophoneDevice);
1419
+ case 1:
1420
+ case "end":
1421
+ return _context8.stop();
1422
+ }
1423
+ }, _callee8, this);
1424
+ }));
1425
+ function _handleMicrophoneIdChanged() {
1426
+ return _handleMicrophoneIdChanged2.apply(this, arguments);
1427
+ }
1428
+ return _handleMicrophoneIdChanged;
1429
+ }()
1430
+ }, {
1431
+ key: "_handleMicrophoneDeviceIdChanged",
1432
+ value: function _handleMicrophoneDeviceIdChanged() {
1433
+ if (!this._microphoneDevice.id) {
1434
+ this.logger.debug('setSelectedMicrophone failed');
1435
+ this._microphone.id = DEFAULT_DEVICE_ID;
1436
+ } else {
1437
+ var _this$_microphoneAudi7, _this$_microphoneAudi8;
1438
+ (_this$_microphoneAudi7 = this._microphoneAudioTrack) === null || _this$_microphoneAudi7 === void 0 || _this$_microphoneAudi7.removeObserver(this._microphoneObserver);
1439
+ (_this$_microphoneAudi8 = this._microphoneAudioTrack) === null || _this$_microphoneAudi8 === void 0 || _this$_microphoneAudi8.stop();
1440
+ this._microphoneAudioTrack = this._mediaControl.getMicrophoneTrack(this._microphoneDevice.id);
1441
+ this._microphoneAudioTrack.addObserver(this._microphoneObserver);
1442
+ this._handleMicrophoneAudioTrack();
1443
+ this._observable.notifyObservers('onMicrophoneChanged', this._microphoneDevice.id);
1444
+ this.setNoiseLevel(this._sharedSettingDataSource.setting.noiseReduce);
1445
+ }
1446
+ }
1447
+ }, {
1448
+ key: "_handleSpeakerDeviceIdChanged",
1449
+ value: function _handleSpeakerDeviceIdChanged() {
1450
+ if (!this._speakerDevice.id) {
1451
+ this.logger.debug('setSelectedSpeaker failed');
1452
+ this._speaker.id = DEFAULT_DEVICE_ID;
1453
+ } else {
1454
+ this._mediaControl.setSelectedSpeaker(this._speakerDevice.id);
1455
+ this._observable.notifyObservers('onSpeakerChanged', this._speakerDevice.id);
1456
+ }
1457
+ }
1458
+ }, {
1459
+ key: "_handleSpeakerIdChanged",
1460
+ value: function () {
1461
+ var _handleSpeakerIdChanged2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9() {
1462
+ return _regenerator["default"].wrap(function (_context9) {
1463
+ while (1) switch (_context9.prev = _context9.next) {
1464
+ case 0:
1465
+ if (!this.followSystemSpeakerDevice) {
1466
+ this._speakerDevice = {
1467
+ id: this._speaker.id
1468
+ };
1469
+ } else {
1470
+ this._correctSystemSpeakerDeviceId();
1471
+ }
1472
+ this._mediaControl.observeSystemSelectedSpeakerChanged(this.followSystemSpeakerDevice);
1473
+ case 1:
1474
+ case "end":
1475
+ return _context9.stop();
1476
+ }
1477
+ }, _callee9, this);
1478
+ }));
1479
+ function _handleSpeakerIdChanged() {
1480
+ return _handleSpeakerIdChanged2.apply(this, arguments);
1481
+ }
1482
+ return _handleSpeakerIdChanged;
1483
+ }()
1457
1484
  }, {
1458
1485
  key: "_fetchZipAndUnzip",
1459
1486
  value: function () {
1460
- var _fetchZipAndUnzip2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11(url, type) {
1487
+ var _fetchZipAndUnzip2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee0(url, type) {
1461
1488
  var md5Url;
1462
- return _regenerator["default"].wrap(function (_context11) {
1463
- while (1) switch (_context11.prev = _context11.next) {
1489
+ return _regenerator["default"].wrap(function (_context0) {
1490
+ while (1) switch (_context0.prev = _context0.next) {
1464
1491
  case 0:
1465
1492
  md5Url = (0, _imports.md5)(url);
1466
- return _context11.abrupt("return", window.runtime.getResourceByFileType(url, md5Url, type));
1493
+ return _context0.abrupt("return", window.runtime.getResourceByFileType(url, md5Url, type));
1467
1494
  case 1:
1468
1495
  case "end":
1469
- return _context11.stop();
1496
+ return _context0.stop();
1470
1497
  }
1471
- }, _callee11);
1498
+ }, _callee0);
1472
1499
  }));
1473
- function _fetchZipAndUnzip(_x0, _x1) {
1500
+ function _fetchZipAndUnzip(_x8, _x9) {
1474
1501
  return _fetchZipAndUnzip2.apply(this, arguments);
1475
1502
  }
1476
1503
  return _fetchZipAndUnzip;
@@ -1497,24 +1524,24 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1497
1524
  }, {
1498
1525
  key: "_correctSystemSpeakerDeviceId",
1499
1526
  value: function () {
1500
- var _correctSystemSpeakerDeviceId2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12() {
1527
+ var _correctSystemSpeakerDeviceId2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee1() {
1501
1528
  var defaultDevice;
1502
- return _regenerator["default"].wrap(function (_context12) {
1503
- while (1) switch (_context12.prev = _context12.next) {
1529
+ return _regenerator["default"].wrap(function (_context1) {
1530
+ while (1) switch (_context1.prev = _context1.next) {
1504
1531
  case 0:
1505
- _context12.next = 1;
1532
+ _context1.next = 1;
1506
1533
  return this._mediaControl.getSystemSelectedSpeaker();
1507
1534
  case 1:
1508
- defaultDevice = _context12.sent;
1535
+ defaultDevice = _context1.sent;
1509
1536
  this.logger.debug("system selected speaker changed : ".concat(defaultDevice === null || defaultDevice === void 0 ? void 0 : defaultDevice.deviceName));
1510
1537
  this._speakerDevice = {
1511
1538
  id: (defaultDevice === null || defaultDevice === void 0 ? void 0 : defaultDevice.deviceId) || null
1512
1539
  };
1513
1540
  case 2:
1514
1541
  case "end":
1515
- return _context12.stop();
1542
+ return _context1.stop();
1516
1543
  }
1517
- }, _callee12, this);
1544
+ }, _callee1, this);
1518
1545
  }));
1519
1546
  function _correctSystemSpeakerDeviceId() {
1520
1547
  return _correctSystemSpeakerDeviceId2.apply(this, arguments);
@@ -1529,24 +1556,24 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1529
1556
  }, {
1530
1557
  key: "_correctSystemSelectedMicrophoneDeviceId",
1531
1558
  value: function () {
1532
- var _correctSystemSelectedMicrophoneDeviceId2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee13() {
1559
+ var _correctSystemSelectedMicrophoneDeviceId2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10() {
1533
1560
  var defaultDevice;
1534
- return _regenerator["default"].wrap(function (_context13) {
1535
- while (1) switch (_context13.prev = _context13.next) {
1561
+ return _regenerator["default"].wrap(function (_context10) {
1562
+ while (1) switch (_context10.prev = _context10.next) {
1536
1563
  case 0:
1537
- _context13.next = 1;
1564
+ _context10.next = 1;
1538
1565
  return this._mediaControl.getSystemSelectedMicrophone();
1539
1566
  case 1:
1540
- defaultDevice = _context13.sent;
1567
+ defaultDevice = _context10.sent;
1541
1568
  this.logger.debug("system selected microphone changed : ".concat(defaultDevice === null || defaultDevice === void 0 ? void 0 : defaultDevice.deviceName));
1542
1569
  this._microphoneDevice = {
1543
1570
  id: (defaultDevice === null || defaultDevice === void 0 ? void 0 : defaultDevice.deviceId) || null
1544
1571
  };
1545
1572
  case 2:
1546
1573
  case "end":
1547
- return _context13.stop();
1574
+ return _context10.stop();
1548
1575
  }
1549
- }, _callee13, this);
1576
+ }, _callee10, this);
1550
1577
  }));
1551
1578
  function _correctSystemSelectedMicrophoneDeviceId() {
1552
1579
  return _correctSystemSelectedMicrophoneDeviceId2.apply(this, arguments);
@@ -1554,40 +1581,38 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1554
1581
  return _correctSystemSelectedMicrophoneDeviceId;
1555
1582
  }()
1556
1583
  }, {
1557
- key: "_handleSpeakerTestVolumeIndicationUpdated",
1558
- value: function _handleSpeakerTestVolumeIndicationUpdated(volume) {
1559
- this.speakerVolumeLevel = Math.floor(volume / 255 * 100);
1584
+ key: "_handleSelectedSpeakerVolumeUpdated",
1585
+ value: function _handleSelectedSpeakerVolumeUpdated(volume) {
1586
+ this.speakerVolume = volume;
1560
1587
  }
1561
1588
  }, {
1562
- key: "_handleSpeakerVolumeUpdated",
1563
- value: function _handleSpeakerVolumeUpdated(volume) {
1564
- this.speakerVolume = volume;
1589
+ key: "_handleSpeakerTestVolumeIndicationUpdated",
1590
+ value: function _handleSpeakerTestVolumeIndicationUpdated(volume) {
1591
+ this.speakerVolumeLevel = getDeviceVolumeLevel(volume);
1565
1592
  }
1566
1593
  }, {
1567
1594
  key: "_handleMicrophoneVolumeIndicationUpdated",
1568
1595
  value: function _handleMicrophoneVolumeIndicationUpdated(_, volume) {
1569
- this.microphoneVolumeLevel = Math.floor(volume / 255 * 100);
1596
+ this.microphoneVolumeLevel = getDeviceVolumeLevel(volume);
1570
1597
  }
1571
1598
  }, {
1572
- key: "_handleCameraChanged",
1573
- value: function _handleCameraChanged() {
1574
- var enabled = this.showCameraPreview;
1575
- this.toggleLocalCameraPreview(enabled);
1576
- }
1577
- }, {
1578
- key: "toggleLocalCameraPreview",
1579
- value: function toggleLocalCameraPreview(enabled) {
1599
+ key: "_toggleLocalCameraPreview",
1600
+ value: function _toggleLocalCameraPreview(enabled) {
1580
1601
  var _this8 = this;
1581
1602
  var localVideoViewSet = this._localVideoViewSet;
1582
1603
  var cameraTrack = this._cameraVideoTrack;
1583
- if (!enabled && localVideoViewSet.size > 0 && cameraTrack) {
1604
+ if (!cameraTrack) {
1605
+ this.logger.warn('camera video track is not set');
1606
+ return;
1607
+ }
1608
+ if (!enabled) {
1584
1609
  localVideoViewSet.forEach(function (view) {
1585
1610
  cameraTrack.stopPreview(view);
1586
1611
  });
1587
1612
  }
1588
1613
  if (enabled) {
1589
1614
  localVideoViewSet.forEach(function (view) {
1590
- cameraTrack === null || cameraTrack === void 0 || cameraTrack.startPreview({
1615
+ cameraTrack.startPreview({
1591
1616
  renderMode: _fcrCore.FcrVideoRenderMode.HIDDEN,
1592
1617
  isMirror: _this8.currentIsMirror
1593
1618
  }, view);
@@ -1595,153 +1620,124 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1595
1620
  }
1596
1621
  }
1597
1622
  }, {
1598
- key: "_handleCameraListUpdated",
1623
+ key: "_handleCameraAdded",
1624
+ value: function _handleCameraAdded() {
1625
+ this._handleCameraListUpdated();
1626
+ }
1627
+ }, {
1628
+ key: "_handleCameraRemoved",
1599
1629
  value: function () {
1600
- var _handleCameraListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee14() {
1630
+ var _handleCameraRemoved2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee11() {
1601
1631
  var _this9 = this;
1602
- var cameraList, currentDeviceExist, _cameraEnabled, deviceId, _deviceId;
1603
- return _regenerator["default"].wrap(function (_context14) {
1604
- while (1) switch (_context14.prev = _context14.next) {
1632
+ var currentDeviceExist, defaultDeviceId;
1633
+ return _regenerator["default"].wrap(function (_context11) {
1634
+ while (1) switch (_context11.prev = _context11.next) {
1605
1635
  case 0:
1606
- _context14.next = 1;
1607
- return this._mediaControl.getCameraList();
1636
+ _context11.next = 1;
1637
+ return this._handleCameraListUpdated();
1608
1638
  case 1:
1609
- cameraList = _context14.sent;
1610
- (0, _mobx.runInAction)(function () {
1611
- _this9.cameraList = cameraList;
1639
+ currentDeviceExist = this.cameraList.some(function (_ref5) {
1640
+ var deviceId = _ref5.deviceId;
1641
+ return _this9._cameraDevice.id === deviceId;
1612
1642
  });
1613
- currentDeviceExist = false;
1614
- if (this.cameraId) {
1615
- currentDeviceExist = this.cameraList.some(function (_ref5) {
1616
- var deviceId = _ref5.deviceId;
1617
- return _this9.cameraId === deviceId;
1618
- });
1619
- _cameraEnabled = this.cameraEnabled;
1620
- if (!currentDeviceExist) {
1621
- this.logger.info('[FcrDeviceStore] current camera is unplugged, close camera');
1622
- if (this.cameraList.length > 0) {
1623
- deviceId = this.cameraList[0].deviceId;
1624
- this.setCameraId(deviceId);
1625
- } else {
1626
- this.setCameraId('');
1627
- }
1628
- if (_cameraEnabled) {
1629
- this.setCameraEnabled(false);
1630
- }
1631
- }
1632
- }
1633
-
1634
- // select the first camera in the list as default
1635
1643
  if (!currentDeviceExist) {
1636
- if (this.cameraList.length > 0) {
1637
- _deviceId = this.cameraList[0].deviceId;
1638
- this.setCameraId(_deviceId);
1644
+ this.logger.info('[FcrDeviceStore] current speaker does not exist in speaker list, switch to follow system');
1645
+ defaultDeviceId = this.cameraList.length > 0 ? this.cameraList[0].deviceId : '';
1646
+ this.setCameraId(defaultDeviceId);
1647
+ if (this.cameraEnabled) {
1648
+ this.setCameraEnabled(false);
1639
1649
  }
1640
1650
  }
1641
- this._observable.notifyObservers('onCameraListUpdated', this.cameraList);
1642
1651
  case 2:
1643
1652
  case "end":
1644
- return _context14.stop();
1645
- }
1646
- }, _callee14, this);
1647
- }));
1648
- function _handleCameraListUpdated() {
1649
- return _handleCameraListUpdated2.apply(this, arguments);
1650
- }
1651
- return _handleCameraListUpdated;
1652
- }()
1653
- }, {
1654
- key: "_handleMicrophoneAdded",
1655
- value: function () {
1656
- var _handleMicrophoneAdded2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee15() {
1657
- return _regenerator["default"].wrap(function (_context15) {
1658
- while (1) switch (_context15.prev = _context15.next) {
1659
- case 0:
1660
- _context15.next = 1;
1661
- return this._handleMicrophoneListUpdated();
1662
- case 1:
1663
- case "end":
1664
- return _context15.stop();
1653
+ return _context11.stop();
1665
1654
  }
1666
- }, _callee15, this);
1655
+ }, _callee11, this);
1667
1656
  }));
1668
- function _handleMicrophoneAdded() {
1669
- return _handleMicrophoneAdded2.apply(this, arguments);
1657
+ function _handleCameraRemoved() {
1658
+ return _handleCameraRemoved2.apply(this, arguments);
1670
1659
  }
1671
- return _handleMicrophoneAdded;
1660
+ return _handleCameraRemoved;
1672
1661
  }()
1673
1662
  }, {
1674
- key: "_handleMicrophoneRemoved",
1663
+ key: "_handleCameraListUpdated",
1675
1664
  value: function () {
1676
- var _handleMicrophoneRemoved2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee16() {
1677
- return _regenerator["default"].wrap(function (_context16) {
1678
- while (1) switch (_context16.prev = _context16.next) {
1665
+ var _handleCameraListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee12() {
1666
+ var cameraList;
1667
+ return _regenerator["default"].wrap(function (_context12) {
1668
+ while (1) switch (_context12.prev = _context12.next) {
1679
1669
  case 0:
1680
- _context16.next = 1;
1681
- return this._handleMicrophoneListUpdated();
1670
+ _context12.next = 1;
1671
+ return this._mediaControl.getCameraList();
1682
1672
  case 1:
1683
- _context16.next = 2;
1684
- return this._correctMicrophoneDeviceId();
1673
+ cameraList = _context12.sent;
1674
+ this.cameraList = cameraList;
1675
+ this._observable.notifyObservers('onCameraListUpdated', this.cameraList);
1685
1676
  case 2:
1686
1677
  case "end":
1687
- return _context16.stop();
1678
+ return _context12.stop();
1688
1679
  }
1689
- }, _callee16, this);
1680
+ }, _callee12, this);
1690
1681
  }));
1691
- function _handleMicrophoneRemoved() {
1692
- return _handleMicrophoneRemoved2.apply(this, arguments);
1682
+ function _handleCameraListUpdated() {
1683
+ return _handleCameraListUpdated2.apply(this, arguments);
1693
1684
  }
1694
- return _handleMicrophoneRemoved;
1685
+ return _handleCameraListUpdated;
1695
1686
  }()
1696
1687
  }, {
1697
- key: "_correctMicrophoneDeviceId",
1688
+ key: "_handleMicrophoneAdded",
1689
+ value: function _handleMicrophoneAdded() {
1690
+ this._handleMicrophoneListUpdated();
1691
+ }
1692
+ }, {
1693
+ key: "_handleMicrophoneRemoved",
1698
1694
  value: function () {
1699
- var _correctMicrophoneDeviceId2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee17() {
1695
+ var _handleMicrophoneRemoved2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee13() {
1700
1696
  var _this0 = this;
1701
1697
  var currentDeviceExist;
1702
- return _regenerator["default"].wrap(function (_context17) {
1703
- while (1) switch (_context17.prev = _context17.next) {
1698
+ return _regenerator["default"].wrap(function (_context13) {
1699
+ while (1) switch (_context13.prev = _context13.next) {
1704
1700
  case 0:
1701
+ _context13.next = 1;
1702
+ return this._handleMicrophoneListUpdated();
1703
+ case 1:
1705
1704
  currentDeviceExist = this.microphoneList.find(function (item) {
1706
1705
  return item.deviceId === _this0._microphoneDevice.id;
1707
1706
  });
1708
- if (currentDeviceExist) {
1709
- _context17.next = 1;
1710
- break;
1707
+ if (!currentDeviceExist) {
1708
+ this.logger.info('[FcrDeviceStore] current microphone does not exist in microphone list, switch to follow system');
1709
+ this.setMicrophoneId(DEFAULT_DEVICE_ID);
1711
1710
  }
1712
- this.logger.info('[FcrDeviceStore] current microphone does not exist in microphone list, switch to follow system');
1713
- _context17.next = 1;
1714
- return this.setMicrophoneId(DEFAULT_DEVICE_ID);
1715
- case 1:
1711
+ case 2:
1716
1712
  case "end":
1717
- return _context17.stop();
1713
+ return _context13.stop();
1718
1714
  }
1719
- }, _callee17, this);
1715
+ }, _callee13, this);
1720
1716
  }));
1721
- function _correctMicrophoneDeviceId() {
1722
- return _correctMicrophoneDeviceId2.apply(this, arguments);
1717
+ function _handleMicrophoneRemoved() {
1718
+ return _handleMicrophoneRemoved2.apply(this, arguments);
1723
1719
  }
1724
- return _correctMicrophoneDeviceId;
1720
+ return _handleMicrophoneRemoved;
1725
1721
  }()
1726
1722
  }, {
1727
1723
  key: "_handleMicrophoneListUpdated",
1728
1724
  value: function () {
1729
- var _handleMicrophoneListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee18() {
1725
+ var _handleMicrophoneListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee14() {
1730
1726
  var microphoneList;
1731
- return _regenerator["default"].wrap(function (_context18) {
1732
- while (1) switch (_context18.prev = _context18.next) {
1727
+ return _regenerator["default"].wrap(function (_context14) {
1728
+ while (1) switch (_context14.prev = _context14.next) {
1733
1729
  case 0:
1734
- _context18.next = 1;
1730
+ _context14.next = 1;
1735
1731
  return this._getMicrophoneList();
1736
1732
  case 1:
1737
- microphoneList = _context18.sent;
1733
+ microphoneList = _context14.sent;
1738
1734
  this.microphoneList = microphoneList;
1739
1735
  this._observable.notifyObservers('onMicrophoneListUpdated', this.microphoneList);
1740
1736
  case 2:
1741
1737
  case "end":
1742
- return _context18.stop();
1738
+ return _context14.stop();
1743
1739
  }
1744
- }, _callee18, this);
1740
+ }, _callee14, this);
1745
1741
  }));
1746
1742
  function _handleMicrophoneListUpdated() {
1747
1743
  return _handleMicrophoneListUpdated2.apply(this, arguments);
@@ -1750,56 +1746,34 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1750
1746
  }()
1751
1747
  }, {
1752
1748
  key: "_handleSpeakerAdded",
1753
- value: function () {
1754
- var _handleSpeakerAdded2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee19() {
1755
- return _regenerator["default"].wrap(function (_context19) {
1756
- while (1) switch (_context19.prev = _context19.next) {
1757
- case 0:
1758
- _context19.next = 1;
1759
- return this._handleSpeakerListUpdated();
1760
- case 1:
1761
- this._observable.notifyObservers('onSpeakerListUpdated', this.speakerList);
1762
- case 2:
1763
- case "end":
1764
- return _context19.stop();
1765
- }
1766
- }, _callee19, this);
1767
- }));
1768
- function _handleSpeakerAdded() {
1769
- return _handleSpeakerAdded2.apply(this, arguments);
1770
- }
1771
- return _handleSpeakerAdded;
1772
- }()
1749
+ value: function _handleSpeakerAdded() {
1750
+ this._handleSpeakerListUpdated();
1751
+ }
1773
1752
  }, {
1774
1753
  key: "_handleSpeakerRemoved",
1775
1754
  value: function () {
1776
- var _handleSpeakerRemoved2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee20() {
1755
+ var _handleSpeakerRemoved2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee15() {
1777
1756
  var _this1 = this;
1778
1757
  var currentDeviceExist;
1779
- return _regenerator["default"].wrap(function (_context20) {
1780
- while (1) switch (_context20.prev = _context20.next) {
1758
+ return _regenerator["default"].wrap(function (_context15) {
1759
+ while (1) switch (_context15.prev = _context15.next) {
1781
1760
  case 0:
1782
- _context20.next = 1;
1761
+ _context15.next = 1;
1783
1762
  return this._handleSpeakerListUpdated();
1784
1763
  case 1:
1785
1764
  // 如何设备移除了,应该切到跟随系统
1786
1765
  currentDeviceExist = this.speakerList.find(function (item) {
1787
1766
  return item.deviceId === _this1._speakerDevice.id;
1788
1767
  });
1789
- if (currentDeviceExist) {
1790
- _context20.next = 2;
1791
- break;
1768
+ if (!currentDeviceExist) {
1769
+ this.logger.info('[FcrDeviceStore] current speaker does not exist in speaker list, switch to follow system');
1770
+ this.setSpeakerId(DEFAULT_DEVICE_ID);
1792
1771
  }
1793
- this.logger.info('[FcrDeviceStore] current speaker does not exist in speaker list, switch to follow system');
1794
- _context20.next = 2;
1795
- return this.setSpeakerId(DEFAULT_DEVICE_ID);
1796
1772
  case 2:
1797
- this._observable.notifyObservers('onSpeakerListUpdated', this.speakerList);
1798
- case 3:
1799
1773
  case "end":
1800
- return _context20.stop();
1774
+ return _context15.stop();
1801
1775
  }
1802
- }, _callee20, this);
1776
+ }, _callee15, this);
1803
1777
  }));
1804
1778
  function _handleSpeakerRemoved() {
1805
1779
  return _handleSpeakerRemoved2.apply(this, arguments);
@@ -1809,24 +1783,22 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1809
1783
  }, {
1810
1784
  key: "_handleSpeakerListUpdated",
1811
1785
  value: function () {
1812
- var _handleSpeakerListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee21() {
1813
- var _this10 = this;
1786
+ var _handleSpeakerListUpdated2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee16() {
1814
1787
  var speakerList;
1815
- return _regenerator["default"].wrap(function (_context21) {
1816
- while (1) switch (_context21.prev = _context21.next) {
1788
+ return _regenerator["default"].wrap(function (_context16) {
1789
+ while (1) switch (_context16.prev = _context16.next) {
1817
1790
  case 0:
1818
- _context21.next = 1;
1791
+ _context16.next = 1;
1819
1792
  return this._getSpeakerList();
1820
1793
  case 1:
1821
- speakerList = _context21.sent;
1822
- (0, _mobx.runInAction)(function () {
1823
- _this10.speakerList = speakerList;
1824
- });
1794
+ speakerList = _context16.sent;
1795
+ this.speakerList = speakerList;
1796
+ this._observable.notifyObservers('onSpeakerListUpdated', this.speakerList);
1825
1797
  case 2:
1826
1798
  case "end":
1827
- return _context21.stop();
1799
+ return _context16.stop();
1828
1800
  }
1829
- }, _callee21, this);
1801
+ }, _callee16, this);
1830
1802
  }));
1831
1803
  function _handleSpeakerListUpdated() {
1832
1804
  return _handleSpeakerListUpdated2.apply(this, arguments);
@@ -1836,60 +1808,26 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1836
1808
  }, {
1837
1809
  key: "_getMicrophoneList",
1838
1810
  value: function () {
1839
- var _getMicrophoneList2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee22() {
1840
- var defaultDevice, list, defaultIdDevice;
1841
- return _regenerator["default"].wrap(function (_context22) {
1842
- while (1) switch (_context22.prev = _context22.next) {
1811
+ var _getMicrophoneList2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee17() {
1812
+ var systemSelectedMicrophone, deviceList, formatDeviceList;
1813
+ return _regenerator["default"].wrap(function (_context17) {
1814
+ while (1) switch (_context17.prev = _context17.next) {
1843
1815
  case 0:
1844
- _context22.next = 1;
1816
+ _context17.next = 1;
1845
1817
  return this._mediaControl.getSystemSelectedMicrophone();
1846
1818
  case 1:
1847
- defaultDevice = _context22.sent;
1848
- _context22.next = 2;
1819
+ systemSelectedMicrophone = _context17.sent;
1820
+ _context17.next = 2;
1849
1821
  return this._mediaControl.getMicrophoneList();
1850
1822
  case 2:
1851
- list = _context22.sent;
1852
- list.forEach(function (item) {
1853
- var results = /^default \((.*)\)$/.exec(item.deviceName);
1854
- if (results && results.length > 1) {
1855
- item.deviceName = results[1];
1856
- }
1857
- });
1858
-
1859
- // 过滤掉虚拟声卡
1860
- list = list.filter(function (item) {
1861
- return !(0, _tools.matchVirtualSoundCardPattern)(item.deviceName);
1862
- });
1863
- // 加入默认设备
1864
- defaultIdDevice = list.find(function (item) {
1865
- return item.deviceId === DEFAULT_DEVICE_ID;
1866
- }); // 设备列表中没有默认设备,但是系统默认设备存在
1867
- if (!defaultIdDevice && defaultDevice !== null && defaultDevice !== void 0 && defaultDevice.deviceName) {
1868
- list.unshift({
1869
- deviceId: DEFAULT_DEVICE_ID,
1870
- deviceName: (0, _i18n.transI18n)('fmt_device_label_speaker_follow_system', {
1871
- reason1: (0, _i18n.transI18n)('fmt_device_label_speaker_default')
1872
- })
1873
- });
1874
- }
1875
-
1876
- // 设备列表中有默认设备
1877
- if (defaultIdDevice && defaultIdDevice.deviceName) {
1878
- defaultIdDevice.deviceName = (0, _i18n.transI18n)('fmt_device_label_speaker_follow_system', {
1879
- reason1: (0, _i18n.transI18n)('fmt_device_label_speaker_default')
1880
- });
1881
- }
1882
- list.sort(function (a, b) {
1883
- if (a.deviceId === DEFAULT_DEVICE_ID) return -1;
1884
- if (b.deviceId === DEFAULT_DEVICE_ID) return 1;
1885
- return 0;
1886
- });
1887
- return _context22.abrupt("return", list);
1823
+ deviceList = _context17.sent;
1824
+ formatDeviceList = this._formatDeviceList(deviceList, systemSelectedMicrophone);
1825
+ return _context17.abrupt("return", formatDeviceList);
1888
1826
  case 3:
1889
1827
  case "end":
1890
- return _context22.stop();
1828
+ return _context17.stop();
1891
1829
  }
1892
- }, _callee22, this);
1830
+ }, _callee17, this);
1893
1831
  }));
1894
1832
  function _getMicrophoneList() {
1895
1833
  return _getMicrophoneList2.apply(this, arguments);
@@ -1899,54 +1837,26 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1899
1837
  }, {
1900
1838
  key: "_getSpeakerList",
1901
1839
  value: function () {
1902
- var _getSpeakerList2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee23() {
1903
- var defaultDevice, list, defaultIdDevice;
1904
- return _regenerator["default"].wrap(function (_context23) {
1905
- while (1) switch (_context23.prev = _context23.next) {
1840
+ var _getSpeakerList2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee18() {
1841
+ var systemSelectedSpeaker, deviceList, formatDeviceList;
1842
+ return _regenerator["default"].wrap(function (_context18) {
1843
+ while (1) switch (_context18.prev = _context18.next) {
1906
1844
  case 0:
1907
- _context23.next = 1;
1845
+ _context18.next = 1;
1908
1846
  return this._mediaControl.getSystemSelectedSpeaker();
1909
1847
  case 1:
1910
- defaultDevice = _context23.sent;
1911
- _context23.next = 2;
1848
+ systemSelectedSpeaker = _context18.sent;
1849
+ _context18.next = 2;
1912
1850
  return this._mediaControl.getSpeakerList();
1913
1851
  case 2:
1914
- list = _context23.sent;
1915
- list.forEach(function (item) {
1916
- var results = /^default \((.*)\)$/.exec(item.deviceName);
1917
- if (results && results.length > 1) {
1918
- item.deviceName = results[1];
1919
- }
1920
- });
1921
-
1922
- // 过滤掉虚拟声卡
1923
- list = list.filter(function (item) {
1924
- return !(0, _tools.matchVirtualSoundCardPattern)(item.deviceName);
1925
- });
1926
- defaultIdDevice = list.find(function (item) {
1927
- return item.deviceId === DEFAULT_DEVICE_ID;
1928
- }); // 设备列表中没有默认设备,但是系统默认设备存在
1929
- if (!defaultIdDevice && defaultDevice !== null && defaultDevice !== void 0 && defaultDevice.deviceName) {
1930
- list.unshift({
1931
- deviceId: DEFAULT_DEVICE_ID,
1932
- deviceName: (0, _i18n.transI18n)('fmt_device_label_speaker_follow_system', {
1933
- reason1: (0, _i18n.transI18n)('fmt_device_label_speaker_default')
1934
- })
1935
- });
1936
- }
1937
-
1938
- // 设备列表中有默认设备
1939
- if (defaultIdDevice && defaultIdDevice.deviceName) {
1940
- defaultIdDevice.deviceName = (0, _i18n.transI18n)('fmt_device_label_speaker_follow_system', {
1941
- reason1: (0, _i18n.transI18n)('fmt_device_label_speaker_default')
1942
- });
1943
- }
1944
- return _context23.abrupt("return", list);
1852
+ deviceList = _context18.sent;
1853
+ formatDeviceList = this._formatDeviceList(deviceList, systemSelectedSpeaker);
1854
+ return _context18.abrupt("return", formatDeviceList);
1945
1855
  case 3:
1946
1856
  case "end":
1947
- return _context23.stop();
1857
+ return _context18.stop();
1948
1858
  }
1949
- }, _callee23, this);
1859
+ }, _callee18, this);
1950
1860
  }));
1951
1861
  function _getSpeakerList() {
1952
1862
  return _getSpeakerList2.apply(this, arguments);
@@ -1954,24 +1864,58 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
1954
1864
  return _getSpeakerList;
1955
1865
  }()
1956
1866
  }, {
1957
- key: "setMainRoomAudioOff",
1958
- value: function setMainRoomAudioOff(enable) {
1959
- this.isMainRoomAudioOff = enable;
1867
+ key: "_formatDeviceList",
1868
+ value: function _formatDeviceList(deviceList, systemSelectedDevice) {
1869
+ var defaultDeviceName = (0, _i18n.transI18n)('fmt_device_label_speaker_follow_system', {
1870
+ reason1: (0, _i18n.transI18n)('fmt_device_label_speaker_default')
1871
+ });
1872
+ var formatDeviceList = deviceList.reduce(function (deviceList, deviceInfo) {
1873
+ var results = /^default \((.*)\)$/.exec(deviceInfo.deviceName);
1874
+ if (results && results.length > 1) {
1875
+ deviceInfo.deviceName = results[1];
1876
+ }
1877
+ var isNotVirtualSoundCard = !(0, _tools.matchVirtualSoundCardPattern)(deviceInfo.deviceName);
1878
+ if (isNotVirtualSoundCard) {
1879
+ if (deviceInfo.deviceId === DEFAULT_DEVICE_ID) {
1880
+ deviceInfo.deviceName = defaultDeviceName;
1881
+ }
1882
+ deviceList.push(deviceInfo);
1883
+ }
1884
+ return deviceList;
1885
+ }, []);
1886
+ var defaultIdDevice = formatDeviceList.find(function (item) {
1887
+ return item.deviceId === DEFAULT_DEVICE_ID;
1888
+ });
1889
+
1890
+ // 设备列表中没有默认设备,但是系统默认设备存在
1891
+ if (!defaultIdDevice && systemSelectedDevice !== null && systemSelectedDevice !== void 0 && systemSelectedDevice.deviceName) {
1892
+ formatDeviceList.unshift({
1893
+ deviceId: DEFAULT_DEVICE_ID,
1894
+ deviceName: defaultDeviceName
1895
+ });
1896
+ } else {
1897
+ formatDeviceList.sort(function (a, b) {
1898
+ if (a.deviceId === DEFAULT_DEVICE_ID) return -1;
1899
+ if (b.deviceId === DEFAULT_DEVICE_ID) return 1;
1900
+ return 0;
1901
+ });
1902
+ }
1903
+ return formatDeviceList;
1960
1904
  }
1961
1905
  }, {
1962
1906
  key: "_loadBuiltinResources",
1963
1907
  value: function () {
1964
- var _loadBuiltinResources2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee24() {
1908
+ var _loadBuiltinResources2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee19() {
1965
1909
  var _window$runtime,
1966
- _this11 = this;
1910
+ _this10 = this;
1967
1911
  var _yield$window$runtime, virtualBackgroundImages, virtualBackgroundVideos, soundEffects, newVirtualBackgroundList, images, videos, sounds;
1968
- return _regenerator["default"].wrap(function (_context24) {
1969
- while (1) switch (_context24.prev = _context24.next) {
1912
+ return _regenerator["default"].wrap(function (_context19) {
1913
+ while (1) switch (_context19.prev = _context19.next) {
1970
1914
  case 0:
1971
- _context24.next = 1;
1915
+ _context19.next = 1;
1972
1916
  return (_window$runtime = window.runtime) === null || _window$runtime === void 0 ? void 0 : _window$runtime.loadBuiltinResources();
1973
1917
  case 1:
1974
- _yield$window$runtime = _context24.sent;
1918
+ _yield$window$runtime = _context19.sent;
1975
1919
  virtualBackgroundImages = _yield$window$runtime.virtualBackgroundImages;
1976
1920
  virtualBackgroundVideos = _yield$window$runtime.virtualBackgroundVideos;
1977
1921
  soundEffects = _yield$window$runtime.soundEffects;
@@ -2004,16 +1948,16 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
2004
1948
  newVirtualBackgroundList = newVirtualBackgroundList.concat(images);
2005
1949
  newVirtualBackgroundList = newVirtualBackgroundList.concat(videos);
2006
1950
  (0, _mobx.runInAction)(function () {
2007
- _this11._updateVirtualBackgroundList(newVirtualBackgroundList);
1951
+ _this10._updateVirtualBackgroundList(newVirtualBackgroundList);
2008
1952
  sounds.forEach(function (item) {
2009
- _this11.soundEffectList.set((0, _tools.getFileNameWithoutExtension)(item.url), item);
1953
+ _this10.soundEffectList.set((0, _tools.getFileNameWithoutExtension)(item.url), item);
2010
1954
  });
2011
1955
  });
2012
1956
  case 2:
2013
1957
  case "end":
2014
- return _context24.stop();
1958
+ return _context19.stop();
2015
1959
  }
2016
- }, _callee24, this);
1960
+ }, _callee19, this);
2017
1961
  }));
2018
1962
  function _loadBuiltinResources() {
2019
1963
  return _loadBuiltinResources2.apply(this, arguments);
@@ -2023,14 +1967,14 @@ var FcrUIDeviceProviderImpl = exports.FcrUIDeviceProviderImpl = /*#__PURE__*/fun
2023
1967
  }]);
2024
1968
  }();
2025
1969
  _FcrUIDeviceProviderImpl = FcrUIDeviceProviderImpl;
2026
- var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIDeviceProviderImpl, [[_mobx.observable, 1, "_microphoneDevice"], [_mobx.observable, 1, "_microphone"], [_mobx.observable, 1, "_speakerDevice"], [_mobx.observable, 1, "_speaker"], [_mobx.observable, 1, "currentIsMirror"], [_mobx.observable, 1, "showForceOpenEffectDialog"], [_mobx.observable, 1, "cameraId"], [_mobx.observable, 1, "cameraEnabled"], [_mobx.observable, 1, "showCameraPreview"], [_mobx.observable, 1, "microphoneEnabled"], [_mobx.observable, 1, "cameraList"], [_mobx.observable, 1, "microphoneList"], [_mobx.observable, 1, "microphoneVolumeLevel"], [_mobx.observable, 1, "speakerList"], [_mobx.observable, 1, "isLocalMirrorEnabled"], [_mobx.observable, 1, "isLocalEditBeautyOptions"], [_mobx.observable, 1, "speakerVolumeLevel"], [_mobx.observable, 1, "speakerVolume"], [_mobx.observable, 1, "microphoneVolume"], [_mobx.observable, 1, "virtualBackgroundName"], [_mobx.observable, 1, "enableBeauty"], [_mobx.observable, 1, "beautyKey"], [_mobx.observable, 1, "beautyOptions"], [_mobx.observable, 1, "virtualBackgroundList"], [_mobx.observable, 1, "soundEffectList"], [_mobx.observable, 1, "microphoneDetecting"], [_mobx.observable, 1, "speakerDetecting"], [_mobx.observable, 1, "connectType"], [_mobx.observable, 1, "isMainRoomAudioOff"], [_imports.bound, 2, "connectAudio"], [_imports.bound, 2, "disconnectAudio"], [_initDeviceListDecs, 18, "initDeviceList"], [_startPlayLocalVideoDecs, 18, "startPlayLocalVideo"], [_stopPlayLocalVideoDecs, 18, "stopPlayLocalVideo"], [_handleSpeakerDetectingChangedDecs, 18, "_handleSpeakerDetectingChanged"], [_startSpeakerTestDecs, 18, "startSpeakerTest"], [_stopSpeakerTestDecs, 18, "stopSpeakerTest"], [_setCurrentIsMirrorDecs, 18, "setCurrentIsMirror"], [_toggleLocalMirrorPreviewDecs, 18, "toggleLocalMirrorPreview"], [_setBeautyOptionsDecs, 18, "setBeautyOptions"], [_handleCancelForceOpenVideoEffectDecs, 18, "handleCancelForceOpenVideoEffect"], [_handleForceOpenVideoEffectDecs, 18, "handleForceOpenVideoEffect"], [_imports.bound, 2, "setVideoOrientation"], [_setCameraEnabledDecs, 18, "setCameraEnabled"], [_handleMicrophoneAudioTrackDecs, 18, "_handleMicrophoneAudioTrack"], [_setMicrophoneEnabledDecs, 18, "setMicrophoneEnabled"], [_handleMicrophoneEnabledChangedDecs, 18, "_handleMicrophoneEnabledChanged"], [_toggleLocalMirrorDecs, 18, "toggleLocalMirror"], [_resetMirrorDecs, 18, "resetMirror"], [_handleMicrophoneDetectingChangedDecs, 18, "_handleMicrophoneDetectingChanged"], [_startMicrophoneTestDecs, 18, "startMicrophoneTest"], [_stopMicrophoneTestDecs, 18, "stopMicrophoneTest"], [_enableVirtualBackgroundDecs, 18, "enableVirtualBackground"], [_setEditBeautyKeyDecs, 18, "setEditBeautyKey"], [_enableBeautyEffectDecs, 18, "enableBeautyEffect"], [_setCameraIdDecs, 18, "setCameraId"], [_imports.bound, 2, "_handleMicrophoneIdChanged"], [_imports.bound, 2, "_handleMicrophoneDeviceIdChanged"], [_imports.bound, 2, "_handleSpeakerDeviceIdChanged"], [_imports.bound, 2, "_handleSpeakerIdChanged"], [_setSpeakerIdDecs, 18, "setSpeakerId"], [_setMicrophoneIdDecs, 18, "setMicrophoneId"], [_setSpeakerVolumeDecs, 18, "setSpeakerVolume"], [_setMicrophoneVolumeDecs, 18, "setMicrophoneVolume"], [_loadUiResourcesDecs, 18, "loadUiResources"], [_imports.bound, 2, "toggleAGC"], [_setConnectTypeDecs, 18, "setConnectType"], [_updateVirtualBackgroundListDecs, 18, "_updateVirtualBackgroundList"], [_handleSystemSelectedSpeakerChangedDecs, 18, "_handleSystemSelectedSpeakerChanged"], [_handleSystemSelectedMicrophoneChangedDecs, 18, "_handleSystemSelectedMicrophoneChanged"], [_correctSystemSelectedMicrophoneDeviceIdDecs, 18, "_correctSystemSelectedMicrophoneDeviceId"], [_handleSpeakerTestVolumeIndicationUpdatedDecs, 18, "_handleSpeakerTestVolumeIndicationUpdated"], [_handleSpeakerVolumeUpdatedDecs, 18, "_handleSpeakerVolumeUpdated"], [_handleMicrophoneVolumeIndicationUpdatedDecs, 18, "_handleMicrophoneVolumeIndicationUpdated"], [_imports.bound, 2, "_handleCameraChanged"], [_imports.bound, 2, "toggleLocalCameraPreview"], [_imports.bound, 2, "_handleCameraListUpdated"], [_imports.bound, 2, "_handleMicrophoneAdded"], [_imports.bound, 2, "_handleMicrophoneRemoved"], [_imports.bound, 2, "_handleMicrophoneListUpdated"], [_handleSpeakerAddedDecs, 18, "_handleSpeakerAdded"], [_handleSpeakerRemovedDecs, 18, "_handleSpeakerRemoved"], [_handleSpeakerListUpdatedDecs, 18, "_handleSpeakerListUpdated"], [_setMainRoomAudioOffDecs, 18, "setMainRoomAudioOff"]], []).e, 30);
1970
+ var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_FcrUIDeviceProviderImpl, [[_mobx.observable, 1, "_microphoneDevice"], [_mobx.observable, 1, "_microphone"], [_mobx.observable, 1, "_speakerDevice"], [_mobx.observable, 1, "_speaker"], [_mobx.observable, 1, "_cameraDevice"], [_mobx.observable, 1, "currentIsMirror"], [_mobx.observable, 1, "showForceOpenEffectDialog"], [_mobx.observable, 1, "cameraEnabled"], [_mobx.observable, 1, "showCameraPreview"], [_mobx.observable, 1, "microphoneEnabled"], [_mobx.observable, 1, "cameraList"], [_mobx.observable, 1, "microphoneList"], [_mobx.observable, 1, "microphoneVolumeLevel"], [_mobx.observable, 1, "speakerList"], [_mobx.observable, 1, "isLocalMirrorEnabled"], [_mobx.observable, 1, "isLocalEditBeautyOptions"], [_mobx.observable, 1, "speakerVolumeLevel"], [_mobx.observable, 1, "speakerVolume"], [_mobx.observable, 1, "microphoneVolume"], [_mobx.observable, 1, "virtualBackgroundName"], [_mobx.observable, 1, "enableBeauty"], [_mobx.observable, 1, "beautyKey"], [_mobx.observable, 1, "beautyOptions"], [_mobx.observable, 1, "virtualBackgroundList"], [_mobx.observable, 1, "soundEffectList"], [_mobx.observable, 1, "microphoneDetecting"], [_mobx.observable, 1, "speakerDetecting"], [_mobx.observable, 1, "connectType"], [_mobx.observable, 1, "isMainRoomAudioOff"], [_imports.bound, 2, "connectAudio"], [_imports.bound, 2, "disconnectAudio"], [_startPlayLocalVideoDecs, 18, "startPlayLocalVideo"], [_stopPlayLocalVideoDecs, 18, "stopPlayLocalVideo"], [_startSpeakerTestDecs, 18, "startSpeakerTest"], [_stopSpeakerTestDecs, 18, "stopSpeakerTest"], [_setCurrentIsMirrorDecs, 18, "setCurrentIsMirror"], [_toggleLocalMirrorPreviewDecs, 18, "toggleLocalMirrorPreview"], [_setBeautyOptionsDecs, 18, "setBeautyOptions"], [_handleCancelForceOpenVideoEffectDecs, 18, "handleCancelForceOpenVideoEffect"], [_handleForceOpenVideoEffectDecs, 18, "handleForceOpenVideoEffect"], [_imports.bound, 2, "setVideoOrientation"], [_setCameraEnabledDecs, 18, "setCameraEnabled"], [_handleCameraEnabledChangedDecs, 18, "_handleCameraEnabledChanged"], [_setMicrophoneEnabledDecs, 18, "setMicrophoneEnabled"], [_toggleLocalMirrorDecs, 18, "toggleLocalMirror"], [_resetMirrorDecs, 18, "resetMirror"], [_startMicrophoneTestDecs, 18, "startMicrophoneTest"], [_stopMicrophoneTestDecs, 18, "stopMicrophoneTest"], [_enableVirtualBackgroundDecs, 18, "enableVirtualBackground"], [_setEditBeautyKeyDecs, 18, "setEditBeautyKey"], [_enableBeautyEffectDecs, 18, "enableBeautyEffect"], [_setCameraIdDecs, 18, "setCameraId"], [_setMainRoomAudioOffDecs, 18, "setMainRoomAudioOff"], [_setSpeakerIdDecs, 18, "setSpeakerId"], [_setMicrophoneIdDecs, 18, "setMicrophoneId"], [_setSpeakerVolumeDecs, 18, "setSpeakerVolume"], [_setMicrophoneVolumeDecs, 18, "setMicrophoneVolume"], [_startOrStopCameraDecs, 18, "startOrStopCamera"], [_setShowCameraPreviewDecs, 18, "setShowCameraPreview"], [_loadUiResourcesDecs, 18, "loadUiResources"], [_loadZipResourcesDecs, 18, "loadZipResources"], [_imports.bound, 2, "toggleAGC"], [_setConnectTypeDecs, 18, "setConnectType"], [_toggleLocalCameraPreviewDecs, 18, "toggleLocalCameraPreview"], [_getLoopbackDeviceIdDecs, 18, "getLoopbackDeviceId"], [_initDeviceListDecs, 18, "_initDeviceList"], [_handleMicrophoneAudioTrackDecs, 18, "_handleMicrophoneAudioTrack"], [_handleMicrophoneEnabledChangedDecs, 18, "_handleMicrophoneEnabledChanged"], [_handleCameraVideoTrackDecs, 18, "_handleCameraVideoTrack"], [_imports.bound, 2, "_handleCameraDeviceIdChanged"], [_handleSpeakerDetectingChangedDecs, 18, "_handleSpeakerDetectingChanged"], [_stopSelectedSpeakerTestDecs, 18, "_stopSelectedSpeakerTest"], [_handleMicrophoneDetectingChangedDecs, 18, "_handleMicrophoneDetectingChanged"], [_stopMicrophoneTestDecs2, 18, "_stopMicrophoneTest"], [_imports.bound, 2, "_handleMicrophoneIdChanged"], [_imports.bound, 2, "_handleMicrophoneDeviceIdChanged"], [_imports.bound, 2, "_handleSpeakerDeviceIdChanged"], [_imports.bound, 2, "_handleSpeakerIdChanged"], [_updateVirtualBackgroundListDecs, 18, "_updateVirtualBackgroundList"], [_handleSystemSelectedSpeakerChangedDecs, 18, "_handleSystemSelectedSpeakerChanged"], [_handleSystemSelectedMicrophoneChangedDecs, 18, "_handleSystemSelectedMicrophoneChanged"], [_correctSystemSelectedMicrophoneDeviceIdDecs, 18, "_correctSystemSelectedMicrophoneDeviceId"], [_handleSelectedSpeakerVolumeUpdatedDecs, 18, "_handleSelectedSpeakerVolumeUpdated"], [_handleSpeakerTestVolumeIndicationUpdatedDecs, 18, "_handleSpeakerTestVolumeIndicationUpdated"], [_handleMicrophoneVolumeIndicationUpdatedDecs, 18, "_handleMicrophoneVolumeIndicationUpdated"], [_imports.bound, 2, "_toggleLocalCameraPreview"], [_imports.bound, 2, "_handleCameraAdded"], [_imports.bound, 2, "_handleCameraRemoved"], [_imports.bound, 2, "_handleCameraListUpdated"], [_imports.bound, 2, "_handleMicrophoneAdded"], [_imports.bound, 2, "_handleMicrophoneRemoved"], [_imports.bound, 2, "_handleMicrophoneListUpdated"], [_handleSpeakerAddedDecs, 18, "_handleSpeakerAdded"], [_handleSpeakerRemovedDecs, 18, "_handleSpeakerRemoved"], [_handleSpeakerListUpdatedDecs, 18, "_handleSpeakerListUpdated"], [_getMicrophoneListDecs, 18, "_getMicrophoneList"], [_getSpeakerListDecs, 18, "_getSpeakerList"], [_formatDeviceListDecs, 18, "_formatDeviceList"], [_loadBuiltinResourcesDecs, 18, "_loadBuiltinResources"]], []).e, 30);
2027
1971
  _init__microphoneDevice = _applyDecs$e[0];
2028
1972
  _init__microphone = _applyDecs$e[1];
2029
1973
  _init__speakerDevice = _applyDecs$e[2];
2030
1974
  _init__speaker = _applyDecs$e[3];
2031
- _init_currentIsMirror = _applyDecs$e[4];
2032
- _init_showForceOpenEffectDialog = _applyDecs$e[5];
2033
- _init_cameraId = _applyDecs$e[6];
1975
+ _init__cameraDevice = _applyDecs$e[4];
1976
+ _init_currentIsMirror = _applyDecs$e[5];
1977
+ _init_showForceOpenEffectDialog = _applyDecs$e[6];
2034
1978
  _init_cameraEnabled = _applyDecs$e[7];
2035
1979
  _init_showCameraPreview = _applyDecs$e[8];
2036
1980
  _init_microphoneEnabled = _applyDecs$e[9];