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.
- package/dist/index.js +2 -2
- package/lib/configs/index.d.ts +8 -6
- package/lib/configs/index.js +8 -6
- package/lib/core/engine/index.js +1 -7
- package/lib/core/logger/index.d.ts +1 -0
- package/lib/core/logger/index.js +22 -2
- package/lib/core/logger/log.worker.js +4 -2
- package/lib/core/media/control.d.ts +11 -8
- package/lib/core/media/control.js +42 -32
- package/lib/core/media/player.d.ts +9 -0
- package/lib/core/media/player.js +36 -0
- package/lib/core/media/track.d.ts +8 -1
- package/lib/core/media/track.js +18 -0
- package/lib/core/media/type.d.ts +113 -0
- package/lib/core/media/type.js +31 -0
- package/lib/core/processor/channel-msg/data.d.ts +1 -0
- package/lib/core/processor/channel-msg/data.js +5 -0
- package/lib/core/processor/channel-msg/handler.d.ts +1 -3
- package/lib/core/processor/channel-msg/handler.js +20 -21
- package/lib/core/processor/channel-msg/message-parser.d.ts +6 -0
- package/lib/core/processor/channel-msg/message-parser.js +57 -0
- package/lib/core/processor/channel-msg/struct.d.ts +5 -0
- package/lib/core/processor/channel-msg/synchronizer.d.ts +7 -14
- package/lib/core/processor/channel-msg/synchronizer.js +33 -48
- package/lib/core/processor/peer-msg/handler.d.ts +16 -0
- package/lib/core/processor/peer-msg/handler.js +57 -0
- package/lib/core/processor/peer-msg/struct.d.ts +4 -0
- package/lib/core/processor/type.d.ts +200 -0
- package/lib/core/rc/index.js +6 -2
- package/lib/core/rtc/adapter/base.d.ts +6 -7
- package/lib/core/rtc/adapter/electron/device.d.ts +0 -1
- package/lib/core/rtc/adapter/electron/device.js +0 -5
- package/lib/core/rtc/adapter/electron/index.d.ts +6 -7
- package/lib/core/rtc/adapter/electron/index.js +22 -24
- package/lib/core/rtc/adapter/web/client.d.ts +11 -9
- package/lib/core/rtc/adapter/web/client.js +40 -38
- package/lib/core/rtc/adapter/web/device.d.ts +0 -1
- package/lib/core/rtc/adapter/web/device.js +0 -5
- package/lib/core/rtc/adapter/web/dispatcher.d.ts +61 -0
- package/lib/core/rtc/adapter/web/dispatcher.js +166 -0
- package/lib/core/rtc/adapter/web/index.d.ts +11 -7
- package/lib/core/rtc/adapter/web/index.js +25 -16
- package/lib/core/rtc/adapter/web/thread.d.ts +18 -11
- package/lib/core/rtc/adapter/web/thread.js +241 -133
- package/lib/core/rtc/channel.d.ts +2 -3
- package/lib/core/rtc/index.d.ts +5 -4
- package/lib/core/rtc/index.js +12 -12
- package/lib/core/rtc/type.d.ts +0 -4
- package/lib/core/services/api.d.ts +15 -0
- package/lib/core/services/api.js +36 -1
- package/lib/core/utils/events.d.ts +0 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +24 -17
- package/lib/scene/index.d.ts +1 -5
- package/lib/scene/index.js +88 -66
- package/lib/scene/state-sync.d.ts +21 -0
- package/lib/scene/state-sync.js +169 -0
- package/package.json +1 -1
package/lib/configs/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AGRtcConfig } from '../core/rtc/adapter';
|
|
2
2
|
import { IExtension, IBaseProcessor } from 'agora-rte-extension';
|
|
3
3
|
import { AgoraRteLogLevel } from '../type';
|
|
4
|
+
import { AgoraRteSequenceVersion } from '../core/services/api';
|
|
4
5
|
export declare enum AgoraRteRuntimePlatform {
|
|
5
6
|
Electron = 0,
|
|
6
7
|
Web = 1
|
|
@@ -41,9 +42,6 @@ export interface AgoraRteOptions {
|
|
|
41
42
|
latencyLevel?: AgoraLatencyLevel;
|
|
42
43
|
}
|
|
43
44
|
export declare class AgoraRteEngineConfig {
|
|
44
|
-
private static _config?;
|
|
45
|
-
static get shared(): AgoraRteEngineConfig;
|
|
46
|
-
static setConfig(config: AgoraRteEngineConfig): void;
|
|
47
45
|
appId: string;
|
|
48
46
|
service: AgoraRteServiceConfig;
|
|
49
47
|
rtcConfigs: AGRtcConfig;
|
|
@@ -51,9 +49,6 @@ export declare class AgoraRteEngineConfig {
|
|
|
51
49
|
rtcSDKParameters: any[];
|
|
52
50
|
rtcSDKExtensions: AgoraRtcSDKExtension[];
|
|
53
51
|
latencyLevel: AgoraLatencyLevel;
|
|
54
|
-
static logLevel: AgoraRteLogLevel;
|
|
55
|
-
static consoleHijackEnabled: boolean;
|
|
56
|
-
static get platform(): AgoraRteRuntimePlatform;
|
|
57
52
|
userId: string;
|
|
58
53
|
token: string;
|
|
59
54
|
ignoreUrlRegionPrefix: boolean;
|
|
@@ -66,5 +61,12 @@ export declare class AgoraRteEngineConfig {
|
|
|
66
61
|
constructor(appId: string, opts?: AgoraRteOptions);
|
|
67
62
|
setRtcRegion(region: AgoraComponentRegion): void;
|
|
68
63
|
setRtmRegion(region: AgoraComponentRegion): void;
|
|
64
|
+
private static _config?;
|
|
65
|
+
static logLevel: AgoraRteLogLevel;
|
|
66
|
+
static consoleHijackEnabled: boolean;
|
|
67
|
+
static sequenceVersion: AgoraRteSequenceVersion;
|
|
68
|
+
static setConfig(config: AgoraRteEngineConfig): void;
|
|
69
|
+
static get shared(): AgoraRteEngineConfig;
|
|
70
|
+
static get platform(): AgoraRteRuntimePlatform;
|
|
69
71
|
static get version(): string;
|
|
70
72
|
}
|
package/lib/configs/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/cl
|
|
|
20
20
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
21
21
|
var _error = require("../core/utils/error");
|
|
22
22
|
var _type = require("../type");
|
|
23
|
+
var _api = require("../core/services/api");
|
|
23
24
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
25
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
26
|
var AgoraRteRuntimePlatform;
|
|
@@ -112,6 +113,11 @@ var AgoraRteEngineConfig = /*#__PURE__*/function () {
|
|
|
112
113
|
this._rtmRegion = region;
|
|
113
114
|
}
|
|
114
115
|
}], [{
|
|
116
|
+
key: "setConfig",
|
|
117
|
+
value: function setConfig(config) {
|
|
118
|
+
this._config = config;
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
115
121
|
key: "shared",
|
|
116
122
|
get: function get() {
|
|
117
123
|
if (!this._config) {
|
|
@@ -119,11 +125,6 @@ var AgoraRteEngineConfig = /*#__PURE__*/function () {
|
|
|
119
125
|
}
|
|
120
126
|
return this._config;
|
|
121
127
|
}
|
|
122
|
-
}, {
|
|
123
|
-
key: "setConfig",
|
|
124
|
-
value: function setConfig(config) {
|
|
125
|
-
this._config = config;
|
|
126
|
-
}
|
|
127
128
|
}, {
|
|
128
129
|
key: "platform",
|
|
129
130
|
get: function get() {
|
|
@@ -145,4 +146,5 @@ var AgoraRteEngineConfig = /*#__PURE__*/function () {
|
|
|
145
146
|
exports.AgoraRteEngineConfig = AgoraRteEngineConfig;
|
|
146
147
|
AgoraRteEngineConfig._config = void 0;
|
|
147
148
|
AgoraRteEngineConfig.logLevel = _type.AgoraRteLogLevel.INFO;
|
|
148
|
-
AgoraRteEngineConfig.consoleHijackEnabled = false;
|
|
149
|
+
AgoraRteEngineConfig.consoleHijackEnabled = false;
|
|
150
|
+
AgoraRteEngineConfig.sequenceVersion = _api.AgoraRteSequenceVersion.v2;
|
package/lib/core/engine/index.js
CHANGED
|
@@ -148,18 +148,12 @@ var AgoraRteEngine = /*#__PURE__*/function (_AGEventEmitter) {
|
|
|
148
148
|
}, {
|
|
149
149
|
key: "createAgoraRteScene",
|
|
150
150
|
value: function createAgoraRteScene(sceneId) {
|
|
151
|
-
var _this$_rtmManager$cre = this._rtmManager.createObserverChannel(sceneId),
|
|
152
|
-
_this$_rtmManager$cre2 = (0, _slicedToArray2["default"])(_this$_rtmManager$cre, 2),
|
|
153
|
-
rtmChannel = _this$_rtmManager$cre2[0],
|
|
154
|
-
rtmChannelObserver = _this$_rtmManager$cre2[1];
|
|
155
151
|
var rtcChannel = this._rtcManager.getRtcChannel(sceneId);
|
|
156
152
|
return new _scene.AgoraRteScene(sceneId, {
|
|
157
153
|
engine: this,
|
|
158
154
|
rtc: this._rtcManager,
|
|
159
|
-
rtcChannel: rtcChannel,
|
|
160
155
|
rtm: this._rtmManager,
|
|
161
|
-
|
|
162
|
-
rtmChannelObserver: rtmChannelObserver
|
|
156
|
+
rtcChannel: rtcChannel
|
|
163
157
|
});
|
|
164
158
|
}
|
|
165
159
|
}, {
|
|
@@ -26,6 +26,7 @@ export declare class Logger {
|
|
|
26
26
|
static info(...args: unknown[]): void;
|
|
27
27
|
static error(...args: unknown[]): void;
|
|
28
28
|
static originConsole: Console;
|
|
29
|
+
static setMaxRecords(maxRecords: number): void;
|
|
29
30
|
debug(...args: unknown[]): void;
|
|
30
31
|
info(...args: unknown[]): void;
|
|
31
32
|
warn(...args: unknown[]): void;
|
package/lib/core/logger/index.js
CHANGED
|
@@ -61,6 +61,7 @@ var _configs = require("../../configs");
|
|
|
61
61
|
var _db = require("./db");
|
|
62
62
|
var _log2 = _interopRequireDefault(require("worker-loader?inline=no-fallback!./log.worker"));
|
|
63
63
|
var _type = require("../../type");
|
|
64
|
+
var _isNumber = _interopRequireDefault(require("lodash/isNumber"));
|
|
64
65
|
var _logLevelMap;
|
|
65
66
|
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; }
|
|
66
67
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -176,6 +177,21 @@ var Logger = /*#__PURE__*/function () {
|
|
|
176
177
|
var _Logger$logger4;
|
|
177
178
|
(_Logger$logger4 = Logger.logger).error.apply(_Logger$logger4, arguments);
|
|
178
179
|
}
|
|
180
|
+
}, {
|
|
181
|
+
key: "setMaxRecords",
|
|
182
|
+
value: function setMaxRecords(maxRecords) {
|
|
183
|
+
if ((0, _isNumber["default"])(maxRecords)) {
|
|
184
|
+
console.log("[logger] set maxRecords to ".concat(maxRecords));
|
|
185
|
+
Logger.thread.postMessage({
|
|
186
|
+
type: 'setting',
|
|
187
|
+
data: {
|
|
188
|
+
maxRecords: maxRecords
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
} else {
|
|
192
|
+
console.warn("[logger] cannot set maxRecords to an invalid number :".concat(maxRecords));
|
|
193
|
+
}
|
|
194
|
+
}
|
|
179
195
|
}, {
|
|
180
196
|
key: "setupConsoleHijack",
|
|
181
197
|
value: function setupConsoleHijack() {
|
|
@@ -382,7 +398,11 @@ Logger._instancesByLabel = new Map(Object.entries({
|
|
|
382
398
|
database: true
|
|
383
399
|
}),
|
|
384
400
|
'channel-message': new Logger('channel-message', {
|
|
385
|
-
console:
|
|
401
|
+
console: true,
|
|
402
|
+
database: true
|
|
403
|
+
}),
|
|
404
|
+
'peer-message': new Logger('peer-message', {
|
|
405
|
+
console: true,
|
|
386
406
|
database: true
|
|
387
407
|
}),
|
|
388
408
|
'http-error': new Logger('http-error', {
|
|
@@ -395,5 +415,5 @@ Logger._instancesByLabel = new Map(Object.entries({
|
|
|
395
415
|
})
|
|
396
416
|
}));
|
|
397
417
|
Logger.logger = Logger._instancesByLabel.get('default');
|
|
398
|
-
Logger.thread =
|
|
418
|
+
Logger.thread = new _log2["default"]();
|
|
399
419
|
Logger.originConsole = window.console;
|
|
@@ -34,7 +34,7 @@ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyri
|
|
|
34
34
|
console.log("[worker] log worker initialzied");
|
|
35
35
|
var ctx = self;
|
|
36
36
|
var mutex = new _mutex.Mutex();
|
|
37
|
-
var
|
|
37
|
+
var maxRecords = 50000;
|
|
38
38
|
var logs = [];
|
|
39
39
|
var log = function log() {
|
|
40
40
|
var _console;
|
|
@@ -55,7 +55,7 @@ var debouncedWriting = (0, _debounce["default"])(function () {
|
|
|
55
55
|
return _db.db.logs.count();
|
|
56
56
|
case 6:
|
|
57
57
|
count = _context.sent;
|
|
58
|
-
exceedNo = logscopy.length + count -
|
|
58
|
+
exceedNo = logscopy.length + count - maxRecords;
|
|
59
59
|
if (!(exceedNo > 0)) {
|
|
60
60
|
_context.next = 12;
|
|
61
61
|
break;
|
|
@@ -112,6 +112,8 @@ ctx.onmessage = /*#__PURE__*/function () {
|
|
|
112
112
|
timestamp: "".concat(now)
|
|
113
113
|
});
|
|
114
114
|
debouncedWriting();
|
|
115
|
+
} else if (evt.data && evt.data.type === 'setting') {
|
|
116
|
+
maxRecords = evt.data.data.maxRecords || 50000;
|
|
115
117
|
}
|
|
116
118
|
case 1:
|
|
117
119
|
case "end":
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AGEventEmitter } from '../utils/events';
|
|
2
2
|
import { AGRtcManager } from '../rtc';
|
|
3
3
|
import { AgoraRteCameraVideoTrack, AgoraRteStreamMediaTrack, AgoraRteMicrophoneAudioTrack, AgoraRteScreenShareTrack } from './track';
|
|
4
|
-
import {
|
|
4
|
+
import { AGBeautyEffect, AGRtcDeviceInfo, AGScreenShareDevice } from '../../';
|
|
5
|
+
import { AgoraRteStreamPlayer } from './player';
|
|
5
6
|
export declare enum AgoraMediaControlEventType {
|
|
6
7
|
cameraListChanged = "camera-list-changed",
|
|
7
8
|
localAudioVolume = "local-audio-volume",
|
|
@@ -13,20 +14,25 @@ export declare enum AgoraMediaControlEventType {
|
|
|
13
14
|
recordingDeviceListChanged = "recording-device-list-changed",
|
|
14
15
|
localAudioPlaybackVolumeIndicator = "start-test-audio-playback-volume-indicator",
|
|
15
16
|
audioPlaybackStateChanged = "audio-playback-state-changed",
|
|
16
|
-
localAudioFrame = "local-audio-frame",
|
|
17
17
|
localTrackBeforeDestroy = "local-track-before-destroy",
|
|
18
18
|
videoAutoPlayFailed = "video-auto-play-failed"
|
|
19
19
|
}
|
|
20
20
|
export declare class AgoraMediaControl extends AGEventEmitter {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
private _camera?;
|
|
22
|
+
private _microphone?;
|
|
23
|
+
private _screen?;
|
|
24
|
+
private _player?;
|
|
24
25
|
private _rtc;
|
|
25
26
|
constructor(rtc: AGRtcManager);
|
|
27
|
+
get camera(): AgoraRteCameraVideoTrack | undefined;
|
|
28
|
+
get microphone(): AgoraRteMicrophoneAudioTrack | undefined;
|
|
29
|
+
get screen(): AgoraRteScreenShareTrack | undefined;
|
|
30
|
+
get player(): AgoraRteStreamPlayer | undefined;
|
|
26
31
|
private _addEventListener;
|
|
27
32
|
createCameraVideoTrack(): AgoraRteCameraVideoTrack;
|
|
28
33
|
createMicrophoneAudioTrack(): AgoraRteMicrophoneAudioTrack;
|
|
29
34
|
createScreenShareTrack(): AgoraRteScreenShareTrack;
|
|
35
|
+
createStreamPlayer(): AgoraRteStreamPlayer;
|
|
30
36
|
getVideoCameraList(): AGRtcDeviceInfo[];
|
|
31
37
|
getAudioRecordingList(): AGRtcDeviceInfo[];
|
|
32
38
|
getAudioPlaybackList(): AGRtcDeviceInfo[];
|
|
@@ -38,10 +44,7 @@ export declare class AgoraMediaControl extends AGEventEmitter {
|
|
|
38
44
|
stopAudioRecordingDeviceTest(): number;
|
|
39
45
|
startAudioPlaybackDeviceTest(url: string): number;
|
|
40
46
|
stopAudioPlaybackDeviceTest(): number;
|
|
41
|
-
setAudioFrameCallback(): number;
|
|
42
|
-
stopAudioFrameCallback(): number;
|
|
43
47
|
setBeautyEffectOptions(enable: boolean, options: AGBeautyEffect): number;
|
|
44
|
-
setAudioRawDataConfig(config: AGAudioRawDataConfig): number;
|
|
45
48
|
createStreamMediaTrack(): AgoraRteStreamMediaTrack;
|
|
46
49
|
takeSnapshot(channel: string, streamUuid: number, filePath: string): Promise<void | import("../rtc/type").AGSnapshotInfo>;
|
|
47
50
|
getCurrentFrameData(channelName: string, streamUuid: string, isLocal: boolean): ImageData;
|
|
@@ -15,6 +15,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
15
15
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
16
16
|
var _events = require("../utils/events");
|
|
17
17
|
var _track = require("./track");
|
|
18
|
+
var _player = require("./player");
|
|
18
19
|
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); }; }
|
|
19
20
|
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; } }
|
|
20
21
|
var AgoraMediaControlEventType;
|
|
@@ -30,7 +31,6 @@ exports.AgoraMediaControlEventType = AgoraMediaControlEventType;
|
|
|
30
31
|
AgoraMediaControlEventType["recordingDeviceListChanged"] = "recording-device-list-changed";
|
|
31
32
|
AgoraMediaControlEventType["localAudioPlaybackVolumeIndicator"] = "start-test-audio-playback-volume-indicator";
|
|
32
33
|
AgoraMediaControlEventType["audioPlaybackStateChanged"] = "audio-playback-state-changed";
|
|
33
|
-
AgoraMediaControlEventType["localAudioFrame"] = "local-audio-frame";
|
|
34
34
|
AgoraMediaControlEventType["localTrackBeforeDestroy"] = "local-track-before-destroy";
|
|
35
35
|
AgoraMediaControlEventType["videoAutoPlayFailed"] = "video-auto-play-failed";
|
|
36
36
|
})(AgoraMediaControlEventType || (exports.AgoraMediaControlEventType = AgoraMediaControlEventType = {}));
|
|
@@ -41,15 +41,36 @@ var AgoraMediaControl = /*#__PURE__*/function (_AGEventEmitter) {
|
|
|
41
41
|
var _this;
|
|
42
42
|
(0, _classCallCheck2["default"])(this, AgoraMediaControl);
|
|
43
43
|
_this = _super.call(this);
|
|
44
|
-
_this.
|
|
45
|
-
_this.
|
|
46
|
-
_this.
|
|
44
|
+
_this._camera = void 0;
|
|
45
|
+
_this._microphone = void 0;
|
|
46
|
+
_this._screen = void 0;
|
|
47
|
+
_this._player = void 0;
|
|
47
48
|
_this._rtc = void 0;
|
|
48
49
|
_this._rtc = rtc;
|
|
49
50
|
_this._addEventListener(rtc);
|
|
50
51
|
return _this;
|
|
51
52
|
}
|
|
52
53
|
(0, _createClass2["default"])(AgoraMediaControl, [{
|
|
54
|
+
key: "camera",
|
|
55
|
+
get: function get() {
|
|
56
|
+
return this._camera;
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
key: "microphone",
|
|
60
|
+
get: function get() {
|
|
61
|
+
return this._microphone;
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
key: "screen",
|
|
65
|
+
get: function get() {
|
|
66
|
+
return this._screen;
|
|
67
|
+
}
|
|
68
|
+
}, {
|
|
69
|
+
key: "player",
|
|
70
|
+
get: function get() {
|
|
71
|
+
return this._player;
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
53
74
|
key: "_addEventListener",
|
|
54
75
|
value: function _addEventListener(rtc) {
|
|
55
76
|
var _this2 = this;
|
|
@@ -100,10 +121,6 @@ var AgoraMediaControl = /*#__PURE__*/function (_AGEventEmitter) {
|
|
|
100
121
|
rtc.getAudioDeviceManager().onLocalAudioPlaybackTestVolumeChanged(function (volume) {
|
|
101
122
|
_this2.emit(AgoraMediaControlEventType.localAudioPlaybackVolumeIndicator, volume);
|
|
102
123
|
});
|
|
103
|
-
// 本地原始音频数据(PCM)
|
|
104
|
-
rtc.getAudioDeviceManager().onAudioFrame(function (buffer) {
|
|
105
|
-
_this2.emit(AgoraMediaControlEventType.localAudioFrame, buffer);
|
|
106
|
-
});
|
|
107
124
|
// local screenshare
|
|
108
125
|
rtc.onLocalScreenShareTrackStateChanged(function () {
|
|
109
126
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
@@ -116,26 +133,34 @@ var AgoraMediaControl = /*#__PURE__*/function (_AGEventEmitter) {
|
|
|
116
133
|
}, {
|
|
117
134
|
key: "createCameraVideoTrack",
|
|
118
135
|
value: function createCameraVideoTrack() {
|
|
119
|
-
if (!this.
|
|
120
|
-
this.
|
|
136
|
+
if (!this._camera) {
|
|
137
|
+
this._camera = new _track.AgoraRteCameraVideoTrack(this._rtc);
|
|
121
138
|
}
|
|
122
|
-
return this.
|
|
139
|
+
return this._camera;
|
|
123
140
|
}
|
|
124
141
|
}, {
|
|
125
142
|
key: "createMicrophoneAudioTrack",
|
|
126
143
|
value: function createMicrophoneAudioTrack() {
|
|
127
|
-
if (!this.
|
|
128
|
-
this.
|
|
144
|
+
if (!this._microphone) {
|
|
145
|
+
this._microphone = new _track.AgoraRteMicrophoneAudioTrack(this._rtc);
|
|
129
146
|
}
|
|
130
|
-
return this.
|
|
147
|
+
return this._microphone;
|
|
131
148
|
}
|
|
132
149
|
}, {
|
|
133
150
|
key: "createScreenShareTrack",
|
|
134
151
|
value: function createScreenShareTrack() {
|
|
135
|
-
if (!this.
|
|
136
|
-
this.
|
|
152
|
+
if (!this._screen) {
|
|
153
|
+
this._screen = new _track.AgoraRteScreenShareTrack(this._rtc);
|
|
137
154
|
}
|
|
138
|
-
return this.
|
|
155
|
+
return this._screen;
|
|
156
|
+
}
|
|
157
|
+
}, {
|
|
158
|
+
key: "createStreamPlayer",
|
|
159
|
+
value: function createStreamPlayer() {
|
|
160
|
+
if (!this._player) {
|
|
161
|
+
this._player = new _player.AgoraRteStreamPlayer(this._rtc);
|
|
162
|
+
}
|
|
163
|
+
return this._player;
|
|
139
164
|
}
|
|
140
165
|
}, {
|
|
141
166
|
key: "getVideoCameraList",
|
|
@@ -192,26 +217,11 @@ var AgoraMediaControl = /*#__PURE__*/function (_AGEventEmitter) {
|
|
|
192
217
|
value: function stopAudioPlaybackDeviceTest() {
|
|
193
218
|
return this._rtc.stopAudioPlaybackDeviceTest();
|
|
194
219
|
}
|
|
195
|
-
}, {
|
|
196
|
-
key: "setAudioFrameCallback",
|
|
197
|
-
value: function setAudioFrameCallback() {
|
|
198
|
-
return this._rtc.setAudioFrameCallback();
|
|
199
|
-
}
|
|
200
|
-
}, {
|
|
201
|
-
key: "stopAudioFrameCallback",
|
|
202
|
-
value: function stopAudioFrameCallback() {
|
|
203
|
-
return this._rtc.stopAudioFrameCallback();
|
|
204
|
-
}
|
|
205
220
|
}, {
|
|
206
221
|
key: "setBeautyEffectOptions",
|
|
207
222
|
value: function setBeautyEffectOptions(enable, options) {
|
|
208
223
|
return this._rtc.setBeautyEffectOptions(enable, options);
|
|
209
224
|
}
|
|
210
|
-
}, {
|
|
211
|
-
key: "setAudioRawDataConfig",
|
|
212
|
-
value: function setAudioRawDataConfig(config) {
|
|
213
|
-
return this._rtc.setAudioRawDataConfig(config);
|
|
214
|
-
}
|
|
215
225
|
}, {
|
|
216
226
|
key: "createStreamMediaTrack",
|
|
217
227
|
value: function createStreamMediaTrack() {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AGRtcManager } from '../rtc';
|
|
2
|
+
import { AgoraRteAudioRawDataConfig, AgoraRtePlayAudioRawDataObserver } from './type';
|
|
3
|
+
export declare class AgoraRteStreamPlayer {
|
|
4
|
+
private _rtc;
|
|
5
|
+
constructor(rtc: AGRtcManager);
|
|
6
|
+
setAudioRawDataConfig(config: AgoraRteAudioRawDataConfig): void;
|
|
7
|
+
addAudioRawDataObserver(observer: AgoraRtePlayAudioRawDataObserver): void;
|
|
8
|
+
removeAudioRawDataObserver(observer: AgoraRtePlayAudioRawDataObserver): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.AgoraRteStreamPlayer = void 0;
|
|
9
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
+
var _type = require("./type");
|
|
12
|
+
var AgoraRteStreamPlayer = /*#__PURE__*/function () {
|
|
13
|
+
function AgoraRteStreamPlayer(rtc) {
|
|
14
|
+
(0, _classCallCheck2["default"])(this, AgoraRteStreamPlayer);
|
|
15
|
+
this._rtc = void 0;
|
|
16
|
+
this._rtc = rtc;
|
|
17
|
+
}
|
|
18
|
+
(0, _createClass2["default"])(AgoraRteStreamPlayer, [{
|
|
19
|
+
key: "setAudioRawDataConfig",
|
|
20
|
+
value: function setAudioRawDataConfig(config) {
|
|
21
|
+
this._rtc.setAudioRawDataConfig(config, _type.AgoraRteAudioRawDataPosition.beforeMixed);
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
key: "addAudioRawDataObserver",
|
|
25
|
+
value: function addAudioRawDataObserver(observer) {
|
|
26
|
+
this._rtc.addAudioRawDataObserver(observer, _type.AgoraRteAudioRawDataPosition.beforeMixed);
|
|
27
|
+
}
|
|
28
|
+
}, {
|
|
29
|
+
key: "removeAudioRawDataObserver",
|
|
30
|
+
value: function removeAudioRawDataObserver(observer) {
|
|
31
|
+
this._rtc.removeAudioRawDataObserver(observer, _type.AgoraRteAudioRawDataPosition.beforeMixed);
|
|
32
|
+
}
|
|
33
|
+
}]);
|
|
34
|
+
return AgoraRteStreamPlayer;
|
|
35
|
+
}();
|
|
36
|
+
exports.AgoraRteStreamPlayer = AgoraRteStreamPlayer;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { IBaseProcessor } from 'agora-rte-extension';
|
|
2
|
-
import { AgoraRteMediaSourceState, AGScreenShareType } from '../..';
|
|
2
|
+
import { AgoraRteAudioRawDataConfig, AgoraRteMediaSourceState, AGScreenShareType } from '../..';
|
|
3
3
|
import { AGRtcManager } from '../rtc';
|
|
4
4
|
import { AgoraMediaPlayerCanvas, AgoraRtcVideoCanvas } from '../rtc/canvas';
|
|
5
5
|
import { StreamMediaPlayer } from '../media-player';
|
|
6
|
+
import { AgoraRteRecordAudioRawDataObserver } from './type';
|
|
6
7
|
export declare enum AgoraRteVideoSourceType {
|
|
7
8
|
None = 0,
|
|
8
9
|
Camera = 1,
|
|
@@ -19,6 +20,9 @@ export declare enum AgoraRteMediaPublishState {
|
|
|
19
20
|
Unpublished = 0,
|
|
20
21
|
Published = 1
|
|
21
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
22
26
|
export declare abstract class AgoraRteMediaTrack {
|
|
23
27
|
videoSourceType: AgoraRteVideoSourceType;
|
|
24
28
|
audioSourceType: AgoraRteAudioSourceType;
|
|
@@ -63,6 +67,9 @@ export declare class AgoraRteMicrophoneAudioTrack extends AgoraRteMediaTrack {
|
|
|
63
67
|
removeProcessors(): number;
|
|
64
68
|
setRecordingDevice(deviceId: string): number;
|
|
65
69
|
setPlaybackDevice(deviceId: string): number;
|
|
70
|
+
setAudioRawDataConfig(config: AgoraRteAudioRawDataConfig): void;
|
|
71
|
+
addAudioRawDataObserver(observer: AgoraRteRecordAudioRawDataObserver): void;
|
|
72
|
+
removeAudioRawDataObserver(observer: AgoraRteRecordAudioRawDataObserver): void;
|
|
66
73
|
start(): number;
|
|
67
74
|
stop(): number;
|
|
68
75
|
}
|
package/lib/core/media/track.js
CHANGED
|
@@ -33,6 +33,9 @@ exports.AgoraRteAudioSourceType = AgoraRteAudioSourceType;
|
|
|
33
33
|
AgoraRteAudioSourceType[AgoraRteAudioSourceType["MediaPlayer"] = 3] = "MediaPlayer";
|
|
34
34
|
})(AgoraRteAudioSourceType || (exports.AgoraRteAudioSourceType = AgoraRteAudioSourceType = {}));
|
|
35
35
|
var AgoraRteMediaPublishState;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
36
39
|
exports.AgoraRteMediaPublishState = AgoraRteMediaPublishState;
|
|
37
40
|
(function (AgoraRteMediaPublishState) {
|
|
38
41
|
AgoraRteMediaPublishState[AgoraRteMediaPublishState["Unpublished"] = 0] = "Unpublished";
|
|
@@ -205,6 +208,21 @@ var AgoraRteMicrophoneAudioTrack = /*#__PURE__*/function (_AgoraRteMediaTrack3)
|
|
|
205
208
|
value: function setPlaybackDevice(deviceId) {
|
|
206
209
|
return this.rtc.setAudioPlaybackDevice(deviceId);
|
|
207
210
|
}
|
|
211
|
+
}, {
|
|
212
|
+
key: "setAudioRawDataConfig",
|
|
213
|
+
value: function setAudioRawDataConfig(config) {
|
|
214
|
+
this.rtc.setAudioRawDataConfig(config, _.AgoraRteAudioRawDataPosition.record);
|
|
215
|
+
}
|
|
216
|
+
}, {
|
|
217
|
+
key: "addAudioRawDataObserver",
|
|
218
|
+
value: function addAudioRawDataObserver(observer) {
|
|
219
|
+
this.rtc.addAudioRawDataObserver(observer, _.AgoraRteAudioRawDataPosition.record);
|
|
220
|
+
}
|
|
221
|
+
}, {
|
|
222
|
+
key: "removeAudioRawDataObserver",
|
|
223
|
+
value: function removeAudioRawDataObserver(observer) {
|
|
224
|
+
this.rtc.removeAudioRawDataObserver(observer, _.AgoraRteAudioRawDataPosition.record);
|
|
225
|
+
}
|
|
208
226
|
}, {
|
|
209
227
|
key: "start",
|
|
210
228
|
value: function start() {
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 音频裸数据回调参数
|
|
3
|
+
*/
|
|
4
|
+
/** @en
|
|
5
|
+
* Audio raw data callback parameter
|
|
6
|
+
*/
|
|
7
|
+
export interface AgoraRteAudioRawDataConfig {
|
|
8
|
+
/**
|
|
9
|
+
* 每次回调返回的音频数据长度
|
|
10
|
+
*/
|
|
11
|
+
/** @en
|
|
12
|
+
* The length of audio data returned in each callback
|
|
13
|
+
*/
|
|
14
|
+
frameSize?: 256 | 512 | 1024 | 2048 | 4096 | 8192 | 16384;
|
|
15
|
+
/**
|
|
16
|
+
* 音频数据的采样率
|
|
17
|
+
*/
|
|
18
|
+
/** @en
|
|
19
|
+
* Sampling rate of audio data
|
|
20
|
+
*/
|
|
21
|
+
sampleRate?: number;
|
|
22
|
+
/**
|
|
23
|
+
* 是否启用立体音
|
|
24
|
+
*/
|
|
25
|
+
/** @en
|
|
26
|
+
* Whether to enable stereo.
|
|
27
|
+
*/
|
|
28
|
+
stereo?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 音频的输出位置
|
|
32
|
+
*/
|
|
33
|
+
/** @en
|
|
34
|
+
* The audio output position
|
|
35
|
+
*/
|
|
36
|
+
export declare enum AgoraRteAudioRawDataPosition {
|
|
37
|
+
/**
|
|
38
|
+
* 录制后
|
|
39
|
+
*/
|
|
40
|
+
/** @en
|
|
41
|
+
* After recording
|
|
42
|
+
*/
|
|
43
|
+
record = 2,
|
|
44
|
+
/**
|
|
45
|
+
* 多条音频流混合成一路即将播放的音频流前
|
|
46
|
+
*/
|
|
47
|
+
/** @en
|
|
48
|
+
* Before multiple audio streams are blended into one stream to be played
|
|
49
|
+
*/
|
|
50
|
+
beforeMixed = 8
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 音频录制数据
|
|
54
|
+
*/
|
|
55
|
+
/** @en
|
|
56
|
+
* Audio recording data
|
|
57
|
+
*/
|
|
58
|
+
export declare type AgoraRteAudioRawData = {
|
|
59
|
+
/**
|
|
60
|
+
* 音频裸数据
|
|
61
|
+
* @param buffer
|
|
62
|
+
*/
|
|
63
|
+
/** @en
|
|
64
|
+
* Audio raw data
|
|
65
|
+
* @param buffer
|
|
66
|
+
*/
|
|
67
|
+
buffer: AudioBuffer;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* 音频裸数据观察者(本地录音设备)
|
|
71
|
+
*/
|
|
72
|
+
/** @en
|
|
73
|
+
* Audio raw data observer(local recording device)
|
|
74
|
+
*/
|
|
75
|
+
export interface AgoraRteRecordAudioRawDataObserver {
|
|
76
|
+
/**
|
|
77
|
+
* 本地录制音频裸数据回调
|
|
78
|
+
* @param rawData
|
|
79
|
+
*/
|
|
80
|
+
/** @en
|
|
81
|
+
* Local audio stream raw data callback
|
|
82
|
+
* @param rawData
|
|
83
|
+
*/
|
|
84
|
+
onAudioRawDataRecored(rawData: AgoraRteAudioRawData): void;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 音频裸数据观察者(远端流)
|
|
88
|
+
*/
|
|
89
|
+
/** @en
|
|
90
|
+
* Audio raw data observer(remote streams)
|
|
91
|
+
*/
|
|
92
|
+
export interface AgoraRtePlayAudioRawDataObserver {
|
|
93
|
+
/**
|
|
94
|
+
* 远端音频流裸数据回调
|
|
95
|
+
* @param rawData
|
|
96
|
+
* @param streamUuid
|
|
97
|
+
* @param sceneId
|
|
98
|
+
*/
|
|
99
|
+
/** @en
|
|
100
|
+
* Remote audio stream raw data callback
|
|
101
|
+
* @param rawData
|
|
102
|
+
* @param streamUuid
|
|
103
|
+
* @param sceneId
|
|
104
|
+
*/
|
|
105
|
+
onAudioRawDataBeforeMixed(rawData: AgoraRteAudioRawData, streamUuid: string, sceneId: string): void;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 音频裸数据观察者
|
|
109
|
+
*/
|
|
110
|
+
/** @en
|
|
111
|
+
* Audio raw data observer
|
|
112
|
+
*/
|
|
113
|
+
export declare type AgoraRteAudioRawDataObserver = AgoraRteRecordAudioRawDataObserver & AgoraRtePlayAudioRawDataObserver;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.AgoraRteAudioRawDataPosition = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* 音频裸数据回调参数
|
|
10
|
+
*/
|
|
11
|
+
/** @en
|
|
12
|
+
* Audio raw data callback parameter
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* 音频的输出位置
|
|
16
|
+
*/
|
|
17
|
+
/** @en
|
|
18
|
+
* The audio output position
|
|
19
|
+
*/
|
|
20
|
+
var AgoraRteAudioRawDataPosition;
|
|
21
|
+
/**
|
|
22
|
+
* 音频录制数据
|
|
23
|
+
*/
|
|
24
|
+
/** @en
|
|
25
|
+
* Audio recording data
|
|
26
|
+
*/
|
|
27
|
+
exports.AgoraRteAudioRawDataPosition = AgoraRteAudioRawDataPosition;
|
|
28
|
+
(function (AgoraRteAudioRawDataPosition) {
|
|
29
|
+
AgoraRteAudioRawDataPosition[AgoraRteAudioRawDataPosition["record"] = 2] = "record";
|
|
30
|
+
AgoraRteAudioRawDataPosition[AgoraRteAudioRawDataPosition["beforeMixed"] = 8] = "beforeMixed";
|
|
31
|
+
})(AgoraRteAudioRawDataPosition || (exports.AgoraRteAudioRawDataPosition = AgoraRteAudioRawDataPosition = {}));
|
|
@@ -16,6 +16,7 @@ export declare class AgoraRteSyncDataStore {
|
|
|
16
16
|
findUserStreams(userUuid: string): AgoraStream[];
|
|
17
17
|
setStream(key: string, stream: AgoraStream): void;
|
|
18
18
|
deleteStream(key: string): void;
|
|
19
|
+
deleteStreams(keys: string[]): void;
|
|
19
20
|
findStream(streamUuid: string): AgoraStream | undefined;
|
|
20
21
|
private _roomInfo;
|
|
21
22
|
get roomInfo(): Immutable.Map<unknown, unknown>;
|