fcr-core 3.7.5 → 3.7.7-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 (52) hide show
  1. package/lib/chat-connection/index.js +34 -20
  2. package/lib/engine/index.js +62 -69
  3. package/lib/imports.js +1 -0
  4. package/lib/media-control/desktop.js +13 -8
  5. package/lib/media-control/mobile.js +17 -12
  6. package/lib/monitor-control/index.js +9 -4
  7. package/lib/peer-session/index.js +47 -38
  8. package/lib/plugins/chatroom.js +217 -202
  9. package/lib/room-control/ability-control/index.js +13 -8
  10. package/lib/room-control/group-control/index.js +20 -15
  11. package/lib/room-control/helpers/validation-helper.js +1 -1
  12. package/lib/room-control/index.js +53 -36
  13. package/lib/room-control/interpreter-control/index.js +23 -17
  14. package/lib/room-control/interpreter-control/room.js +6 -4
  15. package/lib/room-control/join-before-host-waitingroom-control/index.js +6 -4
  16. package/lib/room-control/mainroom-control/index.js +24 -16
  17. package/lib/room-control/privilege-control/helper.js +8 -5
  18. package/lib/room-control/privilege-control/index.js +25 -18
  19. package/lib/room-control/room-connector-control/index.js +22 -15
  20. package/lib/room-control/room-control-factory.js +2 -1
  21. package/lib/room-control/room-session/index.js +47 -38
  22. package/lib/room-control/shared-cache.js +36 -29
  23. package/lib/room-control/sharing-control/index.js +40 -29
  24. package/lib/room-control/stream-control/index.js +177 -172
  25. package/lib/room-control/user-control/index.js +142 -135
  26. package/lib/room-control/waitingroom-control/index.js +13 -8
  27. package/lib/room-control/whiteboard-control-v2/annotation-control/control.js +25 -18
  28. package/lib/room-control/whiteboard-control-v2/annotation-control/index.js +26 -15
  29. package/lib/room-control/whiteboard-control-v2/annotation-control/privilege-control.js +62 -52
  30. package/lib/room-control/whiteboard-control-v2/index.js +35 -24
  31. package/lib/room-control/whiteboard-control-v2/main-window.js +27 -22
  32. package/lib/room-control/whiteboard-control-v2/utils.js +5 -5
  33. package/lib/room-control/whiteboard-control-v2/whiteboard-control/control.js +32 -23
  34. package/lib/room-control/whiteboard-control-v2/whiteboard-control/index.js +5 -3
  35. package/lib/room-control/whiteboard-control-v2/whiteboard-control/privilege-control.js +53 -41
  36. package/lib/room-router/index.js +67 -34
  37. package/lib/room-router/type.d.ts +4 -0
  38. package/lib/service/api.d.ts +12 -1
  39. package/lib/service/api.js +98 -88
  40. package/lib/utilities/collection.js +3 -2
  41. package/lib/utilities/error-helpers.js +32 -26
  42. package/lib/utilities/error.js +9 -8
  43. package/lib/utilities/join-helper.js +22 -18
  44. package/lib/utilities/logger.js +2 -2
  45. package/lib/utilities/parameters.js +8 -4
  46. package/lib/utilities/retry-helpers.js +1 -0
  47. package/lib/utilities/shared-storage.js +1 -0
  48. package/lib/utilities/storage.js +1 -0
  49. package/lib/utilities/stream.js +16 -11
  50. package/lib/utilities/user.js +4 -3
  51. package/lib/utilities/validate-params.js +2 -1
  52. package/package.json +4 -4
@@ -1,7 +1,12 @@
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");
7
+ require("core-js/modules/esnext.iterator.constructor.js");
8
+ require("core-js/modules/esnext.iterator.filter.js");
9
+ require("core-js/modules/esnext.iterator.for-each.js");
5
10
  require("core-js/modules/esnext.map.delete-all.js");
6
11
  require("core-js/modules/esnext.map.emplace.js");
7
12
  require("core-js/modules/esnext.map.every.js");
@@ -17,34 +22,41 @@ require("core-js/modules/esnext.map.reduce.js");
17
22
  require("core-js/modules/esnext.map.some.js");
18
23
  require("core-js/modules/esnext.map.update.js");
19
24
  require("core-js/modules/esnext.symbol.metadata.js");
25
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
20
26
  Object.defineProperty(exports, "__esModule", {
21
27
  value: true
22
28
  });
23
29
  exports.FcrChatConnectionImpl = void 0;
30
+ require("core-js/modules/es.json.stringify.js");
31
+ require("core-js/modules/es.regexp.exec.js");
32
+ require("core-js/modules/web.dom-collections.iterator.js");
33
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
24
34
  var _imports = require("../imports");
25
35
  var _type = require("./type");
26
36
  var _config = require("./config");
27
37
  var _logger = require("../utilities/logger");
28
38
  var _packageInfo = require("../utilities/package-info");
29
- var _staticBlock;
39
+ var _FcrChatConnectionImpl;
30
40
  let _initProto;
41
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
42
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31
43
  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)]; } }; }
32
44
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
33
45
  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); }
34
46
  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; }
35
47
  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; }
