agora-rte-sdk 2.8.21 → 2.8.40

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 (58) hide show
  1. package/dist/index.js +2 -2
  2. package/lib/configs/index.d.ts +8 -6
  3. package/lib/configs/index.js +8 -6
  4. package/lib/core/engine/index.js +1 -7
  5. package/lib/core/logger/index.d.ts +1 -0
  6. package/lib/core/logger/index.js +22 -2
  7. package/lib/core/logger/log.worker.js +4 -2
  8. package/lib/core/media/control.d.ts +11 -8
  9. package/lib/core/media/control.js +42 -32
  10. package/lib/core/media/player.d.ts +9 -0
  11. package/lib/core/media/player.js +36 -0
  12. package/lib/core/media/track.d.ts +8 -1
  13. package/lib/core/media/track.js +18 -0
  14. package/lib/core/media/type.d.ts +113 -0
  15. package/lib/core/media/type.js +31 -0
  16. package/lib/core/processor/channel-msg/data.d.ts +1 -0
  17. package/lib/core/processor/channel-msg/data.js +5 -0
  18. package/lib/core/processor/channel-msg/handler.d.ts +1 -3
  19. package/lib/core/processor/channel-msg/handler.js +20 -21
  20. package/lib/core/processor/channel-msg/message-parser.d.ts +6 -0
  21. package/lib/core/processor/channel-msg/message-parser.js +57 -0
  22. package/lib/core/processor/channel-msg/struct.d.ts +5 -0
  23. package/lib/core/processor/channel-msg/synchronizer.d.ts +7 -14
  24. package/lib/core/processor/channel-msg/synchronizer.js +33 -48
  25. package/lib/core/processor/peer-msg/handler.d.ts +16 -0
  26. package/lib/core/processor/peer-msg/handler.js +57 -0
  27. package/lib/core/processor/peer-msg/struct.d.ts +4 -0
  28. package/lib/core/processor/type.d.ts +200 -0
  29. package/lib/core/rc/index.js +6 -2
  30. package/lib/core/rtc/adapter/base.d.ts +6 -7
  31. package/lib/core/rtc/adapter/electron/device.d.ts +0 -1
  32. package/lib/core/rtc/adapter/electron/device.js +0 -5
  33. package/lib/core/rtc/adapter/electron/index.d.ts +6 -7
  34. package/lib/core/rtc/adapter/electron/index.js +22 -24
  35. package/lib/core/rtc/adapter/web/client.d.ts +11 -9
  36. package/lib/core/rtc/adapter/web/client.js +40 -38
  37. package/lib/core/rtc/adapter/web/device.d.ts +0 -1
  38. package/lib/core/rtc/adapter/web/device.js +0 -5
  39. package/lib/core/rtc/adapter/web/dispatcher.d.ts +61 -0
  40. package/lib/core/rtc/adapter/web/dispatcher.js +166 -0
  41. package/lib/core/rtc/adapter/web/index.d.ts +11 -7
  42. package/lib/core/rtc/adapter/web/index.js +25 -16
  43. package/lib/core/rtc/adapter/web/thread.d.ts +18 -11
  44. package/lib/core/rtc/adapter/web/thread.js +241 -133
  45. package/lib/core/rtc/channel.d.ts +2 -3
  46. package/lib/core/rtc/index.d.ts +5 -4
  47. package/lib/core/rtc/index.js +12 -12
  48. package/lib/core/rtc/type.d.ts +0 -4
  49. package/lib/core/services/api.d.ts +15 -0
  50. package/lib/core/services/api.js +36 -1
  51. package/lib/core/utils/events.d.ts +0 -1
  52. package/lib/index.d.ts +3 -1
  53. package/lib/index.js +24 -17
  54. package/lib/scene/index.d.ts +1 -5
  55. package/lib/scene/index.js +88 -66
  56. package/lib/scene/state-sync.d.ts +21 -0
  57. package/lib/scene/state-sync.js +169 -0
  58. package/package.json +1 -1
@@ -1,7 +1,6 @@
1
- import { RemoteStreamType } from 'agora-rtc-sdk-ng';
2
1
  import { AgoraLatencyLevel } from '../../configs';
3
2
  import { RtcChannelAdapterBase } from './adapter/base';
