fcr-core 3.10.2 → 3.10.5

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 (127) hide show
  1. package/lib/engine/index.js +102 -108
  2. package/lib/imports.js +1 -0
  3. package/lib/media-control/desktop.js +22 -13
  4. package/lib/media-control/mobile.js +27 -19
  5. package/lib/media-control/type.d.ts +3 -3
  6. package/lib/monitor-control/index.js +17 -7
  7. package/lib/peer-session/index.js +120 -121
  8. package/lib/plugins/chat/chatroom.js +119 -96
  9. package/lib/plugins/chat/connector.js +69 -48
  10. package/lib/remote-control/index.js +194 -216
  11. package/lib/room-control/ability-control/index.js +20 -10
  12. package/lib/room-control/application-control/index.js +82 -75
  13. package/lib/room-control/group-control/index.js +31 -30
  14. package/lib/room-control/helpers/board-init-info-helper.js +16 -10
  15. package/lib/room-control/helpers/validation-helper.js +1 -1
  16. package/lib/room-control/index.js +70 -51
  17. package/lib/room-control/infinity-room-control/index.js +27 -19
  18. package/lib/room-control/interpreter-control/index.js +77 -65
  19. package/lib/room-control/interpreter-control/room.js +6 -4
  20. package/lib/room-control/join-before-host-waitingroom-control/index.js +6 -4
  21. package/lib/room-control/mainroom-control/index.js +37 -25
  22. package/lib/room-control/privilege-control/helper.js +28 -13
  23. package/lib/room-control/privilege-control/index.js +36 -28
  24. package/lib/room-control/room-connector-control/index.js +52 -49
  25. package/lib/room-control/room-connector-control/type.d.ts +1 -1
  26. package/lib/room-control/room-control-factory.js +10 -12
  27. package/lib/room-control/room-session/index.js +77 -74
  28. package/lib/room-control/shared-cache.js +63 -56
  29. package/lib/room-control/sharing-control/index.js +65 -57
  30. package/lib/room-control/stream-control/index.js +197 -193
  31. package/lib/room-control/stt-control/de-compress-gzip.js +10 -0
  32. package/lib/room-control/stt-control/index.js +93 -86
  33. package/lib/room-control/user-control/index.js +162 -155
  34. package/lib/room-control/waitingroom-control/index.js +18 -9
  35. package/lib/room-control/whiteboard-control/utils.js +4 -2
  36. package/lib/room-control/whiteboard-control-v1/board-subwindow.js +2 -1
  37. package/lib/room-control/whiteboard-control-v1/board-window.js +120 -103
  38. package/lib/room-control/whiteboard-control-v1/factory.js +7 -4
  39. package/lib/room-control/whiteboard-control-v1/index.js +80 -67
  40. package/lib/room-control/whiteboard-control-v1/mount-manager.js +4 -2
  41. package/lib/room-control/whiteboard-control-v1/utils.js +17 -14
  42. package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +14 -10
  43. package/lib/room-control/whiteboard-control-v2/annotation-control/factory.js +17 -8
  44. package/lib/room-control/whiteboard-control-v2/base/index.js +61 -53
  45. package/lib/room-control/whiteboard-control-v2/base/main-window.js +39 -30
  46. package/lib/room-control/whiteboard-control-v2/utils.js +10 -10
  47. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +45 -33
  48. package/lib/room-control/whiteboard-control-v2/whiteboard-control/factory.js +27 -11
  49. package/lib/room-control/widget-control/index.js +43 -33
  50. package/lib/room-router/index.js +66 -58
  51. package/lib/schema.d.ts +15 -15
  52. package/lib/service/api.js +446 -548
  53. package/lib/struct.js +5 -2
  54. package/lib/utilities/abortable-retry.js +3 -0
  55. package/lib/utilities/collection.js +15 -11
  56. package/lib/utilities/error-helpers.js +34 -27
  57. package/lib/utilities/error.js +4 -3
  58. package/lib/utilities/join-helper.js +37 -31
  59. package/lib/utilities/logger.js +8 -5
  60. package/lib/utilities/parameters.js +21 -10
  61. package/lib/utilities/retry-helpers.js +1 -0
  62. package/lib/utilities/stream.js +16 -11
  63. package/lib/utilities/user.js +4 -3
  64. package/lib/utilities/validate-params.js +1 -1
  65. package/lib/utilities/video-encoder-config.js +10 -5
  66. package/lib-es/engine/index.js +102 -108
  67. package/lib-es/media-control/desktop.js +22 -13
  68. package/lib-es/media-control/mobile.js +27 -19
  69. package/lib-es/monitor-control/index.js +16 -7
  70. package/lib-es/peer-session/index.js +120 -121
  71. package/lib-es/plugins/chat/chatroom.js +118 -95
  72. package/lib-es/plugins/chat/connector.js +67 -47
  73. package/lib-es/remote-control/index.js +194 -216
  74. package/lib-es/room-control/ability-control/index.js +19 -10
  75. package/lib-es/room-control/application-control/index.js +81 -75
  76. package/lib-es/room-control/group-control/index.js +31 -30
  77. package/lib-es/room-control/helpers/board-init-info-helper.js +15 -10
  78. package/lib-es/room-control/helpers/validation-helper.js +1 -1
  79. package/lib-es/room-control/index.js +69 -51
  80. package/lib-es/room-control/infinity-room-control/index.js +26 -19
  81. package/lib-es/room-control/interpreter-control/index.js +77 -65
  82. package/lib-es/room-control/interpreter-control/room.js +5 -4
  83. package/lib-es/room-control/join-before-host-waitingroom-control/index.js +5 -4
  84. package/lib-es/room-control/mainroom-control/index.js +37 -25
  85. package/lib-es/room-control/privilege-control/helper.js +27 -13
  86. package/lib-es/room-control/privilege-control/index.js +36 -28
  87. package/lib-es/room-control/room-connector-control/index.js +52 -49
  88. package/lib-es/room-control/room-control-factory.js +10 -12
  89. package/lib-es/room-control/room-session/index.js +77 -74
  90. package/lib-es/room-control/shared-cache.js +62 -56
  91. package/lib-es/room-control/sharing-control/index.js +64 -57
  92. package/lib-es/room-control/stream-control/index.js +197 -193
  93. package/lib-es/room-control/stt-control/de-compress-gzip.js +10 -0
  94. package/lib-es/room-control/stt-control/index.js +93 -86
  95. package/lib-es/room-control/user-control/index.js +162 -155
  96. package/lib-es/room-control/waitingroom-control/index.js +18 -9
  97. package/lib-es/room-control/whiteboard-control/utils.js +4 -2
  98. package/lib-es/room-control/whiteboard-control-v1/board-subwindow.js +2 -1
  99. package/lib-es/room-control/whiteboard-control-v1/board-window.js +120 -103
  100. package/lib-es/room-control/whiteboard-control-v1/factory.js +6 -4
  101. package/lib-es/room-control/whiteboard-control-v1/index.js +80 -67
  102. package/lib-es/room-control/whiteboard-control-v1/mount-manager.js +3 -2
  103. package/lib-es/room-control/whiteboard-control-v1/utils.js +17 -14
  104. package/lib-es/room-control/whiteboard-control-v2/annotation-control/control.js +13 -10
  105. package/lib-es/room-control/whiteboard-control-v2/annotation-control/factory.js +16 -8
  106. package/lib-es/room-control/whiteboard-control-v2/base/index.js +60 -53
  107. package/lib-es/room-control/whiteboard-control-v2/base/main-window.js +39 -30
  108. package/lib-es/room-control/whiteboard-control-v2/utils.js +10 -10
  109. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/control.js +45 -33
  110. package/lib-es/room-control/whiteboard-control-v2/whiteboard-control/factory.js +26 -11
  111. package/lib-es/room-control/widget-control/index.js +42 -33
  112. package/lib-es/room-router/index.js +66 -58
  113. package/lib-es/service/api.js +445 -548
  114. package/lib-es/struct.js +4 -2
  115. package/lib-es/utilities/abortable-retry.js +3 -0
  116. package/lib-es/utilities/collection.js +14 -11
  117. package/lib-es/utilities/error-helpers.js +33 -26
  118. package/lib-es/utilities/error.js +4 -3
  119. package/lib-es/utilities/join-helper.js +36 -29
  120. package/lib-es/utilities/logger.js +7 -5
  121. package/lib-es/utilities/parameters.js +21 -10
  122. package/lib-es/utilities/retry-helpers.js +1 -0
  123. package/lib-es/utilities/stream.js +15 -11
  124. package/lib-es/utilities/user.js +4 -3
  125. package/lib-es/utilities/validate-params.js +1 -1
  126. package/lib-es/utilities/video-encoder-config.js +10 -5
  127. package/package.json +4 -4
