fcr-ui-scene 3.7.7 → 3.7.8-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 (212) hide show
  1. package/installer/icons/icon.png +0 -0
  2. package/installer/mac/entitlements.mac.plist +5 -1
  3. package/lib/creator/provider-initializer.browser.js +2 -2
  4. package/lib/creator/provider-initializer.electron.js +2 -2
  5. package/lib/electron/bootstrap-sdk.js +70 -33
  6. package/lib/electron/hang-detection/index.d.ts +3 -0
  7. package/lib/electron/hang-detection/index.js +15 -0
  8. package/lib/electron/hang-detection/manager.d.ts +28 -0
  9. package/lib/electron/hang-detection/manager.js +231 -0
  10. package/lib/electron/hang-detection/types.d.ts +14 -0
  11. package/lib/electron/until.d.ts +1 -4
  12. package/lib/electron/until.js +9 -4
  13. package/lib/modules/action-bar/components/screen-share/index.electron.js +1 -1
  14. package/lib/modules/components/control-bar/components/switch-theme/index.js +4 -2
  15. package/lib/modules/components/control-bar/index.js +1 -3
  16. package/lib/modules/participant/store.base.js +0 -1
  17. package/lib/modules/share-screen/store.electron.js +9 -0
  18. package/lib/modules/state-bar/store.base.electron.js +6 -2
  19. package/lib/providers/board-share/bar-control/base.d.ts +2 -0
  20. package/lib/providers/board-share/bar-control/base.js +13 -3
  21. package/lib/providers/board-share/bar-control/electron.d.ts +1 -0
  22. package/lib/providers/board-share/bar-control/electron.js +15 -4
  23. package/lib/providers/board-share/provider.base.d.ts +1 -0
  24. package/lib/providers/board-share/provider.base.js +3 -1
  25. package/lib/providers/board-share/provider.electron.d.ts +1 -0
  26. package/lib/providers/board-share/provider.electron.js +8 -2
  27. package/lib/providers/board-share/type.d.ts +2 -0
  28. package/lib/providers/dialog/provider.electron.js +10 -2
  29. package/lib/providers/screen-share/strategy/browser.js +50 -3
  30. package/lib/providers/screen-share/strategy/electron.js +77 -8
  31. package/lib/providers/screen-share/stream-state-sync.d.ts +3 -1
  32. package/lib/providers/screen-share/stream-state-sync.js +133 -40
  33. package/package.json +5 -5
  34. package/lib/creator.d.ts +0 -36
  35. package/lib/creator.js +0 -465
  36. package/lib/modules/action-bar/index.d.ts +0 -58
  37. package/lib/modules/action-bar/index.dev.d.ts +0 -0
  38. package/lib/modules/action-bar/index.dev.js +0 -94
  39. package/lib/modules/action-bar/index.js +0 -109
  40. package/lib/modules/action-bar/store.d.ts +0 -259
  41. package/lib/modules/action-bar/store.js +0 -1529
  42. package/lib/modules/action-bar/types.d.ts +0 -90
  43. package/lib/modules/action-bar/view.d.ts +0 -5
  44. package/lib/modules/action-bar/view.js +0 -112
  45. package/lib/modules/annotation/annotation-index.d.ts +0 -2
  46. package/lib/modules/annotation/annotation-index.js +0 -80
  47. package/lib/modules/annotation/annotation-toolbar-store.d.ts +0 -75
  48. package/lib/modules/annotation/annotation-toolbar-store.js +0 -459
  49. package/lib/modules/annotation/board-cursor.css +0 -77
  50. package/lib/modules/annotation/components/color-picker/components/color.d.ts +0 -5
  51. package/lib/modules/annotation/components/color-picker/components/color.js +0 -38
  52. package/lib/modules/annotation/components/color-picker/components/panel.d.ts +0 -1
  53. package/lib/modules/annotation/components/color-picker/components/panel.js +0 -109
  54. package/lib/modules/annotation/components/color-picker/components/picker.d.ts +0 -1
  55. package/lib/modules/annotation/components/color-picker/components/picker.js +0 -75
  56. package/lib/modules/annotation/components/color-picker/index.d.ts +0 -2
  57. package/lib/modules/annotation/components/color-picker/index.js +0 -47
  58. package/lib/modules/annotation/components/eraser-picker.d.ts +0 -4
  59. package/lib/modules/annotation/components/eraser-picker.js +0 -144
  60. package/lib/modules/annotation/components/expansion/index.d.ts +0 -1
  61. package/lib/modules/annotation/components/expansion/index.js +0 -100
  62. package/lib/modules/annotation/components/extra-tool-picker.d.ts +0 -1
  63. package/lib/modules/annotation/components/extra-tool-picker.js +0 -62
  64. package/lib/modules/annotation/components/history.d.ts +0 -2
  65. package/lib/modules/annotation/components/history.js +0 -78
  66. package/lib/modules/annotation/components/icons/fold-icon.d.ts +0 -2
  67. package/lib/modules/annotation/components/icons/fold-icon.js +0 -41
  68. package/lib/modules/annotation/components/icons/move-icon.d.ts +0 -1
  69. package/lib/modules/annotation/components/icons/move-icon.js +0 -66
  70. package/lib/modules/annotation/components/item/index.d.ts +0 -1
  71. package/lib/modules/annotation/components/item/index.js +0 -43
  72. package/lib/modules/annotation/components/move-handle.d.ts +0 -5
  73. package/lib/modules/annotation/components/move-handle.js +0 -134
  74. package/lib/modules/annotation/components/pen-picker.d.ts +0 -4
  75. package/lib/modules/annotation/components/pen-picker.js +0 -155
  76. package/lib/modules/annotation/components/screen-capture-picker.d.ts +0 -4
  77. package/lib/modules/annotation/components/screen-capture-picker.js +0 -85
  78. package/lib/modules/annotation/components/shape-picker.d.ts +0 -4
  79. package/lib/modules/annotation/components/shape-picker.js +0 -210
  80. package/lib/modules/annotation/hooks/index.d.ts +0 -14
  81. package/lib/modules/annotation/hooks/index.js +0 -292
  82. package/lib/modules/annotation/index.d.ts +0 -45
  83. package/lib/modules/annotation/index.js +0 -168
  84. package/lib/modules/annotation/store.d.ts +0 -98
  85. package/lib/modules/annotation/store.js +0 -620
  86. package/lib/modules/annotation/style.css +0 -36
  87. package/lib/modules/annotation/view.d.ts +0 -3
  88. package/lib/modules/annotation/view.js +0 -44
  89. package/lib/modules/components/device-control/store.d.ts +0 -42
  90. package/lib/modules/components/device-control/store.js +0 -241
  91. package/lib/modules/components/leave-meeting/store.d.ts +0 -39
  92. package/lib/modules/components/leave-meeting/store.js +0 -270
  93. package/lib/modules/control-bar/components/annotation-button/index.d.ts +0 -1
  94. package/lib/modules/control-bar/components/annotation-button/index.js +0 -72
  95. package/lib/modules/control-bar/types.d.ts +0 -20
  96. package/lib/modules/control-bar/types.js +0 -6
  97. package/lib/modules/dialog/dialogs/pre-setting/index.css +0 -26
  98. package/lib/modules/dialog/dialogs/pre-setting/index.d.ts +0 -6
  99. package/lib/modules/dialog/dialogs/pre-setting/index.js +0 -62
  100. package/lib/modules/dialog/dialogs/widget/electron.d.ts +0 -6
  101. package/lib/modules/dialog/dialogs/widget/electron.js +0 -38
  102. package/lib/modules/dialog/hooks/use-popover-watcher.d.ts +0 -14
  103. package/lib/modules/dialog/hooks/use-popover-watcher.js +0 -110
  104. package/lib/modules/dialog/hooks/useElectron.d.ts +0 -28
  105. package/lib/modules/dialog/hooks/useElectron.js +0 -277
  106. package/lib/modules/dialog/store.d.ts +0 -135
  107. package/lib/modules/dialog/store.js +0 -616
  108. package/lib/modules/event-confirm/components/window/index.d.ts +0 -7
  109. package/lib/modules/event-confirm/components/window/index.js +0 -221
  110. package/lib/modules/event-confirm/index.css +0 -24
  111. package/lib/modules/event-confirm/index.d.ts +0 -27
  112. package/lib/modules/event-confirm/index.js +0 -76
  113. package/lib/modules/event-confirm/store.d.ts +0 -50
  114. package/lib/modules/event-confirm/store.js +0 -394
  115. package/lib/modules/event-confirm/view.d.ts +0 -2
  116. package/lib/modules/event-confirm/view.js +0 -55
  117. package/lib/modules/event-toast/store.d.ts +0 -27
  118. package/lib/modules/event-toast/store.js +0 -205
  119. package/lib/modules/layout/store.d.ts +0 -176
  120. package/lib/modules/layout/store.js +0 -1452
  121. package/lib/modules/participant/store.d.ts +0 -222
  122. package/lib/modules/participant/store.js +0 -1929
  123. package/lib/modules/pc-audio-connect/index.d.ts +0 -22
  124. package/lib/modules/pc-audio-connect/index.js +0 -67
  125. package/lib/modules/pc-audio-connect/store.d.ts +0 -46
  126. package/lib/modules/pc-audio-connect/store.js +0 -304
  127. package/lib/modules/setting/common/advance-link.d.ts +0 -3
  128. package/lib/modules/setting/common/advance-link.js +0 -27
  129. package/lib/modules/setting/common/index.css +0 -26
  130. package/lib/modules/setting/common/useNamespace.d.ts +0 -15
  131. package/lib/modules/setting/common/useNamespace.js +0 -66
  132. package/lib/modules/setting/dialog-wrapper.d.ts +0 -2
  133. package/lib/modules/setting/dialog-wrapper.js +0 -110
  134. package/lib/modules/setting/store.d.ts +0 -261
  135. package/lib/modules/setting/store.js +0 -1321
  136. package/lib/modules/share-screen/store.d.ts +0 -148
  137. package/lib/modules/share-screen/store.js +0 -960
  138. package/lib/modules/share-screen/types.d.ts +0 -26
  139. package/lib/modules/share-screen/types.js +0 -6
  140. package/lib/modules/state-bar/store.d.ts +0 -124
  141. package/lib/modules/state-bar/store.js +0 -664
  142. package/lib/modules/whiteboard/components/progress/electron.d.ts +0 -1
  143. package/lib/modules/whiteboard/components/progress/electron.js +0 -33
  144. package/lib/modules/widget/store.d.ts +0 -14
  145. package/lib/modules/widget/store.js +0 -28
  146. package/lib/providers/annotation-provider.d.ts +0 -124
  147. package/lib/providers/annotation-provider.js +0 -369
  148. package/lib/providers/dialog-provider.d.ts +0 -137
  149. package/lib/providers/dialog-provider.js +0 -194
  150. package/lib/providers/message-provider.d.ts +0 -69
  151. package/lib/providers/message-provider.js +0 -140
  152. package/lib/providers/room-provider.d.ts +0 -194
  153. package/lib/providers/room-provider.js +0 -916
  154. package/lib/providers/screen-share-provider.d.ts +0 -245
  155. package/lib/providers/screen-share-provider.js +0 -850
  156. package/lib/providers/sharing-provider.d.ts +0 -42
  157. package/lib/providers/sharing-provider.js +0 -228
  158. package/lib/providers/user-setting-storage-provider.d.ts +0 -21
  159. package/lib/providers/user-setting-storage-provider.js +0 -65
  160. package/lib/providers/whiteboard-provider.d.ts +0 -24
  161. package/lib/providers/whiteboard-provider.js +0 -128
  162. package/lib/shared-data-source/annotation-data.d.ts +0 -17
  163. package/lib/shared-data-source/annotation-data.js +0 -110
  164. package/lib/shared-data-source/app-list-data.d.ts +0 -34
  165. package/lib/shared-data-source/app-list-data.js +0 -133
  166. package/lib/shared-data-source/chat-data.d.ts +0 -25
  167. package/lib/shared-data-source/chat-data.js +0 -139
  168. package/lib/shared-data-source/config.d.ts +0 -35
  169. package/lib/shared-data-source/config.js +0 -40
  170. package/lib/shared-data-source/confirm-data.d.ts +0 -44
  171. package/lib/shared-data-source/confirm-data.js +0 -201
  172. package/lib/shared-data-source/device-privilege-data.d.ts +0 -8
  173. package/lib/shared-data-source/device-privilege-data.js +0 -25
  174. package/lib/shared-data-source/interpreter.d.ts +0 -77
  175. package/lib/shared-data-source/interpreter.js +0 -247
  176. package/lib/shared-data-source/layout-data.d.ts +0 -31
  177. package/lib/shared-data-source/layout-data.js +0 -189
  178. package/lib/shared-data-source/meeting-time.d.ts +0 -90
  179. package/lib/shared-data-source/meeting-time.js +0 -416
  180. package/lib/shared-data-source/member-data.d.ts +0 -139
  181. package/lib/shared-data-source/member-data.js +0 -517
  182. package/lib/shared-data-source/pin-data.d.ts +0 -13
  183. package/lib/shared-data-source/pin-data.js +0 -111
  184. package/lib/shared-data-source/screen-share-data.d.ts +0 -357
  185. package/lib/shared-data-source/screen-share-data.js +0 -513
  186. package/lib/shared-data-source/security-data.d.ts +0 -39
  187. package/lib/shared-data-source/security-data.js +0 -156
  188. package/lib/shared-data-source/setting.d.ts +0 -67
  189. package/lib/shared-data-source/setting.js +0 -220
  190. package/lib/shared-data-source/speaker-spotlight.d.ts +0 -5
  191. package/lib/shared-data-source/speaker-spotlight.js +0 -15
  192. package/lib/shared-data-source/video-window.d.ts +0 -165
  193. package/lib/shared-data-source/video-window.js +0 -1266
  194. package/lib/shared-data-source/waiting-room.d.ts +0 -46
  195. package/lib/shared-data-source/waiting-room.js +0 -222
  196. package/lib/shared-data-source/whiteboard-data.d.ts +0 -70
  197. package/lib/shared-data-source/whiteboard-data.js +0 -348
  198. package/lib/utilities/board-context.d.ts +0 -4
  199. package/lib/utilities/board-context.js +0 -12
  200. package/lib/utilities/copyText.d.ts +0 -2
  201. package/lib/utilities/copyText.js +0 -48
  202. package/lib/utilities/renderer-event.d.ts +0 -10
  203. package/lib/utilities/renderer-event.js +0 -95
  204. package/lib/utilities/screen-capture-permission.d.ts +0 -2
  205. package/lib/utilities/screen-capture-permission.js +0 -24
  206. package/lib/utilities/screen.d.ts +0 -3
  207. package/lib/utilities/screen.js +0 -53
  208. package/lib/utilities/video-track-render-context.d.ts +0 -6
  209. package/lib/utilities/video-track-render-context.js +0 -9
  210. package/lib/waiting-room-control-manager.d.ts +0 -28
  211. package/lib/waiting-room-control-manager.js +0 -230
  212. /package/lib/{modules/action-bar → electron/hang-detection}/types.js +0 -0