4
- import { AGLowStreamParameter, AGNetworkStats, AGRtcState } from './type';
3
+ import { AGLowStreamParameter, AGNetworkStats, AGRemoteVideoStreamType, AGRtcState } from './type';
5
4
  export declare enum AGRtcConnectionType {
6
5
  main = 0,
7
6
  sub = 1
@@ -13,7 +12,7 @@ export declare class AGRtcChannel {
13
12
  private connectionType;
14
13
  enableDualStream(enable: boolean, connectionType?: AGRtcConnectionType): Promise<void>;
15
14
  setLowStreamParameter(streamParameter: AGLowStreamParameter, connectionType?: AGRtcConnectionType): number;
16
- setRemoteVideoStreamType(streamUuid: string, streamType: RemoteStreamType, connectionType?: AGRtcConnectionType): Promise<void>;
15
+ setRemoteVideoStreamType(streamUuid: string, streamType: AGRemoteVideoStreamType, connectionType?: AGRtcConnectionType): Promise<void>;
17
16
  getRtcSid(): string;
18
17
  join(token: string, streamUuid: string, connectionType?: AGRtcConnectionType): Promise<void>;
19
18
  leave(connectionType?: AGRtcConnectionType): Promise<void>;
@@ -4,7 +4,8 @@ import { AGRtcConfig } from './adapter';
4
4
  import { LocalAudioTrackStateEvent, LocalVideoTrackStateEvent, RtcAudioDeviceManagerBase, RtcVideoDeviceManagerBase } from './adapter/base';
5
5
  import { AgoraRtcVideoCanvas } from './canvas';
6
6
  import { AGRtcChannel } from './channel';
7
- import { AGRtcDeviceInfo, AGScreenShareDevice, AGScreenShareType, AGBeautyEffect, AGAudioRawDataConfig } from './type';
7
+ import { AGRtcDeviceInfo, AGScreenShareDevice, AGScreenShareType, AGBeautyEffect } from './type';
8
+ import { AgoraRteAudioRawDataConfig, AgoraRteAudioRawDataObserver, AgoraRteAudioRawDataPosition } from '../media/type';
8
9
  export declare class AGRtcManager {
9
10
  private _adapter;
10
11
  private _channels;
@@ -34,8 +35,6 @@ export declare class AGRtcManager {
34
35
  stopAudioRecordingDeviceTest(): number;
35
36
  startAudioPlaybackDeviceTest(url: string): number;
36
37
  stopAudioPlaybackDeviceTest(): number;
37
- setAudioFrameCallback(): number;
38
- stopAudioFrameCallback(): number;
39
38
  onAutoPlayFailed(cb: () => void): number;
40
39
  onLocalCameraListChanged(cb: (addNewDevice: boolean, newDevices: AGRtcDeviceInfo[], allDevices: AGRtcDeviceInfo[]) => void): number;
41
40
  onLocalRecordingDeviceListChanged(cb: (addNewDevice: boolean, newDevices: AGRtcDeviceInfo[], allDevices: AGRtcDeviceInfo[]) => void): number;
@@ -44,7 +43,9 @@ export declare class AGRtcManager {
44
43
  onLocalAudioTrackStateChanged(cb: LocalAudioTrackStateEvent): number;
45
44
  onLocalAudioVolume(cb: (volume: number) => void): number;
46
45
  setBeautyEffectOptions(enable: boolean, options: AGBeautyEffect): number;
47
- setAudioRawDataConfig(config: AGAudioRawDataConfig): number;
46
+ setAudioRawDataConfig(config: AgoraRteAudioRawDataConfig, position: AgoraRteAudioRawDataPosition): number;
47
+ addAudioRawDataObserver(observer: AgoraRteAudioRawDataObserver, position: AgoraRteAudioRawDataPosition): number;
48
+ removeAudioRawDataObserver(observer: AgoraRteAudioRawDataObserver, position: AgoraRteAudioRawDataPosition): number;
48
49
  hasScreenSharePermission(): boolean;
49
50
  takeSnapshot(channel: string, streamUuid: number, filePath: string): Promise<void | import("./type").AGSnapshotInfo>;
50
51
  getCurrentFrameData(channelName: string, streamUuid: string, isLocal: boolean): ImageData;
@@ -151,16 +151,6 @@ var AGRtcManager = (_dec = _decorator.Log.attach(), _dec2 = _decorator.Log.silen
151
151
  value: function stopAudioPlaybackDeviceTest() {
152
152
  return this._adapter.stopAudioPlaybackDeviceTest();
153
153
  }
154
- }, {
155
- key: "setAudioFrameCallback",
156
- value: function setAudioFrameCallback() {
157
- return this._adapter.setAudioFrameCallback();
158
- }
159
- }, {
160
- key: "stopAudioFrameCallback",
161
- value: function stopAudioFrameCallback() {
162
- return this._adapter.stopAudioFrameCallback();
163
- }
164
154
  }, {
165
155
  key: "onAutoPlayFailed",
166
156
  value: function onAutoPlayFailed(cb) {
@@ -203,8 +193,18 @@ var AGRtcManager = (_dec = _decorator.Log.attach(), _dec2 = _decorator.Log.silen
203
193
  }
204
194
  }, {
205
195
  key: "setAudioRawDataConfig",
206
- value: function setAudioRawDataConfig(config) {
207
- return this._adapter.setAudioRawDataConfig(config);
196
+ value: function setAudioRawDataConfig(config, position) {
197
+ return this._adapter.setAudioRawDataConfig(config, position);
198
+ }
199
+ }, {
200
+ key: "addAudioRawDataObserver",
201
+ value: function addAudioRawDataObserver(observer, position) {
202
+ return this._adapter.addAudioRawDataObserver(observer, position);
203
+ }
204
+ }, {
205
+ key: "removeAudioRawDataObserver",
206
+ value: function removeAudioRawDataObserver(observer, position) {
207
+ return this._adapter.removeAudioRawDataObserver(observer, position);
208
208
  }
209
209
  }, {
210
210
  key: "hasScreenSharePermission",
@@ -132,10 +132,6 @@ export interface AGBeautyEffect {
132
132
  smoothnessLevel: number;
133
133
  sharpnessLevel: number;
134
134
  }
135
- export interface AGAudioRawDataConfig {
136
- frameSize?: 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384;
137
- sampleRate?: number;
138
- }
139
135
  export declare enum AGRemoteVideoStreamType {
140
136
  /**
141
137
  * 0: High-quality video stream (high-bitrate, high-resolution).
@@ -11,6 +11,17 @@ export interface EntryRequestParams {
11
11
  videoSourceState?: AgoraRteMediaSourceState;
12
12
  audioSourceState?: AgoraRteMediaSourceState;
13
13
  };
14
+ sequenceVersion?: AgoraRteSequenceVersion;
15
+ }
16
+ export declare enum AgoraRteSequenceVersion {
17
+ /**
18
+ * 服务端返回单条sequence
19
+ */
20
+ v1 = 1,
21
+ /**
22
+ * 服务端返回sequence数组
23
+ */
24
+ v2 = 2
14
25
  }
15
26
  export interface PublishCdnParams {
16
27
  streamName?: string;
@@ -92,4 +103,8 @@ export declare class AgoraRteService extends ApiBase {
92
103
  }): Promise<any>;
93
104
  sendRoomChatMessage(message: string, roomUuid: string): Promise<any>;
94
105
  publishStreamToCdn(roomUuid: string, userUuid: string, streamUuid: string, params: PublishCdnParams): Promise<any>;
106
+ updateOnlineState({ userUuid, roomUuid }: {
107
+ roomUuid: string;
108
+ userUuid: string;
109
+ }): Promise<any>;
95
110
  }
@@ -27,7 +27,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
27
27
  Object.defineProperty(exports, "__esModule", {
28
28
  value: true
29
29
  });
30
- exports.AgoraRteService = void 0;
30
+ exports.AgoraRteService = exports.AgoraRteSequenceVersion = void 0;
31
31
  require("core-js/modules/es.array.concat.js");
32
32
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
33
33
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
@@ -44,6 +44,12 @@ var _dec, _class;
44
44
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
45
45
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
46
46
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
47
+ var AgoraRteSequenceVersion;
48
+ exports.AgoraRteSequenceVersion = AgoraRteSequenceVersion;
49
+ (function (AgoraRteSequenceVersion) {
50
+ AgoraRteSequenceVersion[AgoraRteSequenceVersion["v1"] = 1] = "v1";
51
+ AgoraRteSequenceVersion[AgoraRteSequenceVersion["v2"] = 2] = "v2";
52
+ })(AgoraRteSequenceVersion || (exports.AgoraRteSequenceVersion = AgoraRteSequenceVersion = {}));
47
53
  var AgoraRteService = (_dec = _log.Log.attach(), _dec(_class = /*#__PURE__*/function (_ApiBase) {
48
54
  (0, _inherits2["default"])(AgoraRteService, _ApiBase);
49
55
  var _super = _createSuper(AgoraRteService);
@@ -569,6 +575,35 @@ var AgoraRteService = (_dec = _log.Log.attach(), _dec(_class = /*#__PURE__*/func
569
575
  }
570
576
  return publishStreamToCdn;
571
577
  }()
578
+ }, {
579
+ key: "updateOnlineState",
580
+ value: function () {
581
+ var _updateOnlineState = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(_ref9) {
582
+ var userUuid, roomUuid;
583
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
584
+ while (1) {
585
+ switch (_context16.prev = _context16.next) {
586
+ case 0:
587
+ userUuid = _ref9.userUuid, roomUuid = _ref9.roomUuid;
588
+ _context16.next = 3;
589
+ return this.fetch({
590
+ path: "/v1/rooms/".concat(roomUuid, "/users/").concat(userUuid, "/states/1"),
591
+ method: 'PUT'
592
+ });
593
+ case 3:
594
+ return _context16.abrupt("return", _context16.sent);
595
+ case 4:
596
+ case "end":
597
+ return _context16.stop();
598
+ }
599
+ }
600
+ }, _callee16, this);
601
+ }));
602
+ function updateOnlineState(_x34) {
603
+ return _updateOnlineState.apply(this, arguments);
604
+ }
605
+ return updateOnlineState;
606
+ }()
572
607
  }]);
573
608
  return AgoraRteService;
574
609
  }(_base.ApiBase)) || _class);