@@ -1,5 +1,7 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.symbol.description.js");
4
+ require("core-js/modules/es.error.cause.js");
3
5
  require("core-js/modules/es.array.push.js");
4
6
  require("core-js/modules/esnext.function.metadata.js");
5
7
  require("core-js/modules/esnext.map.delete-all.js");
@@ -17,6 +19,8 @@ require("core-js/modules/esnext.map.reduce.js");
17
19
  require("core-js/modules/esnext.map.some.js");
18
20
  require("core-js/modules/esnext.map.update.js");
19
21
  require("core-js/modules/esnext.symbol.metadata.js");
22
+ require("core-js/modules/web.dom-collections.iterator.js");
23
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
20
24
  Object.defineProperty(exports, "__esModule", {
21
25
  value: true
22
26
  });
@@ -25,6 +29,8 @@ require("core-js/modules/esnext.iterator.constructor.js");
25
29
  require("core-js/modules/esnext.iterator.find.js");
26
30
  require("core-js/modules/esnext.iterator.for-each.js");
27
31
  require("core-js/modules/esnext.iterator.some.js");
32
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
33
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
28
34
  var _type = require("./type");
29
35
  var _type2 = require("../../type");
30
36
  var _imports = require("../../imports");
@@ -37,38 +43,15 @@ var _type4 = require("../whiteboard-control/type");
37
43
  var _sceneProperties = require("../../utilities/scene-properties");
