agora-rte-sdk 3.9.0 → 3.9.1-alpha
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/constant.d.ts +1 -0
- package/lib/constant.js +2 -1
- package/lib/core/engine/ap-detector.js +9 -5
- package/lib/core/engine/index.d.ts +1 -0
- package/lib/core/engine/index.js +16 -7
- package/lib/core/engine/plugin.js +0 -4
- package/lib/core/media/camera.js +8 -8
- package/lib/core/media/loopback.js +8 -8
- package/lib/core/media/microphone.js +8 -8
- package/lib/core/media/screen.js +8 -8
- package/lib/core/scene/helpers/stream-publish-handlers.d.ts +2 -1
- package/lib/core/scene/helpers/stream-publish-handlers.js +2 -7
- package/lib/core/scene/index.js +3 -3
- package/lib/core/scene/type.d.ts +2 -1
- package/lib/core/scene/type.js +1 -0
- package/lib/core/utilities/logger.d.ts +22 -7
- package/lib/core/utilities/logger.js +75 -9
- package/lib/core/utilities/parameters.d.ts +3 -0
- package/lib/core/utilities/parameters.js +39 -9
- package/lib/plugin/rtc/electron/camera-preview-task-manager.d.ts +1 -0
- package/lib/plugin/rtc/electron/camera-preview-task-manager.js +6 -1
- package/lib/plugin/rtc/electron/channel.js +1 -1
- package/lib/plugin/rtc/electron/client.js +31 -19
- package/lib/plugin/rtc/electron/downloadALD.d.ts +2 -1
- package/lib/plugin/rtc/electron/downloadALD.js +10 -13
- package/lib/plugin/rtc/electron/index.js +2 -1
- package/lib/plugin/rtc/electron/publisher.js +3 -3
- package/lib/plugin/rtc/electron/source-manager.js +5 -3
- package/lib/plugin/rtc/electron/utils.d.ts +4 -4
- package/lib/plugin/rtc/electron/utils.js +19 -21
- package/lib/plugin/rtc/web/assembler.js +5 -3
- package/lib/plugin/rtc/web/track-control/camera.d.ts +1 -0
- package/lib/plugin/rtc/web/track-control/camera.js +64 -35
- package/lib/plugin/rtm/client.d.ts +1 -0
- package/lib/plugin/rtm/client.js +16 -10
- package/lib/plugin/rtm/index.js +3 -1
- package/lib/plugin/rtm/type.d.ts +1 -0
- package/lib-es/constant.js +1 -0
- package/lib-es/core/engine/ap-detector.js +10 -6
- package/lib-es/core/engine/index.js +18 -9
- package/lib-es/core/engine/plugin.js +0 -4
- package/lib-es/core/media/camera.js +8 -8
- package/lib-es/core/media/loopback.js +8 -8
- package/lib-es/core/media/microphone.js +8 -8
- package/lib-es/core/media/screen.js +8 -8
- package/lib-es/core/scene/helpers/stream-publish-handlers.js +2 -7
- package/lib-es/core/scene/index.js +3 -3
- package/lib-es/core/scene/type.js +1 -0
- package/lib-es/core/utilities/logger.js +73 -8
- package/lib-es/core/utilities/parameters.js +40 -10
- package/lib-es/plugin/rtc/electron/camera-preview-task-manager.js +6 -1
- package/lib-es/plugin/rtc/electron/channel.js +1 -1
- package/lib-es/plugin/rtc/electron/client.js +31 -19
- package/lib-es/plugin/rtc/electron/downloadALD.js +11 -13
- package/lib-es/plugin/rtc/electron/index.js +3 -2
- package/lib-es/plugin/rtc/electron/publisher.js +3 -3
- package/lib-es/plugin/rtc/electron/source-manager.js +5 -3
- package/lib-es/plugin/rtc/electron/utils.js +19 -21
- package/lib-es/plugin/rtc/web/assembler.js +5 -3
- package/lib-es/plugin/rtc/web/track-control/camera.js +64 -35
- package/lib-es/plugin/rtm/client.js +16 -10
- package/lib-es/plugin/rtm/index.js +4 -2
- package/package.json +3 -3
package/lib/constant.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const TIMEOUT_ONE_AND_HALF_MINUTES = 15000;
|
|
2
2
|
export declare const DEFAULT_AP_DETECT_TIMEOUT = 300;
|
|
3
|
+
export declare const DEFAULT_LOG_FILE_SIZE = 512;
|
|
3
4
|
export declare const DEFAULT_AP_DETECT_IS_REDETECT = true;
|
|
4
5
|
export declare const DEFAULT_RTC_CLIENT_IS_DISABLED = false;
|
|
5
6
|
export declare const DEFAULT_RTM_CLIENT_IS_DISABLED = false;
|
package/lib/constant.js
CHANGED
|
@@ -4,11 +4,12 @@ require("core-js/modules/es.object.define-property.js");
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.TIMEOUT_ONE_AND_HALF_MINUTES = exports.DEFAULT_RTM_CLIENT_IS_DISABLED = exports.DEFAULT_RTC_CLIENT_IS_DISABLED = exports.DEFAULT_ONLINE_STATE_ENSURE_DELAY = exports.DEFAULT_AP_DETECT_TIMEOUT = exports.DEFAULT_AP_DETECT_IS_REDETECT = exports.AgoraRtmReturnCode = exports.AgoraRteReturnCode = exports.AgoraRtcErrorCode = void 0;
|
|
7
|
+
exports.TIMEOUT_ONE_AND_HALF_MINUTES = exports.DEFAULT_RTM_CLIENT_IS_DISABLED = exports.DEFAULT_RTC_CLIENT_IS_DISABLED = exports.DEFAULT_ONLINE_STATE_ENSURE_DELAY = exports.DEFAULT_LOG_FILE_SIZE = exports.DEFAULT_AP_DETECT_TIMEOUT = exports.DEFAULT_AP_DETECT_IS_REDETECT = exports.AgoraRtmReturnCode = exports.AgoraRteReturnCode = exports.AgoraRtcErrorCode = void 0;
|
|
8
8
|
var TIMEOUT_ONE_AND_HALF_MINUTES = exports.TIMEOUT_ONE_AND_HALF_MINUTES = 15000;
|
|
9
9
|
|
|
10
10
|
// milliseconds
|
|
11
11
|
var DEFAULT_AP_DETECT_TIMEOUT = exports.DEFAULT_AP_DETECT_TIMEOUT = 300;
|
|
12
|
+
var DEFAULT_LOG_FILE_SIZE = exports.DEFAULT_LOG_FILE_SIZE = 512;
|
|
12
13
|
var DEFAULT_AP_DETECT_IS_REDETECT = exports.DEFAULT_AP_DETECT_IS_REDETECT = true;
|
|
13
14
|
var DEFAULT_RTC_CLIENT_IS_DISABLED = exports.DEFAULT_RTC_CLIENT_IS_DISABLED = false;
|
|
14
15
|
var DEFAULT_RTM_CLIENT_IS_DISABLED = exports.DEFAULT_RTM_CLIENT_IS_DISABLED = false;
|
|
@@ -98,9 +98,13 @@ var removeHttpPrefix = function removeHttpPrefix(url) {
|
|
|
98
98
|
// 使用 replace 方法替换匹配到的前缀为空字符串
|
|
99
99
|
return url.replace(regex, '');
|
|
100
100
|
};
|
|
101
|
+
var isHarmonyOrElectronPlatform = function isHarmonyOrElectronPlatform(isElectron) {
|
|
102
|
+
var platform = (0, _imports.getPlatform)();
|
|
103
|
+
return isElectron || platform === _imports.FcrApplicationPlatform.HARMONY;
|
|
104
|
+
};
|
|
101
105
|
var transformUrlToRequestUrl = exports.transformUrlToRequestUrl = function transformUrlToRequestUrl(url, isElectron) {
|
|
102
106
|
var pureUrl = removeHttpPrefix(url);
|
|
103
|
-
if (isElectron) {
|
|
107
|
+
if (isHarmonyOrElectronPlatform(isElectron)) {
|
|
104
108
|
return "https://".concat(pureUrl);
|
|
105
109
|
} else {
|
|
106
110
|
if (isIP(pureUrl)) {
|
|
@@ -632,10 +636,10 @@ var AgoraRteApDetectorImpl = exports.AgoraRteApDetectorImpl = /*#__PURE__*/funct
|
|
|
632
636
|
if (!Array.isArray(rtcConfig.serverList)) {
|
|
633
637
|
this.logger.error("".concat(name, ".serverList type is ").concat((0, _typeof2["default"])(rtcConfig.serverList), ", expect type array"));
|
|
634
638
|
}
|
|
635
|
-
if (this._isElectron) {
|
|
636
|
-
var
|
|
637
|
-
if (typeof
|
|
638
|
-
this.logger.error("".concat(name, ".verifyDomainName type is ").concat((0, _typeof2["default"])(
|
|
639
|
+
if (isHarmonyOrElectronPlatform(this._isElectron)) {
|
|
640
|
+
var harmonyOrElectronRtcConfig = rtcConfig;
|
|
641
|
+
if (typeof harmonyOrElectronRtcConfig.verifyDomainName !== 'string') {
|
|
642
|
+
this.logger.error("".concat(name, ".verifyDomainName type is ").concat((0, _typeof2["default"])(harmonyOrElectronRtcConfig.verifyDomainName), ", expect type string"));
|
|
639
643
|
return undefined;
|
|
640
644
|
}
|
|
641
645
|
} else {
|
package/lib/core/engine/index.js
CHANGED
|
@@ -88,9 +88,7 @@ _ref = (_createSceneDecs = (0, _imports.trace)(['config']), _sendPeerMessageDecs
|
|
|
88
88
|
var AgoraRteEngineImpl = exports.AgoraRteEngineImpl = /*#__PURE__*/function () {
|
|
89
89
|
function AgoraRteEngineImpl(config) {
|
|
90
90
|
(0, _classCallCheck2["default"])(this, AgoraRteEngineImpl);
|
|
91
|
-
(0, _defineProperty2["default"])(this, _ref,
|
|
92
|
-
prefix: 'AgoraRteEngine'
|
|
93
|
-
})));
|
|
91
|
+
(0, _defineProperty2["default"])(this, _ref, void _initProto(this));
|
|
94
92
|
(0, _defineProperty2["default"])(this, "_observable", new _imports.AgoraObservable());
|
|
95
93
|
(0, _defineProperty2["default"])(this, "_sceneRefs", new _weakInvoker.WeakInvoker());
|
|
96
94
|
(0, _defineProperty2["default"])(this, "_rtmClientObserver", {
|
|
@@ -105,14 +103,14 @@ var AgoraRteEngineImpl = exports.AgoraRteEngineImpl = /*#__PURE__*/function () {
|
|
|
105
103
|
onTrackAudioStateUpdated: this._handleTrackAudioStateUpdated.bind(this),
|
|
106
104
|
onTrackVideoStateUpdated: this._handleTrackVideoStateUpdated.bind(this)
|
|
107
105
|
});
|
|
108
|
-
(0, _defineProperty2["default"])(this, "_apDetector", this._createDefaultApDetector());
|
|
109
106
|
(0, _defineProperty2["default"])(this, "_pluginManager", (0, _plugin.getPluginManager)());
|
|
110
107
|
(0, _defineProperty2["default"])(this, "_requestScheduler", new _imports.AgoraRequestScheduler());
|
|
111
108
|
(0, _domainHolder.resetSharedDomainHolder)();
|
|
112
109
|
this._config = (0, _clone.cloneDeep)(config);
|
|
113
110
|
|
|
114
111
|
// setupConsoleHijack(getDefaultLogger());
|
|
115
|
-
|
|
112
|
+
this.logger = this._createLogger();
|
|
113
|
+
this._apDetector = this._createDefaultApDetector();
|
|
116
114
|
this.logger.info('RTE engine is created, version: ', this.getVersion());
|
|
117
115
|
this._pluginManager.callInitialize(this._config);
|
|
118
116
|
if ((0, _imports.isElectron)()) {
|
|
@@ -316,7 +314,7 @@ var AgoraRteEngineImpl = exports.AgoraRteEngineImpl = /*#__PURE__*/function () {
|
|
|
316
314
|
this._mediaControl.release();
|
|
317
315
|
}
|
|
318
316
|
// restoreConsoleHijack();
|
|
319
|
-
|
|
317
|
+
_logger.RteLoggerManagerHolder.destroy();
|
|
320
318
|
return _constant.AgoraRteReturnCode.SUCCESS;
|
|
321
319
|
}
|
|
322
320
|
}, {
|
|
@@ -530,10 +528,21 @@ var AgoraRteEngineImpl = exports.AgoraRteEngineImpl = /*#__PURE__*/function () {
|
|
|
530
528
|
}
|
|
531
529
|
}
|
|
532
530
|
}
|
|
531
|
+
}, {
|
|
532
|
+
key: "_createLogger",
|
|
533
|
+
value: function _createLogger() {
|
|
534
|
+
var rteLogFileSize = (0, _parameters.getRteLogFileSize)(this._config.parameters);
|
|
535
|
+
_logger.RteLoggerManagerHolder.initialize({
|
|
536
|
+
maxSize: rteLogFileSize
|
|
537
|
+
});
|
|
538
|
+
return (0, _logger.createLogger)({
|
|
539
|
+
prefix: 'AgoraRteEngine'
|
|
540
|
+
});
|
|
541
|
+
}
|
|
533
542
|
}]);
|
|
534
543
|
}();
|
|
535
544
|
_AgoraRteEngineImpl = AgoraRteEngineImpl;
|
|
536
|
-
var _applyDecs$e = _applyDecs(_AgoraRteEngineImpl, [[_imports.trace, 2, "login"], [_imports.trace, 2, "logout"], [_createSceneDecs, 2, "createScene"], [_sendPeerMessageDecs, 2, "sendPeerMessage"], [_setParametersDecs, 2, "setParameters"], [_renewUserTokenDecs, 2, "renewUserToken"], [_imports.trace, 2, "release"], [_imports.bound, 2, "_updateApDetector"]], []).e;
|
|
545
|
+
var _applyDecs$e = _applyDecs(_AgoraRteEngineImpl, [[_imports.trace, 2, "login"], [_imports.trace, 2, "logout"], [_createSceneDecs, 2, "createScene"], [_sendPeerMessageDecs, 2, "sendPeerMessage"], [_setParametersDecs, 2, "setParameters"], [_renewUserTokenDecs, 2, "renewUserToken"], [_imports.trace, 2, "release"], [_imports.bound, 2, "_updateApDetector"], [_imports.bound, 2, "_createLogger"]], []).e;
|
|
537
546
|
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
538
547
|
_initProto = _applyDecs$e2[0];
|
|
539
548
|
_applyDecs$e;
|
|
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.registerPlugin = exports.getPluginManager = void 0;
|
|
9
9
|
require("core-js/modules/es.array.for-each.js");
|
|
10
10
|
require("core-js/modules/es.array.iterator.js");
|
|
11
|
-
require("core-js/modules/es.function.name.js");
|
|
12
11
|
require("core-js/modules/es.object.to-string.js");
|
|
13
12
|
require("core-js/modules/es.set.js");
|
|
14
13
|
require("core-js/modules/es.string.iterator.js");
|
|
@@ -42,7 +41,6 @@ require("core-js/modules/web.dom-collections.iterator.js");
|
|
|
42
41
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
43
42
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
44
43
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
45
|
-
var _logger = require("../utilities/logger");
|
|
46
44
|
var AgoraRtePluginManager = /*#__PURE__*/function () {
|
|
47
45
|
function AgoraRtePluginManager() {
|
|
48
46
|
(0, _classCallCheck2["default"])(this, AgoraRtePluginManager);
|
|
@@ -86,7 +84,5 @@ var getPluginManager = exports.getPluginManager = function getPluginManager() {
|
|
|
86
84
|
return pluginManager;
|
|
87
85
|
};
|
|
88
86
|
var registerPlugin = exports.registerPlugin = function registerPlugin(plugin) {
|
|
89
|
-
var logger = (0, _logger.getLogger)();
|
|
90
|
-
logger.info('Register plugin:', plugin.name);
|
|
91
87
|
getPluginManager().registerPlugin(plugin);
|
|
92
88
|
};
|
package/lib/core/media/camera.js
CHANGED
|
@@ -55,8 +55,8 @@ var _type2 = require("./type");
|
|
|
55
55
|
var _effectEnhancer = require("./effect-enhancer");
|
|
56
56
|
var _logger = require("../utilities/logger");
|
|
57
57
|
var _imports = require("../../imports");
|
|
58
|
-
var
|
|
59
|
-
var _initProto, _startPreviewDecs, _stopPreviewDecs, _setCaptureParamsDecs, _setVideoOrientationDecs,
|
|
58
|
+
var _AgoraRteCameraTrackImpl;
|
|
59
|
+
var _initProto, _startPreviewDecs, _stopPreviewDecs, _setCaptureParamsDecs, _setVideoOrientationDecs, _ref;
|
|
60
60
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
61
61
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
62
62
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
@@ -67,14 +67,14 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
67
67
|
/**
|
|
68
68
|
* Interface for a video track from a camera in Agora RTE SDK.
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
_ref = (_startPreviewDecs = (0, _imports.trace)(['config', 'view']), _stopPreviewDecs = (0, _imports.trace)(['view']), _setCaptureParamsDecs = (0, _imports.trace)(['params']), _setVideoOrientationDecs = (0, _imports.trace)(['orientation']), "logger");
|
|
71
71
|
//@internal
|
|
72
|
-
var AgoraRteCameraTrackImpl = exports.AgoraRteCameraTrackImpl = /*#__PURE__*/function (
|
|
72
|
+
var AgoraRteCameraTrackImpl = exports.AgoraRteCameraTrackImpl = /*#__PURE__*/function (_AgoraRteBaseTrack) {
|
|
73
73
|
function AgoraRteCameraTrackImpl(_rtcClient, _deviceId) {
|
|
74
74
|
var _this;
|
|
75
75
|
(0, _classCallCheck2["default"])(this, AgoraRteCameraTrackImpl);
|
|
76
76
|
_this = _callSuper(this, AgoraRteCameraTrackImpl, [_rtcClient]);
|
|
77
|
-
(0, _defineProperty2["default"])(_this,
|
|
77
|
+
(0, _defineProperty2["default"])(_this, _ref, (_initProto(_this), (0, _logger.createLogger)({
|
|
78
78
|
prefix: 'AgoraRteCameraTrackImpl'
|
|
79
79
|
})));
|
|
80
80
|
(0, _defineProperty2["default"])(_this, "_state", _type.AgoraRteMediaSourceState.CLOSE);
|
|
@@ -85,7 +85,7 @@ var AgoraRteCameraTrackImpl = exports.AgoraRteCameraTrackImpl = /*#__PURE__*/fun
|
|
|
85
85
|
});
|
|
86
86
|
return _this;
|
|
87
87
|
}
|
|
88
|
-
(0, _inherits2["default"])(AgoraRteCameraTrackImpl,
|
|
88
|
+
(0, _inherits2["default"])(AgoraRteCameraTrackImpl, _AgoraRteBaseTrack);
|
|
89
89
|
return (0, _createClass2["default"])(AgoraRteCameraTrackImpl, [{
|
|
90
90
|
key: "getVideoEffectEnhancer",
|
|
91
91
|
value: function getVideoEffectEnhancer() {
|
|
@@ -166,9 +166,9 @@ var AgoraRteCameraTrackImpl = exports.AgoraRteCameraTrackImpl = /*#__PURE__*/fun
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
}]);
|
|
169
|
-
}(
|
|
169
|
+
}(_baseTrack.AgoraRteBaseTrack); // @internal
|
|
170
170
|
_AgoraRteCameraTrackImpl = AgoraRteCameraTrackImpl;
|
|
171
|
-
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AgoraRteCameraTrackImpl, [[_imports.trace, 2, "switchPosition"], [_imports.trace, 2, "start"], [_imports.trace, 2, "stop"], [_startPreviewDecs, 2, "startPreview"], [_stopPreviewDecs, 2, "stopPreview"], [_imports.trace, 2, "startTest"], [_imports.trace, 2, "stopTest"], [_setCaptureParamsDecs, 2, "setCaptureParams"], [_setVideoOrientationDecs, 2, "setVideoOrientation"]], [], 0, void 0,
|
|
171
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AgoraRteCameraTrackImpl, [[_imports.trace, 2, "switchPosition"], [_imports.trace, 2, "start"], [_imports.trace, 2, "stop"], [_startPreviewDecs, 2, "startPreview"], [_stopPreviewDecs, 2, "stopPreview"], [_imports.trace, 2, "startTest"], [_imports.trace, 2, "stopTest"], [_setCaptureParamsDecs, 2, "setCaptureParams"], [_setVideoOrientationDecs, 2, "setVideoOrientation"]], [], 0, void 0, _baseTrack.AgoraRteBaseTrack).e, 1);
|
|
172
172
|
_initProto = _applyDecs$e[0];
|
|
173
173
|
var AgoraRteCameraDummyTrackImpl = exports.AgoraRteCameraDummyTrackImpl = /*#__PURE__*/function () {
|
|
174
174
|
function AgoraRteCameraDummyTrackImpl() {
|
|
@@ -53,8 +53,8 @@ var _imports = require("../../imports");
|
|
|
53
53
|
var _type = require("../../type");
|
|
54
54
|
var _logger = require("../utilities/logger");
|
|
55
55
|
var _baseTrack = require("./base-track");
|
|
56
|
-
var
|
|
57
|
-
var _initProto, _adjustVolumeDecs,
|
|
56
|
+
var _AgoraRteLoopbackTrackImpl;
|
|
57
|
+
var _initProto, _adjustVolumeDecs, _ref;
|
|
58
58
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
59
59
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
60
60
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
@@ -65,14 +65,14 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
65
65
|
/**
|
|
66
66
|
* Interface for a loopback audio track in Agora RTE SDK.
|
|
67
67
|
*/
|
|
68
|
-
|
|
68
|
+
_ref = (_adjustVolumeDecs = (0, _imports.trace)(['volume']), "logger");
|
|
69
69
|
//@internal
|
|
70
|
-
var AgoraRteLoopbackTrackImpl = exports.AgoraRteLoopbackTrackImpl = /*#__PURE__*/function (
|
|
70
|
+
var AgoraRteLoopbackTrackImpl = exports.AgoraRteLoopbackTrackImpl = /*#__PURE__*/function (_AgoraRteBaseTrack) {
|
|
71
71
|
function AgoraRteLoopbackTrackImpl(_rtcClient, _deviceId) {
|
|
72
72
|
var _this;
|
|
73
73
|
(0, _classCallCheck2["default"])(this, AgoraRteLoopbackTrackImpl);
|
|
74
74
|
_this = _callSuper(this, AgoraRteLoopbackTrackImpl, [_rtcClient]);
|
|
75
|
-
(0, _defineProperty2["default"])(_this,
|
|
75
|
+
(0, _defineProperty2["default"])(_this, _ref, (_initProto(_this), (0, _logger.createLogger)({
|
|
76
76
|
prefix: 'AgoraRteLoopbackTrackImpl'
|
|
77
77
|
})));
|
|
78
78
|
(0, _defineProperty2["default"])(_this, "_state", _type.AgoraRteMediaSourceState.CLOSE);
|
|
@@ -82,7 +82,7 @@ var AgoraRteLoopbackTrackImpl = exports.AgoraRteLoopbackTrackImpl = /*#__PURE__*
|
|
|
82
82
|
});
|
|
83
83
|
return _this;
|
|
84
84
|
}
|
|
85
|
-
(0, _inherits2["default"])(AgoraRteLoopbackTrackImpl,
|
|
85
|
+
(0, _inherits2["default"])(AgoraRteLoopbackTrackImpl, _AgoraRteBaseTrack);
|
|
86
86
|
return (0, _createClass2["default"])(AgoraRteLoopbackTrackImpl, [{
|
|
87
87
|
key: "getDeviceId",
|
|
88
88
|
value: function getDeviceId() {
|
|
@@ -123,9 +123,9 @@ var AgoraRteLoopbackTrackImpl = exports.AgoraRteLoopbackTrackImpl = /*#__PURE__*
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
}]);
|
|
126
|
-
}(
|
|
126
|
+
}(_baseTrack.AgoraRteBaseTrack); // @internal
|
|
127
127
|
_AgoraRteLoopbackTrackImpl = AgoraRteLoopbackTrackImpl;
|
|
128
|
-
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AgoraRteLoopbackTrackImpl, [[_imports.trace, 2, "start"], [_imports.trace, 2, "stop"], [_adjustVolumeDecs, 2, "adjustVolume"]], [], 0, void 0,
|
|
128
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AgoraRteLoopbackTrackImpl, [[_imports.trace, 2, "start"], [_imports.trace, 2, "stop"], [_adjustVolumeDecs, 2, "adjustVolume"]], [], 0, void 0, _baseTrack.AgoraRteBaseTrack).e, 1);
|
|
129
129
|
_initProto = _applyDecs$e[0];
|
|
130
130
|
var AgoraRteLoopbackDummyTrackImpl = exports.AgoraRteLoopbackDummyTrackImpl = /*#__PURE__*/function () {
|
|
131
131
|
function AgoraRteLoopbackDummyTrackImpl() {
|
|
@@ -55,8 +55,8 @@ var _effectEnhancer = require("./effect-enhancer");
|
|
|
55
55
|
var _imports = require("../../imports");
|
|
56
56
|
var _logger = require("../utilities/logger");
|
|
57
57
|
var _constant = require("../../constant");
|
|
58
|
-
var
|
|
59
|
-
var _initProto, _setAudioRawDataConfigDecs, _startTestDecs, _adjustVolumeDecs,
|
|
58
|
+
var _AgoraRteMicrophoneTrackImpl;
|
|
59
|
+
var _initProto, _setAudioRawDataConfigDecs, _startTestDecs, _adjustVolumeDecs, _ref;
|
|
60
60
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
61
61
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
62
62
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
@@ -67,14 +67,14 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
67
67
|
/**
|
|
68
68
|
* Interface for a microphone audio track in Agora RTE SDK.
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
_ref = (_setAudioRawDataConfigDecs = (0, _imports.trace)(['config']), _startTestDecs = (0, _imports.trace)(['interval']), _adjustVolumeDecs = (0, _imports.trace)(['volume']), "logger");
|
|
71
71
|
//@internal
|
|
72
|
-
var AgoraRteMicrophoneTrackImpl = exports.AgoraRteMicrophoneTrackImpl = /*#__PURE__*/function (
|
|
72
|
+
var AgoraRteMicrophoneTrackImpl = exports.AgoraRteMicrophoneTrackImpl = /*#__PURE__*/function (_AgoraRteBaseTrack) {
|
|
73
73
|
function AgoraRteMicrophoneTrackImpl(_rtcClient, _deviceId) {
|
|
74
74
|
var _this;
|
|
75
75
|
(0, _classCallCheck2["default"])(this, AgoraRteMicrophoneTrackImpl);
|
|
76
76
|
_this = _callSuper(this, AgoraRteMicrophoneTrackImpl, [_rtcClient]);
|
|
77
|
-
(0, _defineProperty2["default"])(_this,
|
|
77
|
+
(0, _defineProperty2["default"])(_this, _ref, (_initProto(_this), (0, _logger.createLogger)({
|
|
78
78
|
prefix: 'AgoraRteMicrophoneTrackImpl'
|
|
79
79
|
})));
|
|
80
80
|
(0, _defineProperty2["default"])(_this, "_state", _type.AgoraRteMediaSourceState.CLOSE);
|
|
@@ -87,7 +87,7 @@ var AgoraRteMicrophoneTrackImpl = exports.AgoraRteMicrophoneTrackImpl = /*#__PUR
|
|
|
87
87
|
_this._rtcClient.sourceManager.addObserver(_this._sourceManagerObserver);
|
|
88
88
|
return _this;
|
|
89
89
|
}
|
|
90
|
-
(0, _inherits2["default"])(AgoraRteMicrophoneTrackImpl,
|
|
90
|
+
(0, _inherits2["default"])(AgoraRteMicrophoneTrackImpl, _AgoraRteBaseTrack);
|
|
91
91
|
return (0, _createClass2["default"])(AgoraRteMicrophoneTrackImpl, [{
|
|
92
92
|
key: "release",
|
|
93
93
|
value: function release() {
|
|
@@ -161,9 +161,9 @@ var AgoraRteMicrophoneTrackImpl = exports.AgoraRteMicrophoneTrackImpl = /*#__PUR
|
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
}]);
|
|
164
|
-
}(
|
|
164
|
+
}(_baseTrack.AgoraRteBaseTrack); // @internal
|
|
165
165
|
_AgoraRteMicrophoneTrackImpl = AgoraRteMicrophoneTrackImpl;
|
|
166
|
-
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AgoraRteMicrophoneTrackImpl, [[_imports.trace, 2, "release"], [_setAudioRawDataConfigDecs, 2, "setAudioRawDataConfig"], [_imports.trace, 2, "start"], [_imports.trace, 2, "stop"], [_startTestDecs, 2, "startTest"], [_imports.trace, 2, "stopTest"], [_adjustVolumeDecs, 2, "adjustVolume"], [_imports.bound, 2, "_handleMicrophoneStateUpdated"], [_imports.bound, 2, "_handleLocalMicrophoneVolumeUpdated"]], [], 0, void 0,
|
|
166
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AgoraRteMicrophoneTrackImpl, [[_imports.trace, 2, "release"], [_setAudioRawDataConfigDecs, 2, "setAudioRawDataConfig"], [_imports.trace, 2, "start"], [_imports.trace, 2, "stop"], [_startTestDecs, 2, "startTest"], [_imports.trace, 2, "stopTest"], [_adjustVolumeDecs, 2, "adjustVolume"], [_imports.bound, 2, "_handleMicrophoneStateUpdated"], [_imports.bound, 2, "_handleLocalMicrophoneVolumeUpdated"]], [], 0, void 0, _baseTrack.AgoraRteBaseTrack).e, 1);
|
|
167
167
|
_initProto = _applyDecs$e[0];
|
|
168
168
|
var AgoraRteMicrophoneDummyTrackImpl = exports.AgoraRteMicrophoneDummyTrackImpl = /*#__PURE__*/function () {
|
|
169
169
|
function AgoraRteMicrophoneDummyTrackImpl() {
|
package/lib/core/media/screen.js
CHANGED
|
@@ -57,8 +57,8 @@ var _type3 = require("./type");
|
|
|
57
57
|
var _logger = require("../utilities/logger");
|
|
58
58
|
var _imports = require("../../imports");
|
|
59
59
|
var _constant = require("../../constant");
|
|
60
|
-
var
|
|
61
|
-
var _initProto, _setCaptureParamsDecs, _startDecs, _updateExcludeWindowsDecs, _startPreviewDecs,
|
|
60
|
+
var _AgoraRteScreenTrackImpl;
|
|
61
|
+
var _initProto, _setCaptureParamsDecs, _startDecs, _updateExcludeWindowsDecs, _startPreviewDecs, _ref;
|
|
62
62
|
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
|
|
63
63
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
64
64
|
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
@@ -69,14 +69,14 @@ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side
|
|
|
69
69
|
/**
|
|
70
70
|
* Interface for a screen video track in Agora RTE SDK.
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
_ref = (_setCaptureParamsDecs = (0, _imports.trace)(['params']), _startDecs = (0, _imports.trace)(['type', 'excludeWindowList']), _updateExcludeWindowsDecs = (0, _imports.trace)(['excludeWindowList']), _startPreviewDecs = (0, _imports.trace)(['config', 'view']), "logger");
|
|
73
73
|
//@internal
|
|
74
|
-
var AgoraRteScreenTrackImpl = exports.AgoraRteScreenTrackImpl = /*#__PURE__*/function (
|
|
74
|
+
var AgoraRteScreenTrackImpl = exports.AgoraRteScreenTrackImpl = /*#__PURE__*/function (_AgoraRteBaseTrack) {
|
|
75
75
|
function AgoraRteScreenTrackImpl(_rtcClient, _sourceId) {
|
|
76
76
|
var _this;
|
|
77
77
|
(0, _classCallCheck2["default"])(this, AgoraRteScreenTrackImpl);
|
|
78
78
|
_this = _callSuper(this, AgoraRteScreenTrackImpl, [_rtcClient]);
|
|
79
|
-
(0, _defineProperty2["default"])(_this,
|
|
79
|
+
(0, _defineProperty2["default"])(_this, _ref, (_initProto(_this), (0, _logger.createLogger)({
|
|
80
80
|
prefix: 'AgoraRteScreenTrackImpl'
|
|
81
81
|
})));
|
|
82
82
|
(0, _defineProperty2["default"])(_this, "_state", _type.AgoraRteMediaSourceState.CLOSE);
|
|
@@ -88,7 +88,7 @@ var AgoraRteScreenTrackImpl = exports.AgoraRteScreenTrackImpl = /*#__PURE__*/fun
|
|
|
88
88
|
});
|
|
89
89
|
return _this;
|
|
90
90
|
}
|
|
91
|
-
(0, _inherits2["default"])(AgoraRteScreenTrackImpl,
|
|
91
|
+
(0, _inherits2["default"])(AgoraRteScreenTrackImpl, _AgoraRteBaseTrack);
|
|
92
92
|
return (0, _createClass2["default"])(AgoraRteScreenTrackImpl, [{
|
|
93
93
|
key: "getSourceId",
|
|
94
94
|
value: function getSourceId() {
|
|
@@ -166,9 +166,9 @@ var AgoraRteScreenTrackImpl = exports.AgoraRteScreenTrackImpl = /*#__PURE__*/fun
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
}]);
|
|
169
|
-
}(
|
|
169
|
+
}(_baseTrack.AgoraRteBaseTrack); // @internal
|
|
170
170
|
_AgoraRteScreenTrackImpl = AgoraRteScreenTrackImpl;
|
|
171
|
-
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AgoraRteScreenTrackImpl, [[_setCaptureParamsDecs, 2, "setCaptureParams"], [_startDecs, 2, "start"], [_imports.trace, 2, "stop"], [_updateExcludeWindowsDecs, 2, "updateExcludeWindows"], [_startPreviewDecs, 2, "startPreview"], [_imports.trace, 2, "stopPreview"]], [], 0, void 0,
|
|
171
|
+
var _applyDecs$e = (0, _slicedToArray2["default"])(_applyDecs(_AgoraRteScreenTrackImpl, [[_setCaptureParamsDecs, 2, "setCaptureParams"], [_startDecs, 2, "start"], [_imports.trace, 2, "stop"], [_updateExcludeWindowsDecs, 2, "updateExcludeWindows"], [_startPreviewDecs, 2, "startPreview"], [_imports.trace, 2, "stopPreview"]], [], 0, void 0, _baseTrack.AgoraRteBaseTrack).e, 1);
|
|
172
172
|
_initProto = _applyDecs$e[0];
|
|
173
173
|
var AgoraRteScreenDummyTrackImpl = exports.AgoraRteScreenDummyTrackImpl = /*#__PURE__*/function () {
|
|
174
174
|
function AgoraRteScreenDummyTrackImpl() {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { AgoraRtcChannelClient } from '../../rtc/channel';
|
|
2
2
|
import { AgoraRteMediaStreamInfo, AgoraRteLocalUser } from '../type';
|
|
3
|
+
import { Logger } from '../../../imports';
|
|
3
4
|
/**
|
|
4
5
|
* Handle streams published event - republish audio/video streams through RTC
|
|
5
6
|
* @param streams Array of stream info to be published
|
|
6
7
|
* @param rtcChannelClient RTC channel client for publishing
|
|
7
8
|
* @param localUser Local user for token management
|
|
8
9
|
*/
|
|
9
|
-
export declare function handleStreamsPublished(streams: AgoraRteMediaStreamInfo[], rtcChannelClient: AgoraRtcChannelClient, localUser: AgoraRteLocalUser, screenStreamLabelMap: Map<string, Map<string, string
|
|
10
|
+
export declare function handleStreamsPublished(streams: AgoraRteMediaStreamInfo[], rtcChannelClient: AgoraRtcChannelClient, localUser: AgoraRteLocalUser, screenStreamLabelMap: Map<string, Map<string, string>>, logger: Logger): void;
|
|
10
11
|
/**
|
|
11
12
|
* Handle streams unpublished event - stop publishing audio/video streams through RTC
|
|
12
13
|
* @param streams Array of stream info to be unpublished
|
|
@@ -15,19 +15,14 @@ require("core-js/modules/esnext.iterator.constructor.js");
|
|
|
15
15
|
require("core-js/modules/esnext.iterator.for-each.js");
|
|
16
16
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
17
17
|
var _type = require("../type");
|
|
18
|
-
var _logger = require("../../utilities/logger");
|
|
19
18
|
var _type2 = require("../../../type");
|
|
20
|
-
var logger = (0, _logger.createLogger)({
|
|
21
|
-
prefix: 'StreamHandlers'
|
|
22
|
-
});
|
|
23
|
-
|
|
24
19
|
/**
|
|
25
20
|
* Handle streams published event - republish audio/video streams through RTC
|
|
26
21
|
* @param streams Array of stream info to be published
|
|
27
22
|
* @param rtcChannelClient RTC channel client for publishing
|
|
28
23
|
* @param localUser Local user for token management
|
|
29
24
|
*/
|
|
30
|
-
function handleStreamsPublished(streams, rtcChannelClient, localUser, screenStreamLabelMap) {
|
|
25
|
+
function handleStreamsPublished(streams, rtcChannelClient, localUser, screenStreamLabelMap, logger) {
|
|
31
26
|
streams.forEach(/*#__PURE__*/function () {
|
|
32
27
|
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(stream) {
|
|
33
28
|
var streamToken, shouldPublishAudio, shouldPublishVideo, localLabelSourceType, sourceType, observer;
|
|
@@ -53,7 +48,7 @@ function handleStreamsPublished(streams, rtcChannelClient, localUser, screenStre
|
|
|
53
48
|
if (!streamToken) {
|
|
54
49
|
observer = {
|
|
55
50
|
onStreamTokenUpdated: function onStreamTokenUpdated(streamId, token) {
|
|
56
|
-
logger.info("republish stream after token updated streamId: ".concat(streamId));
|
|
51
|
+
logger.info("[StreamPublishHandlers] republish stream after token updated streamId: ".concat(streamId));
|
|
57
52
|
if (streamId === stream.streamId) {
|
|
58
53
|
if (shouldPublishAudio) {
|
|
59
54
|
rtcChannelClient === null || rtcChannelClient === void 0 || rtcChannelClient.publisher.publishLocalAudioStream(token, stream.streamId, stream.audioSourceId, stream.audioSourceType);
|
package/lib/core/scene/index.js
CHANGED
|
@@ -767,7 +767,7 @@ var AgoraRteSceneImpl = exports.AgoraRteSceneImpl = /*#__PURE__*/function () {
|
|
|
767
767
|
value: function _handleOnSnapshotUpdated() {
|
|
768
768
|
var localStreams = this.getStreamsByUserId(this.localUser.getLocalUserId());
|
|
769
769
|
if (this._rtcChannelClient && this._localUser) {
|
|
770
|
-
(0, _streamPublishHandlers.handleStreamsPublished)(localStreams, this._rtcChannelClient, this._localUser, this._screenStreamLabelMap);
|
|
770
|
+
(0, _streamPublishHandlers.handleStreamsPublished)(localStreams, this._rtcChannelClient, this._localUser, this._screenStreamLabelMap, this.logger);
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
773
|
}, {
|
|
@@ -992,7 +992,7 @@ var AgoraRteSceneImpl = exports.AgoraRteSceneImpl = /*#__PURE__*/function () {
|
|
|
992
992
|
return;
|
|
993
993
|
}
|
|
994
994
|
if (this._rtcChannelClient && this._localUser) {
|
|
995
|
-
(0, _streamPublishHandlers.handleStreamsPublished)(streams, this._rtcChannelClient, this._localUser, this._screenStreamLabelMap);
|
|
995
|
+
(0, _streamPublishHandlers.handleStreamsPublished)(streams, this._rtcChannelClient, this._localUser, this._screenStreamLabelMap, this.logger);
|
|
996
996
|
}
|
|
997
997
|
this._checkMediaSourceState(streams);
|
|
998
998
|
this._checkLocalStreamBind(streams);
|
|
@@ -1011,7 +1011,7 @@ var AgoraRteSceneImpl = exports.AgoraRteSceneImpl = /*#__PURE__*/function () {
|
|
|
1011
1011
|
return;
|
|
1012
1012
|
}
|
|
1013
1013
|
if (this._rtcChannelClient && this._localUser) {
|
|
1014
|
-
(0, _streamPublishHandlers.handleStreamsPublished)(streams, this._rtcChannelClient, this._localUser, this._screenStreamLabelMap);
|
|
1014
|
+
(0, _streamPublishHandlers.handleStreamsPublished)(streams, this._rtcChannelClient, this._localUser, this._screenStreamLabelMap, this.logger);
|
|
1015
1015
|
}
|
|
1016
1016
|
this._checkMediaSourceState(streams);
|
|
1017
1017
|
this._checkLocalStreamBind(streams);
|
package/lib/core/scene/type.d.ts
CHANGED
package/lib/core/scene/type.js
CHANGED
|
@@ -21,6 +21,7 @@ var AgoraRteRoomConnectorType = exports.AgoraRteRoomConnectorType = /*#__PURE__*
|
|
|
21
21
|
AgoraRteRoomConnectorType[AgoraRteRoomConnectorType["PSTN"] = 1] = "PSTN";
|
|
22
22
|
AgoraRteRoomConnectorType[AgoraRteRoomConnectorType["SIP"] = 2] = "SIP";
|
|
23
23
|
AgoraRteRoomConnectorType[AgoraRteRoomConnectorType["H323"] = 3] = "H323";
|
|
24
|
+
AgoraRteRoomConnectorType[AgoraRteRoomConnectorType["VOLTE"] = 4] = "VOLTE";
|
|
24
25
|
return AgoraRteRoomConnectorType;
|
|
25
26
|
}({});
|
|
26
27
|
var AgoraRteUserUpdatedReason = exports.AgoraRteUserUpdatedReason = /*#__PURE__*/function (AgoraRteUserUpdatedReason) {
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
export declare
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { LoggerManager, Logger } from '../../imports';
|
|
2
|
+
export declare class RteLoggerManagerHolder {
|
|
3
|
+
private static instance;
|
|
4
|
+
private static isDestroying;
|
|
5
|
+
private static label;
|
|
6
|
+
static initialize(opts: {
|
|
7
|
+
maxSize?: number;
|
|
8
|
+
}): void;
|
|
9
|
+
static getInstance(): LoggerManager;
|
|
10
|
+
static createLogger(opts: {
|
|
11
|
+
prefix: string;
|
|
12
|
+
database?: boolean;
|
|
13
|
+
}): Logger;
|
|
14
|
+
static getLogger(): Logger;
|
|
15
|
+
static generateLogObserver<T>(logger: Logger, callbackMethods: (keyof T | [keyof T, string[]])[]): T;
|
|
16
|
+
static destroy(): void;
|
|
17
|
+
static isInitialized(): boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare const getLogger: typeof RteLoggerManagerHolder.getLogger;
|
|
20
|
+
export declare const createLogger: typeof RteLoggerManagerHolder.createLogger;
|
|
21
|
+
export declare const generateLogObserver: typeof RteLoggerManagerHolder.generateLogObserver;
|
|
22
|
+
export declare const getRtmSdkLogger: (maxSize?: number) => Logger;
|
|
@@ -1,20 +1,86 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
|
-
exports.getRtmSdkLogger = exports.getLogger = exports.generateLogObserver = exports.createLogger = void 0;
|
|
8
|
+
exports.getRtmSdkLogger = exports.getLogger = exports.generateLogObserver = exports.createLogger = exports.RteLoggerManagerHolder = void 0;
|
|
9
|
+
require("core-js/modules/es.error.cause.js");
|
|
10
|
+
require("core-js/modules/es.error.to-string.js");
|
|
8
11
|
require("core-js/modules/es.function.bind.js");
|
|
12
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
15
|
var _imports = require("../../imports");
|
|
10
|
-
var
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
var RteLoggerManagerHolder = exports.RteLoggerManagerHolder = /*#__PURE__*/function () {
|
|
17
|
+
function RteLoggerManagerHolder() {
|
|
18
|
+
(0, _classCallCheck2["default"])(this, RteLoggerManagerHolder);
|
|
19
|
+
}
|
|
20
|
+
return (0, _createClass2["default"])(RteLoggerManagerHolder, null, [{
|
|
21
|
+
key: "initialize",
|
|
22
|
+
value: function initialize(opts) {
|
|
23
|
+
if (this.instance && !this.isDestroying) {
|
|
24
|
+
console.warn("".concat(this.label, " LoggerManager is already initialized. Reinitializing..."));
|
|
25
|
+
}
|
|
26
|
+
this.destroy();
|
|
27
|
+
this.instance = new _imports.LoggerManager({
|
|
28
|
+
label: this.label,
|
|
29
|
+
maxSize: opts.maxSize
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
key: "getInstance",
|
|
34
|
+
value: function getInstance() {
|
|
35
|
+
if (!this.instance) {
|
|
36
|
+
throw new Error('LoggerManager is not initialized. ' + "Call ".concat(this.label, "LoggerManager.initialize() first."));
|
|
37
|
+
}
|
|
38
|
+
return this.instance;
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "createLogger",
|
|
42
|
+
value: function createLogger(opts) {
|
|
43
|
+
return this.getInstance().createLogger(opts);
|
|
44
|
+
}
|
|
45
|
+
}, {
|
|
46
|
+
key: "getLogger",
|
|
47
|
+
value: function getLogger() {
|
|
48
|
+
return this.getInstance().getLogger();
|
|
49
|
+
}
|
|
50
|
+
}, {
|
|
51
|
+
key: "generateLogObserver",
|
|
52
|
+
value: function generateLogObserver(logger, callbackMethods) {
|
|
53
|
+
return this.getInstance().generateLogObserver(logger, callbackMethods);
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "destroy",
|
|
57
|
+
value: function destroy() {
|
|
58
|
+
if (this.instance && !this.isDestroying) {
|
|
59
|
+
this.isDestroying = true;
|
|
60
|
+
try {
|
|
61
|
+
this.instance.release();
|
|
62
|
+
} finally {
|
|
63
|
+
this.instance = null;
|
|
64
|
+
this.isDestroying = false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "isInitialized",
|
|
70
|
+
value: function isInitialized() {
|
|
71
|
+
return this.instance !== null;
|
|
72
|
+
}
|
|
73
|
+
}]);
|
|
74
|
+
}();
|
|
75
|
+
(0, _defineProperty2["default"])(RteLoggerManagerHolder, "instance", null);
|
|
76
|
+
(0, _defineProperty2["default"])(RteLoggerManagerHolder, "isDestroying", false);
|
|
77
|
+
(0, _defineProperty2["default"])(RteLoggerManagerHolder, "label", 'agora-rte');
|
|
78
|
+
var getLogger = exports.getLogger = RteLoggerManagerHolder.getLogger.bind(RteLoggerManagerHolder);
|
|
79
|
+
var createLogger = exports.createLogger = RteLoggerManagerHolder.createLogger.bind(RteLoggerManagerHolder);
|
|
80
|
+
var generateLogObserver = exports.generateLogObserver = RteLoggerManagerHolder.generateLogObserver.bind(RteLoggerManagerHolder);
|
|
81
|
+
var getRtmSdkLogger = exports.getRtmSdkLogger = function getRtmSdkLogger(maxSize) {
|
|
17
82
|
return (0, _imports.createLogger)({
|
|
18
|
-
label: 'agora-rtm'
|
|
83
|
+
label: 'agora-rtm',
|
|
84
|
+
maxSize: maxSize
|
|
19
85
|
});
|
|
20
86
|
};
|
|
@@ -14,6 +14,9 @@ export declare const getRtcInternaApConfig: (parameters?: AgoraRteEngineParamete
|
|
|
14
14
|
export declare const getRtcWebExternaApConfig: (parameters?: AgoraRteEngineParameters) => {} | undefined;
|
|
15
15
|
export declare const getRtcWebInternaApConfig: (parameters?: AgoraRteEngineParameters) => {} | undefined;
|
|
16
16
|
export declare const getApDetectTimeout: (parameters?: AgoraRteEngineParameters) => number;
|
|
17
|
+
export declare const getRteLogFileSize: (parameters?: AgoraRteEngineParameters) => number | undefined;
|
|
18
|
+
export declare const getRtcLogFileSize: (parameters?: AgoraRteEngineParameters) => number | undefined;
|
|
19
|
+
export declare const getRtmLogFileSize: (parameters?: AgoraRteEngineParameters) => number | undefined;
|
|
17
20
|
export declare const getApDetectIsRedetect: (parameters?: AgoraRteEngineParameters) => boolean;
|
|
18
21
|
export declare const getRtcClientIsDisabled: (parameters?: AgoraRteEngineParameters) => boolean;
|
|
19
22
|
export declare const getRtmClientIsDisabled: (parameters?: AgoraRteEngineParameters) => boolean;
|