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.
Files changed (266) hide show
  1. package/lib/constant.d.ts +9 -0
  2. package/lib/constant.js +13 -2
  3. package/lib/core/engine/ap-detector.d.ts +4 -4
  4. package/lib/core/engine/ap-detector.js +33 -20
  5. package/lib/core/engine/index.d.ts +19 -11
  6. package/lib/core/engine/index.js +132 -48
  7. package/lib/core/engine/plugin.js +2 -2
  8. package/lib/core/engine/type.d.ts +29 -0
  9. package/lib/core/engine/type.js +6 -0
  10. package/lib/core/media/camera.d.ts +8 -8
  11. package/lib/core/media/camera.js +38 -21
  12. package/lib/core/media/effect-enhancer.d.ts +5 -6
  13. package/lib/core/media/effect-enhancer.js +6 -16
  14. package/lib/core/media/index.d.ts +1 -155
  15. package/lib/core/media/index.js +44 -15
  16. package/lib/core/media/loopback.d.ts +3 -3
  17. package/lib/core/media/loopback.js +18 -11
  18. package/lib/core/media/microphone.d.ts +6 -6
  19. package/lib/core/media/microphone.js +32 -16
  20. package/lib/core/media/screen.d.ts +13 -5
  21. package/lib/core/media/screen.js +46 -16
  22. package/lib/core/media/type.d.ts +159 -2
  23. package/lib/core/media/type.js +4 -1
  24. package/lib/core/processor/message-handler.d.ts +4 -4
  25. package/lib/core/processor/message-handler.js +66 -28
  26. package/lib/core/processor/sequence-msg/data.d.ts +9 -7
  27. package/lib/core/processor/sequence-msg/data.js +26 -3
  28. package/lib/core/processor/struct.js +2 -2
  29. package/lib/core/processor/synchronizer/synchronizer-manager.d.ts +10 -0
  30. package/lib/core/processor/synchronizer/synchronizer-manager.js +43 -4
  31. package/lib/core/rtc/capture-enhancement.d.ts +4 -14
  32. package/lib/core/rtc/channel.d.ts +4 -4
  33. package/lib/core/rtc/constant.d.ts +1 -5
  34. package/lib/core/rtc/constant.js +2 -8
  35. package/lib/core/rtc/publish-pool.d.ts +20 -8
  36. package/lib/core/rtc/publish-pool.js +272 -3
  37. package/lib/core/rtc/publisher.d.ts +20 -14
  38. package/lib/core/rtc/publisher.js +151 -7
  39. package/lib/core/rtc/source-manager.d.ts +12 -2
  40. package/lib/core/rtc/subscriber.d.ts +14 -6
  41. package/lib/core/rtc/subscriber.js +171 -4
  42. package/lib/core/rtc/type.d.ts +6 -17
  43. package/lib/core/rtc/type.js +10 -26
  44. package/lib/core/rtm/channel.d.ts +3 -3
  45. package/lib/core/rtm/client.d.ts +4 -4
  46. package/lib/core/rtm/type.d.ts +1 -2
  47. package/lib/core/scene/helpers/ap-detect.d.ts +5 -0
  48. package/lib/core/scene/helpers/ap-detect.js +153 -0
  49. package/lib/core/scene/helpers/join.d.ts +8 -0
  50. package/lib/core/scene/helpers/join.js +105 -0
  51. package/lib/core/scene/helpers/rtc-event.d.ts +4 -0
  52. package/lib/core/scene/helpers/rtc-event.js +36 -0
  53. package/lib/core/scene/helpers/stream-publish-handlers.d.ts +15 -0
  54. package/lib/core/scene/helpers/stream-publish-handlers.js +121 -0
  55. package/lib/core/scene/helpers/stream-type.d.ts +7 -0
  56. package/lib/core/scene/{helper.js → helpers/stream-type.js} +3 -32
  57. package/lib/core/scene/index.d.ts +69 -187
  58. package/lib/core/scene/index.js +813 -1368
  59. package/lib/core/scene/local-user.d.ts +19 -85
  60. package/lib/core/scene/local-user.js +151 -152
  61. package/lib/core/scene/state-sync.d.ts +5 -7
  62. package/lib/core/scene/state-sync.js +20 -43
  63. package/lib/core/scene/stream-player.d.ts +9 -8
  64. package/lib/core/scene/stream-player.js +13 -10
  65. package/lib/core/scene/type.d.ts +359 -9
  66. package/lib/core/services/api.d.ts +9 -0
  67. package/lib/core/services/api.js +96 -58
  68. package/lib/core/services/auth-headers.d.ts +1 -0
  69. package/lib/core/services/auth-headers.js +5 -2
  70. package/lib/core/services/client.d.ts +3 -0
  71. package/lib/core/services/client.js +14 -2
  72. package/lib/core/services/type.d.ts +1 -0
  73. package/lib/core/type.d.ts +1 -0
  74. package/lib/core/type.js +6 -0
  75. package/lib/core/utilities/abort-manager.d.ts +18 -0
  76. package/lib/core/utilities/abort-manager.js +154 -0
  77. package/lib/core/utilities/error.d.ts +5 -36
  78. package/lib/core/utilities/error.js +23 -92
  79. package/lib/core/utilities/join-manager.d.ts +54 -0
  80. package/lib/core/utilities/join-manager.js +198 -0
  81. package/lib/core/utilities/logger.d.ts +2 -0
  82. package/lib/core/utilities/logger.js +8 -13
  83. package/lib/core/utilities/package-info.d.ts +1 -0
  84. package/lib/core/utilities/package-info.js +6 -4
  85. package/lib/core/utilities/property-extract.d.ts +2 -0
  86. package/lib/core/utilities/property-extract.js +79 -0
  87. package/lib/core/utilities/weak-invoker.d.ts +11 -0
  88. package/lib/core/utilities/weak-invoker.js +121 -0
  89. package/lib/imports.d.ts +6 -4
  90. package/lib/imports.js +42 -17
  91. package/lib/index.d.ts +7 -5
  92. package/lib/index.js +6 -5
  93. package/lib/plugin/restful-client/index.d.ts +1 -1
  94. package/lib/plugin/restful-client/index.js +11 -10
  95. package/lib/plugin/rtc/electron/camera-preview-task-manager.d.ts +14 -0
  96. package/lib/plugin/rtc/electron/camera-preview-task-manager.js +125 -0
  97. package/lib/plugin/rtc/electron/canvas-helper.d.ts +2 -2
  98. package/lib/plugin/rtc/electron/canvas-helper.js +15 -12
  99. package/lib/plugin/rtc/electron/canvas-tag-pool.d.ts +4 -4
  100. package/lib/plugin/rtc/electron/canvas-tag-pool.js +21 -13
  101. package/lib/plugin/rtc/electron/capture-enhancement.d.ts +3 -5
  102. package/lib/plugin/rtc/electron/capture-enhancement.js +45 -29
  103. package/lib/plugin/rtc/electron/channel.d.ts +13 -16
  104. package/lib/plugin/rtc/electron/channel.js +48 -57
  105. package/lib/plugin/rtc/electron/client.d.ts +8 -4
  106. package/lib/plugin/rtc/electron/client.js +107 -72
  107. package/lib/plugin/rtc/electron/constants.d.ts +12 -1
  108. package/lib/plugin/rtc/electron/constants.js +94 -26
  109. package/lib/plugin/rtc/electron/desc-type.js +1 -1
  110. package/lib/plugin/rtc/electron/downloadALD.js +9 -7
  111. package/lib/plugin/rtc/electron/publish-pool.d.ts +9 -17
  112. package/lib/plugin/rtc/electron/publish-pool.js +110 -256
  113. package/lib/plugin/rtc/electron/publisher.d.ts +9 -21
  114. package/lib/plugin/rtc/electron/publisher.js +80 -254
  115. package/lib/plugin/rtc/electron/source-manager.d.ts +22 -16
  116. package/lib/plugin/rtc/electron/source-manager.js +345 -215
  117. package/lib/plugin/rtc/electron/source-state-control/loopback-state-control.d.ts +1 -5
  118. package/lib/plugin/rtc/electron/source-state-control/loopback-state-control.js +2 -18
  119. package/lib/plugin/rtc/electron/source-state-control/media-state-control.d.ts +18 -0
  120. package/lib/plugin/rtc/electron/source-state-control/{camera-state-control.js → media-state-control.js} +50 -104
  121. package/lib/plugin/rtc/electron/source-state-control/microphone-state-control.d.ts +4 -10
  122. package/lib/plugin/rtc/electron/source-state-control/microphone-state-control.js +5 -26
  123. package/lib/plugin/rtc/electron/source-state-control/source-state-control.d.ts +30 -26
  124. package/lib/plugin/rtc/electron/source-state-control/source-state-control.js +68 -110
  125. package/lib/plugin/rtc/electron/subscriber.d.ts +7 -16
  126. package/lib/plugin/rtc/electron/subscriber.js +34 -112
  127. package/lib/plugin/rtc/electron/type.d.ts +7 -3
  128. package/lib/plugin/rtc/electron/type.js +8 -2
  129. package/lib/plugin/rtc/electron/utils.d.ts +9 -6
  130. package/lib/plugin/rtc/electron/utils.js +37 -9
  131. package/lib/plugin/rtc/web/assembler.d.ts +2 -1
  132. package/lib/plugin/rtc/web/assembler.js +9 -2
  133. package/lib/plugin/rtc/web/audio-player.d.ts +1 -1
  134. package/lib/plugin/rtc/web/audio-player.js +13 -8
  135. package/lib/plugin/rtc/web/canvas-helper.d.ts +1 -1
  136. package/lib/plugin/rtc/web/canvas-helper.js +3 -1
  137. package/lib/plugin/rtc/web/capture-enhancement.d.ts +3 -5
  138. package/lib/plugin/rtc/web/capture-enhancement.js +14 -20
  139. package/lib/plugin/rtc/web/channel.d.ts +17 -13
  140. package/lib/plugin/rtc/web/channel.js +221 -124
  141. package/lib/plugin/rtc/web/client.d.ts +5 -3
  142. package/lib/plugin/rtc/web/client.js +49 -21
  143. package/lib/plugin/rtc/web/convert-type.d.ts +3 -0
  144. package/lib/plugin/rtc/web/convert-type.js +22 -0
  145. package/lib/plugin/rtc/web/device.js +2 -3
  146. package/lib/plugin/rtc/web/effect-enabler.js +3 -3
  147. package/lib/plugin/rtc/web/extension.d.ts +1 -1
  148. package/lib/plugin/rtc/web/extension.js +4 -1
  149. package/lib/plugin/rtc/web/publish-pool.d.ts +4 -17
  150. package/lib/plugin/rtc/web/publish-pool.js +41 -194
  151. package/lib/plugin/rtc/web/publish.d.ts +9 -8
  152. package/lib/plugin/rtc/web/publish.js +71 -27
  153. package/lib/plugin/rtc/web/publisher.d.ts +20 -12
  154. package/lib/plugin/rtc/web/publisher.js +118 -69
  155. package/lib/plugin/rtc/web/source-manager.d.ts +1 -0
  156. package/lib/plugin/rtc/web/source-manager.js +15 -9
  157. package/lib/plugin/rtc/web/subscribe.d.ts +10 -10
  158. package/lib/plugin/rtc/web/subscribe.js +26 -14
  159. package/lib/plugin/rtc/web/subscriber.d.ts +5 -10
  160. package/lib/plugin/rtc/web/subscriber.js +21 -82
  161. package/lib/plugin/rtc/web/track-control/camera.d.ts +1 -1
  162. package/lib/plugin/rtc/web/track-control/camera.js +4 -1
  163. package/lib/plugin/rtc/web/track-control/screen.d.ts +1 -1
  164. package/lib/plugin/rtc/web/track-control/screen.js +4 -1
  165. package/lib/plugin/rtm/channel.d.ts +8 -5
  166. package/lib/plugin/rtm/channel.js +113 -49
  167. package/lib/plugin/rtm/client.d.ts +10 -5
  168. package/lib/plugin/rtm/client.js +120 -61
  169. package/lib/plugin/rtm/utils.js +1 -1
  170. package/lib/plugin/synchronizer-worker/worker.js +71 -7
  171. package/lib/type.d.ts +0 -5
  172. package/lib-es/constant.js +12 -1
  173. package/lib-es/core/engine/ap-detector.js +36 -22
  174. package/lib-es/core/engine/index.js +134 -50
  175. package/lib-es/core/engine/plugin.js +1 -1
  176. package/lib-es/core/engine/type.js +1 -0
  177. package/lib-es/core/media/camera.js +38 -22
  178. package/lib-es/core/media/effect-enhancer.js +6 -16
  179. package/lib-es/core/media/index.js +44 -17
  180. package/lib-es/core/media/loopback.js +18 -12
  181. package/lib-es/core/media/microphone.js +32 -17
  182. package/lib-es/core/media/screen.js +46 -17
  183. package/lib-es/core/media/type.js +5 -1
  184. package/lib-es/core/processor/message-handler.js +44 -6
  185. package/lib-es/core/processor/sequence-msg/data.js +27 -4
  186. package/lib-es/core/processor/struct.js +1 -1
  187. package/lib-es/core/processor/synchronizer/synchronizer-manager.js +43 -4
  188. package/lib-es/core/rtc/constant.js +1 -7
  189. package/lib-es/core/rtc/publish-pool.js +274 -4
  190. package/lib-es/core/rtc/publisher.js +153 -9
  191. package/lib-es/core/rtc/subscriber.js +172 -4
  192. package/lib-es/core/rtc/type.js +9 -25
  193. package/lib-es/core/scene/helpers/ap-detect.js +143 -0
  194. package/lib-es/core/scene/helpers/join.js +97 -0
  195. package/lib-es/core/scene/helpers/rtc-event.js +29 -0
  196. package/lib-es/core/scene/helpers/stream-publish-handlers.js +112 -0
  197. package/lib-es/core/scene/helpers/stream-type.js +43 -0
  198. package/lib-es/core/scene/index.js +817 -1373
  199. package/lib-es/core/scene/local-user.js +144 -146
  200. package/lib-es/core/scene/state-sync.js +19 -42
  201. package/lib-es/core/scene/stream-player.js +13 -10
  202. package/lib-es/core/services/api.js +97 -59
  203. package/lib-es/core/services/auth-headers.js +4 -1
  204. package/lib-es/core/services/client.js +13 -1
  205. package/lib-es/core/type.js +1 -0
  206. package/lib-es/core/utilities/abort-manager.js +146 -0
  207. package/lib-es/core/utilities/error.js +22 -91
  208. package/lib-es/core/utilities/join-manager.js +190 -0
  209. package/lib-es/core/utilities/logger.js +8 -13
  210. package/lib-es/core/utilities/package-info.js +5 -3
  211. package/lib-es/core/utilities/property-extract.js +71 -0
  212. package/lib-es/core/utilities/weak-invoker.js +113 -0
  213. package/lib-es/imports.js +9 -5
  214. package/lib-es/index.js +3 -2
  215. package/lib-es/plugin/restful-client/index.js +5 -4
  216. package/lib-es/plugin/rtc/electron/camera-preview-task-manager.js +117 -0
  217. package/lib-es/plugin/rtc/electron/canvas-helper.js +15 -12
  218. package/lib-es/plugin/rtc/electron/canvas-tag-pool.js +21 -13
  219. package/lib-es/plugin/rtc/electron/capture-enhancement.js +46 -30
  220. package/lib-es/plugin/rtc/electron/channel.js +49 -58
  221. package/lib-es/plugin/rtc/electron/client.js +107 -72
  222. package/lib-es/plugin/rtc/electron/constants.js +93 -25
  223. package/lib-es/plugin/rtc/electron/desc-type.js +1 -1
  224. package/lib-es/plugin/rtc/electron/downloadALD.js +10 -8
  225. package/lib-es/plugin/rtc/electron/publish-pool.js +111 -257
  226. package/lib-es/plugin/rtc/electron/publisher.js +51 -226
  227. package/lib-es/plugin/rtc/electron/source-manager.js +348 -218
  228. package/lib-es/plugin/rtc/electron/source-state-control/loopback-state-control.js +2 -18
  229. package/lib-es/plugin/rtc/electron/source-state-control/{camera-state-control.js → media-state-control.js} +64 -118
  230. package/lib-es/plugin/rtc/electron/source-state-control/microphone-state-control.js +5 -26
  231. package/lib-es/plugin/rtc/electron/source-state-control/source-state-control.js +69 -109
  232. package/lib-es/plugin/rtc/electron/subscriber.js +38 -116
  233. package/lib-es/plugin/rtc/electron/type.js +7 -1
  234. package/lib-es/plugin/rtc/electron/utils.js +37 -9
  235. package/lib-es/plugin/rtc/web/assembler.js +9 -2
  236. package/lib-es/plugin/rtc/web/audio-player.js +14 -9
  237. package/lib-es/plugin/rtc/web/canvas-helper.js +3 -1
  238. package/lib-es/plugin/rtc/web/capture-enhancement.js +14 -20
  239. package/lib-es/plugin/rtc/web/channel.js +234 -137
  240. package/lib-es/plugin/rtc/web/client.js +50 -22
  241. package/lib-es/plugin/rtc/web/convert-type.js +15 -0
  242. package/lib-es/plugin/rtc/web/device.js +3 -4
  243. package/lib-es/plugin/rtc/web/effect-enabler.js +3 -3
  244. package/lib-es/plugin/rtc/web/extension.js +4 -1
  245. package/lib-es/plugin/rtc/web/publish-pool.js +45 -198
  246. package/lib-es/plugin/rtc/web/publish.js +71 -27
  247. package/lib-es/plugin/rtc/web/publisher.js +122 -72
  248. package/lib-es/plugin/rtc/web/source-manager.js +16 -10
  249. package/lib-es/plugin/rtc/web/subscribe.js +26 -14
  250. package/lib-es/plugin/rtc/web/subscriber.js +25 -86
  251. package/lib-es/plugin/rtc/web/track-control/camera.js +4 -1
  252. package/lib-es/plugin/rtc/web/track-control/screen.js +4 -1
  253. package/lib-es/plugin/rtm/channel.js +112 -48
  254. package/lib-es/plugin/rtm/client.js +116 -57
  255. package/lib-es/plugin/rtm/utils.js +1 -1
  256. package/lib-es/plugin/synchronizer-worker/worker.js +71 -7
  257. package/package.json +4 -4
  258. package/lib/core/scene/helper.d.ts +0 -10
  259. package/lib/plugin/rtc/electron/source-state-control/camera-state-control.d.ts +0 -28
  260. package/lib/plugin/rtc/electron/source-state-control/screen-state-control.d.ts +0 -31
  261. package/lib/plugin/rtc/electron/source-state-control/screen-state-control.js +0 -213
  262. package/lib/plugin/rtc/electron/source-state-control/window-state-control.d.ts +0 -31
  263. package/lib/plugin/rtc/electron/source-state-control/window-state-control.js +0 -213
  264. package/lib-es/core/scene/helper.js +0 -72
  265. package/lib-es/plugin/rtc/electron/source-state-control/screen-state-control.js +0 -206
  266. 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, "logger", (_initProto(this), (0, _logger.createLogger)({
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, [[_imports.trace, 2, "setUsers"], [_imports.trace, 2, "setUser"], [_imports.trace, 2, "deleteUser"], [_imports.trace, 2, "setStreams"], [_imports.trace, 2, "setStream"], [_imports.trace, 2, "deleteStream"], [_imports.trace, 2, "deleteStreams"]], []).e;
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 _helper = require("../scene/helper");
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, _helper.convertPublishStateToStreamType)(data.audioState, data.videoState),
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 _this = this;
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
- _this.handleSequenceGapDetected({
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
- _this.handleTaskReady({
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
- _this.logger.debug("Fallback synchronizer queue update: ".concat(JSON.stringify(data)));
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 echo cancellation.
58
+ * Enables AEC.
69
59
  */
70
- abstract enableEchoCancellation(): number;
60
+ abstract enableAEC(): number;
71
61
  /**
72
- * Disables echo cancellation.
62
+ * Disables AEC.
73
63
  */
74
- abstract disableEchoCancellation(): number;
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<void>;
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<void>;
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<void>;
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): void;
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;
@@ -1,5 +1 @@
1
- export declare const JOIN_TIMEOUT = 15000;
2
- export declare const ERROR_CODE: {
3
- UNDEFINED: number;
4
- JOIN_TIMEOUT: number;
5
- };
1
+ export declare const JOIN_TIMEOUT_MS = 15000;
@@ -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.JOIN_TIMEOUT = exports.ERROR_CODE = void 0;
8
- var JOIN_TIMEOUT = exports.JOIN_TIMEOUT = 15000; // milliseconds
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 publishVideo(token: string | undefined, streamId: string, sourceId: string, type: AgoraRtcVideoSourceType, state: AgoraRtcMediaSourceState): number;
8
- abstract publishAudio(token: string | undefined, streamId: string, sourceId: string, type: AgoraRtcAudioSourceType, state: AgoraRtcMediaSourceState): number;
9
- abstract updateVideoSource(sourceId: string, type: AgoraRtcVideoSourceType, state: AgoraRtcMediaSourceState): number;
10
- abstract updateAudioSource(sourceId: string, type: AgoraRtcAudioSourceType, state: AgoraRtcMediaSourceState): number;
11
- abstract unpublishVideo(streamId: string, type: AgoraRtcVideoSourceType): number;
12
- abstract unpublishAudio(streamId: string, type: AgoraRtcAudioSourceType): number;
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
  }