@@ -1,5 +1,4 @@
1
1
  export declare class AGEventEmitter {
2
- private readonly _eventMap;
3
2
  once(evt: string, cb: CallableFunction): this;
4
3
  on(evt: string, cb: CallableFunction): this;
5
4
  off(evt: string, cb: CallableFunction): this;
package/lib/index.d.ts CHANGED
@@ -15,11 +15,13 @@ export { retryAttempt } from './core/utils/utils';
15
15
  export { Log, Lodash, bound } from './core/decorator';
16
16
  export { AgoraRteVideoSourceType, AgoraRteAudioSourceType, AgoraRteMediaPublishState, AgoraRteMediaTrack, AgoraRteCameraVideoTrack, AgoraRteMicrophoneAudioTrack, AgoraRteScreenShareTrack, AgoraRteStreamMediaTrack, } from './core/media/track';
17
17
  export { AgoraMediaControlEventType, AgoraMediaControl } from './core/media/control';
18
+ export { AgoraRteAudioRawDataPosition } from './core/media/type';
19
+ export type { AgoraRteAudioRawDataConfig, AgoraRteAudioRawDataObserver } from './core/media/type';
18
20
  export type { AgoraFromUser } from './core/processor/channel-msg/struct';
19
21
  export { Scheduler, ActionWhenTaskFail } from './core/schedule';
20
22
  export { Duration } from './core/schedule/scheduler';
21
23
  export { AGNetworkQuality, AgoraRteMediaSourceState, AGRtcState, AGMediaEncryptionMode, AGRteTrackErrorReason, AGScreenShareType, AGRenderMode, AGLighteningLevel, AGRemoteVideoStreamType, } from './core/rtc/type';
22
- export type { AGNetworkStats, AGRtcDeviceInfo, AGMediaEncryptionConfig, AGScreenShareDevice, AGVideoEncoderConfigurations, AGBeautyEffect, AGAudioRawDataConfig, AGLowStreamParameter, AGSnapshotInfo, } from './core/rtc/type';
24
+ export type { AGNetworkStats, AGRtcDeviceInfo, AGMediaEncryptionConfig, AGScreenShareDevice, AGVideoEncoderConfigurations, AGBeautyEffect, AGLowStreamParameter, AGSnapshotInfo, } from './core/rtc/type';
23
25
  export type { AGRtcConfig } from './core/rtc/adapter/index';
24
26
  export { AGEventEmitter } from './core/utils/events';
25
27
  export { AgoraRteConnectionState, AGChannelProfile, AgoraRteLogLevel } from './type';
package/lib/index.js CHANGED
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  Object.defineProperty(exports, "AGChannelProfile", {
8
8
  enumerable: true,
9
9
  get: function get() {
10
- return _type2.AGChannelProfile;
10
+ return _type3.AGChannelProfile;
11
11
  }
12
12
  });
13
13
  Object.defineProperty(exports, "AGError", {
@@ -31,31 +31,31 @@ Object.defineProperty(exports, "AGEventEmitter", {
31
31
  Object.defineProperty(exports, "AGLighteningLevel", {
32
32
  enumerable: true,
33
33
  get: function get() {
34
- return _type.AGLighteningLevel;
34
+ return _type2.AGLighteningLevel;
35
35
  }
36
36
  });
37
37
  Object.defineProperty(exports, "AGMediaEncryptionMode", {
38
38
  enumerable: true,
39
39
  get: function get() {
40
- return _type.AGMediaEncryptionMode;
40
+ return _type2.AGMediaEncryptionMode;
41
41
  }
42
42
  });
43
43
  Object.defineProperty(exports, "AGNetworkQuality", {
44
44
  enumerable: true,
45
45
  get: function get() {
46
- return _type.AGNetworkQuality;
46
+ return _type2.AGNetworkQuality;
47
47
  }
48
48
  });
49
49
  Object.defineProperty(exports, "AGRemoteVideoStreamType", {
50
50
  enumerable: true,
51
51
  get: function get() {
52
- return _type.AGRemoteVideoStreamType;
52
+ return _type2.AGRemoteVideoStreamType;
53
53
  }
54
54
  });
55
55
  Object.defineProperty(exports, "AGRenderMode", {
56
56
  enumerable: true,
57
57
  get: function get() {
58
- return _type.AGRenderMode;
58
+ return _type2.AGRenderMode;
59
59
  }
60
60
  });
61
61
  Object.defineProperty(exports, "AGRtcConnectionType", {
@@ -67,7 +67,7 @@ Object.defineProperty(exports, "AGRtcConnectionType", {
67
67
  Object.defineProperty(exports, "AGRtcState", {
68
68
  enumerable: true,
69
69
  get: function get() {
70
- return _type.AGRtcState;
70
+ return _type2.AGRtcState;
71
71
  }
72
72
  });
73
73
  Object.defineProperty(exports, "AGRteErrorCode", {
@@ -79,13 +79,13 @@ Object.defineProperty(exports, "AGRteErrorCode", {
79
79
  Object.defineProperty(exports, "AGRteTrackErrorReason", {
80
80
  enumerable: true,
81
81
  get: function get() {
82
- return _type.AGRteTrackErrorReason;
82
+ return _type2.AGRteTrackErrorReason;
83
83
  }
84
84
  });
85
85
  Object.defineProperty(exports, "AGScreenShareType", {
86
86
  enumerable: true,
87
87
  get: function get() {
88
- return _type.AGScreenShareType;
88
+ return _type2.AGScreenShareType;
89
89
  }
90
90
  });
91
91
  Object.defineProperty(exports, "AbstractErrorCenter", {
@@ -133,13 +133,13 @@ Object.defineProperty(exports, "AgoraMediaPlayerCanvas", {
133
133
  Object.defineProperty(exports, "AgoraRCEventType", {
134
134
  enumerable: true,
135
135
  get: function get() {
136
- return _type3.AgoraRCEventType;
136
+ return _type4.AgoraRCEventType;
137
137
  }
138
138
  });
139
139
  Object.defineProperty(exports, "AgoraRCRole", {
140
140
  enumerable: true,
141
141
  get: function get() {
142
- return _type3.AgoraRCRole;
142
+ return _type4.AgoraRCRole;
143
143
  }
144
144
  });
145
145
  Object.defineProperty(exports, "AgoraRegion", {
@@ -166,6 +166,12 @@ Object.defineProperty(exports, "AgoraRtcVideoCanvas", {
166
166
  return _canvas.AgoraRtcVideoCanvas;
167
167
  }
168
168
  });
169
+ Object.defineProperty(exports, "AgoraRteAudioRawDataPosition", {
170
+ enumerable: true,
171
+ get: function get() {
172
+ return _type.AgoraRteAudioRawDataPosition;
173
+ }
174
+ });
169
175
  Object.defineProperty(exports, "AgoraRteAudioSourceType", {
170
176
  enumerable: true,
171
177
  get: function get() {
@@ -181,7 +187,7 @@ Object.defineProperty(exports, "AgoraRteCameraVideoTrack", {
181
187
  Object.defineProperty(exports, "AgoraRteConnectionState", {
182
188
  enumerable: true,
183
189
  get: function get() {
184
- return _type2.AgoraRteConnectionState;
190
+ return _type3.AgoraRteConnectionState;
185
191
  }
186
192
  });
187
193
  Object.defineProperty(exports, "AgoraRteEngine", {
@@ -205,7 +211,7 @@ Object.defineProperty(exports, "AgoraRteEventType", {
205
211
  Object.defineProperty(exports, "AgoraRteLogLevel", {
206
212
  enumerable: true,
207
213
  get: function get() {
208
- return _type2.AgoraRteLogLevel;
214
+ return _type3.AgoraRteLogLevel;
209
215
  }
210
216
  });
211
217
  Object.defineProperty(exports, "AgoraRteMediaPublishState", {
@@ -217,7 +223,7 @@ Object.defineProperty(exports, "AgoraRteMediaPublishState", {
217
223
  Object.defineProperty(exports, "AgoraRteMediaSourceState", {
218
224
  enumerable: true,
219
225
  get: function get() {
220
- return _type.AgoraRteMediaSourceState;
226
+ return _type2.AgoraRteMediaSourceState;
221
227
  }
222
228
  });
223
229
  Object.defineProperty(exports, "AgoraRteMediaTrack", {
@@ -354,11 +360,12 @@ var _utils = require("./core/utils/utils");
354
360
  var _decorator = require("./core/decorator");
355
361
  var _track = require("./core/media/track");
356
362
  var _control = require("./core/media/control");
363
+ var _type = require("./core/media/type");
357
364
  var _schedule = require("./core/schedule");
358
365
  var _scheduler = require("./core/schedule/scheduler");
359
- var _type = require("./core/rtc/type");
366
+ var _type2 = require("./core/rtc/type");
360
367
  var _events = require("./core/utils/events");
361
- var _type2 = require("./type");
368
+ var _type3 = require("./type");
362
369
  var _thread = require("./core/utils/thread");
363
- var _type3 = require("./core/rc/type");
370
+ var _type4 = require("./core/rc/type");
364
371
  var _mediaPlayer = require("./core/media-player");
@@ -1,7 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { AGRtmManager } from '../core/rtm';
3
3
  import { AgoraRteLocalUser } from '../user';
4
- import { RtmChannel } from 'agora-rtm-sdk';
5
4
  import { EventEmitter } from 'events';
6
5
  import { AGRtcManager } from '../core/rtc';
7
6
  import { AGRtcChannel, AGRtcConnectionType } from '../core/rtc/channel';
@@ -25,8 +24,6 @@ export interface SceneObjects {
25
24
  rtc: AGRtcManager;
26
25
  rtcChannel: AGRtcChannel;
27
26
  rtm: AGRtmManager;
28
- rtmChannel: RtmChannel;
29
- rtmChannelObserver: EventEmitter;
30
27
  }
31
28
  export declare class AgoraRteScene extends EventEmitter {
32
29
  logger: Logger;
@@ -42,9 +39,8 @@ export declare class AgoraRteScene extends EventEmitter {
42
39
  readonly dataStore: AgoraRteSyncDataStore;
43
40
  private _rtmManager;
44
41
  private _rtcManager;
45
- private _rtmChannel;
46
42
  private _rtcChannel;
47
- private _rtmChannelObserver;
43
+ private _stateSynchronizer;
48
44
  private _synchronizer?;
49
45
  private _timestampGap;
50
46
  createTs?: number;