agora-rte-sdk 3.8.2 → 3.9.0-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 +9 -0
- package/lib/constant.js +13 -2
- package/lib/core/engine/ap-detector.d.ts +4 -4
- package/lib/core/engine/ap-detector.js +33 -20
- package/lib/core/engine/index.d.ts +19 -11
- package/lib/core/engine/index.js +132 -48
- package/lib/core/engine/plugin.js +2 -2
- package/lib/core/engine/type.d.ts +29 -0
- package/lib/core/engine/type.js +6 -0
- package/lib/core/media/camera.d.ts +8 -8
- package/lib/core/media/camera.js +38 -21
- package/lib/core/media/effect-enhancer.d.ts +5 -6
- package/lib/core/media/effect-enhancer.js +6 -16
- package/lib/core/media/index.d.ts +1 -155
- package/lib/core/media/index.js +44 -15
- package/lib/core/media/loopback.d.ts +3 -3
- package/lib/core/media/loopback.js +18 -11
- package/lib/core/media/microphone.d.ts +6 -6
- package/lib/core/media/microphone.js +32 -16
- package/lib/core/media/screen.d.ts +13 -5
- package/lib/core/media/screen.js +46 -16
- package/lib/core/media/type.d.ts +159 -2
- package/lib/core/media/type.js +4 -1
- package/lib/core/processor/message-handler.d.ts +4 -4
- package/lib/core/processor/message-handler.js +66 -28
- package/lib/core/processor/sequence-msg/data.d.ts +9 -7
- package/lib/core/processor/sequence-msg/data.js +26 -3
- package/lib/core/processor/struct.js +2 -2
- package/lib/core/processor/synchronizer/synchronizer-manager.d.ts +10 -0
- package/lib/core/processor/synchronizer/synchronizer-manager.js +43 -4
- package/lib/core/rtc/capture-enhancement.d.ts +4 -14
- package/lib/core/rtc/channel.d.ts +4 -4
- package/lib/core/rtc/constant.d.ts +1 -5
- package/lib/core/rtc/constant.js +2 -8
- package/lib/core/rtc/publish-pool.d.ts +20 -8
- package/lib/core/rtc/publish-pool.js +272 -3
- package/lib/core/rtc/publisher.d.ts +20 -14
- package/lib/core/rtc/publisher.js +151 -7
- package/lib/core/rtc/source-manager.d.ts +12 -2
- package/lib/core/rtc/subscriber.d.ts +14 -6
- package/lib/core/rtc/subscriber.js +171 -4
- package/lib/core/rtc/type.d.ts +6 -17
- package/lib/core/rtc/type.js +10 -26
- package/lib/core/rtm/channel.d.ts +3 -3
- package/lib/core/rtm/client.d.ts +4 -4
- package/lib/core/rtm/type.d.ts +1 -2
- package/lib/core/scene/helpers/ap-detect.d.ts +5 -0
- package/lib/core/scene/helpers/ap-detect.js +153 -0
- package/lib/core/scene/helpers/join.d.ts +8 -0
- package/lib/core/scene/helpers/join.js +105 -0
- package/lib/core/scene/helpers/rtc-event.d.ts +4 -0
- package/lib/core/scene/helpers/rtc-event.js +36 -0
- package/lib/core/scene/helpers/stream-publish-handlers.d.ts +15 -0
- package/lib/core/scene/helpers/stream-publish-handlers.js +121 -0
- package/lib/core/scene/helpers/stream-type.d.ts +7 -0
- package/lib/core/scene/{helper.js → helpers/stream-type.js} +3 -32
- package/lib/core/scene/index.d.ts +69 -187
- package/lib/core/scene/index.js +813 -1368
- package/lib/core/scene/local-user.d.ts +19 -85
- package/lib/core/scene/local-user.js +151 -152
- package/lib/core/scene/state-sync.d.ts +5 -7
- package/lib/core/scene/state-sync.js +20 -43
- package/lib/core/scene/stream-player.d.ts +9 -8
- package/lib/core/scene/stream-player.js +13 -10
- package/lib/core/scene/type.d.ts +359 -9
- package/lib/core/services/api.d.ts +9 -0
- package/lib/core/services/api.js +96 -58
- package/lib/core/services/auth-headers.d.ts +1 -0
- package/lib/core/services/auth-headers.js +5 -2
- package/lib/core/services/client.d.ts +3 -0
- package/lib/core/services/client.js +14 -2
- package/lib/core/services/type.d.ts +1 -0
- package/lib/core/type.d.ts +1 -0
- package/lib/core/type.js +6 -0
- package/lib/core/utilities/abort-manager.d.ts +18 -0
- package/lib/core/utilities/abort-manager.js +154 -0
- package/lib/core/utilities/error.d.ts +5 -36
- package/lib/core/utilities/error.js +23 -92
- package/lib/core/utilities/join-manager.d.ts +54 -0
- package/lib/core/utilities/join-manager.js +198 -0
- package/lib/core/utilities/logger.d.ts +2 -0
- package/lib/core/utilities/logger.js +8 -13
- package/lib/core/utilities/package-info.d.ts +1 -0
- package/lib/core/utilities/package-info.js +6 -4
- package/lib/core/utilities/property-extract.d.ts +2 -0
- package/lib/core/utilities/property-extract.js +79 -0
- package/lib/core/utilities/weak-invoker.d.ts +11 -0
- package/lib/core/utilities/weak-invoker.js +121 -0
- package/lib/imports.d.ts +6 -4
- package/lib/imports.js +42 -17
- package/lib/index.d.ts +7 -5
- package/lib/index.js +6 -5
- package/lib/plugin/restful-client/index.d.ts +1 -1
- package/lib/plugin/restful-client/index.js +11 -10
- package/lib/plugin/rtc/electron/camera-preview-task-manager.d.ts +14 -0
- package/lib/plugin/rtc/electron/camera-preview-task-manager.js +125 -0
- package/lib/plugin/rtc/electron/canvas-helper.d.ts +2 -2
- package/lib/plugin/rtc/electron/canvas-helper.js +15 -12
- package/lib/plugin/rtc/electron/canvas-tag-pool.d.ts +4 -4
- package/lib/plugin/rtc/electron/canvas-tag-pool.js +21 -13
- package/lib/plugin/rtc/electron/capture-enhancement.d.ts +3 -5
- package/lib/plugin/rtc/electron/capture-enhancement.js +45 -29
- package/lib/plugin/rtc/electron/channel.d.ts +13 -16
- package/lib/plugin/rtc/electron/channel.js +48 -57
- package/lib/plugin/rtc/electron/client.d.ts +8 -4
- package/lib/plugin/rtc/electron/client.js +107 -72
- package/lib/plugin/rtc/electron/constants.d.ts +12 -1
- package/lib/plugin/rtc/electron/constants.js +94 -26
- package/lib/plugin/rtc/electron/desc-type.js +1 -1
- package/lib/plugin/rtc/electron/downloadALD.js +9 -7
- package/lib/plugin/rtc/electron/publish-pool.d.ts +9 -17
- package/lib/plugin/rtc/electron/publish-pool.js +110 -256
- package/lib/plugin/rtc/electron/publisher.d.ts +9 -21
- package/lib/plugin/rtc/electron/publisher.js +80 -254
- package/lib/plugin/rtc/electron/source-manager.d.ts +22 -16
- package/lib/plugin/rtc/electron/source-manager.js +345 -215
- package/lib/plugin/rtc/electron/source-state-control/loopback-state-control.d.ts +1 -5
- package/lib/plugin/rtc/electron/source-state-control/loopback-state-control.js +2 -18
- package/lib/plugin/rtc/electron/source-state-control/media-state-control.d.ts +18 -0
- package/lib/plugin/rtc/electron/source-state-control/{camera-state-control.js → media-state-control.js} +50 -104
- package/lib/plugin/rtc/electron/source-state-control/microphone-state-control.d.ts +4 -10
- package/lib/plugin/rtc/electron/source-state-control/microphone-state-control.js +5 -26
- package/lib/plugin/rtc/electron/source-state-control/source-state-control.d.ts +30 -26
- package/lib/plugin/rtc/electron/source-state-control/source-state-control.js +68 -110
- package/lib/plugin/rtc/electron/subscriber.d.ts +7 -16
- package/lib/plugin/rtc/electron/subscriber.js +34 -112
- package/lib/plugin/rtc/electron/type.d.ts +7 -3
- package/lib/plugin/rtc/electron/type.js +8 -2
- package/lib/plugin/rtc/electron/utils.d.ts +9 -6
- package/lib/plugin/rtc/electron/utils.js +37 -9
- package/lib/plugin/rtc/web/assembler.d.ts +2 -1
- package/lib/plugin/rtc/web/assembler.js +9 -2
- package/lib/plugin/rtc/web/audio-player.d.ts +1 -1
- package/lib/plugin/rtc/web/audio-player.js +13 -8
- package/lib/plugin/rtc/web/canvas-helper.d.ts +1 -1
- package/lib/plugin/rtc/web/canvas-helper.js +3 -1
- package/lib/plugin/rtc/web/capture-enhancement.d.ts +3 -5
- package/lib/plugin/rtc/web/capture-enhancement.js +14 -20
- package/lib/plugin/rtc/web/channel.d.ts +17 -13
- package/lib/plugin/rtc/web/channel.js +221 -124
- package/lib/plugin/rtc/web/client.d.ts +5 -3
- package/lib/plugin/rtc/web/client.js +49 -21
- package/lib/plugin/rtc/web/convert-type.d.ts +3 -0
- package/lib/plugin/rtc/web/convert-type.js +22 -0
- package/lib/plugin/rtc/web/device.js +2 -3
- package/lib/plugin/rtc/web/effect-enabler.js +3 -3
- package/lib/plugin/rtc/web/extension.d.ts +1 -1
- package/lib/plugin/rtc/web/extension.js +4 -1
- package/lib/plugin/rtc/web/publish-pool.d.ts +4 -17
- package/lib/plugin/rtc/web/publish-pool.js +41 -194
- package/lib/plugin/rtc/web/publish.d.ts +9 -8
- package/lib/plugin/rtc/web/publish.js +71 -27
- package/lib/plugin/rtc/web/publisher.d.ts +20 -12
- package/lib/plugin/rtc/web/publisher.js +118 -69
- package/lib/plugin/rtc/web/source-manager.d.ts +1 -0
- package/lib/plugin/rtc/web/source-manager.js +15 -9
- package/lib/plugin/rtc/web/subscribe.d.ts +10 -10
- package/lib/plugin/rtc/web/subscribe.js +26 -14
- package/lib/plugin/rtc/web/subscriber.d.ts +5 -10
- package/lib/plugin/rtc/web/subscriber.js +21 -82
- package/lib/plugin/rtc/web/track-control/camera.d.ts +1 -1
- package/lib/plugin/rtc/web/track-control/camera.js +4 -1
- package/lib/plugin/rtc/web/track-control/screen.d.ts +1 -1
- package/lib/plugin/rtc/web/track-control/screen.js +4 -1
- package/lib/plugin/rtm/channel.d.ts +8 -5
- package/lib/plugin/rtm/channel.js +113 -49
- package/lib/plugin/rtm/client.d.ts +10 -5
- package/lib/plugin/rtm/client.js +120 -61
- package/lib/plugin/rtm/utils.js +1 -1
- package/lib/plugin/synchronizer-worker/worker.js +71 -7
- package/lib/type.d.ts +0 -5
- package/lib-es/constant.js +12 -1
- package/lib-es/core/engine/ap-detector.js +36 -22
- package/lib-es/core/engine/index.js +134 -50
- package/lib-es/core/engine/plugin.js +1 -1
- package/lib-es/core/engine/type.js +1 -0
- package/lib-es/core/media/camera.js +38 -22
- package/lib-es/core/media/effect-enhancer.js +6 -16
- package/lib-es/core/media/index.js +44 -17
- package/lib-es/core/media/loopback.js +18 -12
- package/lib-es/core/media/microphone.js +32 -17
- package/lib-es/core/media/screen.js +46 -17
- package/lib-es/core/media/type.js +5 -1
- package/lib-es/core/processor/message-handler.js +44 -6
- package/lib-es/core/processor/sequence-msg/data.js +27 -4
- package/lib-es/core/processor/struct.js +1 -1
- package/lib-es/core/processor/synchronizer/synchronizer-manager.js +43 -4
- package/lib-es/core/rtc/constant.js +1 -7
- package/lib-es/core/rtc/publish-pool.js +274 -4
- package/lib-es/core/rtc/publisher.js +153 -9
- package/lib-es/core/rtc/subscriber.js +172 -4
- package/lib-es/core/rtc/type.js +9 -25
- package/lib-es/core/scene/helpers/ap-detect.js +143 -0
- package/lib-es/core/scene/helpers/join.js +97 -0
- package/lib-es/core/scene/helpers/rtc-event.js +29 -0
- package/lib-es/core/scene/helpers/stream-publish-handlers.js +112 -0
- package/lib-es/core/scene/helpers/stream-type.js +43 -0
- package/lib-es/core/scene/index.js +817 -1373
- package/lib-es/core/scene/local-user.js +144 -146
- package/lib-es/core/scene/state-sync.js +19 -42
- package/lib-es/core/scene/stream-player.js +13 -10
- package/lib-es/core/services/api.js +97 -59
- package/lib-es/core/services/auth-headers.js +4 -1
- package/lib-es/core/services/client.js +13 -1
- package/lib-es/core/type.js +1 -0
- package/lib-es/core/utilities/abort-manager.js +146 -0
- package/lib-es/core/utilities/error.js +22 -91
- package/lib-es/core/utilities/join-manager.js +190 -0
- package/lib-es/core/utilities/logger.js +8 -13
- package/lib-es/core/utilities/package-info.js +5 -3
- package/lib-es/core/utilities/property-extract.js +71 -0
- package/lib-es/core/utilities/weak-invoker.js +113 -0
- package/lib-es/imports.js +9 -5
- package/lib-es/index.js +3 -2
- package/lib-es/plugin/restful-client/index.js +5 -4
- package/lib-es/plugin/rtc/electron/camera-preview-task-manager.js +117 -0
- package/lib-es/plugin/rtc/electron/canvas-helper.js +15 -12
- package/lib-es/plugin/rtc/electron/canvas-tag-pool.js +21 -13
- package/lib-es/plugin/rtc/electron/capture-enhancement.js +46 -30
- package/lib-es/plugin/rtc/electron/channel.js +49 -58
- package/lib-es/plugin/rtc/electron/client.js +107 -72
- package/lib-es/plugin/rtc/electron/constants.js +93 -25
- package/lib-es/plugin/rtc/electron/desc-type.js +1 -1
- package/lib-es/plugin/rtc/electron/downloadALD.js +10 -8
- package/lib-es/plugin/rtc/electron/publish-pool.js +111 -257
- package/lib-es/plugin/rtc/electron/publisher.js +51 -226
- package/lib-es/plugin/rtc/electron/source-manager.js +348 -218
- package/lib-es/plugin/rtc/electron/source-state-control/loopback-state-control.js +2 -18
- package/lib-es/plugin/rtc/electron/source-state-control/{camera-state-control.js → media-state-control.js} +64 -118
- package/lib-es/plugin/rtc/electron/source-state-control/microphone-state-control.js +5 -26
- package/lib-es/plugin/rtc/electron/source-state-control/source-state-control.js +69 -109
- package/lib-es/plugin/rtc/electron/subscriber.js +38 -116
- package/lib-es/plugin/rtc/electron/type.js +7 -1
- package/lib-es/plugin/rtc/electron/utils.js +37 -9
- package/lib-es/plugin/rtc/web/assembler.js +9 -2
- package/lib-es/plugin/rtc/web/audio-player.js +14 -9
- package/lib-es/plugin/rtc/web/canvas-helper.js +3 -1
- package/lib-es/plugin/rtc/web/capture-enhancement.js +14 -20
- package/lib-es/plugin/rtc/web/channel.js +234 -137
- package/lib-es/plugin/rtc/web/client.js +50 -22
- package/lib-es/plugin/rtc/web/convert-type.js +15 -0
- package/lib-es/plugin/rtc/web/device.js +3 -4
- package/lib-es/plugin/rtc/web/effect-enabler.js +3 -3
- package/lib-es/plugin/rtc/web/extension.js +4 -1
- package/lib-es/plugin/rtc/web/publish-pool.js +45 -198
- package/lib-es/plugin/rtc/web/publish.js +71 -27
- package/lib-es/plugin/rtc/web/publisher.js +122 -72
- package/lib-es/plugin/rtc/web/source-manager.js +16 -10
- package/lib-es/plugin/rtc/web/subscribe.js +26 -14
- package/lib-es/plugin/rtc/web/subscriber.js +25 -86
- package/lib-es/plugin/rtc/web/track-control/camera.js +4 -1
- package/lib-es/plugin/rtc/web/track-control/screen.js +4 -1
- package/lib-es/plugin/rtm/channel.js +112 -48
- package/lib-es/plugin/rtm/client.js +116 -57
- package/lib-es/plugin/rtm/utils.js +1 -1
- package/lib-es/plugin/synchronizer-worker/worker.js +71 -7
- package/package.json +4 -4
- package/lib/core/scene/helper.d.ts +0 -10
- package/lib/plugin/rtc/electron/source-state-control/camera-state-control.d.ts +0 -28
- package/lib/plugin/rtc/electron/source-state-control/screen-state-control.d.ts +0 -31
- package/lib/plugin/rtc/electron/source-state-control/screen-state-control.js +0 -213
- package/lib/plugin/rtc/electron/source-state-control/window-state-control.d.ts +0 -31
- package/lib/plugin/rtc/electron/source-state-control/window-state-control.js +0 -213
- package/lib-es/core/scene/helper.js +0 -72
- package/lib-es/plugin/rtc/electron/source-state-control/screen-state-control.js +0 -206
- package/lib-es/plugin/rtc/electron/source-state-control/window-state-control.js +0 -206
|
@@ -51,17 +51,20 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
|
|
|
51
51
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
52
52
|
var _imports = require("../../../imports");
|
|
53
53
|
var _logger = require("../../utilities/logger");
|
|
54
|
+
var _constant = require("../../../constant");
|
|
55
|
+
var _propertyExtract = require("../../utilities/property-extract");
|
|
54
56
|
var _AgoraRteSyncDataStore;
|
|
55
|
-
var _initProto;
|
|
57
|
+
var _initProto, _setUsersDecs, _setUserDecs, _deleteUserDecs, _setStreamsDecs, _setStreamDecs, _deleteStreamDecs, _deleteStreamsDecs, _ref;
|
|
56
58
|
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)]; } }; }
|
|
57
59
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
58
60
|
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); }
|
|
59
61
|
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; }
|
|
60
62
|
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; }
|
|
63
|
+
_ref = (_setUsersDecs = (0, _imports.trace)(['users']), _setUserDecs = (0, _imports.trace)(['key', 'user']), _deleteUserDecs = (0, _imports.trace)(['key']), _setStreamsDecs = (0, _imports.trace)(['streams']), _setStreamDecs = (0, _imports.trace)(['key', 'stream']), _deleteStreamDecs = (0, _imports.trace)(['key']), _deleteStreamsDecs = (0, _imports.trace)(['keys']), "logger");
|
|
61
64
|
var AgoraRteSyncDataStore = exports.AgoraRteSyncDataStore = /*#__PURE__*/function () {
|
|
62
65
|
function AgoraRteSyncDataStore() {
|
|
63
66
|
(0, _classCallCheck2["default"])(this, AgoraRteSyncDataStore);
|
|
64
|
-
(0, _defineProperty2["default"])(this,
|
|
67
|
+
(0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.createLogger)({
|
|
65
68
|
prefix: 'AgoraRteSyncDataStore'
|
|
66
69
|
})));
|
|
67
70
|
(0, _defineProperty2["default"])(this, "_userCount", 0);
|
|
@@ -78,16 +81,19 @@ var AgoraRteSyncDataStore = exports.AgoraRteSyncDataStore = /*#__PURE__*/functio
|
|
|
78
81
|
key: "setUsers",
|
|
79
82
|
value: function setUsers(users) {
|
|
80
83
|
this._users = _imports.Immutable.Map(users);
|
|
84
|
+
return _constant.AgoraRteReturnCode.SUCCESS;
|
|
81
85
|
}
|
|
82
86
|
}, {
|
|
83
87
|
key: "setUser",
|
|
84
88
|
value: function setUser(key, user) {
|
|
85
89
|
this._users = this._users.set(key, user);
|
|
90
|
+
return _constant.AgoraRteReturnCode.SUCCESS;
|
|
86
91
|
}
|
|
87
92
|
}, {
|
|
88
93
|
key: "deleteUser",
|
|
89
94
|
value: function deleteUser(key) {
|
|
90
95
|
this._users = this._users["delete"](key);
|
|
96
|
+
return _constant.AgoraRteReturnCode.SUCCESS;
|
|
91
97
|
}
|
|
92
98
|
}, {
|
|
93
99
|
key: "findUser",
|
|
@@ -113,6 +119,7 @@ var AgoraRteSyncDataStore = exports.AgoraRteSyncDataStore = /*#__PURE__*/functio
|
|
|
113
119
|
key: "setStreams",
|
|
114
120
|
value: function setStreams(streams) {
|
|
115
121
|
this._streams = _imports.Immutable.Map(streams);
|
|
122
|
+
return _constant.AgoraRteReturnCode.SUCCESS;
|
|
116
123
|
}
|
|
117
124
|
}, {
|
|
118
125
|
key: "findUserStreams",
|
|
@@ -125,16 +132,19 @@ var AgoraRteSyncDataStore = exports.AgoraRteSyncDataStore = /*#__PURE__*/functio
|
|
|
125
132
|
key: "setStream",
|
|
126
133
|
value: function setStream(key, stream) {
|
|
127
134
|
this._streams = this._streams.set(key, stream);
|
|
135
|
+
return _constant.AgoraRteReturnCode.SUCCESS;
|
|
128
136
|
}
|
|
129
137
|
}, {
|
|
130
138
|
key: "deleteStream",
|
|
131
139
|
value: function deleteStream(key) {
|
|
132
140
|
this._streams = this._streams["delete"](key);
|
|
141
|
+
return _constant.AgoraRteReturnCode.SUCCESS;
|
|
133
142
|
}
|
|
134
143
|
}, {
|
|
135
144
|
key: "deleteStreams",
|
|
136
145
|
value: function deleteStreams(keys) {
|
|
137
146
|
this._streams = this.streams.deleteAll(keys);
|
|
147
|
+
return _constant.AgoraRteReturnCode.SUCCESS;
|
|
138
148
|
}
|
|
139
149
|
}, {
|
|
140
150
|
key: "findStream",
|
|
@@ -151,10 +161,23 @@ var AgoraRteSyncDataStore = exports.AgoraRteSyncDataStore = /*#__PURE__*/functio
|
|
|
151
161
|
value: function setUserCount(userCount) {
|
|
152
162
|
this._userCount = userCount;
|
|
153
163
|
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "getRoomPropertiesDeepCloneByKeyPath",
|
|
166
|
+
value: function getRoomPropertiesDeepCloneByKeyPath(keyPath) {
|
|
167
|
+
return (0, _imports.cloneDeep)((0, _propertyExtract.extractValueByKeyPath)(this._roomProperties, keyPath));
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
key: "getUserPropertiesDeepCloneByKeyPath",
|
|
171
|
+
value: function getUserPropertiesDeepCloneByKeyPath(userId, keyPath) {
|
|
172
|
+
var user = this.findUser(userId);
|
|
173
|
+
if (user) {
|
|
174
|
+
return (0, _imports.cloneDeep)((0, _propertyExtract.extractValueByKeyPath)(user.userProperties, keyPath));
|
|
175
|
+
}
|
|
176
|
+
}
|
|
154
177
|
}]);
|
|
155
178
|
}();
|
|
156
179
|
_AgoraRteSyncDataStore = AgoraRteSyncDataStore;
|
|
157
|
-
var _applyDecs$e = _applyDecs(_AgoraRteSyncDataStore, [[
|
|
180
|
+
var _applyDecs$e = _applyDecs(_AgoraRteSyncDataStore, [[_setUsersDecs, 2, "setUsers"], [_setUserDecs, 2, "setUser"], [_deleteUserDecs, 2, "deleteUser"], [_setStreamsDecs, 2, "setStreams"], [_setStreamDecs, 2, "setStream"], [_deleteStreamDecs, 2, "deleteStream"], [_deleteStreamsDecs, 2, "deleteStreams"]], []).e;
|
|
158
181
|
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
159
182
|
_initProto = _applyDecs$e2[0];
|
|
160
183
|
_applyDecs$e;
|
|
@@ -24,7 +24,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
24
24
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
25
25
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
26
26
|
var _type = require("../scene/type");
|
|
27
|
-
var
|
|
27
|
+
var _streamType = require("../scene/helpers/stream-type");
|
|
28
28
|
var _imports = require("../../imports");
|
|
29
29
|
var AgoraRteUser = exports.AgoraRteUser = /*#__PURE__*/function () {
|
|
30
30
|
function AgoraRteUser(data) {
|
|
@@ -129,7 +129,7 @@ var AgoraRteMediaStream = exports.AgoraRteMediaStream = /*#__PURE__*/function ()
|
|
|
129
129
|
audioSourceType: data.audioSourceType,
|
|
130
130
|
videoSourceId: data.videoSourceUuid,
|
|
131
131
|
audioSourceId: data.audioSourceUuid,
|
|
132
|
-
streamType: (0,
|
|
132
|
+
streamType: (0, _streamType.convertPublishStateToStreamType)(data.audioState, data.videoState),
|
|
133
133
|
connectorType: (_data$connectorType2 = data.connectorType) !== null && _data$connectorType2 !== void 0 ? _data$connectorType2 : _type.AgoraRteRoomConnectorType.NONE
|
|
134
134
|
});
|
|
135
135
|
}
|
|
@@ -18,6 +18,8 @@ export declare class AgoraRteSynchronizerManager {
|
|
|
18
18
|
private _isReady;
|
|
19
19
|
private _messageQueue;
|
|
20
20
|
private _useMainThread;
|
|
21
|
+
private _readyTimeoutTimer?;
|
|
22
|
+
private readonly _readyTimeoutMs;
|
|
21
23
|
constructor({ apiService, sceneId, sequenceType, userId, }: {
|
|
22
24
|
apiService: AgoraRteServiceApi;
|
|
23
25
|
sceneId: string;
|
|
@@ -27,6 +29,14 @@ export declare class AgoraRteSynchronizerManager {
|
|
|
27
29
|
get sequenceTypeLabel(): "ChannelSequence" | "PeerSequence";
|
|
28
30
|
release(): void;
|
|
29
31
|
private initWorker;
|
|
32
|
+
/**
|
|
33
|
+
* 启动 worker 就绪超时定时器
|
|
34
|
+
*/
|
|
35
|
+
private startReadyTimeout;
|
|
36
|
+
/**
|
|
37
|
+
* 清除 worker 就绪超时定时器
|
|
38
|
+
*/
|
|
39
|
+
private clearReadyTimeout;
|
|
30
40
|
/**
|
|
31
41
|
* 回退到主进程同步器
|
|
32
42
|
*/
|
|
@@ -33,6 +33,8 @@ var _fallbackSynchronizer = require("./fallback-synchronizer");
|
|
|
33
33
|
* 负责管理事件同步器,处理与事件同步器的通信,以及API调用
|
|
34
34
|
*/
|
|
35
35
|
var AgoraRteSynchronizerManager = exports.AgoraRteSynchronizerManager = /*#__PURE__*/function () {
|
|
36
|
+
// 5秒超时
|
|
37
|
+
|
|
36
38
|
function AgoraRteSynchronizerManager(_ref) {
|
|
37
39
|
var apiService = _ref.apiService,
|
|
38
40
|
sceneId = _ref.sceneId,
|
|
@@ -48,6 +50,7 @@ var AgoraRteSynchronizerManager = exports.AgoraRteSynchronizerManager = /*#__PUR
|
|
|
48
50
|
(0, _defineProperty2["default"])(this, "_isReady", false);
|
|
49
51
|
(0, _defineProperty2["default"])(this, "_messageQueue", []);
|
|
50
52
|
(0, _defineProperty2["default"])(this, "_useMainThread", false);
|
|
53
|
+
(0, _defineProperty2["default"])(this, "_readyTimeoutMs", 5000);
|
|
51
54
|
this._apiService = apiService;
|
|
52
55
|
this._sceneId = sceneId;
|
|
53
56
|
this._sequenceType = sequenceType;
|
|
@@ -75,6 +78,9 @@ var AgoraRteSynchronizerManager = exports.AgoraRteSynchronizerManager = /*#__PUR
|
|
|
75
78
|
this._worker.addEventListener('message', this.handleWorkerMessage.bind(this));
|
|
76
79
|
this._worker.addEventListener('error', this.handleWorkerError.bind(this));
|
|
77
80
|
|
|
81
|
+
// 启动超时定时器
|
|
82
|
+
this.startReadyTimeout();
|
|
83
|
+
|
|
78
84
|
// 发送初始化消息
|
|
79
85
|
this.postMessage({
|
|
80
86
|
type: _types.WorkerMessageType.INIT,
|
|
@@ -87,37 +93,67 @@ var AgoraRteSynchronizerManager = exports.AgoraRteSynchronizerManager = /*#__PUR
|
|
|
87
93
|
this.logger.info('Worker created successfully');
|
|
88
94
|
} catch (error) {
|
|
89
95
|
this.logger.warn("Failed to create worker: ".concat(error, ", falling back to main thread synchronizer"));
|
|
96
|
+
this.clearReadyTimeout();
|
|
90
97
|
this.fallbackToMainThread();
|
|
91
98
|
}
|
|
92
99
|
}
|
|
93
100
|
|
|
101
|
+
/**
|
|
102
|
+
* 启动 worker 就绪超时定时器
|
|
103
|
+
*/
|
|
104
|
+
}, {
|
|
105
|
+
key: "startReadyTimeout",
|
|
106
|
+
value: function startReadyTimeout() {
|
|
107
|
+
var _this = this;
|
|
108
|
+
this.clearReadyTimeout();
|
|
109
|
+
this._readyTimeoutTimer = setTimeout(function () {
|
|
110
|
+
if (!_this._isReady && !_this._useMainThread) {
|
|
111
|
+
_this.logger.warn("Worker not ready within ".concat(_this._readyTimeoutMs, "ms, falling back to main thread synchronizer"));
|
|
112
|
+
_this.cleanupWorker();
|
|
113
|
+
_this.fallbackToMainThread();
|
|
114
|
+
}
|
|
115
|
+
}, this._readyTimeoutMs);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* 清除 worker 就绪超时定时器
|
|
120
|
+
*/
|
|
121
|
+
}, {
|
|
122
|
+
key: "clearReadyTimeout",
|
|
123
|
+
value: function clearReadyTimeout() {
|
|
124
|
+
if (this._readyTimeoutTimer) {
|
|
125
|
+
clearTimeout(this._readyTimeoutTimer);
|
|
126
|
+
this._readyTimeoutTimer = undefined;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
94
130
|
/**
|
|
95
131
|
* 回退到主进程同步器
|
|
96
132
|
*/
|
|
97
133
|
}, {
|
|
98
134
|
key: "fallbackToMainThread",
|
|
99
135
|
value: function fallbackToMainThread() {
|
|
100
|
-
var
|
|
136
|
+
var _this2 = this;
|
|
101
137
|
this._useMainThread = true;
|
|
102
138
|
this._fallbackSynchronizer = new _fallbackSynchronizer.FallbackSynchronizer(this._sceneId, this._sequenceType, this._userId);
|
|
103
139
|
|
|
104
140
|
// 设置观察者
|
|
105
141
|
this._fallbackSynchronizer.addObserver({
|
|
106
142
|
onSequenceGapDetected: function onSequenceGapDetected(data) {
|
|
107
|
-
|
|
143
|
+
_this2.handleSequenceGapDetected({
|
|
108
144
|
type: _types.WorkerMessageType.SEQUENCE_GAP_DETECTED,
|
|
109
145
|
data: data
|
|
110
146
|
});
|
|
111
147
|
},
|
|
112
148
|
onTaskReady: function onTaskReady(data) {
|
|
113
|
-
|
|
149
|
+
_this2.handleTaskReady({
|
|
114
150
|
type: _types.WorkerMessageType.TASK_READY,
|
|
115
151
|
data: data
|
|
116
152
|
});
|
|
117
153
|
},
|
|
118
154
|
onTaskQueueUpdate: function onTaskQueueUpdate(data) {
|
|
119
155
|
// 回退同步器的队列更新通知
|
|
120
|
-
|
|
156
|
+
_this2.logger.debug("Fallback synchronizer queue update: ".concat(JSON.stringify(data)));
|
|
121
157
|
}
|
|
122
158
|
});
|
|
123
159
|
this._isReady = true;
|
|
@@ -131,6 +167,7 @@ var AgoraRteSynchronizerManager = exports.AgoraRteSynchronizerManager = /*#__PUR
|
|
|
131
167
|
var message = event.data;
|
|
132
168
|
switch (message.type) {
|
|
133
169
|
case _types.WorkerMessageType.READY:
|
|
170
|
+
this.clearReadyTimeout();
|
|
134
171
|
this._isReady = true;
|
|
135
172
|
this.logger.info("Worker ready for userId: ".concat(this._userId, " , sequenceType: ").concat(this.sequenceTypeLabel));
|
|
136
173
|
this.flushMessageQueue();
|
|
@@ -181,6 +218,7 @@ var AgoraRteSynchronizerManager = exports.AgoraRteSynchronizerManager = /*#__PUR
|
|
|
181
218
|
}, {
|
|
182
219
|
key: "cleanupWorker",
|
|
183
220
|
value: function cleanupWorker() {
|
|
221
|
+
this.clearReadyTimeout();
|
|
184
222
|
if (this._worker) {
|
|
185
223
|
this._worker.removeEventListener('message', this.handleWorkerMessage.bind(this));
|
|
186
224
|
this._worker.removeEventListener('error', this.handleWorkerError.bind(this));
|
|
@@ -410,6 +448,7 @@ var AgoraRteSynchronizerManager = exports.AgoraRteSynchronizerManager = /*#__PUR
|
|
|
410
448
|
value: function destroy() {
|
|
411
449
|
// 清理队列
|
|
412
450
|
this._messageQueue = [];
|
|
451
|
+
this.clearReadyTimeout();
|
|
413
452
|
this.cleanupWorker();
|
|
414
453
|
if (this._fallbackSynchronizer) {
|
|
415
454
|
this._fallbackSynchronizer.destroy();
|
|
@@ -32,16 +32,6 @@ export declare abstract class AgoraRtcCaptureEnhancement {
|
|
|
32
32
|
* @param deviceId The ID of the device to disable virtual background for.
|
|
33
33
|
*/
|
|
34
34
|
abstract disableVirtualBackground(deviceId: string): number;
|
|
35
|
-
/**
|
|
36
|
-
* Enables AI denoiser for a specific device.
|
|
37
|
-
* @param deviceId The ID of the device to enable AI denoiser for.
|
|
38
|
-
*/
|
|
39
|
-
abstract enableAiDenoiser(deviceId: string): number;
|
|
40
|
-
/**
|
|
41
|
-
* Disables AI denoiser for a specific device.
|
|
42
|
-
* @param deviceId The ID of the device to disable AI denoiser for.
|
|
43
|
-
*/
|
|
44
|
-
abstract disableAiDenoiser(deviceId: string): number;
|
|
45
35
|
/**
|
|
46
36
|
* Sets the AI denoise level for a specific device.
|
|
47
37
|
* @param deviceId The ID of the device to set the AI denoise level for.
|
|
@@ -65,13 +55,13 @@ export declare abstract class AgoraRtcCaptureEnhancement {
|
|
|
65
55
|
*/
|
|
66
56
|
abstract disableAGC(): number;
|
|
67
57
|
/**
|
|
68
|
-
* Enables
|
|
58
|
+
* Enables AEC.
|
|
69
59
|
*/
|
|
70
|
-
abstract
|
|
60
|
+
abstract enableAEC(): number;
|
|
71
61
|
/**
|
|
72
|
-
* Disables
|
|
62
|
+
* Disables AEC.
|
|
73
63
|
*/
|
|
74
|
-
abstract
|
|
64
|
+
abstract disableAEC(): number;
|
|
75
65
|
/**
|
|
76
66
|
* Enables stereo mode.
|
|
77
67
|
*/
|
|
@@ -28,19 +28,19 @@ export declare abstract class AgoraRtcChannelClient {
|
|
|
28
28
|
* @param token The token for authentication.
|
|
29
29
|
* @returns A promise that resolves when the join is successful.
|
|
30
30
|
*/
|
|
31
|
-
abstract join(streamId: string, token: string): Promise<
|
|
31
|
+
abstract join(streamId: string, token: string): Promise<number>;
|
|
32
32
|
/**
|
|
33
33
|
* ReJoin an Agora RTC channel.
|
|
34
34
|
* @param streamId The ID of the stream.
|
|
35
35
|
* @param token The token for authentication.
|
|
36
36
|
* @returns A promise that resolves when the join is successful.
|
|
37
37
|
*/
|
|
38
|
-
abstract rejoin(streamId: string, token: string): Promise<
|
|
38
|
+
abstract rejoin(streamId: string, token: string): Promise<number>;
|
|
39
39
|
/**
|
|
40
40
|
* Leaves an Agora RTC channel.
|
|
41
41
|
* @returns A promise that resolves when the leave is successful.
|
|
42
42
|
*/
|
|
43
|
-
abstract leave(): Promise<
|
|
43
|
+
abstract leave(): Promise<number>;
|
|
44
44
|
/**
|
|
45
45
|
* Sets the encryption configuration for the client.
|
|
46
46
|
* @param config The encryption configuration.
|
|
@@ -96,7 +96,7 @@ export declare abstract class AgoraRtcChannelClient {
|
|
|
96
96
|
* @param type The type of the scenario.
|
|
97
97
|
* @returns The result of the operation.
|
|
98
98
|
*/
|
|
99
|
-
abstract setScreenScenario(type: AgoraRtcScreenScenarioType):
|
|
99
|
+
abstract setScreenScenario(type: AgoraRtcScreenScenarioType): number;
|
|
100
100
|
abstract adjustRemoteAudioStreamVolume(streamId: string, volume: number): number;
|
|
101
101
|
abstract pause(): void;
|
|
102
102
|
abstract resume(): void;
|
package/lib/core/rtc/constant.js
CHANGED
|
@@ -4,11 +4,5 @@ require("core-js/modules/es.object.define-property.js");
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
// Error code
|
|
11
|
-
var ERROR_CODE = exports.ERROR_CODE = {
|
|
12
|
-
UNDEFINED: 1,
|
|
13
|
-
JOIN_TIMEOUT: 10
|
|
14
|
-
};
|
|
7
|
+
exports.JOIN_TIMEOUT_MS = void 0;
|
|
8
|
+
var JOIN_TIMEOUT_MS = exports.JOIN_TIMEOUT_MS = 15000; // milliseconds
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import { AgoraObservable } from '../../imports';
|
|
2
|
-
import { AgoraRtcVideoSourceType, AgoraRtcAudioSourceType, AgoraRtcMediaSourceState, AgoraRtcStreamPublishPoolObserver } from './type';
|
|
3
|
-
export declare abstract class AgoraRtcStreamPublishPool {
|
|
2
|
+
import { AgoraRtcVideoSourceType, AgoraRtcAudioSourceType, AgoraRtcMediaSourceState, AgoraRtcStreamPublishPoolObserver, AgoraRtcStreamPublishPoolItem } from './type';
|
|
3
|
+
export declare abstract class AgoraRtcStreamPublishPool<TItem extends AgoraRtcStreamPublishPoolItem = AgoraRtcStreamPublishPoolItem> {
|
|
4
4
|
protected readonly observable: AgoraObservable<AgoraRtcStreamPublishPoolObserver>;
|
|
5
|
+
protected _itemMap: Map<string, TItem>;
|
|
6
|
+
protected _isPaused: boolean;
|
|
5
7
|
addObserver(observer: AgoraRtcStreamPublishPoolObserver): void;
|
|
6
8
|
removeObserver(observer: AgoraRtcStreamPublishPoolObserver): void;
|
|
7
|
-
abstract
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
protected abstract createItem(streamId: string, token: string | undefined): TItem;
|
|
10
|
+
protected onVideoItemUpdated(item: TItem): void;
|
|
11
|
+
protected onBeforeUpdate(item: TItem): void;
|
|
12
|
+
protected shouldNotifyUpdate(item: TItem): boolean;
|
|
13
|
+
protected shouldNotifyVideoEncoderConfig(item: TItem, wasVideoPublished: boolean): boolean;
|
|
14
|
+
private getOrCreateItem;
|
|
15
|
+
publishVideo(token: string | undefined, streamId: string, sourceId: string, type: AgoraRtcVideoSourceType, state: AgoraRtcMediaSourceState): number;
|
|
16
|
+
publishAudio(token: string | undefined, streamId: string, sourceId: string, type: AgoraRtcAudioSourceType, state: AgoraRtcMediaSourceState): number;
|
|
17
|
+
updateVideoSource(sourceId: string, type: AgoraRtcVideoSourceType, state: AgoraRtcMediaSourceState): number;
|
|
18
|
+
updateAudioSource(sourceId: string, type: AgoraRtcAudioSourceType, state: AgoraRtcMediaSourceState): number;
|
|
19
|
+
unpublishVideo(streamId: string, type: AgoraRtcVideoSourceType): number;
|
|
20
|
+
unpublishAudio(streamId: string, type: AgoraRtcAudioSourceType): number;
|
|
21
|
+
pause(): number;
|
|
22
|
+
resume(): number;
|
|
23
|
+
getItem(streamId: string): TItem | undefined;
|
|
24
|
+
abstract release(): void;
|
|
13
25
|
}
|