fcr-core 3.10.5 → 3.10.6

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