agora-rte-sdk 3.6.4 → 3.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/constant.d.ts +30 -0
- package/lib/constant.js +40 -0
- package/lib/core/engine/ap-detector.js +6 -8
- package/lib/core/engine/index.d.ts +0 -1
- package/lib/core/engine/index.js +25 -22
- package/lib/core/media/effect-enhancer.d.ts +2 -0
- package/lib/core/media/effect-enhancer.js +10 -0
- package/lib/core/media/index.d.ts +18 -6
- package/lib/core/media/index.js +26 -7
- package/lib/core/media/type.d.ts +2 -0
- package/lib/core/processor/message-handler.d.ts +25 -3
- package/lib/core/processor/message-handler.js +152 -59
- package/lib/core/processor/type.d.ts +4 -2
- package/lib/core/rtc/capture-enhancement.d.ts +8 -0
- package/lib/core/rtc/channel.d.ts +7 -0
- package/lib/core/rtc/client.d.ts +6 -6
- package/lib/core/rtc/publisher.d.ts +16 -1
- package/lib/core/rtc/source-manager.d.ts +1 -0
- package/lib/core/rtc/type.d.ts +21 -2
- package/lib/core/rtc/type.js +12 -7
- package/lib/core/scene/index.d.ts +4 -2
- package/lib/core/scene/index.js +99 -52
- package/lib/core/scene/local-user.d.ts +2 -1
- package/lib/core/scene/local-user.js +6 -1
- package/lib/core/scene/state-sync.d.ts +2 -2
- package/lib/core/scene/state-sync.js +6 -16
- package/lib/core/utilities/parameters.d.ts +2 -2
- package/lib/core/utilities/parameters.js +6 -1
- package/lib/plugin/monitor/index.js +1 -1
- package/lib/plugin/monitor/log-upload/handler.js +9 -9
- package/lib/plugin/rtc/electron/canvas-helper.js +2 -1
- package/lib/plugin/rtc/electron/capture-enhancement.d.ts +2 -0
- package/lib/plugin/rtc/electron/capture-enhancement.js +24 -9
- package/lib/plugin/rtc/electron/channel.d.ts +3 -1
- package/lib/plugin/rtc/electron/channel.js +44 -33
- package/lib/plugin/rtc/electron/client.d.ts +7 -3
- package/lib/plugin/rtc/electron/client.js +144 -71
- package/lib/plugin/rtc/electron/index.js +4 -1
- package/lib/plugin/rtc/electron/publish-pool.js +8 -7
- package/lib/plugin/rtc/electron/publisher.d.ts +27 -7
- package/lib/plugin/rtc/electron/publisher.js +222 -72
- package/lib/plugin/rtc/electron/source-manager.d.ts +8 -4
- package/lib/plugin/rtc/electron/source-manager.js +146 -77
- package/lib/plugin/rtc/electron/type.d.ts +6 -31
- package/lib/plugin/rtc/electron/type.js +12 -19
- package/lib/plugin/rtc/electron/utils.d.ts +5 -5
- package/lib/plugin/rtc/electron/utils.js +37 -30
- package/lib/plugin/rtc/web/audio-player.js +0 -1
- package/lib/plugin/rtc/web/canvas-helper.js +2 -1
- package/lib/plugin/rtc/web/capture-enhancement.d.ts +2 -0
- package/lib/plugin/rtc/web/capture-enhancement.js +12 -0
- package/lib/plugin/rtc/web/channel.d.ts +2 -1
- package/lib/plugin/rtc/web/channel.js +8 -1
- package/lib/plugin/rtc/web/client.d.ts +4 -2
- package/lib/plugin/rtc/web/client.js +143 -9
- package/lib/plugin/rtc/web/device.js +3 -1
- package/lib/plugin/rtc/web/publish-pool.js +4 -3
- package/lib/plugin/rtc/web/publisher.d.ts +4 -1
- package/lib/plugin/rtc/web/publisher.js +13 -2
- package/lib/plugin/rtc/web/source-manager.d.ts +1 -0
- package/lib/plugin/rtc/web/source-manager.js +6 -0
- package/lib/plugin/rtc/web/track-control/camera.js +16 -18
- package/lib/plugin/rtc/web/track-control/microphone.js +11 -11
- package/lib/plugin/rtm/channel.js +3 -1
- package/lib/plugin/rtm/client.js +8 -4
- package/lib/type.d.ts +2 -14
- package/lib/type.js +8 -1
- package/package.json +3 -6
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const TIMEOUT_ONE_AND_HALF_MINUTES = 15000;
|
|
2
|
+
export declare const DEFAULT_AP_DETECT_TIMEOUT = 300;
|
|
3
|
+
export declare const DEFAULT_AP_DETECT_IS_REDETECT = true;
|
|
4
|
+
export declare enum AgoraRtcErrorCode {
|
|
5
|
+
SUCCESS = 0,
|
|
6
|
+
CANNOT_SET_VIDEO_ENCODER_CONFIG = 1,
|
|
7
|
+
HAVE_NO_EXIST_CANVAS_ID = 2,
|
|
8
|
+
CANNOT_ENABLE_BEAUTY = 3,
|
|
9
|
+
VIRTUAL_BACKGROUND_IS_NOT_IMAGE = 4,
|
|
10
|
+
VIRTUAL_BACKGROUND_IS_NOT_VALID_IMAGE_PATTERN = 5,
|
|
11
|
+
VIRTUAL_BACKGROUND_IS_NOT_VALID_VIDEO_PATTERN = 6,
|
|
12
|
+
VIRTUAL_BACKGROUND_IS_NOT_VALID_COLOR_VALUE = 7,
|
|
13
|
+
CANNOT_ENABLE_VIRTUAL_BACKGROUND = 8,
|
|
14
|
+
CANNOT_FIND_ITEM_IN_UNPUBLISH_VIDEO = 9,
|
|
15
|
+
CANNOT_FIND_ITEM_IN_UNPUBLISH_AUDIO = 10,
|
|
16
|
+
CANNOT_FIND_ITEM_IN_PAUSE_POOL = 11,
|
|
17
|
+
CANNOT_PUBLISH_LOCAL_VIDEO_STREAM = 12,
|
|
18
|
+
CANNOT_PUBLISH_LOCAL_AUDIO_STREAM = 13,
|
|
19
|
+
VIDEO_SOURCE_TYPE_IS_NONE = 14,
|
|
20
|
+
CANNOT_SET_CAMERA_VIDEO_ORIENTATION = 15,
|
|
21
|
+
CANNOT_START_CAMERA_CAPTURE = 16,
|
|
22
|
+
CANNOT_STOP_CAMERA_CAPTURE = 17,
|
|
23
|
+
CANNOT_GENERATE_VIDEO_SOURCE_INDEX = 18,
|
|
24
|
+
CONNECTION_IS_NOT_VALID = 19,
|
|
25
|
+
SOURCE_INDEX_IS_NOT_VALID = 20,
|
|
26
|
+
PLACEMENT_IS_NOT_RENDERED = 21,
|
|
27
|
+
UNKNOWN_RENDER_TYPE = 22,
|
|
28
|
+
INVALID_ARGUMENT = 23,
|
|
29
|
+
UNSUPPORT_SCENARIO_TYPE = 24
|
|
30
|
+
}
|
package/lib/constant.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
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.TIMEOUT_ONE_AND_HALF_MINUTES = exports.DEFAULT_AP_DETECT_TIMEOUT = exports.DEFAULT_AP_DETECT_IS_REDETECT = exports.AgoraRtcErrorCode = void 0;
|
|
8
|
+
var TIMEOUT_ONE_AND_HALF_MINUTES = exports.TIMEOUT_ONE_AND_HALF_MINUTES = 15000;
|
|
9
|
+
|
|
10
|
+
// milliseconds
|
|
11
|
+
var DEFAULT_AP_DETECT_TIMEOUT = exports.DEFAULT_AP_DETECT_TIMEOUT = 300;
|
|
12
|
+
var DEFAULT_AP_DETECT_IS_REDETECT = exports.DEFAULT_AP_DETECT_IS_REDETECT = true;
|
|
13
|
+
var AgoraRtcErrorCode = exports.AgoraRtcErrorCode = /*#__PURE__*/function (AgoraRtcErrorCode) {
|
|
14
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["SUCCESS"] = 0] = "SUCCESS";
|
|
15
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_SET_VIDEO_ENCODER_CONFIG"] = 1] = "CANNOT_SET_VIDEO_ENCODER_CONFIG";
|
|
16
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["HAVE_NO_EXIST_CANVAS_ID"] = 2] = "HAVE_NO_EXIST_CANVAS_ID";
|
|
17
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_ENABLE_BEAUTY"] = 3] = "CANNOT_ENABLE_BEAUTY";
|
|
18
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["VIRTUAL_BACKGROUND_IS_NOT_IMAGE"] = 4] = "VIRTUAL_BACKGROUND_IS_NOT_IMAGE";
|
|
19
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["VIRTUAL_BACKGROUND_IS_NOT_VALID_IMAGE_PATTERN"] = 5] = "VIRTUAL_BACKGROUND_IS_NOT_VALID_IMAGE_PATTERN";
|
|
20
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["VIRTUAL_BACKGROUND_IS_NOT_VALID_VIDEO_PATTERN"] = 6] = "VIRTUAL_BACKGROUND_IS_NOT_VALID_VIDEO_PATTERN";
|
|
21
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["VIRTUAL_BACKGROUND_IS_NOT_VALID_COLOR_VALUE"] = 7] = "VIRTUAL_BACKGROUND_IS_NOT_VALID_COLOR_VALUE";
|
|
22
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_ENABLE_VIRTUAL_BACKGROUND"] = 8] = "CANNOT_ENABLE_VIRTUAL_BACKGROUND";
|
|
23
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_FIND_ITEM_IN_UNPUBLISH_VIDEO"] = 9] = "CANNOT_FIND_ITEM_IN_UNPUBLISH_VIDEO";
|
|
24
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_FIND_ITEM_IN_UNPUBLISH_AUDIO"] = 10] = "CANNOT_FIND_ITEM_IN_UNPUBLISH_AUDIO";
|
|
25
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_FIND_ITEM_IN_PAUSE_POOL"] = 11] = "CANNOT_FIND_ITEM_IN_PAUSE_POOL";
|
|
26
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_PUBLISH_LOCAL_VIDEO_STREAM"] = 12] = "CANNOT_PUBLISH_LOCAL_VIDEO_STREAM";
|
|
27
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_PUBLISH_LOCAL_AUDIO_STREAM"] = 13] = "CANNOT_PUBLISH_LOCAL_AUDIO_STREAM";
|
|
28
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["VIDEO_SOURCE_TYPE_IS_NONE"] = 14] = "VIDEO_SOURCE_TYPE_IS_NONE";
|
|
29
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_SET_CAMERA_VIDEO_ORIENTATION"] = 15] = "CANNOT_SET_CAMERA_VIDEO_ORIENTATION";
|
|
30
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_START_CAMERA_CAPTURE"] = 16] = "CANNOT_START_CAMERA_CAPTURE";
|
|
31
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_STOP_CAMERA_CAPTURE"] = 17] = "CANNOT_STOP_CAMERA_CAPTURE";
|
|
32
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CANNOT_GENERATE_VIDEO_SOURCE_INDEX"] = 18] = "CANNOT_GENERATE_VIDEO_SOURCE_INDEX";
|
|
33
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["CONNECTION_IS_NOT_VALID"] = 19] = "CONNECTION_IS_NOT_VALID";
|
|
34
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["SOURCE_INDEX_IS_NOT_VALID"] = 20] = "SOURCE_INDEX_IS_NOT_VALID";
|
|
35
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["PLACEMENT_IS_NOT_RENDERED"] = 21] = "PLACEMENT_IS_NOT_RENDERED";
|
|
36
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["UNKNOWN_RENDER_TYPE"] = 22] = "UNKNOWN_RENDER_TYPE";
|
|
37
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["INVALID_ARGUMENT"] = 23] = "INVALID_ARGUMENT";
|
|
38
|
+
AgoraRtcErrorCode[AgoraRtcErrorCode["UNSUPPORT_SCENARIO_TYPE"] = 24] = "UNSUPPORT_SCENARIO_TYPE";
|
|
39
|
+
return AgoraRtcErrorCode;
|
|
40
|
+
}({});
|
|
@@ -153,15 +153,13 @@ var AgoraRteApDetectorImpl = exports.AgoraRteApDetectorImpl = /*#__PURE__*/funct
|
|
|
153
153
|
}, {
|
|
154
154
|
key: "setConfig",
|
|
155
155
|
value: function setConfig(detectTimeout, isRedetect, internalRtcConfig, externalRtcConfig) {
|
|
156
|
-
this.
|
|
156
|
+
this.stop();
|
|
157
|
+
this._apDetectTimeout = detectTimeout;
|
|
157
158
|
this._apDetectIsRedetect = isRedetect;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
if (externalRtcConfig) {
|
|
162
|
-
this._externalRtcConfig = externalRtcConfig;
|
|
163
|
-
}
|
|
159
|
+
this._internalRtcConfig = internalRtcConfig;
|
|
160
|
+
this._externalRtcConfig = externalRtcConfig;
|
|
164
161
|
this._finished = false;
|
|
162
|
+
this.logger.info("setConfig, apDetectTimeout: ".concat(this._apDetectTimeout, ", _apDetectIsRedetect: ").concat(this._apDetectIsRedetect, ", ") + "_internalRtcConfig: ".concat((0, _imports.jsonstring)(this._internalRtcConfig), ", _externalRtcConfig: ").concat((0, _imports.jsonstring)(this._externalRtcConfig)));
|
|
165
163
|
}
|
|
166
164
|
}, {
|
|
167
165
|
key: "isDetecting",
|
|
@@ -534,7 +532,7 @@ var AgoraRteApDetectorImpl = exports.AgoraRteApDetectorImpl = /*#__PURE__*/funct
|
|
|
534
532
|
}]);
|
|
535
533
|
}();
|
|
536
534
|
_AgoraRteApDetectorImpl = AgoraRteApDetectorImpl;
|
|
537
|
-
var _applyDecs$e = _applyDecs(_AgoraRteApDetectorImpl, [[_imports.trace, 2, "restart"], [_imports.trace, 2, "start"], [_imports.trace, 2, "isDetectRequired"], [_imports.trace, 2, "getAvailableRtcAccessPointConfig"]], []).e;
|
|
535
|
+
var _applyDecs$e = _applyDecs(_AgoraRteApDetectorImpl, [[_imports.trace, 2, "restart"], [_imports.trace, 2, "start"], [_imports.trace, 2, "isDetectRequired"], [_imports.trace, 2, "isRedetectRequired"], [_imports.trace, 2, "stop"], [_imports.trace, 2, "isFinished"], [_imports.trace, 2, "getAvailableRtcAccessPointConfig"]], []).e;
|
|
538
536
|
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
539
537
|
_initProto = _applyDecs$e2[0];
|
|
540
538
|
_applyDecs$e;
|
package/lib/core/engine/index.js
CHANGED
|
@@ -3,11 +3,13 @@
|
|
|
3
3
|
require("core-js/modules/es.symbol.js");
|
|
4
4
|
require("core-js/modules/es.symbol.description.js");
|
|
5
5
|
require("core-js/modules/es.symbol.to-primitive.js");
|
|
6
|
+
require("core-js/modules/es.array.is-array.js");
|
|
6
7
|
require("core-js/modules/es.array.iterator.js");
|
|
7
8
|
require("core-js/modules/es.array.push.js");
|
|
8
9
|
require("core-js/modules/es.date.to-primitive.js");
|
|
9
10
|
require("core-js/modules/es.function.name.js");
|
|
10
11
|
require("core-js/modules/es.map.js");
|
|
12
|
+
require("core-js/modules/es.number.constructor.js");
|
|
11
13
|
require("core-js/modules/es.object.create.js");
|
|
12
14
|
require("core-js/modules/es.object.define-property.js");
|
|
13
15
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
@@ -38,14 +40,10 @@ exports.AgoraRteEngine = void 0;
|
|
|
38
40
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
39
41
|
require("core-js/modules/es.error.cause.js");
|
|
40
42
|
require("core-js/modules/es.error.to-string.js");
|
|
41
|
-
require("core-js/modules/es.array.concat.js");
|
|
42
43
|
require("core-js/modules/es.array.for-each.js");
|
|
43
|
-
require("core-js/modules/es.array.is-array.js");
|
|
44
44
|
require("core-js/modules/es.date.to-json.js");
|
|
45
45
|
require("core-js/modules/es.function.bind.js");
|
|
46
46
|
require("core-js/modules/es.json.stringify.js");
|
|
47
|
-
require("core-js/modules/es.number.constructor.js");
|
|
48
|
-
require("core-js/modules/es.number.is-nan.js");
|
|
49
47
|
require("core-js/modules/es.object.keys.js");
|
|
50
48
|
require("core-js/modules/es.object.to-string.js");
|
|
51
49
|
require("core-js/modules/esnext.iterator.constructor.js");
|
|
@@ -100,7 +98,9 @@ var AgoraRteEngine = exports.AgoraRteEngine = /*#__PURE__*/function () {
|
|
|
100
98
|
(0, _defineProperty2["default"])(this, "_pluginManager", (0, _plugin.getPluginManager)());
|
|
101
99
|
(0, _domainHolder.resetSharedDomainHolder)();
|
|
102
100
|
this._config = (0, _clone.cloneDeep)(config);
|
|
103
|
-
|
|
101
|
+
|
|
102
|
+
// setupConsoleHijack(getDefaultLogger());
|
|
103
|
+
|
|
104
104
|
this.logger.info('RTE engine is created, version: ', this.getVersion());
|
|
105
105
|
this._pluginManager.callInitialize(this._config);
|
|
106
106
|
if ((0, _imports.isElectron)()) {
|
|
@@ -242,6 +242,7 @@ var AgoraRteEngine = exports.AgoraRteEngine = /*#__PURE__*/function () {
|
|
|
242
242
|
key: "setParameters",
|
|
243
243
|
value: function setParameters(parameters) {
|
|
244
244
|
try {
|
|
245
|
+
// TODO: need a private parameter class to handle all parameters
|
|
245
246
|
this._setRteIpList(parameters);
|
|
246
247
|
this._setRtcRtmParameters(parameters);
|
|
247
248
|
this._updateApDetector(parameters);
|
|
@@ -260,7 +261,7 @@ var AgoraRteEngine = exports.AgoraRteEngine = /*#__PURE__*/function () {
|
|
|
260
261
|
value: function release() {
|
|
261
262
|
this._pluginManager.callRelease();
|
|
262
263
|
this._monitor.release();
|
|
263
|
-
|
|
264
|
+
// restoreConsoleHijack();
|
|
264
265
|
}
|
|
265
266
|
}, {
|
|
266
267
|
key: "addObserver",
|
|
@@ -334,6 +335,8 @@ var AgoraRteEngine = exports.AgoraRteEngine = /*#__PURE__*/function () {
|
|
|
334
335
|
}
|
|
335
336
|
});
|
|
336
337
|
}
|
|
338
|
+
|
|
339
|
+
// TODO: need a private parameter class to handle all parameters
|
|
337
340
|
}, {
|
|
338
341
|
key: "_initializeParameters",
|
|
339
342
|
value: function _initializeParameters(parameters) {
|
|
@@ -374,22 +377,22 @@ var AgoraRteEngine = exports.AgoraRteEngine = /*#__PURE__*/function () {
|
|
|
374
377
|
}, {
|
|
375
378
|
key: "_updateApDetector",
|
|
376
379
|
value: function _updateApDetector(parameters) {
|
|
377
|
-
|
|
378
|
-
var
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
if (this._isValidAdDetectorCfg(externalRtcConfig) || this._isValidAdDetectorCfg(internalRtcConfig)) {
|
|
386
|
-
this._apDetector.setConfig(paramTimeout, paramIsRedetect, internalRtcConfig, externalRtcConfig);
|
|
380
|
+
var externalRtcConfig = null;
|
|
381
|
+
var internalRtcConfig = null;
|
|
382
|
+
if ((0, _imports.isElectron)()) {
|
|
383
|
+
externalRtcConfig = (0, _parameters.getRtcExternaApConfig)(parameters);
|
|
384
|
+
internalRtcConfig = (0, _parameters.getRtcInternaApConfig)(parameters);
|
|
385
|
+
} else {
|
|
386
|
+
externalRtcConfig = (0, _parameters.getRtcWebExternaApConfig)(parameters);
|
|
387
|
+
internalRtcConfig = (0, _parameters.getRtcWebInternaApConfig)(parameters);
|
|
387
388
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
if (externalRtcConfig == null && internalRtcConfig == null) {
|
|
390
|
+
this.logger.warn('externalRtcConfig and internalRtcConfig are both null, not update ap detector config');
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
var paramTimeout = (0, _parameters.getApDetectTimeout)(parameters);
|
|
394
|
+
var paramIsRedetect = (0, _parameters.getApDetectIsRedetect)(parameters);
|
|
395
|
+
this._apDetector.setConfig(paramTimeout, paramIsRedetect, internalRtcConfig, externalRtcConfig);
|
|
393
396
|
}
|
|
394
397
|
}, {
|
|
395
398
|
key: "_createDefaultApDetector",
|
|
@@ -403,7 +406,7 @@ var AgoraRteEngine = exports.AgoraRteEngine = /*#__PURE__*/function () {
|
|
|
403
406
|
}]);
|
|
404
407
|
}();
|
|
405
408
|
_AgoraRteEngine = AgoraRteEngine;
|
|
406
|
-
var _applyDecs$e = _applyDecs(_AgoraRteEngine, [[_imports.trace, 2, "login"], [_imports.trace, 2, "logout"], [_imports.trace, 2, "createScene"], [_imports.trace, 2, "sendPeerMessage"], [_imports.trace, 2, "setParameters"], [_imports.trace, 2, "renewUserToken"], [_imports.trace, 2, "release"], [
|
|
409
|
+
var _applyDecs$e = _applyDecs(_AgoraRteEngine, [[_imports.trace, 2, "login"], [_imports.trace, 2, "logout"], [_imports.trace, 2, "createScene"], [_imports.trace, 2, "sendPeerMessage"], [_imports.trace, 2, "setParameters"], [_imports.trace, 2, "renewUserToken"], [_imports.trace, 2, "release"], [_imports.bound, 2, "_updateApDetector"]], []).e;
|
|
407
410
|
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
408
411
|
_initProto = _applyDecs$e2[0];
|
|
409
412
|
_applyDecs$e;
|
|
@@ -15,6 +15,8 @@ export declare class AgoraRteAudioEffectEnhancer {
|
|
|
15
15
|
disableStereoMode(): number;
|
|
16
16
|
enableOriginalSoundMode(): number;
|
|
17
17
|
disableOriginalSoundMode(): number;
|
|
18
|
+
enableAGC(): number;
|
|
19
|
+
disableAGC(): number;
|
|
18
20
|
}
|
|
19
21
|
export declare class AgoraRteVideoEffectEnhancer {
|
|
20
22
|
private _rtcClient;
|
|
@@ -69,6 +69,16 @@ var AgoraRteAudioEffectEnhancer = exports.AgoraRteAudioEffectEnhancer = /*#__PUR
|
|
|
69
69
|
value: function disableOriginalSoundMode() {
|
|
70
70
|
return this._rtcClient.captureEnhancement.disableOriginalSoundMode(this._deviceId);
|
|
71
71
|
}
|
|
72
|
+
}, {
|
|
73
|
+
key: "enableAGC",
|
|
74
|
+
value: function enableAGC() {
|
|
75
|
+
return this._rtcClient.captureEnhancement.enableAGC();
|
|
76
|
+
}
|
|
77
|
+
}, {
|
|
78
|
+
key: "disableAGC",
|
|
79
|
+
value: function disableAGC() {
|
|
80
|
+
return this._rtcClient.captureEnhancement.disableAGC();
|
|
81
|
+
}
|
|
72
82
|
}]);
|
|
73
83
|
}();
|
|
74
84
|
var AgoraRteVideoEffectEnhancer = exports.AgoraRteVideoEffectEnhancer = /*#__PURE__*/function () {
|
|
@@ -120,15 +120,27 @@ export interface AgoraRteMediaControl {
|
|
|
120
120
|
*/
|
|
121
121
|
checkLoopbackDevice(): Promise<number>;
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
124
|
-
* @
|
|
123
|
+
* Disable AGC
|
|
124
|
+
* @returns 0 if the AGC is disabled; otherwise,
|
|
125
|
+
* 1 if the AGC is not supported
|
|
125
126
|
*/
|
|
126
|
-
|
|
127
|
+
disableAGC(): number;
|
|
127
128
|
/**
|
|
128
|
-
*
|
|
129
|
-
* @
|
|
129
|
+
* Enable AGC
|
|
130
|
+
* @returns 0 if the AGC is enabled; otherwise,
|
|
131
|
+
* 1 if the AGC is not supported
|
|
130
132
|
*/
|
|
131
|
-
|
|
133
|
+
enableAGC(): number;
|
|
134
|
+
/**
|
|
135
|
+
* Observe the system selected speaker
|
|
136
|
+
* @param enable
|
|
137
|
+
*/
|
|
138
|
+
observeSystemSelectedSpeakerChanged(enable: boolean): void;
|
|
139
|
+
/**
|
|
140
|
+
* Observe the system selected microphone
|
|
141
|
+
* @param enable
|
|
142
|
+
*/
|
|
143
|
+
observeSystemSelectedMicrophoneChanged(enable: boolean): void;
|
|
132
144
|
/**
|
|
133
145
|
* Adds an observer to be notified of media device events.
|
|
134
146
|
* @param observer The observer to add.
|
package/lib/core/media/index.js
CHANGED
|
@@ -99,6 +99,9 @@ var AgoraRteMediaControlImpl = exports.AgoraRteMediaControlImpl = /*#__PURE__*/f
|
|
|
99
99
|
list.forEach(function (device) {
|
|
100
100
|
_this._observable.notifyObservers('onMicrophoneRemoved', device);
|
|
101
101
|
});
|
|
102
|
+
},
|
|
103
|
+
onSystemSelectedMicrophoneChanged: function onSystemSelectedMicrophoneChanged(microphone) {
|
|
104
|
+
_this._observable.notifyObservers('onSystemSelectedMicrophoneChanged', microphone);
|
|
102
105
|
}
|
|
103
106
|
});
|
|
104
107
|
(0, _defineProperty2["default"])(this, "_rtcClientObserver", {
|
|
@@ -122,6 +125,12 @@ var AgoraRteMediaControlImpl = exports.AgoraRteMediaControlImpl = /*#__PURE__*/f
|
|
|
122
125
|
},
|
|
123
126
|
onSpeakerTestVolumeIndicationUpdated: function onSpeakerTestVolumeIndicationUpdated(volume) {
|
|
124
127
|
_this._observable.notifyObservers('onSpeakerTestVolumeIndicationUpdated', volume);
|
|
128
|
+
},
|
|
129
|
+
onSystemSelectedSpeakerChanged: function onSystemSelectedSpeakerChanged(speaker) {
|
|
130
|
+
_this._observable.notifyObservers('onSystemSelectedSpeakerChanged', speaker);
|
|
131
|
+
},
|
|
132
|
+
onSystemSelectedMicrophoneChanged: function onSystemSelectedMicrophoneChanged(microphone) {
|
|
133
|
+
_this._observable.notifyObservers('onSystemSelectedMicrophoneChanged', microphone);
|
|
125
134
|
}
|
|
126
135
|
});
|
|
127
136
|
this._rtcClient = _rtcClient;
|
|
@@ -129,14 +138,24 @@ var AgoraRteMediaControlImpl = exports.AgoraRteMediaControlImpl = /*#__PURE__*/f
|
|
|
129
138
|
this._rtcClient.addObserver(this._rtcClientObserver);
|
|
130
139
|
}
|
|
131
140
|
return (0, _createClass2["default"])(AgoraRteMediaControlImpl, [{
|
|
132
|
-
key: "
|
|
133
|
-
value: function
|
|
134
|
-
this._rtcClient.
|
|
141
|
+
key: "observeSystemSelectedSpeakerChanged",
|
|
142
|
+
value: function observeSystemSelectedSpeakerChanged(enable) {
|
|
143
|
+
this._rtcClient.observeSystemSelectedSpeakerChanged(enable);
|
|
144
|
+
}
|
|
145
|
+
}, {
|
|
146
|
+
key: "observeSystemSelectedMicrophoneChanged",
|
|
147
|
+
value: function observeSystemSelectedMicrophoneChanged(enable) {
|
|
148
|
+
this._rtcClient.observeSystemSelectedMicrophoneChanged(enable);
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
key: "disableAGC",
|
|
152
|
+
value: function disableAGC() {
|
|
153
|
+
return this._rtcClient.captureEnhancement.disableAGC();
|
|
135
154
|
}
|
|
136
155
|
}, {
|
|
137
|
-
key: "
|
|
138
|
-
value: function
|
|
139
|
-
this._rtcClient.
|
|
156
|
+
key: "enableAGC",
|
|
157
|
+
value: function enableAGC() {
|
|
158
|
+
return this._rtcClient.captureEnhancement.enableAGC();
|
|
140
159
|
}
|
|
141
160
|
}, {
|
|
142
161
|
key: "setSelectedSpeaker",
|
|
@@ -274,7 +293,7 @@ var AgoraRteMediaControlImpl = exports.AgoraRteMediaControlImpl = /*#__PURE__*/f
|
|
|
274
293
|
}]);
|
|
275
294
|
}();
|
|
276
295
|
_AgoraRteMediaControlImpl = AgoraRteMediaControlImpl;
|
|
277
|
-
var _applyDecs$e = _applyDecs(_AgoraRteMediaControlImpl, [[_imports.trace, 2, "
|
|
296
|
+
var _applyDecs$e = _applyDecs(_AgoraRteMediaControlImpl, [[_imports.trace, 2, "observeSystemSelectedSpeakerChanged"], [_imports.trace, 2, "observeSystemSelectedMicrophoneChanged"], [_imports.trace, 2, "disableAGC"], [_imports.trace, 2, "enableAGC"], [_imports.trace, 2, "setSelectedSpeaker"], [_imports.trace, 2, "setSelectedSpeakerVolume"], [_imports.trace, 2, "setEnableSpeaker"], [_imports.trace, 2, "startSpeakerTest"], [_imports.trace, 2, "stopSpeakerTest"], [_imports.trace, 2, "adjustAudioOutputVolume"], [_imports.trace, 2, "release"], [_imports.trace, 2, "checkLoopbackDevice"]], []).e;
|
|
278
297
|
var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 1);
|
|
279
298
|
_initProto = _applyDecs$e2[0];
|
|
280
299
|
_applyDecs$e;
|
package/lib/core/media/type.d.ts
CHANGED
|
@@ -62,6 +62,8 @@ export type AgoraRteMediaControlObserver = Partial<{
|
|
|
62
62
|
onSpeakerTestVolumeIndicationUpdated(volume: number): void;
|
|
63
63
|
onAudioOutputRoutingUpdated(routing: AgoraRtcAudioOutputRouting): void;
|
|
64
64
|
onSelectedSpeakerVolumeUpdated(volume: number, muted: boolean): void;
|
|
65
|
+
onSystemSelectedSpeakerChanged(speaker: AgoraRtcDeviceInfo): void;
|
|
66
|
+
onSystemSelectedMicrophoneChanged(microphone: AgoraRtcDeviceInfo): void;
|
|
65
67
|
}>;
|
|
66
68
|
export type AgoraRteObservableTrack<T> = {
|
|
67
69
|
addObserver(observer: T): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AgoraObservable } from '../../imports';
|
|
2
2
|
import { AgoraRteSyncDataStore } from './sequence-msg/data';
|
|
3
|
-
import { AgoraRteSequenceMessage, AgoraRteMessageHandlerObserver } from './type';
|
|
3
|
+
import { AgoraRteSequenceMessage, AgoraRteMessageHandlerObserver, AgoraRteSequenceMessageInUser, AgoraRteSequenceMessageOutUser } from './type';
|
|
4
4
|
import { AgoraRteMediaStreamInfo, AgoraRteSyncSnapshotData } from './struct';
|
|
5
5
|
import { AgoraRteServiceApi } from '../services/api';
|
|
6
6
|
import { AgoraRtmClient } from '../rtm';
|
|
@@ -22,9 +22,11 @@ export declare class AgoraRteMessageHandle {
|
|
|
22
22
|
onRoomPropertyDeleted: (changedKeys: string[], operator: AgoraRteUserInfo, cause: {
|
|
23
23
|
cmd: number;
|
|
24
24
|
}) => void;
|
|
25
|
-
|
|
25
|
+
onRemoteUsersAdded: (users: AgoraRteSequenceMessageInUser[]) => void;
|
|
26
26
|
onUserUpdated: (user: AgoraRteUserInfo, operator?: AgoraRteUserInfo, cause?: import("./type").AgoraRteOperatCause) => void;
|
|
27
|
-
|
|
27
|
+
onRemoteUsersRemoved: (removedUsers: AgoraRteSequenceMessageOutUser[], removedStreamsData: AgoraRteMediaStreamInfo[]) => void;
|
|
28
|
+
onLocalUserRemoved: (user: AgoraRteSequenceMessageOutUser) => void;
|
|
29
|
+
onLocalUserAdded: (user: AgoraRteSequenceMessageInUser) => void;
|
|
28
30
|
onUserSubscribe: (subscribeUsers: AgoraRteUserInfo[], operator: AgoraRteUserInfo, cause?: import("./type").AgoraRteOperatCause) => void;
|
|
29
31
|
onUserUnsubscribe: (unsubscribeUsers: AgoraRteUserInfo[], removedStreamsData: AgoraRteMediaStreamInfo[], operator: AgoraRteUserInfo, cause?: import("./type").AgoraRteOperatCause) => void;
|
|
30
32
|
onUserCountUpdated: (total: number) => void;
|
|
@@ -74,6 +76,26 @@ export declare class AgoraRteMessageHandle {
|
|
|
74
76
|
private _handleRoomProperties;
|
|
75
77
|
private _handleUserSubscribe;
|
|
76
78
|
private _handleUserInOut;
|
|
79
|
+
/**
|
|
80
|
+
* 分离本地用户和远程用户
|
|
81
|
+
*/
|
|
82
|
+
private _separateLocalAndRemoteUsers;
|
|
83
|
+
/**
|
|
84
|
+
* 处理远程用户变化
|
|
85
|
+
*/
|
|
86
|
+
private _processRemoteUsers;
|
|
87
|
+
/**
|
|
88
|
+
* 处理本地用户变化
|
|
89
|
+
*/
|
|
90
|
+
private _processLocalUsers;
|
|
91
|
+
/**
|
|
92
|
+
* 在用户列表中查找当前用户
|
|
93
|
+
*/
|
|
94
|
+
private _findCurrentUserInList;
|
|
95
|
+
/**
|
|
96
|
+
* 通知远端用户变化事件
|
|
97
|
+
*/
|
|
98
|
+
private _notifyRemoteUserChanges;
|
|
77
99
|
private _handleUserInfo;
|
|
78
100
|
private _handleUserProperty;
|
|
79
101
|
private _handleUserProperties;
|