36
48
  class FcrChatConnectionImpl {
37
- logger = (() => (_initProto(this), (0, _logger.createLogger)({
38
- prefix: 'FcrChatConnectionImpl'
39
- })))();
40
- _observable = (() => new _imports.AgoraObservable())();
41
- _connectionState = (() => _type.FcrChatConnectionState.DISCONNECTED)();
42
49
  constructor(_userId, _api, _chatIpList, _restIpList) {
50
+ (0, _defineProperty2.default)(this, "logger", (_initProto(this), (0, _logger.createLogger)({
51
+ prefix: 'FcrChatConnectionImpl'
52
+ })));
53
+ (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
54
+ (0, _defineProperty2.default)(this, "_connectionState", _type.FcrChatConnectionState.DISCONNECTED);
43
55
  this._userId = _userId;
44
56
  this._api = _api;
45
57
  this._chatIpList = _chatIpList;
46
58
  this._restIpList = _restIpList;
47
- this.logger.info(`Chat Version: easemob-websdk@${(0, _packageInfo.getDependenciesInfo)('easemob-websdk')}`);
59
+ this.logger.info("Chat Version: easemob-websdk@".concat((0, _packageInfo.getDependenciesInfo)('easemob-websdk')));
48
60
  }
49
61
  async login() {
50
62
  const privateConfig = this._getPrivateConfig();
@@ -54,13 +66,11 @@ class FcrChatConnectionImpl {
54
66
  await (0, _imports.to)((0, _imports.retryAttempt)(async () => {
55
67
  const tokenResult = await this._api.getUserToken(this._userId);
56
68
  this._initConfig = tokenResult;
57
- const connParams = {
58
- ..._config.agoraChatConfig,
59
- ...privateConfig,
69
+ const connParams = _objectSpread(_objectSpread(_objectSpread({}, _config.agoraChatConfig), privateConfig), {}, {
60
70
  appKey: tokenResult.appKey,
61
71
  autoReconnectNumMax: 99999,
62
72
  isFixedDeviceId: false
63
- };
73
+ });
64
74
  _imports.EasemobChatSDK.logger.setConsoleLogVisibility(false);
65
75
  this._conn = new _imports.EasemobChatSDK.connection(connParams);
66
76
  this._addEventListeners();
@@ -68,7 +78,7 @@ class FcrChatConnectionImpl {
68
78
  accessToken: this._initConfig.token,
69
79
  user: this._userId
70
80
  });
71
- this.logger.info(`onConnectionLoginSuccess, token: ${this._initConfig.token}, userId: ${this._userId}`);
81
+ this.logger.info("onConnectionLoginSuccess, token: ".concat(this._initConfig.token, ", userId: ").concat(this._userId));
72
82
  this._observable.notifyObservers('onConnectionLoginSuccess');
73
83
  }, [], {
74
84
  retriesMax: 3
@@ -81,13 +91,14 @@ class FcrChatConnectionImpl {
81
91
  if (error instanceof _imports.AgoraRestfulClientError) {
82
92
  throw error;
83
93
  }
84
- this.logger.error(`retry to login ChatConnection, ${error.message},retry ${currentRetry} times`);
94
+ this.logger.error("retry to login ChatConnection, ".concat(error.message, ",retry ").concat(currentRetry, " times"));
85
95
  await timeFn();
86
96
  return true;
87
97
  }).exec());
88
98
  }
89
99
  _addEventListeners() {
90
- this._conn?.addEventHandler('connectionListener', {
100
+ var _this$_conn;
101
+ (_this$_conn = this._conn) === null || _this$_conn === void 0 || _this$_conn.addEventHandler('connectionListener', {
91
102
  onError: e => {
92
103
  this.logger.error('onError', e.message);
93
104
  },
@@ -118,7 +129,8 @@ class FcrChatConnectionImpl {
118
129
  });
119
130
  }
120
131
  logout() {
121
- this._conn?.close();
132
+ var _this$_conn2;
133
+ (_this$_conn2 = this._conn) === null || _this$_conn2 === void 0 || _this$_conn2.close();
122
134
  }
123
135
  _setConnectionState(state) {
124
136
  this._connectionState = state;
@@ -137,20 +149,22 @@ class FcrChatConnectionImpl {
137
149
  this._observable.removeObserver(observer);
138
150
  }
139
151
  _getPrivateConfig() {
140
- if (this._chatIpList?.length || this._restIpList?.length) {
152
+ var _this$_chatIpList, _this$_restIpList;
153
+ if ((_this$_chatIpList = this._chatIpList) !== null && _this$_chatIpList !== void 0 && _this$_chatIpList.length || (_this$_restIpList = this._restIpList) !== null && _this$_restIpList !== void 0 && _this$_restIpList.length) {
154
+ var _this$_chatIpList2, _this$_restIpList2;
141
155
  const privateConfig = {
142
156
  isHttpDNS: false
143
157
  };
144
- if (this._chatIpList?.length) {
158
+ if ((_this$_chatIpList2 = this._chatIpList) !== null && _this$_chatIpList2 !== void 0 && _this$_chatIpList2.length) {
145
159
  privateConfig.url = this._chatIpList[0];
146
160
  }
147
- if (this._restIpList?.length) {
161
+ if ((_this$_restIpList2 = this._restIpList) !== null && _this$_restIpList2 !== void 0 && _this$_restIpList2.length) {
148
162
  privateConfig.apiUrl = this._restIpList[0];
149
163
  }
150
164
  return privateConfig;
151
165
  }
152
166
  }
153
- static #_ = (() => _staticBlock = () => [_initProto] = _applyDecs(this, [[_imports.trace, 2, "login"], [_imports.trace, 2, "logout"]], []).e)();
154
167
  }
155
168
  exports.FcrChatConnectionImpl = FcrChatConnectionImpl;
156
- _staticBlock();
169
+ _FcrChatConnectionImpl = FcrChatConnectionImpl;
170
+ [_initProto] = _applyDecs(_FcrChatConnectionImpl, [[_imports.trace, 2, "login"], [_imports.trace, 2, "logout"]], []).e;
@@ -1,6 +1,10 @@
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/esnext.function.metadata.js");
6
+ require("core-js/modules/esnext.iterator.filter.js");
7
+ require("core-js/modules/esnext.iterator.for-each.js");
4
8
  require("core-js/modules/esnext.map.delete-all.js");
5
9
  require("core-js/modules/esnext.map.emplace.js");
6
10
  require("core-js/modules/esnext.map.every.js");
@@ -22,8 +26,12 @@ Object.defineProperty(exports, "__esModule", {
22
26
  });
23
27
  exports.FcrCoreEngine = void 0;
24
28
  require("core-js/modules/es.array.push.js");
29
+ require("core-js/modules/es.json.stringify.js");
30
+ require("core-js/modules/es.regexp.exec.js");
25
31
  require("core-js/modules/esnext.iterator.constructor.js");
26
32
  require("core-js/modules/esnext.iterator.map.js");
33
+ require("core-js/modules/web.dom-collections.iterator.js");
34
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
27
35
  var _imports = require("../imports");
28
36
  var _api = require("../service/api");
29
37
  var _monitorControl = require("../monitor-control");
@@ -50,46 +58,30 @@ var _error2 = require("agora-rte-sdk/lib/core/utilities/error");
50
58
  var _roomRouter = require("../room-router");
51
59
  var _sharedCache = require("../room-control/shared-cache");
52
60
  var _packageInfo = require("../utilities/package-info");
53
- var _staticBlock;
54
- let _initProto, _createMainRoomControlDecs, _createWaitingRoomControlDecs, _createRoomRouterDecs, _createRoomControlAndJoinDecs, _sendPeerMessageDecs, _setParametersDecs;
61
+ var _FcrCoreEngine;
62
+ let _initProto, _createMainRoomControlDecs, _createWaitingRoomControlDecs, _createRoomRouterDecs, _createRoomControlAndJoinDecs, _sendPeerMessageDecs, _setParametersDecs, _ref;
63
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
64
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
55
65
  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)]; } }; }
56
66
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
57
67
  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); }
58
68
  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; }
59
69
  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; }