@@ -1,1452 +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 _this5.barLocked;
1188
- }, function (barLocked) {
1189
- if (_this5._barLockTimer && barLocked) {
1190
- _this5.resetLockTimer();
1191
- } else {
1192
- _this5.setHoveringHandler();
1193
- }
1194
- }), (0, _mobx.reaction)(function () {
1195
- return _this5._deviceProvider.microphoneVolumeLevel;
1196
- }, function (volume) {
1197
- (0, _mobx.runInAction)(function () {
1198
- _this5.userVolumeMap.set('0', volume);
1199
- });
1200
- }), (0, _mobx.reaction)(function () {
1201
- return {
1202
- enableSpotlight: _this5.enableSpotlight
1203
- };
1204
- }, function (_ref6) {
1205
- var enableSpotlight = _ref6.enableSpotlight;
1206
- _this5._videoWindowDataSource.setSpotlightEnabled(enableSpotlight);
1207
- }),
1208
- // 录制的特殊逻辑:
1209
- // 因为录制机器人不发流,且当前切换布局的逻辑是有多个人的视频窗口才切换到 speaker layout
1210
- // 所以当房间只有主持人的时候录制机器人的视角不会切换到 speaker layout,故加上以下逻辑
1211
- (0, _mobx.reaction)(function () {
1212
- var _this5$currentShareDa;
1213
- return (_this5$currentShareDa = _this5.currentShareData) === null || _this5$currentShareDa === void 0 ? void 0 : _this5$currentShareDa.hasScreenSharing;
1214
- }, function (hasScreenSharing) {
1215
- if (_this5.isRobot) {
1216
- if (hasScreenSharing) {
1217
- _this5.logger.info('set layout to speaker for robot');
1218
- _this5.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Speaker);
1219
- } else {
1220
- _this5.logger.info('set layout to gallery for robot');
1221
- _this5.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Gallery);
1222
- }
1223
- }
1224
- }, {
1225
- fireImmediately: true
1226
- }), (0, _mobx.reaction)(function () {
1227
- return _this5._videoWindowDataSource.mainList.filter(_this5._shouldUnpin.bind(_this5));
1228
- }, function (list) {
1229
- list.forEach(function (item) {
1230
- if (_this5._videoWindowDataSource.shouldHideNonVideoParticipants) {
1231
- _this5._pinDataSource.removePin(item.windowId, (0, _i18n.transI18n)('fmt_internalsetting_other_hide_no_video_pin_cancelled'));
1232
- }
1233
- });
1234
- }));
1235
- }
1236
- }, {
1237
- key: "_hasVideoStreamUser",
1238
- get: function get() {
1239
- return this.sourceList.some(function (i) {
1240
- return i.hasVideoStream;
1241
- });
1242
- }
1243
- }, {
1244
- key: "_shouldUnpin",
1245
- value: function _shouldUnpin(item) {
1246
- return !this._isVideoParticipantVisible(item) && item.isPin;
1247
- }
1248
- }, {
1249
- key: "_isVideoParticipantVisible",
1250
- value: function _isVideoParticipantVisible(item) {
1251
- return item.isMySelf && !this._hasVideoStreamUser || item.hasVideoStream || item.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN || item.type === _type2.FcrUIWindowType.BOARD;
1252
- }
1253
- }, {
1254
- key: "_handleFoldListChanged",
1255
- value: function _handleFoldListChanged() {
1256
- this._eventProvider.sendEvent(_constant.FcrUIAction.FOLD_LIST_CHANGED, this.foldList);
1257
- }
1258
- }, {
1259
- key: "_handleMainListLengthChanged",
1260
- value: function _handleMainListLengthChanged() {
1261
- this._eventProvider.sendEvent(_constant.FcrUIAction.MAIN_LIST_LENGTH_CHANGED, this.mainList.length);
1262
- }
1263
- }, {
1264
- key: "_handleMainListChanged",
1265
- value: function _handleMainListChanged() {
1266
- this._eventProvider.sendEvent(_constant.FcrUIAction.MAIN_LIST_CHANGED, this.mainList);
1267
- }
1268
- }, {
1269
- key: "_switchToSpeaker",
1270
- value: function _switchToSpeaker() {
1271
- this.collapsed = false;
1272
- }
1273
- }, {
1274
- key: "_switchToGallery",
1275
- value: function _switchToGallery() {
1276
- this.collapsed = true;
1277
- }
1278
- }, {
1279
- key: "_setBarHovering",
1280
- value: function _setBarHovering(state) {
1281
- this.barHovering = state;
1282
- }
1283
- }, {
1284
- key: "_initStream",
1285
- value: function _initStream() {
1286
- var _this6 = this;
1287
- var isSharingScreen = false;
1288
- this._streamControl.getStreamList().forEach(function (stream) {
1289
- if (stream.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN) {
1290
- isSharingScreen = true;
1291
- }
1292
- _this6._handleStreamAdded(stream);
1293
- });
1294
- if (isSharingScreen && this.layout === _type2.FcrUIVideoWindowLayoutType.Gallery) {
1295
- this.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Speaker);
1296
- }
1297
- }
1298
- }, {
1299
- key: "_handleConnectionUpdated",
1300
- value: function _handleConnectionUpdated(_, state) {
1301
- this.logger.info('layout store handleConnectionUpdated', state);
1302
- this.chatRoomState = state;
1303
- }
1304
- }, {
1305
- key: "_findVideoWindowByUserId",
1306
- value: function _findVideoWindowByUserId(userId) {
1307
- return this.mainList.find(function (item) {
1308
- return item.userId === userId;
1309
- });
1310
- }
1311
- }, {
1312
- key: "_onRemoteUsersLeft",
1313
- value: function _onRemoteUsersLeft(roomId, events) {
1314
- var _this7 = this;
1315
- events.forEach(function (event) {
1316
- var userInfo = event.userInfo;
1317
- var videoWindowData = _this7._findVideoWindowByUserId(userInfo.userId);
1318
- if (videoWindowData) {
1319
- var stream = videoWindowData.getVideoStream();
1320
- if (stream) {
1321
- _this7._videoWindowDataSource["delete"](stream);
1322
- }
1323
- }
1324
- });
1325
- }
1326
- }, {
1327
- key: "_handleLiveStreamingStateUpdated",
1328
- value: function _handleLiveStreamingStateUpdated(_, state, url, reason) {
1329
- this._liveStreamState = state;
1330
- if (state === _type.FcrLiveStreamingState.STOPPED && reason === _type5.FcrLiveStreamingStateUpdatedReason.HOSTCHANGED) {
1331
- this._eventProvider.showToast({
1332
- type: 'info',
1333
- message: (0, _i18n.transI18n)('fmt_broadcast_livestream_tips_hand_over_pc_to_mobile')
1334
- });
1335
- }
1336
- }
1337
- }, {
1338
- key: "_handleStreamAdded",
1339
- value: function _handleStreamAdded(modifiedStream) {
1340
- this._videoWindowDataSource.add(modifiedStream, modifiedStream.owner.userId === this.localUserId);
1341
- if (this.isMultiDisplayActive) {
1342
- // 在开启多屏模式下,屏幕共享流添加时,保持布局不变
1343
- return;
1344
- }
1345
- if (modifiedStream.videoSourceType === _fcrCore.FcrVideoSourceType.SCREEN) {
1346
- var isSharingScreenOwner = modifiedStream.owner.userId === this.localUserId;
1347
- if (this.layout === _type2.FcrUIVideoWindowLayoutType.Gallery) {
1348
- // 在非 Electron 环境或者 Electron 环境下非屏幕共享拥有者时,切换到 Speaker 布局
1349
- var shouldToggleToSpeaker = !(0, _env.isElectron)() || !isSharingScreenOwner;
1350
- if (shouldToggleToSpeaker) {
1351
- this.toggleLayout(_type2.FcrUIVideoWindowLayoutType.Speaker);
1352
- }
1353
- }
1354
- }
1355
- }
1356
- }, {
1357
- key: "_onStreamsAdded",
1358
- value: function _onStreamsAdded(roomId, events) {
1359
- var _this8 = this;
1360
- events.forEach(function (_ref7) {
1361
- var modifiedStream = _ref7.modifiedStream;
1362
- _this8._handleStreamAdded(modifiedStream);
1363
- });
1364
- }
1365
- }, {
1366
- key: "_onStreamsUpdated",
1367
- value: function _onStreamsUpdated(roomId, events) {
1368
- var _this9 = this;
1369
- events.forEach(function (_ref8) {
1370
- var modifiedStream = _ref8.modifiedStream;
1371
- _this9._videoWindowDataSource.update(modifiedStream);
1372
- });
1373
- }
1374
- }, {
1375
- key: "_onStreamsRemoved",
1376
- value: function _onStreamsRemoved(roomId, events) {
1377
- var _this0 = this;
1378
- events.forEach(function (_ref9) {
1379
- var modifiedStream = _ref9.modifiedStream;
1380
- _this0._videoWindowDataSource["delete"](modifiedStream);
1381
- });
1382
- var hasScreenStream = events === null || events === void 0 ? void 0 : events.find(function (event) {
1383
- var videoType = event.modifiedStream.videoSourceType;
1384
- return videoType === _fcrCore.FcrVideoSourceType.SCREEN;
1385
- });
1386
- if (this.isMultiDisplayActive) {
1387
- // 在开启多屏模式下,屏幕共享流被移除时,保持布局不变
1388
- return;
1389
- }
1390
- if (hasScreenStream) {
1391
- if (this.manualLayout) {
1392
- this._videoWindowDataSource.setLayout(this.manualLayout);
1393
- } else {
1394
- this._videoWindowDataSource.setLayout(_type2.FcrUIVideoWindowLayoutType.Gallery);
1395
- }
1396
- }
1397
- }
1398
- }, {
1399
- key: "_onAudioVolumeUpdated",
1400
- value: function _onAudioVolumeUpdated(roomId, streamId, volume) {
1401
- this.userVolumeMap.set(streamId, Math.floor(volume / 255 * 100));
1402
- this._setSpotlightStream();
1403
- }
1404
- }, {
1405
- key: "_findSpotlightStream",
1406
- value: function _findSpotlightStream() {
1407
- var _this1 = this;
1408
- //find the max volume stream
1409
- var res = {
1410
- streamId: '',
1411
- volume: 0
1412
- };
1413
- this.userVolumeMap.forEach(function (volume, id) {
1414
- var _this1$interpreterUse;
1415
- var windowData = _this1.mainListMapByAudioStreamId.get(id);
1416
- 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) {
1417
- return user.userId === windowData.userId;
1418
- }))) {
1419
- res = {
1420
- streamId: windowData.windowId,
1421
- volume: volume
1422
- };
1423
- }
1424
- });
1425
- return res;
1426
- }
1427
- }]);
1428
- }();
1429
- _LayoutStore = LayoutStore;
1430
- 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);
1431
- _init_participant = _applyDecs$e[0];
1432
- _init_chat = _applyDecs$e[1];
1433
- _init_chatAction = _applyDecs$e[2];
1434
- _init_stateBar = _applyDecs$e[3];
1435
- _init_actionBar = _applyDecs$e[4];
1436
- _init_layers = _applyDecs$e[5];
1437
- _init_whiteboard = _applyDecs$e[6];
1438
- _init_annotation = _applyDecs$e[7];
1439
- _init_screenShareControl = _applyDecs$e[8];
1440
- _init_collapsed = _applyDecs$e[9];
1441
- _init_aside = _applyDecs$e[10];
1442
- _init_barHovering = _applyDecs$e[11];
1443
- _init_barLocked = _applyDecs$e[12];
1444
- _init_barHidden = _applyDecs$e[13];
1445
- _init_asideWidth = _applyDecs$e[14];
1446
- _init_userVolumeMap = _applyDecs$e[15];
1447
- _init_chatRoomState = _applyDecs$e[16];
1448
- _init_whiteboardActive = _applyDecs$e[17];
1449
- _init_ownerUser = _applyDecs$e[18];
1450
- _init__handleLayoutUpdated = _applyDecs$e[19];
1451
- _initProto = _applyDecs$e[20];
1452
- var StoreContext = exports.StoreContext = /*#__PURE__*/(0, _react.createContext)(null);