fcr-ui-scene 3.7.8 → 3.7.9-alpha

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 (216) hide show
  1. package/installer/icons/icon.png +0 -0
  2. package/installer/mac/entitlements.mac.plist +1 -5
  3. package/lib/creator/index.js +13 -19
  4. package/lib/creator/provider-initializer.browser.js +4 -3
  5. package/lib/electron/app.js +1 -0
  6. package/lib/electron/bootstrap-sdk.js +19 -2
  7. package/lib/electron/sdk-helper.js +6 -2
  8. package/lib/electron/until.js +3 -0
  9. package/lib/index.js +8 -1
  10. package/lib/modules/components/leave-meeting/store.base.d.ts +1 -0
  11. package/lib/modules/components/leave-meeting/store.base.js +46 -5
  12. package/lib/modules/dialog/dialogs/confirm-leave-meeting/index.d.ts +1 -0
  13. package/lib/modules/dialog/dialogs/confirm-leave-meeting/index.js +2 -1
  14. package/lib/modules/dialog/dialogs/share-screen-selection/index.js +0 -12
  15. package/lib/modules/setting/store.base.d.ts +1 -1
  16. package/lib/modules/setting/store.base.js +3 -2
  17. package/lib/modules/share-screen/store.base.js +0 -2
  18. package/lib/modules/share-screen/store.electron.js +54 -31
  19. package/lib/modules/video-window/popover-watcher.js +4 -1
  20. package/lib/modules/video-window/store.js +7 -1
  21. package/lib/modules/video-window/view.js +14 -4
  22. package/lib/providers/device-provider.js +1 -1
  23. package/lib/providers/screen-share/strategy/browser.js +1 -1
  24. package/lib/providers/window/main-window.js +0 -3
  25. package/lib/providers/window/renderer-window.d.ts +3 -0
  26. package/lib/providers/window/renderer-window.js +47 -4
  27. package/lib/providers/window/type.d.ts +1 -0
  28. package/lib/scenes/main-scene.d.ts +1 -0
  29. package/lib/scenes/main-scene.js +32 -1
  30. package/lib/shared-data/setting.js +1 -1
  31. package/lib/utilities/default-config.js +1 -1
  32. package/lib/utilities/logger.js +1 -1
  33. package/package.json +6 -6
  34. package/public/index.html +2 -149
  35. package/public/meeting-manager.js +391 -0
  36. package/lib/creator.d.ts +0 -36
  37. package/lib/creator.js +0 -465
  38. package/lib/modules/action-bar/index.d.ts +0 -56
  39. package/lib/modules/action-bar/index.dev.d.ts +0 -0
  40. package/lib/modules/action-bar/index.dev.js +0 -94
  41. package/lib/modules/action-bar/index.js +0 -108
  42. package/lib/modules/action-bar/store.d.ts +0 -256
  43. package/lib/modules/action-bar/store.js +0 -1572
  44. package/lib/modules/action-bar/types.d.ts +0 -90
  45. package/lib/modules/action-bar/types.js +0 -6
  46. package/lib/modules/action-bar/view.d.ts +0 -5
  47. package/lib/modules/action-bar/view.js +0 -112
  48. package/lib/modules/annotation/annotation-index.d.ts +0 -2
  49. package/lib/modules/annotation/annotation-index.js +0 -80
  50. package/lib/modules/annotation/annotation-toolbar-store.d.ts +0 -75
  51. package/lib/modules/annotation/annotation-toolbar-store.js +0 -459
  52. package/lib/modules/annotation/board-cursor.css +0 -77
  53. package/lib/modules/annotation/components/color-picker/components/color.d.ts +0 -5
  54. package/lib/modules/annotation/components/color-picker/components/color.js +0 -38
  55. package/lib/modules/annotation/components/color-picker/components/panel.d.ts +0 -1
  56. package/lib/modules/annotation/components/color-picker/components/panel.js +0 -109
  57. package/lib/modules/annotation/components/color-picker/components/picker.d.ts +0 -1
  58. package/lib/modules/annotation/components/color-picker/components/picker.js +0 -75
  59. package/lib/modules/annotation/components/color-picker/index.d.ts +0 -2
  60. package/lib/modules/annotation/components/color-picker/index.js +0 -47
  61. package/lib/modules/annotation/components/eraser-picker.d.ts +0 -4
  62. package/lib/modules/annotation/components/eraser-picker.js +0 -144
  63. package/lib/modules/annotation/components/expansion/index.d.ts +0 -1
  64. package/lib/modules/annotation/components/expansion/index.js +0 -100
  65. package/lib/modules/annotation/components/extra-tool-picker.d.ts +0 -1
  66. package/lib/modules/annotation/components/extra-tool-picker.js +0 -62
  67. package/lib/modules/annotation/components/history.d.ts +0 -2
  68. package/lib/modules/annotation/components/history.js +0 -78
  69. package/lib/modules/annotation/components/icons/fold-icon.d.ts +0 -2
  70. package/lib/modules/annotation/components/icons/fold-icon.js +0 -41
  71. package/lib/modules/annotation/components/icons/move-icon.d.ts +0 -1
  72. package/lib/modules/annotation/components/icons/move-icon.js +0 -66
  73. package/lib/modules/annotation/components/item/index.d.ts +0 -1
  74. package/lib/modules/annotation/components/item/index.js +0 -43
  75. package/lib/modules/annotation/components/move-handle.d.ts +0 -5
  76. package/lib/modules/annotation/components/move-handle.js +0 -134
  77. package/lib/modules/annotation/components/pen-picker.d.ts +0 -4
  78. package/lib/modules/annotation/components/pen-picker.js +0 -155
  79. package/lib/modules/annotation/components/screen-capture-picker.d.ts +0 -4
  80. package/lib/modules/annotation/components/screen-capture-picker.js +0 -85
  81. package/lib/modules/annotation/components/shape-picker.d.ts +0 -4
  82. package/lib/modules/annotation/components/shape-picker.js +0 -210
  83. package/lib/modules/annotation/hooks/index.d.ts +0 -14
  84. package/lib/modules/annotation/hooks/index.js +0 -292
  85. package/lib/modules/annotation/index.d.ts +0 -45
  86. package/lib/modules/annotation/index.js +0 -168
  87. package/lib/modules/annotation/store.d.ts +0 -98
  88. package/lib/modules/annotation/store.js +0 -621
  89. package/lib/modules/annotation/style.css +0 -36
  90. package/lib/modules/annotation/view.d.ts +0 -3
  91. package/lib/modules/annotation/view.js +0 -44
  92. package/lib/modules/components/device-control/store.d.ts +0 -42
  93. package/lib/modules/components/device-control/store.js +0 -241
  94. package/lib/modules/components/leave-meeting/store.d.ts +0 -39
  95. package/lib/modules/components/leave-meeting/store.js +0 -270
  96. package/lib/modules/control-bar/components/annotation-button/index.d.ts +0 -1
  97. package/lib/modules/control-bar/components/annotation-button/index.js +0 -72
  98. package/lib/modules/control-bar/reactor.d.ts +0 -2
  99. package/lib/modules/control-bar/reactor.js +0 -8
  100. package/lib/modules/control-bar/types.d.ts +0 -20
  101. package/lib/modules/control-bar/types.js +0 -6
  102. package/lib/modules/dialog/dialogs/pre-setting/index.css +0 -26
  103. package/lib/modules/dialog/dialogs/pre-setting/index.d.ts +0 -6
  104. package/lib/modules/dialog/dialogs/pre-setting/index.js +0 -62
  105. package/lib/modules/dialog/dialogs/widget/electron.d.ts +0 -6
  106. package/lib/modules/dialog/dialogs/widget/electron.js +0 -38
  107. package/lib/modules/dialog/hooks/use-popover-watcher.d.ts +0 -14
  108. package/lib/modules/dialog/hooks/use-popover-watcher.js +0 -110
  109. package/lib/modules/dialog/hooks/useElectron.d.ts +0 -28
  110. package/lib/modules/dialog/hooks/useElectron.js +0 -277
  111. package/lib/modules/dialog/store.d.ts +0 -135
  112. package/lib/modules/dialog/store.js +0 -616
  113. package/lib/modules/event-confirm/components/window/index.d.ts +0 -4
  114. package/lib/modules/event-confirm/components/window/index.js +0 -197
  115. package/lib/modules/event-confirm/index.css +0 -24
  116. package/lib/modules/event-confirm/index.d.ts +0 -27
  117. package/lib/modules/event-confirm/index.js +0 -76
  118. package/lib/modules/event-confirm/store.d.ts +0 -45
  119. package/lib/modules/event-confirm/store.js +0 -345
  120. package/lib/modules/event-confirm/view.d.ts +0 -2
  121. package/lib/modules/event-confirm/view.js +0 -53
  122. package/lib/modules/event-toast/store.d.ts +0 -27
  123. package/lib/modules/event-toast/store.js +0 -205
  124. package/lib/modules/layout/store.d.ts +0 -176
  125. package/lib/modules/layout/store.js +0 -1466
  126. package/lib/modules/participant/store.d.ts +0 -222
  127. package/lib/modules/participant/store.js +0 -1927
  128. package/lib/modules/pc-audio-connect/index.d.ts +0 -22
  129. package/lib/modules/pc-audio-connect/index.js +0 -67
  130. package/lib/modules/pc-audio-connect/store.d.ts +0 -46
  131. package/lib/modules/pc-audio-connect/store.js +0 -304
  132. package/lib/modules/setting/common/advance-link.d.ts +0 -3
  133. package/lib/modules/setting/common/advance-link.js +0 -27
  134. package/lib/modules/setting/common/index.css +0 -26
  135. package/lib/modules/setting/common/useNamespace.d.ts +0 -15
  136. package/lib/modules/setting/common/useNamespace.js +0 -66
  137. package/lib/modules/setting/dialog-wrapper.d.ts +0 -2
  138. package/lib/modules/setting/dialog-wrapper.js +0 -110
  139. package/lib/modules/setting/store.d.ts +0 -261
  140. package/lib/modules/setting/store.js +0 -1321
  141. package/lib/modules/share-screen/store.d.ts +0 -148
  142. package/lib/modules/share-screen/store.js +0 -950
  143. package/lib/modules/share-screen/types.d.ts +0 -26
  144. package/lib/modules/share-screen/types.js +0 -6
  145. package/lib/modules/state-bar/store.d.ts +0 -124
  146. package/lib/modules/state-bar/store.js +0 -664
  147. package/lib/modules/whiteboard/components/progress/electron.d.ts +0 -1
  148. package/lib/modules/whiteboard/components/progress/electron.js +0 -33
  149. package/lib/modules/widget/store.d.ts +0 -14
  150. package/lib/modules/widget/store.js +0 -28
  151. package/lib/providers/annotation-provider.d.ts +0 -124
  152. package/lib/providers/annotation-provider.js +0 -369
  153. package/lib/providers/dialog-provider.d.ts +0 -137
  154. package/lib/providers/dialog-provider.js +0 -194
  155. package/lib/providers/message-provider.d.ts +0 -69
  156. package/lib/providers/message-provider.js +0 -140
  157. package/lib/providers/room-provider.d.ts +0 -194
  158. package/lib/providers/room-provider.js +0 -916
  159. package/lib/providers/screen-share-provider.d.ts +0 -244
  160. package/lib/providers/screen-share-provider.js +0 -835
  161. package/lib/providers/sharing-provider.d.ts +0 -42
  162. package/lib/providers/sharing-provider.js +0 -221
  163. package/lib/providers/user-setting-storage-provider.d.ts +0 -21
  164. package/lib/providers/user-setting-storage-provider.js +0 -65
  165. package/lib/providers/whiteboard-provider.d.ts +0 -24
  166. package/lib/providers/whiteboard-provider.js +0 -127
  167. package/lib/shared-data-source/annotation-data.d.ts +0 -17
  168. package/lib/shared-data-source/annotation-data.js +0 -110
  169. package/lib/shared-data-source/app-list-data.d.ts +0 -34
  170. package/lib/shared-data-source/app-list-data.js +0 -133
  171. package/lib/shared-data-source/chat-data.d.ts +0 -25
  172. package/lib/shared-data-source/chat-data.js +0 -139
  173. package/lib/shared-data-source/config.d.ts +0 -35
  174. package/lib/shared-data-source/config.js +0 -40
  175. package/lib/shared-data-source/confirm-data.d.ts +0 -25
  176. package/lib/shared-data-source/confirm-data.js +0 -97
  177. package/lib/shared-data-source/device-privilege-data.d.ts +0 -8
  178. package/lib/shared-data-source/device-privilege-data.js +0 -25
  179. package/lib/shared-data-source/interpreter.d.ts +0 -77
  180. package/lib/shared-data-source/interpreter.js +0 -247
  181. package/lib/shared-data-source/layout-data.d.ts +0 -31
  182. package/lib/shared-data-source/layout-data.js +0 -189
  183. package/lib/shared-data-source/meeting-time.d.ts +0 -90
  184. package/lib/shared-data-source/meeting-time.js +0 -416
  185. package/lib/shared-data-source/member-data.d.ts +0 -139
  186. package/lib/shared-data-source/member-data.js +0 -517
  187. package/lib/shared-data-source/pin-data.d.ts +0 -13
  188. package/lib/shared-data-source/pin-data.js +0 -111
  189. package/lib/shared-data-source/screen-share-data.d.ts +0 -364
  190. package/lib/shared-data-source/screen-share-data.js +0 -520
  191. package/lib/shared-data-source/security-data.d.ts +0 -39
  192. package/lib/shared-data-source/security-data.js +0 -156
  193. package/lib/shared-data-source/setting.d.ts +0 -67
  194. package/lib/shared-data-source/setting.js +0 -220
  195. package/lib/shared-data-source/speaker-spotlight.d.ts +0 -5
  196. package/lib/shared-data-source/speaker-spotlight.js +0 -15
  197. package/lib/shared-data-source/video-window.d.ts +0 -165
  198. package/lib/shared-data-source/video-window.js +0 -1266
  199. package/lib/shared-data-source/waiting-room.d.ts +0 -46
  200. package/lib/shared-data-source/waiting-room.js +0 -222
  201. package/lib/shared-data-source/whiteboard-data.d.ts +0 -68
  202. package/lib/shared-data-source/whiteboard-data.js +0 -347
  203. package/lib/utilities/board-context.d.ts +0 -4
  204. package/lib/utilities/board-context.js +0 -12
  205. package/lib/utilities/copyText.d.ts +0 -2
  206. package/lib/utilities/copyText.js +0 -48
  207. package/lib/utilities/renderer-event.d.ts +0 -10
  208. package/lib/utilities/renderer-event.js +0 -95
  209. package/lib/utilities/screen-capture-permission.d.ts +0 -2
  210. package/lib/utilities/screen-capture-permission.js +0 -24
  211. package/lib/utilities/screen.d.ts +0 -3
  212. package/lib/utilities/screen.js +0 -53
  213. package/lib/utilities/video-track-render-context.d.ts +0 -6
  214. package/lib/utilities/video-track-render-context.js +0 -9
  215. package/lib/waiting-room-control-manager.d.ts +0 -28
  216. package/lib/waiting-room-control-manager.js +0 -230