38
44
  var _parameters = require("../../utilities/parameters");
39
45
  var _sharedStorage = require("../../utilities/shared-storage");
40
- let _initProto, _startScreenSharingDecs, _updateScreenSharingDecs;
46
+ var _FcrSharingControlImpl;
47
+ let _initProto, _startScreenSharingDecs, _updateScreenSharingDecs, _ref;
41
48
  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 (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 (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (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 (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)]; } }; }
42
49
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
43
50
  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); }
44
51
  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; }
45
52
  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; }
53
+ _ref = (_startScreenSharingDecs = (0, _imports.trace)(['config', 'size', 'labels']), _updateScreenSharingDecs = (0, _imports.trace)(['enableAnnotation']), "logger");
46
54
  class FcrSharingControlImpl {
47
- static {
48
- [_initProto] = _applyDecs(this, [[_startScreenSharingDecs, 2, "startScreenSharing"], [_imports.trace, 2, "startWhiteboard"], [_updateScreenSharingDecs, 2, "updateScreenSharing"], [_imports.trace, 2, "stop"], [_imports.trace, 2, "getScreenSharingState"]], []).e;
49
- }
50
- [(_startScreenSharingDecs = (0, _imports.trace)(['config', 'size', 'labels']), _updateScreenSharingDecs = (0, _imports.trace)(['enableAnnotation']), "logger")] = (_initProto(this), (0, _logger.createLogger)({
51
- prefix: 'FcrSharingControlImpl'
52
- }));
53
- _observable = new _imports.AgoraObservable();
54
- _isActive = false;
55
- _shareOwnerId = '';
56
- _shareOwnerStream = null;
57
- _lastScreenSharingState = _type.FcrScreenSharingState.END;
58
- _lastScreenSharingStreamId = null;
59
- _streamObserver = {
60
- onStreamsAdded: this._handleOnStreamsAdded.bind(this),
61
- onStreamsRemoved: this._handleOnStreamsRemoved.bind(this)
62
- };
63
- _sceneObserver = {
64
- onScenePropertiesUpdated: this._handleOnScenePropertiesUpdated.bind(this)
65
- };
66
-
67
- // TODO: 这里不应该再维护一套白板的状态和事件了, ui-scene 应该直接用 board control 的
68
- _whiteboardObserver = {
69
- onActive: this._handleOnWhiteboardActive.bind(this),
70
- onInactive: this._handleOnWhiteboardInActive.bind(this)
71
- };
72
55
  get ownerId() {
73
56
  return this._shareOwnerId;
74
57
  }
@@ -76,6 +59,27 @@ class FcrSharingControlImpl {
76
59
  return this._shareOwnerStream;
77
60
  }
78
61
  constructor(_scene, _api, _engine, _config, _privilegeControl, _streamControl, _sharedCache, _userControl) {
62
+ (0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
63
+ prefix: 'FcrSharingControlImpl'
64
+ })));
65
+ (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
66
+ (0, _defineProperty2.default)(this, "_isActive", false);
67
+ (0, _defineProperty2.default)(this, "_shareOwnerId", '');
68
+ (0, _defineProperty2.default)(this, "_shareOwnerStream", null);
69
+ (0, _defineProperty2.default)(this, "_lastScreenSharingState", _type.FcrScreenSharingState.END);
70
+ (0, _defineProperty2.default)(this, "_lastScreenSharingStreamId", null);
71
+ (0, _defineProperty2.default)(this, "_streamObserver", {
72
+ onStreamsAdded: this._handleOnStreamsAdded.bind(this),
73
+ onStreamsRemoved: this._handleOnStreamsRemoved.bind(this)
74
+ });
75
+ (0, _defineProperty2.default)(this, "_sceneObserver", {
76
+ onScenePropertiesUpdated: this._handleOnScenePropertiesUpdated.bind(this)
77
+ });
78
+ // TODO: 这里不应该再维护一套白板的状态和事件了, ui-scene 应该直接用 board control 的
79
+ (0, _defineProperty2.default)(this, "_whiteboardObserver", {
80
+ onActive: this._handleOnWhiteboardActive.bind(this),
81
+ onInactive: this._handleOnWhiteboardInActive.bind(this)
82
+ });
79
83
  this._scene = _scene;
80
84
  this._api = _api;
81
85
  this._engine = _engine;
@@ -97,7 +101,7 @@ class FcrSharingControlImpl {
97
101
  this.logger.info('set board ip list to storage ', boardIpList);
98
102
  (0, _sharedStorage.setBoardIpList)(boardIpList);
99
103
  }
100
- this.logger.info(`initialized, room id: ${this._scene.sceneId}`);
104
+ this.logger.info("initialized, room id: ".concat(this._scene.sceneId));
101
105
  }