70
+ _ref = (_createMainRoomControlDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _createWaitingRoomControlDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _createRoomRouterDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _createRoomControlAndJoinDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrRoomJoinOptionsSchema)], _sendPeerMessageDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema, _schema.booleanSchema, _schema.stringSchema)], _setParametersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema)], "logger");
60
71
  class FcrCoreEngine {
61
- // @internal
62
- [(_createMainRoomControlDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _createWaitingRoomControlDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _createRoomRouterDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _createRoomControlAndJoinDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema, _schema.fcrRoomJoinOptionsSchema)], _sendPeerMessageDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema, _schema.booleanSchema, _schema.stringSchema)], _setParametersDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringKeyUnknownValueSchema)], "logger")] = (() => (_initProto(this), (0, _logger.createLogger)({
63
- prefix: 'FcrCoreEngine'
64
- })))();
65
- // @internal
66
-
67
- // @internal
68
-
69
- // @internal
70
-
71
- // @internal
72
-
73
- // @internal
74
-
75
- // @internal
76
-
77
- // @internal
78
-
79
- // @internal
80
-
81
- // @internal
82
-
83
- // @internal
84
- _isLoggingIn = false;
85
- // @internal
86
- _sharedCache = (() => new _sharedCache.FcrSharedCache())();
87
- // @internal
88
- _lock = (() => new _imports.Mutex())();
89
-
90
- // @internal
91
- _observable = (() => new _imports.AgoraObservable())();
92
72
  constructor(config) {
73
+ // @internal
74
+ (0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
75
+ prefix: 'FcrCoreEngine'
76
+ })));
77
+ // @internal
78
+ (0, _defineProperty2.default)(this, "_isLoggingIn", false);
79
+ // @internal
80
+ (0, _defineProperty2.default)(this, "_sharedCache", new _sharedCache.FcrSharedCache());
81
+ // @internal
82
+ (0, _defineProperty2.default)(this, "_lock", new _imports.Mutex());
83
+ // @internal
84
+ (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
93
85
  this._config = config;
94
86
  (0, _domainHolder.resetSharedDomainHolder)();
95
87
  const parameters = this._presetParameters(config.parameters);
@@ -177,12 +169,11 @@ class FcrCoreEngine {
177
169
  return (0, _imports.getVersion)();
178
170
  }
179
171
  getDependencyVersions() {
180
- return {
181
- ...this._rteEngine.getDependencyVersions(),
172
+ return _objectSpread(_objectSpread({}, this._rteEngine.getDependencyVersions()), {}, {
182
173
  rte: this._rteEngine.getVersion(),
183
174
  whiteboard: (0, _packageInfo.getDependenciesInfo)('@netless/forge-whiteboard'),
184
175
  easemob: (0, _packageInfo.getDependenciesInfo)('easemob-websdk')
185
- };
176
+ });
186
177
  }
187
178
 
188
179
  /**
@@ -230,27 +221,30 @@ class FcrCoreEngine {
230
221
  } = this._rteEngine.getConfig();
231
222
  let roomControl = null;
232
223
  let [error] = await (0, _imports.to)((0, _imports.retryAttempt)(async () => {
233
- const res = await (0, _error.handleRequestError)(() => this._apiService.checkIn({
234
- userName: options.userName,
235
- userId,
236
- userRole: _type.FcrUserRoleToStringMap[options.userRole],
237
- userProperties: options.userProperties,
238
- roomId,
239
- platform: (0, _imports.getPlatform)(),
240
- streams: options.createStreamConfigs?.map(s => ({
241
- videoSourceUuid: s.videoSourceId,
242
- audioSourceUuid: s.audioSourceId,
243
- streamName: s.streamName,
244
- ...(0, _helper.convertStreamTypeToPublishState)(s.streamType),
245
- videoSourceType: s.videoSourceType,
246
- audioSourceType: s.audioSourceType,
247
- audioSourceState: s.audioSourceState,
248
- videoSourceState: s.videoSourceState
249
- })),
250
- version: (0, _imports.getVersion)(),
251
- password: options.password,
252
- avatar: options.avatar
253
- }), _error.FcrErrorModuleCode.ENGINE);
224
+ const res = await (0, _error.handleRequestError)(() => {
225
+ var _options$createStream;
226
+ return this._apiService.checkIn({
227
+ userName: options.userName,
228
+ userId,
229
+ userRole: _type.FcrUserRoleToStringMap[options.userRole],
230
+ userProperties: options.userProperties,
231
+ roomId,
232
+ platform: (0, _imports.getPlatform)(),
233
+ streams: (_options$createStream = options.createStreamConfigs) === null || _options$createStream === void 0 ? void 0 : _options$createStream.map(s => _objectSpread(_objectSpread({
234
+ videoSourceUuid: s.videoSourceId,
235
+ audioSourceUuid: s.audioSourceId,
236
+ streamName: s.streamName
237
+ }, (0, _helper.convertStreamTypeToPublishState)(s.streamType)), {}, {
238
+ videoSourceType: s.videoSourceType,
239
+ audioSourceType: s.audioSourceType,
240
+ audioSourceState: s.audioSourceState,
241
+ videoSourceState: s.videoSourceState
242
+ })),
243
+ version: (0, _imports.getVersion)(),
244
+ password: options.password,
245
+ avatar: options.avatar
246
+ });
247
+ }, _error.FcrErrorModuleCode.ENGINE);
254
248
  const {
255
249
  data,
256
250
  ts
@@ -260,29 +254,28 @@ class FcrCoreEngine {
260
254
  } else {
261
255
  roomControl = this.createMainRoomControl(roomId);
262
256
  }
263
- await roomControl.join({
264
- ...options,
257
+ await roomControl.join(_objectSpread(_objectSpread({}, options), {}, {
265
258
  snapshot: data,
266
259
  timestamp: ts,
267
260
  createStreamConfigs: data.room.roomProperties.roomType === _type2.FcrRoomType.Waitingroom ? [] : options.createStreamConfigs
268
- });
261
+ }));
269
262
  }, [], {
270
263
  retriesMax: 10
271
- }).fail(async _ref => {
264
+ }).fail(async _ref2 => {
272
265
  let {
273
266
  error,
274
267
  timeFn,
275
268
  currentRetry
276
- } = _ref;
269
+ } = _ref2;
277
270
  if ((error instanceof _error2.AgoraRteError || error instanceof _error.FcrError) && _error.ERROR_CODES_NOT_RETRYABLE_WHEN_JOINING_ROOM.includes(error.code)) {
278
271
  throw error;
279
272
  }
280
- this.logger.error(`retry to join room, ${error.message}, retry ${currentRetry} times`);
273
+ this.logger.error("retry to join room, ".concat(error.message, ", retry ").concat(currentRetry, " times"));
281
274
  await timeFn();
282
275
  return true;
283
276
  }).exec());
284
277
  if (error) {
285
- this.logger.error(`join room failed, ${error.message}-${JSON.stringify(error)}`);
278
+ this.logger.error("join room failed, ".concat(error.message, "-").concat(JSON.stringify(error)));
286
279
  throw error;
287
280
  }
288
281
  return roomControl;
@@ -327,7 +320,7 @@ class FcrCoreEngine {
327
320
  * @param receiverId
328
321
  */
329
322
  async sendPeerMessage(payload, guaranteedDelivery, receiverId) {
330
- await this._rteEngine.sendPeerMessage(payload, `${_cmd.CMD_PEER_MESSAGE}`, guaranteedDelivery, receiverId);
323
+ await this._rteEngine.sendPeerMessage(payload, "".concat(_cmd.CMD_PEER_MESSAGE), guaranteedDelivery, receiverId);
331
324
  }
332
325
 
333
326
  /**
@@ -386,7 +379,7 @@ class FcrCoreEngine {
386
379
  _setupCoreIpList(parameters) {
387
380
  const coreIpList = (0, _parameters.getCoreIpList)(parameters);
388
381
  if (coreIpList) {
389
- this.logger.info(`setup fixed service domain list: ${JSON.stringify(coreIpList)}`);
382
+ this.logger.info("setup fixed service domain list: ".concat(JSON.stringify(coreIpList)));
390
383
  (0, _domainHolder.resetSharedDomainHolder)();
391
384
  (0, _imports.getSharedDomainHolder)(this._config.region).setFixedDomainList(coreIpList);
392
385
  this._restfulClient = new _agoraRteSdk.AgoraRestfulClientImpl(this._rteEngine.getHttpAuthHeadersProvider(), (0, _imports.getSharedDomainHolder)(this._config.region));
@@ -397,7 +390,7 @@ class FcrCoreEngine {
397
390
  const chatIpList = (0, _parameters.getEasemobChatIpList)(parameters);
398
391
  const restIpList = (0, _parameters.getEasemobRestIpList)(parameters);
399
392
  if (chatIpList && restIpList) {
400
- this.logger.info(`setup chat ip list: ${JSON.stringify(chatIpList)}, rest ip list: ${JSON.stringify(restIpList)}`);
393
+ this.logger.info("setup chat ip list: ".concat(JSON.stringify(chatIpList), ", rest ip list: ").concat(JSON.stringify(restIpList)));
401
394
  this._chatConnection = this._createChatConnection(parameters);
402
395
  }
403
396
  }
@@ -423,7 +416,7 @@ class FcrCoreEngine {
423
416
  parametersList.push(...rtcPresetParameters);
424
417
  return parametersList;
425
418
  }
426
- static #_ = (() => _staticBlock = () => [_initProto] = _applyDecs(this, [[_imports.trace, 2, "release"], [_imports.trace, 2, "login"], [_imports.trace, 2, "logout"], [_imports.trace, 2, "renewUserToken"], [_imports.trace, 2, "getVersion"], [_createMainRoomControlDecs, 2, "createMainRoomControl"], [_createWaitingRoomControlDecs, 2, "createWaitingRoomControl"], [_createRoomRouterDecs, 2, "createRoomRouter"], [_createRoomControlAndJoinDecs, 2, "createRoomControlAndJoin"], [_imports.trace, 2, "getDesktopMediaControl"], [_imports.trace, 2, "getMobileMediaControl"], [_imports.trace, 2, "getMonitorControl"], [_imports.trace, 2, "getPeerSessionControl"], [_sendPeerMessageDecs, 2, "sendPeerMessage"], [_setParametersDecs, 2, "setParameters"]], []).e)();
427
419
  }
428
420
  exports.FcrCoreEngine = FcrCoreEngine;
429
- _staticBlock();
421
+ _FcrCoreEngine = FcrCoreEngine;
422
+ [_initProto] = _applyDecs(_FcrCoreEngine, [[_imports.trace, 2, "release"], [_imports.trace, 2, "login"], [_imports.trace, 2, "logout"], [_imports.trace, 2, "renewUserToken"], [_imports.trace, 2, "getVersion"], [_createMainRoomControlDecs, 2, "createMainRoomControl"], [_createWaitingRoomControlDecs, 2, "createWaitingRoomControl"], [_createRoomRouterDecs, 2, "createRoomRouter"], [_createRoomControlAndJoinDecs, 2, "createRoomControlAndJoin"], [_imports.trace, 2, "getDesktopMediaControl"], [_imports.trace, 2, "getMobileMediaControl"], [_imports.trace, 2, "getMonitorControl"], [_imports.trace, 2, "getPeerSessionControl"], [_sendPeerMessageDecs, 2, "sendPeerMessage"], [_setParametersDecs, 2, "setParameters"]], []).e;
package/lib/imports.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  require("core-js/modules/esnext.weak-map.delete-all.js");
4
4
  require("core-js/modules/esnext.weak-map.emplace.js");
5
+ require("core-js/modules/web.dom-collections.iterator.js");
5
6
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
7
  Object.defineProperty(exports, "__esModule", {
7
8
  value: true
@@ -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");
@@ -24,12 +26,14 @@ Object.defineProperty(exports, "__esModule", {
24
26
  exports.FcrDesktopMediaControlImpl = void 0;
25
27
  require("core-js/modules/esnext.iterator.constructor.js");
26
28
  require("core-js/modules/esnext.iterator.for-each.js");
29
+ require("core-js/modules/web.dom-collections.iterator.js");
30
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
27
31
  var _imports = require("../imports");
28
32
  var _schema = require("../schema");
29
33
  var _validateParams = _interopRequireDefault(require("../utilities/validate-params"));
30
34
  var _logger = require("../utilities/logger");
31
- var _staticBlock;
32
- let _initProto, _getCameraTrackDecs, _getMicrophoneTrackDecs, _getScreenTrackDecs, _getLoopbackTrackDecs, _setSelectedSpeakerDecs, _startSelectedSpeakerTestDecs, _isCapabilitySupportedDecs, _adjustOutputVolumeDecs, _setSelectedSpeakerVolumeDecs;
35
+ var _FcrDesktopMediaControlImpl;
36
+ let _initProto, _getCameraTrackDecs, _getMicrophoneTrackDecs, _getScreenTrackDecs, _getLoopbackTrackDecs, _setSelectedSpeakerDecs, _startSelectedSpeakerTestDecs, _isCapabilitySupportedDecs, _adjustOutputVolumeDecs, _setSelectedSpeakerVolumeDecs, _ref;
33
37
  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)]; } }; }
34
38
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
35
39
  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); }
@@ -38,12 +42,13 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
38
42
  /**
39
43
  * @internal
40
44
  */
45
+ _ref = (_getCameraTrackDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _getMicrophoneTrackDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _getScreenTrackDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _getLoopbackTrackDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _setSelectedSpeakerDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _startSelectedSpeakerTestDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _isCapabilitySupportedDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrCapabilitySchema)], _adjustOutputVolumeDecs = [_imports.trace, (0, _validateParams.default)(_schema.numberSchema)], _setSelectedSpeakerVolumeDecs = [_imports.trace, (0, _validateParams.default)(_schema.numberSchema)], "logger");
41
46
  class FcrDesktopMediaControlImpl {
42
- [(_getCameraTrackDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _getMicrophoneTrackDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _getScreenTrackDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _getLoopbackTrackDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _setSelectedSpeakerDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _startSelectedSpeakerTestDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringSchema)], _isCapabilitySupportedDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrCapabilitySchema)], _adjustOutputVolumeDecs = [_imports.trace, (0, _validateParams.default)(_schema.numberSchema)], _setSelectedSpeakerVolumeDecs = [_imports.trace, (0, _validateParams.default)(_schema.numberSchema)], "logger")] = (() => (_initProto(this), (0, _logger.createLogger)({
43
- prefix: 'FcrDesktopMediaControlImpl'
44
- })))();
45
- _observable = (() => new _imports.AgoraObservable())();
46
47
  constructor(mediaControl) {
48
+ (0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
49
+ prefix: 'FcrDesktopMediaControlImpl'
50
+ })));
51
+ (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
47
52
  this._mediaControl = mediaControl;
48
53
  this._mediaControl.addObserver({
49
54
  onAutoPlayFailed: () => {
@@ -162,7 +167,7 @@ class FcrDesktopMediaControlImpl {
162
167
  enableAGC() {
163
168
  return this._mediaControl.enableAGC();
164
169
  }
165
- static #_ = (() => _staticBlock = () => [_initProto] = _applyDecs(this, [[_imports.trace, 2, "getLoopbackList"], [_imports.trace, 2, "getCameraList"], [_imports.trace, 2, "getMicrophoneList"], [_imports.trace, 2, "getSpeakerList"], [_imports.trace, 2, "getSystemSelectedMicrophone"], [_imports.trace, 2, "getSystemSelectedSpeaker"], [_imports.trace, 2, "getWindowList"], [_imports.trace, 2, "getDisplayList"], [_getCameraTrackDecs, 2, "getCameraTrack"], [_getMicrophoneTrackDecs, 2, "getMicrophoneTrack"], [_getScreenTrackDecs, 2, "getScreenTrack"], [_getLoopbackTrackDecs, 2, "getLoopbackTrack"], [_setSelectedSpeakerDecs, 2, "setSelectedSpeaker"], [_startSelectedSpeakerTestDecs, 2, "startSelectedSpeakerTest"], [_imports.trace, 2, "stopSelectedSpeakerTest"], [_isCapabilitySupportedDecs, 2, "isCapabilitySupported"], [_adjustOutputVolumeDecs, 2, "adjustOutputVolume"], [_setSelectedSpeakerVolumeDecs, 2, "setSelectedSpeakerVolume"], [_imports.trace, 2, "getSelectedSpeakerVolume"], [_imports.trace, 2, "observeSystemSelectedSpeakerChanged"], [_imports.trace, 2, "observeSystemSelectedMicrophoneChanged"], [_imports.trace, 2, "disableAGC"], [_imports.trace, 2, "enableAGC"]], []).e)();
166
170
  }
167
171
  exports.FcrDesktopMediaControlImpl = FcrDesktopMediaControlImpl;
168
- _staticBlock();
172
+ _FcrDesktopMediaControlImpl = FcrDesktopMediaControlImpl;
173
+ [_initProto] = _applyDecs(_FcrDesktopMediaControlImpl, [[_imports.trace, 2, "getLoopbackList"], [_imports.trace, 2, "getCameraList"], [_imports.trace, 2, "getMicrophoneList"], [_imports.trace, 2, "getSpeakerList"], [_imports.trace, 2, "getSystemSelectedMicrophone"], [_imports.trace, 2, "getSystemSelectedSpeaker"], [_imports.trace, 2, "getWindowList"], [_imports.trace, 2, "getDisplayList"], [_getCameraTrackDecs, 2, "getCameraTrack"], [_getMicrophoneTrackDecs, 2, "getMicrophoneTrack"], [_getScreenTrackDecs, 2, "getScreenTrack"], [_getLoopbackTrackDecs, 2, "getLoopbackTrack"], [_setSelectedSpeakerDecs, 2, "setSelectedSpeaker"], [_startSelectedSpeakerTestDecs, 2, "startSelectedSpeakerTest"], [_imports.trace, 2, "stopSelectedSpeakerTest"], [_isCapabilitySupportedDecs, 2, "isCapabilitySupported"], [_adjustOutputVolumeDecs, 2, "adjustOutputVolume"], [_setSelectedSpeakerVolumeDecs, 2, "setSelectedSpeakerVolume"], [_imports.trace, 2, "getSelectedSpeakerVolume"], [_imports.trace, 2, "observeSystemSelectedSpeakerChanged"], [_imports.trace, 2, "observeSystemSelectedMicrophoneChanged"], [_imports.trace, 2, "disableAGC"], [_imports.trace, 2, "enableAGC"]], []).e;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ require("core-js/modules/es.symbol.description.js");
3
4
  require("core-js/modules/es.array.push.js");
4
5
  require("core-js/modules/esnext.function.metadata.js");
5
6
  require("core-js/modules/esnext.map.delete-all.js");
@@ -22,13 +23,16 @@ Object.defineProperty(exports, "__esModule", {
22
23
  value: true
23
24
  });
24
25
  exports.FcrMobileMediaControlImpl = void 0;
26
+ require("core-js/modules/es.error.cause.js");
27
+ require("core-js/modules/web.dom-collections.iterator.js");
28
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
29
  var _imports = require("../imports");
26
30
  var _type = require("../type");
27
31
  var _schema = require("../schema");
28
32
  var _validateParams = _interopRequireDefault(require("../utilities/validate-params"));
29
33
  var _logger = require("../utilities/logger");
30
- var _staticBlock;
31
- let _initProto, _getDeviceIdDecs, _getDeviceStateDecs, _startCameraPreviewDecs, _stopCameraPreviewDecs, _openDeviceDecs, _closeDeviceDecs, _getCameraTrackDecs, _getMicrophoneTrackDecs, _isCapabilitySupportedDecs, _adjustOutputVolumeDecs;
34
+ var _FcrMobileMediaControlImpl;
35
+ let _initProto, _getDeviceIdDecs, _getDeviceStateDecs, _startCameraPreviewDecs, _stopCameraPreviewDecs, _openDeviceDecs, _closeDeviceDecs, _getCameraTrackDecs, _getMicrophoneTrackDecs, _isCapabilitySupportedDecs, _adjustOutputVolumeDecs, _ref;
32
36
  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)]; } }; }