@@ -1,1466 +0,0 @@
1
- "use strict";
2
-
3
- require("core-js/modules/es.symbol.js");
4
- require("core-js/modules/es.symbol.description.js");
5
- require("core-js/modules/es.symbol.to-primitive.js");
6
- require("core-js/modules/es.error.cause.js");
7
- require("core-js/modules/es.error.to-string.js");
8
- require("core-js/modules/es.array.is-array.js");
9
- require("core-js/modules/es.date.to-primitive.js");
10
- require("core-js/modules/es.function.name.js");
11
- require("core-js/modules/es.number.constructor.js");
12
- require("core-js/modules/es.object.create.js");
13
- require("core-js/modules/es.object.define-property.js");
14
- require("core-js/modules/es.object.get-own-property-descriptor.js");
15
- require("core-js/modules/esnext.function.metadata.js");
16
- require("core-js/modules/esnext.symbol.metadata.js");
17
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
18
- var _typeof = require("@babel/runtime/helpers/typeof");
19
- Object.defineProperty(exports, "__esModule", {
20
- value: true
21
- });
22
- exports["default"] = exports.StoreContext = void 0;
23
- require("core-js/modules/es.array.every.js");
24
- require("core-js/modules/es.array.filter.js");
25
- require("core-js/modules/es.array.find.js");
26
- require("core-js/modules/es.array.for-each.js");
27
- require("core-js/modules/es.array.iterator.js");
28
- require("core-js/modules/es.array.push.js");
29
- require("core-js/modules/es.array.slice.js");
30
- require("core-js/modules/es.array.some.js");
31
- require("core-js/modules/es.function.bind.js");
32
- require("core-js/modules/es.map.js");
33
- require("core-js/modules/es.object.to-string.js");
34
- require("core-js/modules/es.object.values.js");
35
- require("core-js/modules/es.string.iterator.js");
36
- require("core-js/modules/es.weak-map.js");
37
- require("core-js/modules/esnext.iterator.constructor.js");
38
- require("core-js/modules/esnext.iterator.every.js");
39
- require("core-js/modules/esnext.iterator.filter.js");
40
- require("core-js/modules/esnext.iterator.find.js");
41
- require("core-js/modules/esnext.iterator.for-each.js");
42
- require("core-js/modules/esnext.iterator.some.js");
43
- require("core-js/modules/esnext.map.delete-all.js");
44
- require("core-js/modules/esnext.map.emplace.js");
45
- require("core-js/modules/esnext.map.every.js");
46
- require("core-js/modules/esnext.map.filter.js");
47
- require("core-js/modules/esnext.map.find.js");
48
- require("core-js/modules/esnext.map.find-key.js");
49
- require("core-js/modules/esnext.map.includes.js");
50
- require("core-js/modules/esnext.map.key-of.js");
51
- require("core-js/modules/esnext.map.map-keys.js");
52
- require("core-js/modules/esnext.map.map-values.js");
53
- require("core-js/modules/esnext.map.merge.js");
54
- require("core-js/modules/esnext.map.reduce.js");
55
- require("core-js/modules/esnext.map.some.js");
56
- require("core-js/modules/esnext.map.update.js");
57
- require("core-js/modules/esnext.weak-map.delete-all.js");
58
- require("core-js/modules/esnext.weak-map.emplace.js");
59
- require("core-js/modules/web.dom-collections.for-each.js");
60
- require("core-js/modules/web.dom-collections.iterator.js");
61
- require("core-js/modules/web.timers.js");
62
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
63
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
64
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
65
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
66
- var _mobx = require("mobx");
67
- var _fcrCore = require("fcr-core");
68
- var _type = require("fcr-core/lib/type");
69
- var _decorator = require("agora-foundation/lib/decorator");
70
- var _type2 = require("./type");
71
- var _type3 = require("../whiteboard/type");
72
- var _i18n = require("agora-ui-foundation/lib/i18n");
73
- var _type4 = require("fcr-core/lib/room-control/chatroom-control/type");
74
- var _attendee = require("agora-ui-foundation/lib/components/participants/attendee");
75
- var _type5 = require("fcr-core/lib/room-control/type");
76
- var _react = require("react");
77
- var _mobxUtils = require("mobx-utils");
78
- var _constant = require("../../utilities/constant");
79
- var _type6 = require("../../type");
80
- var _view = require("./view");
81
- var _logger = require("../../utilities/logger");
82
- var _env = require("agora-foundation/lib/utilities/env");
83
- var _type7 = require("../secondary-window/type");
84
- var _LayoutStore;
85
- var _initProto, _participantDecs, _init_participant, _chatDecs, _init_chat, _chatActionDecs, _init_chatAction, _stateBarDecs, _init_stateBar, _actionBarDecs, _init_actionBar, _layersDecs, _init_layers, _whiteboardDecs, _init_whiteboard, _annotationDecs, _init_annotation, _screenShareControlDecs, _init_screenShareControl, _init_collapsed, _init_aside, _init_barHovering, _init_barLocked, _init_barHidden, _init_asideWidth, _init_userVolumeMap, _init_chatRoomState, _init_whiteboardActive, _init_ownerUser, _addPinMessageDecs, _cancelPinMessageDecs, _setWhiteboardActiveDecs, _setAsideWidthDecs, _updateSlotsDecs, _toggleLayoutDecs, _toggleCollapsedDecs, _toggleAsideDecs, _asideWidthChangedDecs, _toggleLayoutBarLockDecs, _toggleLayoutBarHiddenDecs, _resetLockTimerDecs, _setHoveringHandlerDecs, _setHoveringLeaveHandlerDecs, _setScreenShareSpeakerViewSizeDecs, _handleLiveLayoutChangeDecs, _onUserInfoUpdatedDecs, _handleLayoutUpdatedDecs, _init__handleLayoutUpdated, _handleFoldListChangedDecs, _handleMainListLengthChangedDecs, _handleMainListChangedDecs, _setBarHoveringDecs, _handleConnectionUpdatedDecs, _findVideoWindowByUserIdDecs, _onRemoteUsersLeftDecs, _onAudioVolumeUpdatedDecs, _ref;
86
- function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
87
- function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
88
- function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
89
- function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
90
- function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
91
- function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
92
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
93
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
94
- function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
95
- 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; }
96
- var _A = /*#__PURE__*/new WeakMap();
97
- var _B = /*#__PURE__*/new WeakMap();
98
- var _C = /*#__PURE__*/new WeakMap();
99
- var _D = /*#__PURE__*/new WeakMap();
100
- var _E = /*#__PURE__*/new WeakMap();
101
- var _F = /*#__PURE__*/new WeakMap();
102
- var _G = /*#__PURE__*/new WeakMap();
103
- var _H = /*#__PURE__*/new WeakMap();
104
- var _I = /*#__PURE__*/new WeakMap();
105
- var _J = /*#__PURE__*/new WeakMap();
106
- var _K = /*#__PURE__*/new WeakMap();
107
- var _L = /*#__PURE__*/new WeakMap();
108
- var _M = /*#__PURE__*/new WeakMap();
109
- var _N = /*#__PURE__*/new WeakMap();
110
- var _O = /*#__PURE__*/new WeakMap();
111
- var _P = /*#__PURE__*/new WeakMap();
112
- var _Q = /*#__PURE__*/new WeakMap();
113
- var _R = /*#__PURE__*/new WeakMap();
114
- var _S = /*#__PURE__*/new WeakMap();
115
- _ref = (_participantDecs = [_mobx.observable, _mobx.observable.ref], _chatDecs = [_mobx.observable, _mobx.observable.ref], _chatActionDecs = [_mobx.observable, _mobx.observable.ref], _stateBarDecs = [_mobx.observable, _mobx.observable.ref], _actionBarDecs = [_mobx.observable, _mobx.observable.ref], _layersDecs = [_mobx.observable, _mobx.observable.ref], _whiteboardDecs = [_mobx.observable, _mobx.observable.ref], _annotationDecs = [_mobx.observable, _mobx.observable.ref], _screenShareControlDecs = [_mobx.observable, _mobx.observable.ref], _addPinMessageDecs = [_mobx.action, _mobx.action.bound], _cancelPinMessageDecs = [_mobx.action, _mobx.action.bound], _setWhiteboardActiveDecs = [_mobx.action, _mobx.action.bound], _setAsideWidthDecs = [_mobx.action, _mobx.action.bound], _updateSlotsDecs = [_mobx.action, _mobx.action.bound], _toggleLayoutDecs = [_mobx.action, _mobx.action.bound], _toggleCollapsedDecs = [_mobx.action, _mobx.action.bound], _toggleAsideDecs = [_mobx.action, _mobx.action.bound], _asideWidthChangedDecs = [_mobx.action, _mobx.action.bound], _toggleLayoutBarLockDecs = [_mobx.action, _mobx.action.bound], _toggleLayoutBarHiddenDecs = [_mobx.action, _mobx.action.bound], _resetLockTimerDecs = [_mobx.action, _mobx.action.bound], _setHoveringHandlerDecs = [_mobx.action, _mobx.action.bound], _setHoveringLeaveHandlerDecs = [_mobx.action, _mobx.action.bound], _setScreenShareSpeakerViewSizeDecs = [(0, _decorator.debounced)(400), _decorator.bound], _handleLiveLayoutChangeDecs = [_mobx.action, _mobx.action.bound], _onUserInfoUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleLayoutUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleFoldListChangedDecs = [_mobx.action, _mobx.action.bound], _handleMainListLengthChangedDecs = [_mobx.action, _mobx.action.bound], _handleMainListChangedDecs = [_mobx.action, _mobx.action.bound], _setBarHoveringDecs = [_mobx.action, _mobx.action.bound], _handleConnectionUpdatedDecs = [_mobx.action, _mobx.action.bound], _findVideoWindowByUserIdDecs = [_mobx.action, _mobx.action.bound], _onRemoteUsersLeftDecs = [_mobx.action, _mobx.action.bound], _onAudioVolumeUpdatedDecs = [_mobx.action, _mobx.action.bound], "logger");
116
- var LayoutStore = exports["default"] = /*#__PURE__*/function () {
117
- function LayoutStore(params) {
118
- var _this = this;
119
- (0, _classCallCheck2["default"])(this, LayoutStore);
120
- (0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.createLogger)({
121
- prefix: 'LayoutStore'
122
- })));
123
- (0, _defineProperty2["default"])(this, "_localView", null);
124
- (0, _defineProperty2["default"])(this, "_disposers", []);
125
- (0, _defineProperty2["default"])(this, "_barLockTimer", 0);
126
- (0, _defineProperty2["default"])(this, "_liveStreamState", _type.FcrLiveStreamingState.STOPPED);
127
- // Slots
128
- _classPrivateFieldInitSpec(this, _A, _init_participant(this, null));
129
- _classPrivateFieldInitSpec(this, _B, _init_chat(this, null));
130
- _classPrivateFieldInitSpec(this, _C, _init_chatAction(this, null));
131
- _classPrivateFieldInitSpec(this, _D, _init_stateBar(this, null));
132
- _classPrivateFieldInitSpec(this, _E, _init_actionBar(this, null));
133
- _classPrivateFieldInitSpec(this, _F, _init_layers(this, null));
134
- _classPrivateFieldInitSpec(this, _G, _init_whiteboard(this, null));
135
- _classPrivateFieldInitSpec(this, _H, _init_annotation(this, null));
136
- _classPrivateFieldInitSpec(this, _I, _init_screenShareControl(this, null));
137
- // State
138
- _classPrivateFieldInitSpec(this, _J, _init_collapsed(this, true));
139
- _classPrivateFieldInitSpec(this, _K, _init_aside(this, false));
140
- _classPrivateFieldInitSpec(this, _L, _init_barHovering(this, true));
141
- _classPrivateFieldInitSpec(this, _M, _init_barLocked(this, true));
142
- _classPrivateFieldInitSpec(this, _N, _init_barHidden(this, false));
143
- _classPrivateFieldInitSpec(this, _O, _init_asideWidth(this, _view.MinAsideWidth));
144
- _classPrivateFieldInitSpec(this, _P, _init_userVolumeMap(this, new Map()));
145
- _classPrivateFieldInitSpec(this, _Q, _init_chatRoomState(this, _type4.FcrChatRoomConnectionState.Disconnected));
146
- _classPrivateFieldInitSpec(this, _R, _init_whiteboardActive(this, false));
147
- _classPrivateFieldInitSpec(this, _S, _init_ownerUser(this, undefined));
148
- (0, _defineProperty2["default"])(this, "getAllowedOperations", (0, _mobxUtils.computedFn)(function (targetRole, isSelf) {
149
- return _this._privilegeProvider.getAllowedOperations(targetRole, isSelf);
150
- }));
151
- (0, _defineProperty2["default"])(this, "_handleLayoutUpdated", _init__handleLayoutUpdated(this, function (layout) {
152
- if (layout === _type2.FcrUIVideoWindowLayoutType.Speaker) {
153
- _this._switchToSpeaker();
154
- } else if (layout === _type2.FcrUIVideoWindowLayoutType.Gallery) {
155
- _this._switchToGallery();
156
- }
157
- }));
158
- (0, _defineProperty2["default"])(this, "_setSpotlightStream", function () {
159
- var spotlightStream = _this._findSpotlightStream();
160
- if (!spotlightStream.streamId || !spotlightStream.volume) return;
161
- var streamId = spotlightStream.streamId;
162
- _this._videoWindowDataSource.setSpeakerSpotlight(streamId);
163
- });
164
- var roomControl = params.roomControl,
165
- chatProvider = params.chatProvider;
166
- this._userControl = roomControl.getUserControl();
167
- this._streamControl = roomControl.getStreamControl();
168
- this._chatRoomControl = roomControl.getChatRoomControl();
169
- this._whiteBoardControl = roomControl.getSharingControl().getBoardControl();
170
- this._roomControl = roomControl;
171
- this._sharedLayoutDataSource = params.sharedLayoutDataSource;
172
- this._eventProvider = params.eventProvider;
173
- this._deviceProvider = params.deviceProvider;
174
- this._privilegeProvider = params.privilegeProvider;
175
- this._sharedSettingDataSource = params.sharedSettingDataSource;
176
- this._sharedInterpreterDataSource = params.sharedInterpreterDataSource;
177
- this._sharedSettingDataSource = params.sharedSettingDataSource;
178
- this._chatProvider = chatProvider;
179
- this._videoWindowDataSource = params.sharedVideoWindowDataSource;
180
- this._sharedMemberDataSource = params.sharedMemberDataSource;
181
- this._pinDataSource = params.sharedPinDataSource;
182
- this.chatRoomState = this._chatRoomControl.getConnectionState();
183
- this._sharedScreenShareDataSource = params.sharedScreenShareDataSource;
184
- this._sharedAnnotationDataSource = params.sharedAnnotationDataSource;
185
- this._multiDisplayProvider = params.multiDisplayProvider;
186
- this._addListeners();
187
- this._initStream();
188
- this._handleFoldListChanged();
189
- this._handleMainListChanged();
190
- this._handleMainListLengthChanged();
191
- this._handleLayoutUpdated(this._videoWindowDataSource.layoutType);
192
- this.setWhiteboardActive(this._whiteBoardControl.getActivity());
193
-
194
- // 进入房间后,如果双屏模式处于激活状态,则需要设置主窗口为窗口最大化
195
- if (this._multiDisplayProvider.isActive) {
196
- this._multiDisplayProvider.setMainWindowMaximize();
197
- }
198
-
199
- // @ts-ignore
200
- window._layoutStore = this;
201
- }
202
- return (0, _createClass2["default"])(LayoutStore, [{
203
- key: "participant",
204
- get: function get() {
205
- return _classPrivateFieldGet(_A, this);
206
- },
207
- set: function set(v) {
208
- _classPrivateFieldSet(_A, this, v);
209
- }
210
- }, {
211
- key: "chat",
212
- get: function get() {
213
- return _classPrivateFieldGet(_B, this);
214
- },
215
- set: function set(v) {
216
- _classPrivateFieldSet(_B, this, v);
217
- }
218
- }, {
219
- key: "chatAction",
220
- get: function get() {
221
- return _classPrivateFieldGet(_C, this);
222
- },
223
- set: function set(v) {
224
- _classPrivateFieldSet(_C, this, v);
225
- }
226
- }, {
227
- key: "stateBar",
228
- get: function get() {
229
- return _classPrivateFieldGet(_D, this);
230
- },
231
- set: function set(v) {
232
- _classPrivateFieldSet(_D, this, v);
233
- }
234
- }, {
235
- key: "actionBar",
236
- get: function get() {
237
- return _classPrivateFieldGet(_E, this);
238
- },
239
- set: function set(v) {
240
- _classPrivateFieldSet(_E, this, v);
241
- }
242
- }, {
243
- key: "layers",
244
- get: function get() {
245
- return _classPrivateFieldGet(_F, this);
246
- },
247
- set: function set(v) {
248
- _classPrivateFieldSet(_F, this, v);
249
- }
250
- }, {
251
- key: "whiteboard",
252
- get: function get() {
253
- return _classPrivateFieldGet(_G, this);
254
- },
255
- set: function set(v) {
256
- _classPrivateFieldSet(_G, this, v);
257
- }
258
- }, {
259
- key: "annotation",
260
- get: function get() {
261
- return _classPrivateFieldGet(_H, this);
262
- },
263
- set: function set(v) {
264
- _classPrivateFieldSet(_H, this, v);
265
- }
266
- }, {
267
- key: "screenShareControl",
268
- get: function get() {
269
- return _classPrivateFieldGet(_I, this);
270
- },
271
- set: function set(v) {
272
- _classPrivateFieldSet(_I, this, v);
273
- }
274
- }, {
275
- key: "collapsed",
276
- get: function get() {
277
- return _classPrivateFieldGet(_J, this);
278
- },
279
- set: function set(v) {
280
- _classPrivateFieldSet(_J, this, v);
281
- }
282
- }, {
283
- key: "aside",
284
- get: function get() {
285
- return _classPrivateFieldGet(_K, this);
286
- },
287
- set: function set(v) {
288
- _classPrivateFieldSet(_K, this, v);
289
- }
290
- }, {
291
- key: "barHovering",
292
- get: function get() {
293
- return _classPrivateFieldGet(_L, this);
294
- },
295
- set: function set(v) {
296
- _classPrivateFieldSet(_L, this, v);
297
- }
298
- }, {
299
- key: "barLocked",
300
- get: function get() {
301
- return _classPrivateFieldGet(_M, this);
302
- },
303
- set: function set(v) {
304
- _classPrivateFieldSet(_M, this, v);
305
- }
306
- }, {
307
- key: "barHidden",
308
- get: function get() {
309
- return _classPrivateFieldGet(_N, this);
310
- },
311
- set: function set(v) {
312
- _classPrivateFieldSet(_N, this, v);
313
- }
314
- }, {
315
- key: "asideWidth",
316
- get: function get() {
317
- return _classPrivateFieldGet(_O, this);
318
- },
319
- set: function set(v) {
320
- _classPrivateFieldSet(_O, this, v);
321
- }
322
- }, {
323
- key: "userVolumeMap",
324
- get: function get() {
325
- return _classPrivateFieldGet(_P, this);
326
- },
327
- set: function set(v) {
328
- _classPrivateFieldSet(_P, this, v);
329
- }
330
- }, {
331
- key: "chatRoomState",
332
- get: function get() {
333
- return _classPrivateFieldGet(_Q, this);
334
- },
335
- set: function set(v) {
336
- _classPrivateFieldSet(_Q, this, v);
337
- }
338
- }, {
339
- key: "whiteboardActive",
340
- get: function get() {
341
- return _classPrivateFieldGet(_R, this);
342
- },
343
- set: function set(v) {
344
- _classPrivateFieldSet(_R, this, v);
345
- }
346
- }, {
347
- key: "ownerUser",
348
- get: function get() {
349
- return _classPrivateFieldGet(_S, this);
350
- },
351
- set: function set(v) {
352
- _classPrivateFieldSet(_S, this, v);
353
- }
354
- }, {
355
- key: "streamControl",
356
- get: function get() {
357
- return this._streamControl;
358
- }
359
- }, {
360
- key: "localUserRole",
361
- get: function get() {
362
- return this._sharedMemberDataSource.localUserRole;
363
- }
364
- }, {
365
- key: "localUser",
366
- get: function get() {
367
- return this._sharedMemberDataSource.localUser;
368
- }
369
- }, {
370
- key: "shouldHideNonVideoParticipants",
371
- get: function get() {
372
- return this._sharedSettingDataSource.setting.shouldHideNonVideoParticipants || false;
373
- }
374
- }, {
375
- key: "shouldHideMyVideo",
376
- get: function get() {
377
- return this._sharedSettingDataSource.setting.shouldHideMyVideo || false;
378
- }
379
- }, {
380
- key: "enableSpotlight",
381
- get: function get() {
382
- return this._sharedSettingDataSource.setting.spotlightEnabled;
383
- }
384
- }, {
385
- key: "isWaterMarkEnabled",
386
- get: function get() {
387
- return this._privilegeProvider.isWaterMarkEnabled();
388
- }
389
- }, {
390
- key: "isMulti",
391
- get: function get() {
392
- return this._privilegeProvider.isMulti();
393
- }
394
- }, {
395
- key: "layout",
396
- get: function get() {
397
- return this._videoWindowDataSource.layoutType;
398
- }
399
- }, {
400
- key: "manualLayout",
401
- get: function get() {
402
- return this._videoWindowDataSource.manualLayout;
403
- }
404
- }, {
405
- key: "scalcValue",
406
- get: function get() {
407
- return this._sharedScreenShareDataSource.screenShareScalcValue;
408
- }
409
- }, {
410
- key: "annotationHasStart",
411
- get: function get() {
412
- return this._sharedAnnotationDataSource.annotationHasStart;
413
- }
414
- }, {
415
- key: "sourceList",
416
- get: function get() {
417
- var mainList = this._videoWindowDataSource.mainList;
418
- if (this.isMultiDisplayActive) {
419
- switch (this.secondaryWindowContentType) {
420
- case _type7.FcrUIDisplayDistributionContentType.LOCAL_CAMERA:
421
- if (mainList.length === 1) {
422
- return mainList;
423
- } else {
424
- return mainList.filter(function (item) {
425
- return !item.isMySelf;
426
- });
427
- }
428
- case _type7.FcrUIDisplayDistributionContentType.SHARING_SCREEN:
429
- case _type7.FcrUIDisplayDistributionContentType.SHARING_SCREEN_WITH_ANNOTATION:
430
- return mainList.filter(function (item) {
431
- return item.videoSourceType !== _fcrCore.FcrVideoSourceType.SCREEN;
432
- });
433
- case _type7.FcrUIDisplayDistributionContentType.SHARING_WHITEBOARD:
434
- return mainList.filter(function (item) {
435
- return item.type !== _type2.FcrUIWindowType.BOARD;
436
- });
437
- case _type7.FcrUIDisplayDistributionContentType.HIDDEN:
438
- var sharingType = this._multiDisplayProvider.displayState.sharingType;
439
-
440
- // 当自己进行屏幕共享时,会隐藏副窗口,主窗口中不需要显示屏幕共享流
441
- if (sharingType === _type7.FcrUIDisplayDistributionContentType.SHARING_SCREEN || sharingType === _type7.FcrUIDisplayDistributionContentType.SHARING_SCREEN_WITH_ANNOTATION) {
442
- return mainList.filter(function (item) {
443
- return item.videoSourceType !== _fcrCore.FcrVideoSourceType.SCREEN;
444
- });
445
- }
446
- }
447
- }
448
- var isMyselfCurrentScreenSharing = this._videoWindowDataSource.mainList.some(function (i) {
449
- return i.hasScreenSharing && i.isMySelf;
450
- });
451
- var isMyselfCurrentHasBoardSharing = this._videoWindowDataSource.mainList.some(function (i) {
452
- return i.hasBoardSharing && i.isMySelf;
453
- });
454
- if (isMyselfCurrentScreenSharing && !isMyselfCurrentHasBoardSharing) {
455
- return this._videoWindowDataSource.mainList.filter(function (i) {
456
- return !(i.isMySelf && i.videoSourceType !== _fcrCore.FcrVideoSourceType.SCREEN);
457
- });
458
- } else {
459
- return this._videoWindowDataSource.mainList.filter(function (i) {
460
- return !i.isMySelf || i.videoSourceType !== _fcrCore.FcrVideoSourceType.SCREEN;
461
- });
462
- }
463
- }
464
- }, {
465
- key: "layoutMainList",
466
- get: function get() {
467
- var _this2 = this;
468
- var nonVideoStreamParticipantList = this.sourceList.filter(function (i) {
469
- return _this2._isVideoParticipantVisible(i);
470
- });
471
- var list = this.shouldHideNonVideoParticipants ? nonVideoStreamParticipantList : this.sourceList;
472
- var isOnlyOne = list.every(function (i) {
473
- return i.isMySelf && i.type === _type2.FcrUIWindowType.VIDEO;
474
- });
475
- return list.filter(function (i) {
476
- if (_this2.shouldHideMyVideo && !isOnlyOne && i.isMySelf && i.type === _type2.FcrUIWindowType.VIDEO) {
477
- return false;
478
- }
479
- return true;
480
- });
481
- }
482
- }, {
483
- key: "mainList",
484
- get: function get() {
485
- return this.layoutMainList;
486
- }
487
- }, {
488
- key: "mainListMapByAudioStreamId",
489
- get: function get() {
490
- var map = new Map();
491
- this._videoWindowDataSource.mainList.forEach(function (item) {
492
- if (item.audioStreamId) {
493
- map.set(item.audioStreamId, item);
494
- } else {
495
- map.set(item.windowId, item);
496
- }
497
- });
498
- return map;
499
- }
500
- }, {
501
- key: "spotlightStreamId",
502
- get: function get() {
503
- return this._videoWindowDataSource.spotlightStreamId;
504
- }
505
- }, {
506
- key: "foldList",
507
- get: function get() {
508
- return this._videoWindowDataSource.foldList;
509
- }
510
- }, {
511
- key: "currentShareData",
512
- get: function get() {
513
- return this.mainList.find(function (item) {
514
- return item.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN || item.type === _type2.FcrUIWindowType.BOARD;
515
- });
516
- }
517
- }, {
518
- key: "galleryList",
519
- get: function get() {
520
- return this._videoWindowDataSource.layoutType === _type2.FcrUIVideoWindowLayoutType.Speaker ? this.mainList.slice(0, 1) : this.mainList;
521
- }
522
- }, {
523
- key: "isMainWindow",
524
- get: function get() {
525
- return this.galleryList.length === 1;
526
- }
527
- }, {
528
- key: "isMainWindowInScreenSharing",
529
- get: function get() {
530
- return this.galleryList.length === 1 && this.galleryList[0].videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN;
531
- }
532
- }, {
533
- key: "isCurrentUserInBoardSharing",
534
- get: function get() {
535
- return this.mainList.some(function (i) {
536
- return i.hasBoardSharing;
537
- });
538
- }
539
- }, {
540
- key: "asideLayout",
541
- get: function get() {
542
- var _this$_sharedLayoutDa;
543
- return (_this$_sharedLayoutDa = this._sharedLayoutDataSource) === null || _this$_sharedLayoutDa === void 0 ? void 0 : _this$_sharedLayoutDa.asideLayout;
544
- }
545
- }, {
546
- key: "carouselList",
547
- get: function get() {
548
- return this._videoWindowDataSource.layoutType === _type2.FcrUIVideoWindowLayoutType.Speaker ? this.mainList.slice(1) : this.mainList;
549
- }
550
- }, {
551
- key: "hasPinnedStream",
552
- get: function get() {
553
- return this.mainList.some(function (u) {
554
- return u.isPin;
555
- });
556
- }
557
- }, {
558
- key: "isRobot",
559
- get: function get() {
560
- return this.localUserRole === _type.FcrUserRole.ROBOT;
561
- }
562
- }, {
563
- key: "findSpotlightUser",
564
- get: function get() {
565
- var _this3 = this;
566
- return this.spotlightStreamId ? this.mainList.find(function (item) {
567
- return item.videoStreamId === _this3.spotlightStreamId || item.audioStreamId === _this3.spotlightStreamId;
568
- }) : null;
569
- }
570
- }, {
571
- key: "isWhoISpeakingActive",
572
- get: function get() {
573
- var _this$findSpotlightUs;
574
- var spotlightUserName = (_this$findSpotlightUs = this.findSpotlightUser) === null || _this$findSpotlightUs === void 0 ? void 0 : _this$findSpotlightUs.userName;
575
- var isSpeakerLayout = this.layout === _type2.FcrUIVideoWindowLayoutType.Speaker;
576
- var speakerWindowData = this.galleryList[0];
577
- var isSpeakerIsSharing = (speakerWindowData === null || speakerWindowData === void 0 ? void 0 : speakerWindowData.videoSourceType) === _fcrCore.FcrVideoSourceType.SCREEN || (speakerWindowData === null || speakerWindowData === void 0 ? void 0 : speakerWindowData.type) === _type2.FcrUIWindowType.BOARD;
578
- var active = spotlightUserName && isSpeakerLayout && this.collapsed && !isSpeakerIsSharing;
579
- return active;
580
- }
581
- }, {
582
- key: "microphoneEnabled",
583
- get: function get() {
584
- return this._deviceProvider.microphoneEnabled;
585
- }
586
- }, {
587
- key: "allowChat",
588
- get: function get() {
589
- return this._privilegeProvider.allowChat();
590
- }
591
- }, {
592
- key: "allowUnmuteSelfAudio",
593
- get: function get() {
594
- return this._privilegeProvider.allowUnmuteSelfAudio();
595
- }
596
- }, {
597
- key: "allowUnmuteSelfVideo",
598
- get: function get() {
599
- return this._privilegeProvider.allowUnmuteSelfVideo();
600
- }
601
- }, {
602
- key: "isHostOrCoHost",
603
- get: function get() {
604
- return this._sharedMemberDataSource.isLocalUserHost;
605
- }
606
- }, {
607
- key: "galleryMaxSize",
608
- get: function get() {
609
- var _this$_sharedLayoutDa2;
610
- return (_this$_sharedLayoutDa2 = this._sharedLayoutDataSource) === null || _this$_sharedLayoutDa2 === void 0 ? void 0 : _this$_sharedLayoutDa2.layoutSize;
611
- }
612
- }, {
613
- key: "allowedAllChat",
614
- get: function get() {
615
- return this._privilegeProvider.allowedAllChat();
616
- }
617
- }, {
618
- key: "allowedPublicChatAndDisallowedPrivateChat",
619
- get: function get() {
620
- return this._privilegeProvider.allowedPublicChatAndDisallowedPrivateChat();
621
- }
622
- }, {
623
- key: "disallowedPublicChatAndDisallowedPrivateChatToParticipant",
624
- get: function get() {
625
- return this._privilegeProvider.disallowedPublicChatAndDisallowedPrivateChatToParticipant();
626
- }
627
- }, {
628
- key: "disallowedAllChat",
629
- get: function get() {
630
- return this._privilegeProvider.disallowedAllChat();
631
- }
632
- }, {
633
- key: "privilegeOperator",
634
- get: function get() {
635
- return this._privilegeProvider.privilegeOperator;
636
- }
637
- }, {
638
- key: "localUserId",
639
- get: function get() {
640
- return this._sharedMemberDataSource.localUser.userId;
641
- }
642
- }, {
643
- key: "interpreterUserList",
644
- get: function get() {
645
- return this._sharedInterpreterDataSource.interpreterUserList;
646
- }
647
- }, {
648
- key: "isInterpreterEnabled",
649
- get: function get() {
650
- return this._sharedInterpreterDataSource.isInterpreterEnabled;
651
- }
652
- }, {
653
- key: "secondaryWindowContentType",
654
- get: function get() {
655
- return this._multiDisplayProvider.secondaryWindowContentType;
656
- }
657
- }, {
658
- key: "isMultiDisplayActive",
659
- get: function get() {
660
- return this._multiDisplayProvider.isActive;
661
- }
662
- }, {
663
- key: "isLocalCameraInSecondaryWindow",
664
- get: function get() {
665
- return this._multiDisplayProvider.isLocalCameraInSecondaryWindow;
666
- }
667
- }, {
668
- key: "participantCount",
669
- get: function get() {
670
- return this._sharedMemberDataSource.totalUserCount;
671
- }
672
- }, {
673
- key: "isVideoSuspended",
674
- get: function get() {
675
- var isSharingScreen = !!this._sharedScreenShareDataSource.isSharingScreen;
676
- var shareScreenOwner = this._sharedScreenShareDataSource.screenSharingOwner;
677
- var isSharingScreenBySelf = this.localUserId === (shareScreenOwner === null || shareScreenOwner === void 0 ? void 0 : shareScreenOwner.userId);
678
-
679
- // 多屏模式开启时, 不需要显示悬浮窗
680
- if (this.isMultiDisplayActive) {
681
- return false;
682
- }
683
- if ((0, _env.isElectron)() && isSharingScreen && isSharingScreenBySelf) {
684
- return true;
685
- }
686
- return false;
687
- }
688
- }, {
689
- key: "asideContent",
690
- get: function get() {
691
- return this._sharedLayoutDataSource.asideLayout;
692
- }
693
- }, {
694
- key: "participantsRenderAt",
695
- get: function get() {
696
- return this._sharedLayoutDataSource.participantsRenderAt;
697
- }
698
- }, {
699
- key: "chatRenderAt",
700
- get: function get() {
701
- return this._sharedLayoutDataSource.chatRenderAt;
702
- }
703
- }, {
704
- key: "getWaterMarkContent",
705
- value: function getWaterMarkContent() {
706
- return this._privilegeProvider.getWaterMarkContent();
707
- }
708
- }, {
709
- key: "hasMutePermission",
710
- value: function hasMutePermission(targetRole) {
711
- return this._privilegeProvider.hasMutePermission(targetRole);
712
- }
713
- }, {
714
- key: "hasUnmutePermission",
715
- value: function hasUnmutePermission(targetRole) {
716
- return this._privilegeProvider.hasUnmutePermission(targetRole);
717
- }
718
- }, {
719
- key: "hasRequestStartAudioPermission",
720
- value: function hasRequestStartAudioPermission(targetRole) {
721
- return this._privilegeProvider.hasRequestStartAudioPermission(targetRole);
722
- }
723
- }, {
724
- key: "toggleMainStream",
725
- value: function toggleMainStream(streamId) {
726
- var success = this._videoWindowDataSource.toggleMainStream(streamId);
727
- if (success) {
728
- if (this.layout === _type2.FcrUIVideoWindowLayoutType.Gallery) {
729
- this.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Speaker, true);
730
- }
731
- }
732
- }
733
- }, {
734
- key: "addPinMessage",
735
- value: function addPinMessage(streamId) {
736
- this._pinDataSource.addPin(streamId);
737
- }
738
- }, {
739
- key: "cancelPinMessage",
740
- value: function cancelPinMessage(streamId) {
741
- this._pinDataSource.removePin(streamId);
742
- }
743
- }, {
744
- key: "addPin",
745
- value: function addPin(streamId) {
746
- this.addPinMessage(streamId);
747
- }
748
- }, {
749
- key: "removePin",
750
- value: function removePin(streamId) {
751
- this.cancelPinMessage(streamId);
752
- }
753
- }, {
754
- key: "setVideoOrientation",
755
- value: function setVideoOrientation() {
756
- this._deviceProvider.setVideoOrientation();
757
- }
758
- }, {
759
- key: "setAllowChat",
760
- value: function setAllowChat(allowChat) {
761
- this._privilegeProvider.setAllowChat(allowChat);
762
- }
763
- }, {
764
- key: "handleSetPinState",
765
- value: function handleSetPinState(userId) {
766
- var _user = this.mainList.find(function (u) {
767
- return u.userId === userId;
768
- });
769
- if (!_user) return;
770
- var streamId = _user.videoStreamId || _user.audioStreamId || '';
771
- if (!streamId) return;
772
- if (_user.isPin) {
773
- this.removePin(streamId);
774
- } else {
775
- this.addPin(streamId);
776
- }
777
- }
778
- }, {
779
- key: "setWhiteboardActive",
780
- value: function setWhiteboardActive(active) {
781
- this.whiteboardActive = active;
782
- }
783
- }, {
784
- key: "setAsideWidth",
785
- value: function setAsideWidth(val) {
786
- this.asideWidthChanged(val);
787
- !this.aside && this.toggleAside(true);
788
- this.asideWidth = val;
789
- }
790
- /**
791
- * Partially update slots, use `null` to delete the slot.
792
- * `undefined` is ignored.
793
- */
794
- }, {
795
- key: "updateSlots",
796
- value: function updateSlots(slots) {
797
- for (var key in slots) {
798
- var slot = slots[key];
799
- if (key in this && slot !== undefined) {
800
- this[key] = slot;
801
- }
802
- }
803
- }
804
- }, {
805
- key: "closeParticipantFromAside",
806
- value: function closeParticipantFromAside() {
807
- this._sharedLayoutDataSource.setAsideLayout({
808
- participant: false
809
- });
810
- }
811
- }, {
812
- key: "moveParticipantFromAsideToDialog",
813
- value: function moveParticipantFromAsideToDialog() {
814
- this.closeParticipantFromAside();
815
- this._sharedLayoutDataSource.setParticipantsRenderAt('dialog');
816
- this._eventProvider.openDialog(_constant.FcrUIDialogKey.PARTICIPANT);
817
- }
818
- }, {
819
- key: "closeChatFromAside",
820
- value: function closeChatFromAside() {
821
- this._sharedLayoutDataSource.setAsideLayout({
822
- chat: false
823
- });
824
- }
825
- }, {
826
- key: "closeAsideChat",
827
- value: function closeAsideChat() {
828
- this.closeChatFromAside();
829
- this._eventProvider.notifyChatResetTarget();
830
- }
831
- }, {
832
- key: "moveChatFromAsideToDialog",
833
- value: function moveChatFromAsideToDialog() {
834
- this.closeChatFromAside();
835
- this._sharedLayoutDataSource.setChatRenderAt('dialog');
836
- this._eventProvider.openDialog(_constant.FcrUIDialogKey.CHAT);
837
- this._sharedLayoutDataSource.setAsideLayout({
838
- chat: true
839
- });
840
- }
841
- }, {
842
- key: "openPrivateChat",
843
- value: function openPrivateChat(userId) {
844
- var _this$_userControl;
845
- if (!this._privilegeProvider.permitPrivateChat(userId)) {
846
- return;
847
- }
848
- if (!this.asideContent.chat) {
849
- this._sharedLayoutDataSource.setAsideLayout({
850
- chat: true
851
- });
852
- }
853
- var user = Object.values(this === null || this === void 0 || (_this$_userControl = this._userControl) === null || _this$_userControl === void 0 ? void 0 : _this$_userControl.getUsers()).find(function (u) {
854
- return u.userId === userId;
855
- });
856
- // user && this._eventProvider.notifyChatUpdateTarget(user, FcrRoomType.Mainroom);
857
- user && this._chatProvider.setPrivateChatTargetUser(user, _type6.FcrUIRoomType.MAIN_ROOM);
858
- }
859
- }, {
860
- key: "openRenameDialog",
861
- value: function openRenameDialog(userId) {
862
- this._eventProvider.sendEvent(_constant.FcrUIAction.PARTICIPANT_ACTION, {
863
- action: _attendee.ParticipantActionType.RENAME_IN_MEETING,
864
- userId: userId
865
- });
866
- }
867
- }, {
868
- key: "toggleLayout",
869
- value: function toggleLayout(layout, manual) {
870
- this._videoWindowDataSource.setLayout(layout, manual);
871
- }
872
- }, {
873
- key: "toggleCollapsed",
874
- value: function toggleCollapsed() {
875
- var collapsed = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.collapsed;
876
- this.collapsed = collapsed;
877
- this._eventProvider.sendEvent(_constant.FcrUIAction.CAROUSEL_COLLAPSED, collapsed);
878
- }
879
- }, {
880
- key: "toggleAside",
881
- value: function toggleAside() {
882
- var open = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : !this.aside;
883
- this.aside = open;
884
- }
885
- }, {
886
- key: "asideWidthChanged",
887
- value: function asideWidthChanged(width) {
888
- this._eventProvider.sendEvent(_constant.FcrUIAction.ASIDE_WIDTH_CHANGED, width);
889
- }
890
- }, {
891
- key: "toggleLayoutBarLock",
892
- value: function toggleLayoutBarLock(state) {
893
- // this.barLocked = state;
894
- }
895
- }, {
896
- key: "toggleLayoutBarHidden",
897
- value: function toggleLayoutBarHidden() {
898
- this.barHidden = !this.barHidden;
899
- }
900
- }, {
901
- key: "resetLockTimer",
902
- value: function resetLockTimer() {
903
- if (!this._barLockTimer) return;
904
- window.clearTimeout(this._barLockTimer);
905
- this._barLockTimer = 0;
906
- }
907
- }, {
908
- key: "setHoveringHandler",
909
- value: function setHoveringHandler() {
910
- var _this4 = this;
911
- this._setBarHovering(true);
912
- if (!this._barLockTimer && !this.barLocked) {
913
- this._barLockTimer = window.setTimeout(function () {
914
- _this4._setBarHovering(false);
915
- _this4.resetLockTimer();
916
- }, 3000);
917
- }
918
- }
919
- }, {
920
- key: "setHoveringLeaveHandler",
921
- value: function setHoveringLeaveHandler() {
922
- return !this.barLocked && this._setBarHovering(false);
923
- }
924
- }, {
925
- key: "setScreenShareSpeakerViewSize",
926
- value: function setScreenShareSpeakerViewSize(width, height) {
927
- this._sharedScreenShareDataSource.setScreenShareSpeakerViewSize(width, height);
928
- }
929
- }, {
930
- key: "handleLiveLayoutChange",
931
- value: function handleLiveLayoutChange(modifiedUser) {
932
- if (modifiedUser.userId === this.localUserId && modifiedUser.userRole === _type.FcrUserRole.HOST) {
933
- // 当本人变成主持人时
934
- if (this._liveStreamState === _type.FcrLiveStreamingState.STARTED) {
935
- // 直播中,切换布局
936
- this._roomControl.updateLiveStreamingLayout(this.layout === _type2.FcrUIVideoWindowLayoutType.Speaker ? _type.FcrLiveStreamingLayoutType.SPEAKER : _type.FcrLiveStreamingLayoutType.GALLERY);
937
- }
938
- }
939
- }
940
- }, {
941
- key: "release",
942
- value: function release() {
943
- this._disposers.forEach(function (fn) {
944
- return fn();
945
- });
946
- this._disposers = [];
947
- }
948
- }, {
949
- key: "onUserInfoUpdated",
950
- value: function onUserInfoUpdated(roomId, event) {
951
- this._videoWindowDataSource.update(event.modifiedUser);
952
- this.handleLiveLayoutChange(event.modifiedUser);
953
- }
954
- }, {
955
- key: "stopLocalPreview",
956
- value: function stopLocalPreview(view) {
957
- this._deviceProvider.stopPlayLocalVideo(view);
958
- }
959
- }, {
960
- key: "startLocalPreview",
961
- value: function startLocalPreview(div) {
962
- if (div) {
963
- this._deviceProvider.startPlayLocalVideo(div);
964
- }
965
- }
966
- }, {
967
- key: "setAllowChatWithPayload",
968
- value: function setAllowChatWithPayload(type) {
969
- switch (type) {
970
- case 'public':
971
- this._privilegeProvider.setAllowedPublicChatAndDisallowedPrivateChat();
972
- break;
973
- case 'private_to_manager':
974
- this._privilegeProvider.setDisallowedPublicChatAndDisallowedPrivateChatToParticipant();
975
- break;
976
- }
977
- }
978
- }, {
979
- key: "setScaleValue",
980
- value: function setScaleValue(scale) {
981
- this._sharedScreenShareDataSource.setScreenShareScalcValue(scale);
982
- }
983
- }, {
984
- key: "muteAudio",
985
- value: function muteAudio(mute, userId) {
986
- this._eventProvider.sendEvent(_constant.FcrUIAction.PARTICIPANT_ACTION, {
987
- action: mute ? _attendee.ParticipantActionType.MUTE_AUDIO : _attendee.ParticipantActionType.UNMUTE_AUDIO,
988
- userId: userId
989
- });
990
- }
991
- }, {
992
- key: "sendParticipantEvent",
993
- value: function sendParticipantEvent(payload) {
994
- this._eventProvider.sendEvent(_constant.FcrUIAction.PARTICIPANT_ACTION, payload);
995
- }
996
-
997
- // onEvent(action: FcrUIAction.UPDATE_ASIDE, payload: FcrUIUpdateAsideParams): void;
998
- }, {
999
- key: "onEvent",
1000
- value:
1001
- // onEvent(
1002
- // action: FcrUIAction.WHITEBOARD_CHANGED,
1003
- // payload: { action: WhiteboardControlbarEvents; payload: boolean },
1004
- // ): void;
1005
- function onEvent(action, payload) {
1006
- if (action === _constant.FcrUIAction.SET_MAIN_SPEAKER) {
1007
- var _ref2 = payload,
1008
- userId = _ref2.userId;
1009
- }
1010
- if (action === _constant.FcrUIAction.SET_USER_PIN_STATE) {
1011
- var _ref3 = payload,
1012
- _userId = _ref3.userId;
1013
- this.handleSetPinState(_userId);
1014
- }
1015
- if (action === _constant.FcrUIAction.TOGGLE_LAYOUT_BAR_LOCK) {
1016
- this.toggleLayoutBarLock(payload);
1017
- }
1018
- if (action === _constant.FcrUIAction.TOGGLE_LAYOUT_ACTIONBAR_HIDDEN) {
1019
- this.toggleLayoutBarHidden();
1020
- }
1021
- if (action === _constant.FcrUIAction.WHITEBOARD_CHANGED) {
1022
- var _ref4 = payload,
1023
- changeAction = _ref4.action,
1024
- isLoneyWindow = _ref4.payload;
1025
- if (changeAction === _type3.WhiteboardControlbarEvents.LONEYWINDOW) {
1026
- if (isLoneyWindow) {
1027
- this._videoWindowDataSource.removeBoard();
1028
- } else {
1029
- var isActive = this._whiteBoardControl.getActivity();
1030
- var ownerUserId = this._whiteBoardControl.getOwnerId();
1031
- if (isActive) {
1032
- var ownerUser = this._userControl.getUser(ownerUserId);
1033
- this._videoWindowDataSource.addBoard(ownerUser, ownerUserId === this.localUserId, this._privilegeProvider.hasWriteBoardPermission());
1034
- } else {
1035
- this.logger.warn('LayoutStore onEvent, WhiteboardControlbarEvents.LONEYWINDOW isLoneyWindow false, boardActiveInfo isActive is false, ownerUserId is null');
1036
- }
1037
- }
1038
- }
1039
- if (changeAction === _type3.WhiteboardBaseEvents.SET_OWNER_USER_ID) {
1040
- var _ref5 = payload,
1041
- _ownerUserId = _ref5.payload;
1042
- this.ownerUser = _ownerUserId ? this._userControl.getUser(_ownerUserId) : undefined;
1043
- }
1044
- }
1045
- }
1046
- }, {
1047
- key: "_addListeners",
1048
- value: function _addListeners() {
1049
- var _this5 = this;
1050
- var roomObserver = {
1051
- onLiveStreamingStateUpdated: this._handleLiveStreamingStateUpdated
1052
- };
1053
- var eventObserver = {
1054
- onEvent: this.onEvent
1055
- };
1056
- var streamObserver = {
1057
- onStreamsAdded: this._onStreamsAdded,
1058
- onStreamsUpdated: this._onStreamsUpdated,
1059
- onStreamsRemoved: this._onStreamsRemoved,
1060
- onStreamVolumeIndicationUpdated: this._onAudioVolumeUpdated
1061
- };
1062
- var userObserver = {
1063
- onUserInfoUpdated: this.onUserInfoUpdated,
1064
- onRemoteUsersLeft: this._onRemoteUsersLeft
1065
- };
1066
- var videoWindowObserver = {
1067
- onLayoutUpdated: this._handleLayoutUpdated,
1068
- onFoldListAdded: this._handleFoldListChanged,
1069
- onFoldListRemoved: this._handleFoldListChanged,
1070
- onFoldListUpdated: this._handleFoldListChanged,
1071
- onMainListAdded: this._handleMainListChanged,
1072
- onMainListUpdated: this._handleMainListChanged,
1073
- onMainListRemoved: this._handleMainListChanged
1074
- };
1075
- var whiteboardObserver = {
1076
- onActive: function onActive() {
1077
- return _this5.setWhiteboardActive(true);
1078
- },
1079
- onInactive: function onInactive() {
1080
- return _this5.setWhiteboardActive(false);
1081
- }
1082
- };
1083
- var chatObserver = {
1084
- onChatRoomConnectionStateUpdated: this._handleConnectionUpdated
1085
- };
1086
- this._roomControl.addObserver(roomObserver);
1087
- this._eventProvider.addObserver(eventObserver);
1088
- this._streamControl.addObserver(streamObserver);
1089
- this._userControl.addObserver(userObserver);
1090
- this._videoWindowDataSource.addObserver(videoWindowObserver);
1091
- this._whiteBoardControl.addObserver(whiteboardObserver);
1092
- this._chatProvider.addObserver(chatObserver);
1093
- this._disposers.push(function () {
1094
- _this5._roomControl.removeObserver(roomObserver);
1095
- _this5._eventProvider.removeObserver(eventObserver);
1096
- _this5._streamControl.removeObserver(streamObserver);
1097
- _this5._userControl.removeObserver(userObserver);
1098
- _this5._videoWindowDataSource.removeObserver(videoWindowObserver);
1099
- _this5._whiteBoardControl.removeObserver(whiteboardObserver);
1100
- _this5._chatProvider.removeObserver(chatObserver);
1101
- }, (0, _mobx.reaction)(function () {
1102
- return _this5.mainList.length;
1103
- }, function (length) {
1104
- if (length < 2) {
1105
- if (_this5.layout === _type2.FcrUIVideoWindowLayoutType.Speaker) {
1106
- _this5.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Gallery);
1107
- }
1108
- }
1109
- _this5._handleMainListLengthChanged();
1110
- }), (0, _mobx.reaction)(function () {
1111
- return _this5._multiDisplayProvider.isActive;
1112
- }, function (isActive) {
1113
- var _this5$_multiDisplayP = _this5._multiDisplayProvider.displayState,
1114
- sharingBySelf = _this5$_multiDisplayP.sharingBySelf,
1115
- isSharingScreen = _this5$_multiDisplayP.isSharingScreen;
1116
- if (isActive) {
1117
- // 多屏模式激活时,需要设置主窗口为窗口最大化
1118
- // 如果自己正在共享屏幕,则关闭 vidoe window 悬浮窗、显示主窗口
1119
- if (sharingBySelf && isSharingScreen) {
1120
- var _this5$_eventProvider;
1121
- (_this5$_eventProvider = _this5._eventProvider) === null || _this5$_eventProvider === void 0 || _this5$_eventProvider.sendEvent(_constant.FcrUIAction.CLOSE_TOP_VIDEO_WINDOW);
1122
- _this5._multiDisplayProvider.showMainWindowInIndexLeastDisplay({
1123
- maximize: true
1124
- });
1125
- } else {
1126
- _this5._multiDisplayProvider.setMainWindowMaximize();
1127
- }
1128
- return;
1129
- }
1130
-
1131
- // 多屏模式从激活状态转变为非激活状态时,
1132
- // 如果当前是自己在共享屏幕,则隐藏主窗口,打开 vidoe window 悬浮窗
1133
- // 如果不是自己在共享,则切换布局到演讲者模式
1134
- // 没屏幕共享时,不做操作
1135
- if (sharingBySelf && isSharingScreen) {
1136
- var _this5$_eventProvider2;
1137
- window.runtime.browserWindow.hide();
1138
- (_this5$_eventProvider2 = _this5._eventProvider) === null || _this5$_eventProvider2 === void 0 || _this5$_eventProvider2.sendEvent(_constant.FcrUIAction.OPEN_TOP_VIDEO_WINDOW);
1139
- } else if (isSharingScreen) {
1140
- _this5.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Speaker);
1141
- }
1142
- }), (0, _mobx.reaction)(function () {
1143
- return _this5.whiteboardActive;
1144
- }, function (isBoardActive) {
1145
- if (isBoardActive) {
1146
- var ownerUserId = _this5._whiteBoardControl.getOwnerId();
1147
- var ownerUser = _this5._userControl.getUser(ownerUserId);
1148
- _this5._videoWindowDataSource.addBoard(ownerUser, ownerUserId === _this5.localUserId);
1149
- if (_this5.secondaryWindowContentType === _type7.FcrUIDisplayDistributionContentType.SHARING_WHITEBOARD) {
1150
- // 在副屏窗口模式显示白板时,不切换布局
1151
- return;
1152
- }
1153
- if (_this5.layout === _type2.FcrUIVideoWindowLayoutType.Gallery) {
1154
- _this5.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Speaker);
1155
- }
1156
- } else {
1157
- _this5._videoWindowDataSource.removeBoard();
1158
- if (_this5.secondaryWindowContentType === _type7.FcrUIDisplayDistributionContentType.SHARING_WHITEBOARD) {
1159
- // 在副屏窗口模式显示白板时,不切换布局
1160
- return;
1161
- }
1162
- if (_this5.manualLayout) {
1163
- _this5.toggleLayout(_this5.manualLayout);
1164
- } else {
1165
- _this5.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Gallery);
1166
- }
1167
- }
1168
- }), (0, _mobx.reaction)(function () {
1169
- return _this5._privilegeProvider.hasWriteBoardPermission();
1170
- }, function (canEdit) {
1171
- if (!_this5.mainList.some(function (u) {
1172
- return u.type === _type2.FcrUIWindowType.BOARD;
1173
- })) return;
1174
- _this5._videoWindowDataSource.updateBoard(canEdit);
1175
- }), (0, _mobx.reaction)(function () {
1176
- return _this5.asideContent;
1177
- }, function (asideContent) {
1178
- if (asideContent.participant || asideContent.chat) {
1179
- _this5.toggleAside(true);
1180
- }
1181
- if (!asideContent.participant && !asideContent.chat) {
1182
- _this5.toggleAside(false);
1183
- }
1184
- }, {
1185
- fireImmediately: true
1186
- }), (0, _mobx.reaction)(function () {
1187
- return {
1188
- cameraEnabled: _this5._deviceProvider.cameraEnabled,
1189
- cameraId: _this5._deviceProvider.cameraId
1190
- };
1191
- }, function (_ref6) {
1192
- var cameraEnabled = _ref6.cameraEnabled,
1193
- cameraId = _ref6.cameraId;
1194
- if (!cameraEnabled && _this5._localView) {
1195
- _this5.stopLocalPreview(_this5._localView);
1196
- }
1197
- if (cameraEnabled && cameraId && _this5._localView) {
1198
- _this5.startLocalPreview(_this5._localView);
1199
- }
1200
- }), (0, _mobx.reaction)(function () {
1201
- return _this5.barLocked;
1202
- }, function (barLocked) {
1203
- if (_this5._barLockTimer && barLocked) {
1204
- _this5.resetLockTimer();
1205
- } else {
1206
- _this5.setHoveringHandler();
1207
- }
1208
- }), (0, _mobx.reaction)(function () {
1209
- return _this5._deviceProvider.microphoneVolumeLevel;
1210
- }, function (volume) {
1211
- (0, _mobx.runInAction)(function () {
1212
- _this5.userVolumeMap.set('0', volume);
1213
- });
1214
- }), (0, _mobx.reaction)(function () {
1215
- return {
1216
- enableSpotlight: _this5.enableSpotlight
1217
- };
1218
- }, function (_ref7) {
1219
- var enableSpotlight = _ref7.enableSpotlight;
1220
- _this5._videoWindowDataSource.setSpotlightEnabled(enableSpotlight);
1221
- }),
1222
- // 录制的特殊逻辑:
1223
- // 因为录制机器人不发流,且当前切换布局的逻辑是有多个人的视频窗口才切换到 speaker layout
1224
- // 所以当房间只有主持人的时候录制机器人的视角不会切换到 speaker layout,故加上以下逻辑
1225
- (0, _mobx.reaction)(function () {
1226
- var _this5$currentShareDa;
1227
- return (_this5$currentShareDa = _this5.currentShareData) === null || _this5$currentShareDa === void 0 ? void 0 : _this5$currentShareDa.hasScreenSharing;
1228
- }, function (hasScreenSharing) {
1229
- if (_this5.isRobot) {
1230
- if (hasScreenSharing) {
1231
- _this5.logger.info('set layout to speaker for robot');
1232
- _this5.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Speaker);
1233
- } else {
1234
- _this5.logger.info('set layout to gallery for robot');
1235
- _this5.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Gallery);
1236
- }
1237
- }
1238
- }, {
1239
- fireImmediately: true
1240
- }), (0, _mobx.reaction)(function () {
1241
- return _this5._videoWindowDataSource.mainList.filter(_this5._shouldUnpin.bind(_this5));
1242
- }, function (list) {
1243
- list.forEach(function (item) {
1244
- if (_this5._videoWindowDataSource.shouldHideNonVideoParticipants) {
1245
- _this5._pinDataSource.removePin(item.windowId, (0, _i18n.transI18n)('fmt_internalsetting_other_hide_no_video_pin_cancelled'));
1246
- }
1247
- });
1248
- }));
1249
- }
1250
- }, {
1251
- key: "_hasVideoStreamUser",
1252
- get: function get() {
1253
- return this.sourceList.some(function (i) {
1254
- return i.hasVideoStream;
1255
- });
1256
- }
1257
- }, {
1258
- key: "_shouldUnpin",
1259
- value: function _shouldUnpin(item) {
1260
- return !this._isVideoParticipantVisible(item) && item.isPin;
1261
- }
1262
- }, {
1263
- key: "_isVideoParticipantVisible",
1264
- value: function _isVideoParticipantVisible(item) {
1265
- return item.isMySelf && !this._hasVideoStreamUser || item.hasVideoStream || item.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN || item.type === _type2.FcrUIWindowType.BOARD;
1266
- }
1267
- }, {
1268
- key: "_handleFoldListChanged",
1269
- value: function _handleFoldListChanged() {
1270
- this._eventProvider.sendEvent(_constant.FcrUIAction.FOLD_LIST_CHANGED, this.foldList);
1271
- }
1272
- }, {
1273
- key: "_handleMainListLengthChanged",
1274
- value: function _handleMainListLengthChanged() {
1275
- this._eventProvider.sendEvent(_constant.FcrUIAction.MAIN_LIST_LENGTH_CHANGED, this.mainList.length);
1276
- }
1277
- }, {
1278
- key: "_handleMainListChanged",
1279
- value: function _handleMainListChanged() {
1280
- this._eventProvider.sendEvent(_constant.FcrUIAction.MAIN_LIST_CHANGED, this.mainList);
1281
- }
1282
- }, {
1283
- key: "_switchToSpeaker",
1284
- value: function _switchToSpeaker() {
1285
- this.collapsed = false;
1286
- }
1287
- }, {
1288
- key: "_switchToGallery",
1289
- value: function _switchToGallery() {
1290
- this.collapsed = true;
1291
- }
1292
- }, {
1293
- key: "_setBarHovering",
1294
- value: function _setBarHovering(state) {
1295
- this.barHovering = state;
1296
- }
1297
- }, {
1298
- key: "_initStream",
1299
- value: function _initStream() {
1300
- var _this6 = this;
1301
- var isSharingScreen = false;
1302
- this._streamControl.getStreamList().forEach(function (stream) {
1303
- if (stream.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN) {
1304
- isSharingScreen = true;
1305
- }
1306
- _this6._handleStreamAdded(stream);
1307
- });
1308
- if (isSharingScreen && this.layout === _type2.FcrUIVideoWindowLayoutType.Gallery) {
1309
- this.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Speaker);
1310
- }
1311
- }
1312
- }, {
1313
- key: "_handleConnectionUpdated",
1314
- value: function _handleConnectionUpdated(_, state) {
1315
- this.logger.info('layout store handleConnectionUpdated', state);
1316
- this.chatRoomState = state;
1317
- }
1318
- }, {
1319
- key: "_findVideoWindowByUserId",
1320
- value: function _findVideoWindowByUserId(userId) {
1321
- return this.mainList.find(function (item) {
1322
- return item.userId === userId;
1323
- });
1324
- }
1325
- }, {
1326
- key: "_onRemoteUsersLeft",
1327
- value: function _onRemoteUsersLeft(roomId, events) {
1328
- var _this7 = this;
1329
- events.forEach(function (event) {
1330
- var userInfo = event.userInfo;
1331
- var videoWindowData = _this7._findVideoWindowByUserId(userInfo.userId);
1332
- if (videoWindowData) {
1333
- var stream = videoWindowData.getVideoStream();
1334
- if (stream) {
1335
- _this7._videoWindowDataSource["delete"](stream);
1336
- }
1337
- }
1338
- });
1339
- }
1340
- }, {
1341
- key: "_handleLiveStreamingStateUpdated",
1342
- value: function _handleLiveStreamingStateUpdated(_, state, url, reason) {
1343
- this._liveStreamState = state;
1344
- if (state === _type.FcrLiveStreamingState.STOPPED && reason === _type5.FcrLiveStreamingStateUpdatedReason.HOSTCHANGED) {
1345
- this._eventProvider.showToast({
1346
- type: 'info',
1347
- message: (0, _i18n.transI18n)('fmt_broadcast_livestream_tips_hand_over_pc_to_mobile')
1348
- });
1349
- }
1350
- }
1351
- }, {
1352
- key: "_handleStreamAdded",
1353
- value: function _handleStreamAdded(modifiedStream) {
1354
- this._videoWindowDataSource.add(modifiedStream, modifiedStream.owner.userId === this.localUserId);
1355
- if (this.isMultiDisplayActive) {
1356
- // 在开启多屏模式下,屏幕共享流添加时,保持布局不变
1357
- return;
1358
- }
1359
- if (modifiedStream.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN) {
1360
- var isSharingScreenOwner = modifiedStream.owner.userId === this.localUserId;
1361
- if (this.layout === _type2.FcrUIVideoWindowLayoutType.Gallery) {
1362
- // 在非 Electron 环境或者 Electron 环境下非屏幕共享拥有者时,切换到 Speaker 布局
1363
- var shouldToggleToSpeaker = !(0, _env.isElectron)() || !isSharingScreenOwner;
1364
- if (shouldToggleToSpeaker) {
1365
- this.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Speaker);
1366
- }
1367
- }
1368
- }
1369
- }
1370
- }, {
1371
- key: "_onStreamsAdded",
1372
- value: function _onStreamsAdded(roomId, events) {
1373
- var _this8 = this;
1374
- events.forEach(function (_ref8) {
1375
- var modifiedStream = _ref8.modifiedStream;
1376
- _this8._handleStreamAdded(modifiedStream);
1377
- });
1378
- }
1379
- }, {
1380
- key: "_onStreamsUpdated",
1381
- value: function _onStreamsUpdated(roomId, events) {
1382
- var _this9 = this;
1383
- events.forEach(function (_ref9) {
1384
- var modifiedStream = _ref9.modifiedStream;
1385
- _this9._videoWindowDataSource.update(modifiedStream);
1386
- });
1387
- }
1388
- }, {
1389
- key: "_onStreamsRemoved",
1390
- value: function _onStreamsRemoved(roomId, events) {
1391
- var _this0 = this;
1392
- events.forEach(function (_ref0) {
1393
- var modifiedStream = _ref0.modifiedStream;
1394
- _this0._videoWindowDataSource["delete"](modifiedStream);
1395
- });
1396
- var hasScreenStream = events === null || events === void 0 ? void 0 : events.find(function (event) {
1397
- var videoType = event.modifiedStream.videoSourceType;
1398
- return videoType === _fcrCore.FcrVideoSourceType.SCREEN;
1399
- });
1400
- if (this.isMultiDisplayActive) {
1401
- // 在开启多屏模式下,屏幕共享流被移除时,保持布局不变
1402
- return;
1403
- }
1404
- if (hasScreenStream) {
1405
- if (this.manualLayout) {
1406
- this._videoWindowDataSource.setLayout(this.manualLayout);
1407
- } else {
1408
- this._videoWindowDataSource.setLayout(_type2.FcrUIVideoWindowLayoutType.Gallery);
1409
- }
1410
- }
1411
- }
1412
- }, {
1413
- key: "_onAudioVolumeUpdated",
1414
- value: function _onAudioVolumeUpdated(roomId, streamId, volume) {
1415
- this.userVolumeMap.set(streamId, Math.floor(volume / 255 * 100));
1416
- this._setSpotlightStream();
1417
- }
1418
- }, {
1419
- key: "_findSpotlightStream",
1420
- value: function _findSpotlightStream() {
1421
- var _this1 = this;
1422
- //find the max volume stream
1423
- var res = {
1424
- streamId: '',
1425
- volume: 0
1426
- };
1427
- this.userVolumeMap.forEach(function (volume, id) {
1428
- var _this1$interpreterUse;
1429
- var windowData = _this1.mainListMapByAudioStreamId.get(id);
1430
- if (id !== '0' && !res.streamId && volume > 45 && windowData !== null && windowData !== void 0 && windowData.hasMicrophoneAudioStream && windowData.videoSourceType !== _fcrCore.FcrVideoSourceType.SCREEN && !((_this1$interpreterUse = _this1.interpreterUserList) !== null && _this1$interpreterUse !== void 0 && _this1$interpreterUse.find(function (user) {
1431
- return user.userId === windowData.userId;
1432
- }))) {
1433
- res = {
1434
- streamId: windowData.windowId,
1435
- volume: volume
1436
- };
1437
- }
1438
- });
1439
- return res;
1440
- }
1441
- }]);
1442
- }();
1443
- _LayoutStore = LayoutStore;
1444
- var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_LayoutStore, [[_participantDecs, 17, "participant"], [_chatDecs, 17, "chat"], [_chatActionDecs, 17, "chatAction"], [_stateBarDecs, 17, "stateBar"], [_actionBarDecs, 17, "actionBar"], [_layersDecs, 17, "layers"], [_whiteboardDecs, 17, "whiteboard"], [_annotationDecs, 17, "annotation"], [_screenShareControlDecs, 17, "screenShareControl"], [_mobx.observable, 1, "collapsed"], [_mobx.observable, 1, "aside"], [_mobx.observable, 1, "barHovering"], [_mobx.observable, 1, "barLocked"], [_mobx.observable, 1, "barHidden"], [_mobx.observable, 1, "asideWidth"], [_mobx.observable, 1, "userVolumeMap"], [_mobx.observable, 1, "chatRoomState"], [_mobx.observable, 1, "whiteboardActive"], [_mobx.observable, 1, "ownerUser"], [_mobx.computed, 3, "isWaterMarkEnabled"], [_mobx.computed, 3, "isMulti"], [_mobx.computed, 3, "layout"], [_mobx.computed, 3, "manualLayout"], [_mobx.computed, 3, "scalcValue"], [_mobx.computed, 3, "sourceList"], [_mobx.computed, 3, "layoutMainList"], [_mobx.computed, 3, "mainList"], [_mobx.computed, 3, "mainListMapByAudioStreamId"], [_mobx.computed, 3, "spotlightStreamId"], [_mobx.computed, 3, "foldList"], [_mobx.computed, 3, "galleryList"], [_mobx.computed, 3, "isMainWindowInScreenSharing"], [_mobx.computed, 3, "isCurrentUserInBoardSharing"], [_mobx.computed, 3, "asideLayout"], [_mobx.computed, 3, "carouselList"], [_mobx.computed, 3, "hasPinnedStream"], [_mobx.computed, 3, "isRobot"], [_mobx.computed, 3, "findSpotlightUser"], [_mobx.computed, 3, "isWhoISpeakingActive"], [_mobx.computed, 3, "microphoneEnabled"], [_mobx.computed, 3, "galleryMaxSize"], [_mobx.computed, 3, "isVideoSuspended"], [_mobx.computed, 3, "asideContent"], [_mobx.computed, 3, "participantsRenderAt"], [_mobx.computed, 3, "chatRenderAt"], [_decorator.bound, 2, "getWaterMarkContent"], [_decorator.bound, 2, "hasMutePermission"], [_decorator.bound, 2, "hasUnmutePermission"], [_decorator.bound, 2, "hasRequestStartAudioPermission"], [_decorator.bound, 2, "toggleMainStream"], [_addPinMessageDecs, 18, "addPinMessage"], [_cancelPinMessageDecs, 18, "cancelPinMessage"], [_decorator.bound, 2, "addPin"], [_decorator.bound, 2, "removePin"], [_decorator.bound, 2, "setVideoOrientation"], [_decorator.bound, 2, "setAllowChat"], [_decorator.bound, 2, "handleSetPinState"], [_setWhiteboardActiveDecs, 18, "setWhiteboardActive"], [_setAsideWidthDecs, 18, "setAsideWidth"], [_updateSlotsDecs, 18, "updateSlots"], [_decorator.bound, 2, "closeParticipantFromAside"], [_decorator.bound, 2, "moveParticipantFromAsideToDialog"], [_decorator.bound, 2, "closeChatFromAside"], [_decorator.bound, 2, "closeAsideChat"], [_decorator.bound, 2, "moveChatFromAsideToDialog"], [_decorator.bound, 2, "openPrivateChat"], [_decorator.bound, 2, "openRenameDialog"], [_toggleLayoutDecs, 18, "toggleLayout"], [_toggleCollapsedDecs, 18, "toggleCollapsed"], [_toggleAsideDecs, 18, "toggleAside"], [_asideWidthChangedDecs, 18, "asideWidthChanged"], [_toggleLayoutBarLockDecs, 18, "toggleLayoutBarLock"], [_toggleLayoutBarHiddenDecs, 18, "toggleLayoutBarHidden"], [_resetLockTimerDecs, 18, "resetLockTimer"], [_setHoveringHandlerDecs, 18, "setHoveringHandler"], [_setHoveringLeaveHandlerDecs, 18, "setHoveringLeaveHandler"], [_setScreenShareSpeakerViewSizeDecs, 2, "setScreenShareSpeakerViewSize"], [_handleLiveLayoutChangeDecs, 18, "handleLiveLayoutChange"], [_onUserInfoUpdatedDecs, 18, "onUserInfoUpdated"], [_decorator.bound, 2, "stopLocalPreview"], [_decorator.bound, 2, "startLocalPreview"], [_decorator.bound, 2, "setAllowChatWithPayload"], [_decorator.bound, 2, "setScaleValue"], [_decorator.bound, 2, "muteAudio"], [_decorator.bound, 2, "sendParticipantEvent"], [_decorator.bound, 2, "onEvent"], [_decorator.bound, 2, "_addListeners"], [_mobx.computed, 3, "_hasVideoStreamUser"], [_handleFoldListChangedDecs, 18, "_handleFoldListChanged"], [_handleMainListLengthChangedDecs, 18, "_handleMainListLengthChanged"], [_handleMainListChangedDecs, 18, "_handleMainListChanged"], [_mobx.action, 2, "_switchToSpeaker"], [_mobx.action, 2, "_switchToGallery"], [_setBarHoveringDecs, 18, "_setBarHovering"], [_decorator.bound, 2, "_initStream"], [_handleConnectionUpdatedDecs, 18, "_handleConnectionUpdated"], [_findVideoWindowByUserIdDecs, 18, "_findVideoWindowByUserId"], [_onRemoteUsersLeftDecs, 18, "_onRemoteUsersLeft"], [_decorator.bound, 2, "_handleLiveStreamingStateUpdated"], [_decorator.bound, 2, "_handleStreamAdded"], [_decorator.bound, 2, "_onStreamsAdded"], [_decorator.bound, 2, "_onStreamsUpdated"], [_decorator.bound, 2, "_onStreamsRemoved"], [_onAudioVolumeUpdatedDecs, 18, "_onAudioVolumeUpdated"], [_handleLayoutUpdatedDecs, 16, "_handleLayoutUpdated"]], []).e, 21);
1445
- _init_participant = _applyDecs$e[0];
1446
- _init_chat = _applyDecs$e[1];
1447
- _init_chatAction = _applyDecs$e[2];
1448
- _init_stateBar = _applyDecs$e[3];
1449
- _init_actionBar = _applyDecs$e[4];
1450
- _init_layers = _applyDecs$e[5];
1451
- _init_whiteboard = _applyDecs$e[6];
1452
- _init_annotation = _applyDecs$e[7];
1453
- _init_screenShareControl = _applyDecs$e[8];
1454
- _init_collapsed = _applyDecs$e[9];
1455
- _init_aside = _applyDecs$e[10];
1456
- _init_barHovering = _applyDecs$e[11];
1457
- _init_barLocked = _applyDecs$e[12];
1458
- _init_barHidden = _applyDecs$e[13];
1459
- _init_asideWidth = _applyDecs$e[14];
1460
- _init_userVolumeMap = _applyDecs$e[15];
1461
- _init_chatRoomState = _applyDecs$e[16];
1462
- _init_whiteboardActive = _applyDecs$e[17];
1463
- _init_ownerUser = _applyDecs$e[18];
1464
- _init__handleLayoutUpdated = _applyDecs$e[19];
1465
- _initProto = _applyDecs$e[20];
1466
- var StoreContext = exports.StoreContext = /*#__PURE__*/(0, _react.createContext)(null);