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