33
37
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
34
38
  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); }
@@ -37,16 +41,17 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
37
41
  /**
38
42
  * @internal
39
43
  */
44
+ _ref = (_getDeviceIdDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrDeviceTypeSchema)], _getDeviceStateDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrDeviceTypeSchema)], _startCameraPreviewDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringOrObjectSchema, _schema.fcrRenderConfigSchema)], _stopCameraPreviewDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringOrObjectSchema)], _openDeviceDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrDeviceTypeSchema)], _closeDeviceDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrDeviceTypeSchema)], _getCameraTrackDecs = (0, _validateParams.default)(_schema.fcrMobileDeviceIdOrNameSchema), _getMicrophoneTrackDecs = (0, _validateParams.default)(_schema.fcrMobileDeviceIdOrNameSchema), _isCapabilitySupportedDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrCapabilitySchema)], _adjustOutputVolumeDecs = [_imports.trace, (0, _validateParams.default)(_schema.numberSchema)], "logger");
40
45
  class FcrMobileMediaControlImpl {
41
- [(_getDeviceIdDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrDeviceTypeSchema)], _getDeviceStateDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrDeviceTypeSchema)], _startCameraPreviewDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringOrObjectSchema, _schema.fcrRenderConfigSchema)], _stopCameraPreviewDecs = [_imports.trace, (0, _validateParams.default)(_schema.stringOrObjectSchema)], _openDeviceDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrDeviceTypeSchema)], _closeDeviceDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrDeviceTypeSchema)], _getCameraTrackDecs = (0, _validateParams.default)(_schema.fcrMobileDeviceIdOrNameSchema), _getMicrophoneTrackDecs = (0, _validateParams.default)(_schema.fcrMobileDeviceIdOrNameSchema), _isCapabilitySupportedDecs = [_imports.trace, (0, _validateParams.default)(_schema.fcrCapabilitySchema)], _adjustOutputVolumeDecs = [_imports.trace, (0, _validateParams.default)(_schema.numberSchema)], "logger")] = (() => (_initProto(this), (0, _logger.createLogger)({
42
- prefix: 'FcrMobileMediaControlImpl'
43
- })))();
44
- _observable = (() => new _imports.AgoraObservable())();
45
- _cameraDeviceName = (() => undefined)();
46
- _microphoneDeviceName = (() => undefined)();
47
- _screenDeviceName = (() => undefined)();
48
- _loopbackDeviceName = (() => undefined)();
49
46
  constructor(mediaControl) {
47
+ (0, _defineProperty2.default)(this, _ref, (_initProto(this), (0, _logger.createLogger)({
48
+ prefix: 'FcrMobileMediaControlImpl'
49
+ })));
50
+ (0, _defineProperty2.default)(this, "_observable", new _imports.AgoraObservable());
51
+ (0, _defineProperty2.default)(this, "_cameraDeviceName", undefined);
52
+ (0, _defineProperty2.default)(this, "_microphoneDeviceName", undefined);
53
+ (0, _defineProperty2.default)(this, "_screenDeviceName", undefined);
54
+ (0, _defineProperty2.default)(this, "_loopbackDeviceName", undefined);
50
55
  this._mediaControl = mediaControl;
51
56
  this._mediaControl.getCameraVideoTrack(this._cameraDeviceName).addObserver({
52
57
  onCameraStateUpdated: (deviceId, state) => {
@@ -196,7 +201,7 @@ class FcrMobileMediaControlImpl {
196
201
  removeObserver(observer) {
197
202
  this._observable.removeObserver(observer);
198
203
  }
199
- static #_ = (() => _staticBlock = () => [_initProto] = _applyDecs(this, [[_getDeviceIdDecs, 2, "getDeviceId"], [_getDeviceStateDecs, 2, "getDeviceState"], [_imports.trace, 2, "startCameraTest"], [_imports.trace, 2, "stopCameraTest"], [_startCameraPreviewDecs, 2, "startCameraPreview"], [_stopCameraPreviewDecs, 2, "stopCameraPreview"], [_imports.trace, 2, "stopCameraPreviewOnAllCanvas"], [_imports.trace, 2, "startScreenCapture"], [_imports.trace, 2, "getScreenCaptureState"], [_imports.trace, 2, "startLoopbackRecording"], [_imports.trace, 2, "stopLoopbackRecording"], [_imports.trace, 2, "getLoopbackRecordingState"], [_imports.trace, 2, "getAudioOutputRouting"], [_imports.trace, 2, "getAudioEffectEnhancer"], [_imports.trace, 2, "getVideoEffectEnhancer"], [_openDeviceDecs, 2, "openDevice"], [_closeDeviceDecs, 2, "closeDevice"], [_imports.trace, 2, "switchCamera"], [_imports.trace, 2, "getCameraPosition"], [_getCameraTrackDecs, 2, "getCameraTrack"], [_getMicrophoneTrackDecs, 2, "getMicrophoneTrack"], [_isCapabilitySupportedDecs, 2, "isCapabilitySupported"], [_adjustOutputVolumeDecs, 2, "adjustOutputVolume"]], []).e)();
200
204
  }
201
205
  exports.FcrMobileMediaControlImpl = FcrMobileMediaControlImpl;
202
- _staticBlock();
206
+ _FcrMobileMediaControlImpl = FcrMobileMediaControlImpl;
207
+ [_initProto] = _applyDecs(_FcrMobileMediaControlImpl, [[_getDeviceIdDecs, 2, "getDeviceId"], [_getDeviceStateDecs, 2, "getDeviceState"], [_imports.trace, 2, "startCameraTest"], [_imports.trace, 2, "stopCameraTest"], [_startCameraPreviewDecs, 2, "startCameraPreview"], [_stopCameraPreviewDecs, 2, "stopCameraPreview"], [_imports.trace, 2, "stopCameraPreviewOnAllCanvas"], [_imports.trace, 2, "startScreenCapture"], [_imports.trace, 2, "getScreenCaptureState"], [_imports.trace, 2, "startLoopbackRecording"], [_imports.trace, 2, "stopLoopbackRecording"], [_imports.trace, 2, "getLoopbackRecordingState"], [_imports.trace, 2, "getAudioOutputRouting"], [_imports.trace, 2, "getAudioEffectEnhancer"], [_imports.trace, 2, "getVideoEffectEnhancer"], [_openDeviceDecs, 2, "openDevice"], [_closeDeviceDecs, 2, "closeDevice"], [_imports.trace, 2, "switchCamera"], [_imports.trace, 2, "getCameraPosition"], [_getCameraTrackDecs, 2, "getCameraTrack"], [_getMicrophoneTrackDecs, 2, "getMicrophoneTrack"], [_isCapabilitySupportedDecs, 2, "isCapabilitySupported"], [_adjustOutputVolumeDecs, 2, "adjustOutputVolume"]], []).e;
@@ -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,12 +19,15 @@ 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
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
20
23
  Object.defineProperty(exports, "__esModule", {
21
24
  value: true
22
25
  });
23
26
  exports.FcrMonitorControlImpl = void 0;
27
+ require("core-js/modules/web.dom-collections.iterator.js");
28
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
24
29
  var _imports = require("../imports");
25
- var _staticBlock;
30
+ var _FcrMonitorControlImpl;
26
31
  let _initProto;
27
32
  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)]; } }; }
28
33
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
@@ -33,8 +38,8 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
33
38
  * @internal
34
39
  */
35
40
  class FcrMonitorControlImpl {
36
- _monitor = (() => void _initProto(this))();
37
41
  constructor(engine, _config) {
42
+ (0, _defineProperty2.default)(this, "_monitor", void _initProto(this));
38
43
  this._config = _config;
39
44
  this._monitor = engine.getMonitor();
40
45
  }
@@ -47,7 +52,7 @@ class FcrMonitorControlImpl {
47
52
  removeObserver(observer) {
48
53
  this._monitor.addObserver(observer);
49
54
  }
50
- static #_ = (() => _staticBlock = () => [_initProto] = _applyDecs(this, [[_imports.trace, 2, "uploadEvent"]], []).e)();
51
55
  }
52
56
  exports.FcrMonitorControlImpl = FcrMonitorControlImpl;
53
- _staticBlock();
57
+ _FcrMonitorControlImpl = FcrMonitorControlImpl;
58
+ [_initProto] = _applyDecs(_FcrMonitorControlImpl, [[_imports.trace, 2, "uploadEvent"]], []).e;