102
106
  async startScreenSharing(config, size, labels) {
103
107
  try {
@@ -159,10 +163,9 @@ class FcrSharingControlImpl {
159
163
  }
160
164
  getAnnotationControl() {
161
165
  if (!this._annotationControl) {
162
- const {
163
- userId,
164
- userName
165
- } = this._userControl.getLocalUser();
166
+ const _this$_userControl$ge = this._userControl.getLocalUser(),
167
+ userId = _this$_userControl$ge.userId,
168
+ userName = _this$_userControl$ge.userName;
166
169
  const annotationConfig = {
167
170
  userId,
168
171
  userName,
@@ -179,15 +182,17 @@ class FcrSharingControlImpl {
179
182
  this._engine._rtmClient._client, annotationConfig, {
180
183
  sceneId: this._scene.sceneId,
181
184
  getAnnotationState: () => {
182
- return this._scene.getScenePropertiesByKeyPath('widgets.annotation.state') ?? _type4.FcrBoardPropertiesState.INACTIVE;
185
+ var _this$_scene$getScene;
186
+ return (_this$_scene$getScene = this._scene.getScenePropertiesByKeyPath('widgets.annotation.state')) !== null && _this$_scene$getScene !== void 0 ? _this$_scene$getScene : _type4.FcrBoardPropertiesState.INACTIVE;
183
187
  },
184
188
  getBoardPerformance: () => (0, _sceneProperties.getBoardPerformance)(this._scene),
185
189
  isAndroidByOwner: () => {
186
- const sharingOwner = this._streamControl.getStreamList().find(stream => stream.videoSourceType === _.FcrVideoSourceType.SCREEN)?.owner;
190
+ var _this$_streamControl$, _this$_userControl$ge2;
191
+ const sharingOwner = (_this$_streamControl$ = this._streamControl.getStreamList().find(stream => stream.videoSourceType === _.FcrVideoSourceType.SCREEN)) === null || _this$_streamControl$ === void 0 ? void 0 : _this$_streamControl$.owner;
187
192
  if (!sharingOwner) {
188
193
  return false;
189
194
  }
190
- return this._userControl.getUser(sharingOwner.userId)?.platform === _type2.FcrPlatform.ANDROID;
195
+ return ((_this$_userControl$ge2 = this._userControl.getUser(sharingOwner.userId)) === null || _this$_userControl$ge2 === void 0 ? void 0 : _this$_userControl$ge2.platform) === _type2.FcrPlatform.ANDROID;
191
196
  }
192
197
  }, this._api);
193
198
  }
@@ -207,10 +212,9 @@ class FcrSharingControlImpl {
207
212
  getBoardControl() {
208
213
  if (!this._whiteboardControl) {
209
214
  const factory = new _factory.FcrWhiteboardControlFactoryImpl();
210
- const {
211
- userId,
212
- userName
213
- } = this._userControl.getLocalUser();
215
+ const _this$_userControl$ge3 = this._userControl.getLocalUser(),
216
+ userId = _this$_userControl$ge3.userId,
217
+ userName = _this$_userControl$ge3.userName;
214
218
  const boardConfig = {
215
219
  userId,
216
220
  userName,
@@ -244,9 +248,7 @@ class FcrSharingControlImpl {
244
248
  }
245
249
  _handleOnStreamsAdded(roomId, events) {
246
250
  events.forEach(event => {
247
- const {
248
- modifiedStream
249
- } = event;
251
+ const modifiedStream = event.modifiedStream;
250
252
  if (this._isStreamToHandleScreenSharing(modifiedStream)) {
251
253
  this._shareOwnerId = modifiedStream.owner.userId;
252
254
  this._shareOwnerStream = modifiedStream;
@@ -256,48 +258,48 @@ class FcrSharingControlImpl {
256
258
  }
257
259
  _handleOnStreamsRemoved(roomId, events) {
258
260
  events.forEach(event => {
259
- const {
260
- modifiedStream
261
- } = event;
261
+ const modifiedStream = event.modifiedStream;
262
262
  const ownerId = modifiedStream.owner.userId;
263
263
  if (this._isStreamToHandleScreenSharing(modifiedStream)) {
264
264
  this._notifyScreenSharingUpdated('onScreenSharingUpdated', modifiedStream, _type.FcrScreenSharingState.END);
265
265
  if (this.getScreenSharingState() === _type.FcrScreenSharingState.END) {
266
266
  const isMeSharing = ownerId === this._userControl.getLocalUser().userId;
267
267
  if (isMeSharing) {
268
+ var _this$_annotationCont;
268
269
  this.logger.info('on stream removed, clean before terminal Annotation app');
269
- this._annotationControl.getMainWindow()?.clean();
270
+ (_this$_annotationCont = this._annotationControl.getMainWindow()) === null || _this$_annotationCont === void 0 || _this$_annotationCont.clean();
270
271
  }
271
272
  }
272
273
  }
273
274
  });
274
275
  }
275
276
  _handleOnScenePropertiesUpdated(sceneId, event) {
276
- const {
277
- cause
278
- } = event;
279
- const causeData = cause?.data;
277
+ var _causeData$widgetCaus;
278
+ const cause = event.cause;
279
+ const causeData = cause === null || cause === void 0 ? void 0 : cause.data;
280
280
  const currentScreenSharingState = this.getScreenSharingState();
281
- const causeCmd = cause?.cmd;
281
+ const causeCmd = cause === null || cause === void 0 ? void 0 : cause.cmd;
282
282
  const isWidgetPropertiesUpdated = causeCmd === 10;
283
- const isAnnotationWidgetUpdated = causeData?.widgetUuid === _type3.FcrWidgetUuid.ANNOTATION;
284
- const isAnnotationStateUpdated = causeData?.widgetCause?.cmd === _type3.FcrWidgetCauseCmd.ANNOTATION;
283
+ const isAnnotationWidgetUpdated = (causeData === null || causeData === void 0 ? void 0 : causeData.widgetUuid) === _type3.FcrWidgetUuid.ANNOTATION;
284
+ const isAnnotationStateUpdated = (causeData === null || causeData === void 0 || (_causeData$widgetCaus = causeData.widgetCause) === null || _causeData$widgetCaus === void 0 ? void 0 : _causeData$widgetCaus.cmd) === _type3.FcrWidgetCauseCmd.ANNOTATION;
285
285
  if (!isWidgetPropertiesUpdated || !isAnnotationWidgetUpdated) {
286
286
  return;
287
287
  }
288
288
  if (currentScreenSharingState === _type.FcrScreenSharingState.END) {
289
- if (causeData.widgetCause?.cmd === _type3.FcrWidgetCauseCmd.ANNOTATION) {
289
+ var _causeData$widgetCaus2;
290
+ if (((_causeData$widgetCaus2 = causeData.widgetCause) === null || _causeData$widgetCaus2 === void 0 ? void 0 : _causeData$widgetCaus2.cmd) === _type3.FcrWidgetCauseCmd.ANNOTATION) {
290
291
  this._notifyScreenSharingUpdated('onScreenSharingUpdated', this.ownerStream, _type.FcrScreenSharingState.END);
291
292
  const isMeSharing = this.ownerId === this._userControl.getLocalUser().userId;
292
293
  if (isMeSharing) {
294
+ var _this$_annotationCont2;
293
295
  this.logger.info('clean annotation board');
294
- this._annotationControl.getMainWindow()?.clean();
296
+ (_this$_annotationCont2 = this._annotationControl.getMainWindow()) === null || _this$_annotationCont2 === void 0 || _this$_annotationCont2.clean();
295
297
  }
296
298
  }
297
299
  } else {
298
300
  if (isAnnotationStateUpdated) {
299
301
  const screenStream = this._getScreenShareStreamByUuid();
300
- this._notifyScreenSharingUpdated('onScreenSharingUpdated', screenStream ?? this.ownerStream, _type.FcrScreenSharingState.START_WHIT_ANNOTATION);
302
+ this._notifyScreenSharingUpdated('onScreenSharingUpdated', screenStream !== null && screenStream !== void 0 ? screenStream : this.ownerStream, _type.FcrScreenSharingState.START_WHIT_ANNOTATION);
301
303
  // const owner = this._userControl.getUser(this.ownerId);
302
304
  // const isElectron =
303
305
  // owner &&
@@ -338,7 +340,8 @@ class FcrSharingControlImpl {
338
340
  return typeof stream === 'undefined' ? null : stream;
339
341
  }
340
342
  _notifyScreenSharingUpdated(eventName, streamInfo, state) {
341
- const streamId = streamInfo?.streamId ?? null;
343
+ var _streamInfo$streamId;
344
+ const streamId = (_streamInfo$streamId = streamInfo === null || streamInfo === void 0 ? void 0 : streamInfo.streamId) !== null && _streamInfo$streamId !== void 0 ? _streamInfo$streamId : null;
342
345
  if (this._lastScreenSharingState === state && this._lastScreenSharingStreamId === streamId) {
343
346
  return;
344
347
  }
@@ -350,4 +353,9 @@ class FcrSharingControlImpl {
350
353
  this.addObserver((0, _logger.generateLogObserver)(this.logger, [['onScreenSharingUpdated', ['streamInfo', 'state']], ['onWhiteboardStarted', ['ownerId', 'operatorUser']], ['onWhiteboardEnded', ['reason', 'operatorUser']]]));
351
354
  }
352
355
  }
353
- exports.FcrSharingControlImpl = FcrSharingControlImpl;
356
+ exports.FcrSharingControlImpl = FcrSharingControlImpl;
357
+ _FcrSharingControlImpl = FcrSharingControlImpl;
358
+ var _applyDecs$e = _applyDecs(_FcrSharingControlImpl, [[_startScreenSharingDecs, 2, "startScreenSharing"], [_imports.trace, 2, "startWhiteboard"], [_updateScreenSharingDecs, 2, "updateScreenSharing"], [_imports.trace, 2, "stop"], [_imports.trace, 2, "getScreenSharingState"]], []).e;
359
+ var _applyDecs$e2 = (0, _slicedToArray2.default)(_applyDecs$e, 1);
360
+ _initProto = _applyDecs$e2[0];
361
+ _applyDecs$e;