fcr-core 3.9.1 → 3.10.0-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/imports.d.ts +1 -0
- package/lib/imports.js +15 -9
- package/lib/monitor-control/index.js +3 -0
- package/lib/monitor-control/type.d.ts +5 -0
- package/lib/room-control/stream-control/index.js +16 -2
- package/lib/utilities/parameters.js +51 -33
- package/lib/utilities/video-encoder-config.js +5 -5
- package/lib-es/imports.js +1 -0
- package/lib-es/monitor-control/index.js +3 -0
- package/lib-es/room-control/stream-control/index.js +18 -4
- package/lib-es/utilities/parameters.js +46 -28
- package/lib-es/utilities/video-encoder-config.js +5 -5
- package/package.json +4 -4
package/lib/imports.d.ts
CHANGED
|
@@ -48,6 +48,7 @@ export type { AgoraRteUpdateStreamPrivilege, AgoraRteMediaStreamInfo, } from 'ag
|
|
|
48
48
|
export { AgoraRteConnectionState, AgoraRteEngine, convertStreamTypeToPublishState, AgoraRteLatencyLevel, } from 'agora-rte-sdk';
|
|
49
49
|
export { AgoraRteRoomConnectorType, AgoraRteStreamPrivilegeOperation, AgoraRteStreamPrivilegeVideoSourceType, AgoraRteStreamPrivilegeAudioSourceType, AgoraRteMediaStreamType, } from 'agora-rte-sdk/lib/core/scene/type';
|
|
50
50
|
export { AgoraRtcRegion, AgoraRtcVideoSourceType, AgoraRtcAudioSourceType, AgoraRtcMediaSourceState, AgoraRtcRenderMode, AgoraRtcVideoStreamType, AgoraRtcCapability, AgoraRtcAiDenoiseLevel, AgoraRtcAudioOutputRouting, AgoraRtcLatencyLevelType, AgoraRtcEncryptionMode, } from 'agora-rte-sdk/lib/core/rtc/type';
|
|
51
|
+
export { AgoraRteStreamLayer } from 'agora-rte-sdk/lib/type';
|
|
51
52
|
export { AgoraRtmRegion } from 'agora-rte-sdk/lib/core/rtm/type';
|
|
52
53
|
export { AgoraRteRegion, AgoraRteAudioSourceType, AgoraRteVideoSourceType, AgoraRteMediaPublishState, AgoraRteScreenScenarioType as FcrScreenScenarioType, AgoraRteMediaSourceState, } from 'agora-rte-sdk/lib/type';
|
|
53
54
|
export { AgoraRestfulClientError } from 'agora-rte-sdk/lib/core/services/client';
|
package/lib/imports.js
CHANGED
|
@@ -93,7 +93,7 @@ Object.defineProperty(exports, "AgoraRtcVideoStreamType", {
|
|
|
93
93
|
Object.defineProperty(exports, "AgoraRteAudioSourceType", {
|
|
94
94
|
enumerable: true,
|
|
95
95
|
get: function () {
|
|
96
|
-
return
|
|
96
|
+
return _type3.AgoraRteAudioSourceType;
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "AgoraRteConnectionState", {
|
|
@@ -123,13 +123,13 @@ Object.defineProperty(exports, "AgoraRteLatencyLevel", {
|
|
|
123
123
|
Object.defineProperty(exports, "AgoraRteMediaPublishState", {
|
|
124
124
|
enumerable: true,
|
|
125
125
|
get: function () {
|
|
126
|
-
return
|
|
126
|
+
return _type3.AgoraRteMediaPublishState;
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
Object.defineProperty(exports, "AgoraRteMediaSourceState", {
|
|
130
130
|
enumerable: true,
|
|
131
131
|
get: function () {
|
|
132
|
-
return
|
|
132
|
+
return _type3.AgoraRteMediaSourceState;
|
|
133
133
|
}
|
|
134
134
|
});
|
|
135
135
|
Object.defineProperty(exports, "AgoraRteMediaStreamType", {
|
|
@@ -141,7 +141,7 @@ Object.defineProperty(exports, "AgoraRteMediaStreamType", {
|
|
|
141
141
|
Object.defineProperty(exports, "AgoraRteRegion", {
|
|
142
142
|
enumerable: true,
|
|
143
143
|
get: function () {
|
|
144
|
-
return
|
|
144
|
+
return _type3.AgoraRteRegion;
|
|
145
145
|
}
|
|
146
146
|
});
|
|
147
147
|
Object.defineProperty(exports, "AgoraRteRoomConnectorType", {
|
|
@@ -156,6 +156,12 @@ Object.defineProperty(exports, "AgoraRteScreenCaptureType", {
|
|
|
156
156
|
return _type5.AgoraRteScreenCaptureType;
|
|
157
157
|
}
|
|
158
158
|
});
|
|
159
|
+
Object.defineProperty(exports, "AgoraRteStreamLayer", {
|
|
160
|
+
enumerable: true,
|
|
161
|
+
get: function () {
|
|
162
|
+
return _type3.AgoraRteStreamLayer;
|
|
163
|
+
}
|
|
164
|
+
});
|
|
159
165
|
Object.defineProperty(exports, "AgoraRteStreamPrivilegeAudioSourceType", {
|
|
160
166
|
enumerable: true,
|
|
161
167
|
get: function () {
|
|
@@ -189,13 +195,13 @@ Object.defineProperty(exports, "AgoraRteVideoOrientation", {
|
|
|
189
195
|
Object.defineProperty(exports, "AgoraRteVideoSourceType", {
|
|
190
196
|
enumerable: true,
|
|
191
197
|
get: function () {
|
|
192
|
-
return
|
|
198
|
+
return _type3.AgoraRteVideoSourceType;
|
|
193
199
|
}
|
|
194
200
|
});
|
|
195
201
|
Object.defineProperty(exports, "AgoraRtmRegion", {
|
|
196
202
|
enumerable: true,
|
|
197
203
|
get: function () {
|
|
198
|
-
return
|
|
204
|
+
return _type4.AgoraRtmRegion;
|
|
199
205
|
}
|
|
200
206
|
});
|
|
201
207
|
Object.defineProperty(exports, "AgoraScheduler", {
|
|
@@ -279,7 +285,7 @@ Object.defineProperty(exports, "FcrRoom", {
|
|
|
279
285
|
Object.defineProperty(exports, "FcrScreenScenarioType", {
|
|
280
286
|
enumerable: true,
|
|
281
287
|
get: function () {
|
|
282
|
-
return
|
|
288
|
+
return _type3.AgoraRteScreenScenarioType;
|
|
283
289
|
}
|
|
284
290
|
});
|
|
285
291
|
Object.defineProperty(exports, "FcrWhiteboardApplication", {
|
|
@@ -568,8 +574,8 @@ var _agoraError = require("agora-foundation/lib/utilities/error/agora-error");
|
|
|
568
574
|
var _agoraRteSdk = require("agora-rte-sdk");
|
|
569
575
|
var _type = require("agora-rte-sdk/lib/core/scene/type");
|
|
570
576
|
var _type2 = require("agora-rte-sdk/lib/core/rtc/type");
|
|
571
|
-
var _type3 = require("agora-rte-sdk/lib/
|
|
572
|
-
var _type4 = require("agora-rte-sdk/lib/type");
|
|
577
|
+
var _type3 = require("agora-rte-sdk/lib/type");
|
|
578
|
+
var _type4 = require("agora-rte-sdk/lib/core/rtm/type");
|
|
573
579
|
var _client = require("agora-rte-sdk/lib/core/services/client");
|
|
574
580
|
var _domainHolder = require("agora-rte-sdk/lib/core/services/domain-holder");
|
|
575
581
|
var _type5 = require("agora-rte-sdk/lib/core/media/type");
|
|
@@ -15,6 +15,11 @@ export interface FcrMonitorControl {
|
|
|
15
15
|
* @param failure Callback function to be called if the upload fails, with an error parameter.
|
|
16
16
|
*/
|
|
17
17
|
uploadEvent(event: FcrMonitorUploadEvent): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Queries the device score.
|
|
20
|
+
* @returns The device score as a number.
|
|
21
|
+
*/
|
|
22
|
+
queryDeviceScore(): number;
|
|
18
23
|
/**
|
|
19
24
|
* Set whether to upload the log.
|
|
20
25
|
* @param isNeed Whether to upload the log.
|
|
@@ -271,7 +271,8 @@ class FcrStreamControlImpl {
|
|
|
271
271
|
return res;
|
|
272
272
|
}
|
|
273
273
|
setVideoEncoderConfig(streamId, config, streamType) {
|
|
274
|
-
|
|
274
|
+
const streamLayer = this._convertToStreamLayer(streamType);
|
|
275
|
+
return this._scene.localUser.setVideoEncoderConfig(config, streamLayer, streamId);
|
|
275
276
|
}
|
|
276
277
|
setDualStreamMode(streamId, enable) {
|
|
277
278
|
return this._scene.localUser.setDualStreamMode(streamId, enable);
|
|
@@ -282,7 +283,10 @@ class FcrStreamControlImpl {
|
|
|
282
283
|
startRenderRemoteVideoStream(streamId, type, config, element) {
|
|
283
284
|
const startTime = Date.now();
|
|
284
285
|
const parameters = `streamId: ${streamId}, config: ${JSON.stringify(config)}, type: ${type}, element: ${element}`;
|
|
285
|
-
|
|
286
|
+
|
|
287
|
+
// 将 FcrVideoStreamType 转换为 AgoraRteStreamLayer
|
|
288
|
+
const streamLayer = this._convertToStreamLayer(type);
|
|
289
|
+
this._scene.streamPlayer.subscribeRemoteVideoStream(streamId, streamLayer);
|
|
286
290
|
try {
|
|
287
291
|
this._scene.streamPlayer.startRenderRemoteVideoStream(streamId, config.renderMode, config.isMirror, element);
|
|
288
292
|
const viewId = this._subscribedStreamsControl.getViewId(element);
|
|
@@ -436,6 +440,16 @@ class FcrStreamControlImpl {
|
|
|
436
440
|
cause: event.cause
|
|
437
441
|
};
|
|
438
442
|
};
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* 将 FcrVideoStreamType 转换为 AgoraRteStreamLayer
|
|
446
|
+
* @param streamType - FcrVideoStreamType (HIGH_STREAM=0, LOW_STREAM=1)
|
|
447
|
+
* @returns AgoraRteStreamLayer (HIGH=1, LOW=0)
|
|
448
|
+
* @version 3.10.0
|
|
449
|
+
*/
|
|
450
|
+
_convertToStreamLayer(streamType) {
|
|
451
|
+
return streamType === _type.FcrVideoStreamType.HIGH_STREAM ? _imports.AgoraRteStreamLayer.HIGH : _imports.AgoraRteStreamLayer.LOW;
|
|
452
|
+
}
|
|
439
453
|
_putUserStream = (userId, stream) => {
|
|
440
454
|
if (!this._streamMapByUserId[userId]) {
|
|
441
455
|
this._streamMapByUserId[userId] = [];
|
|
@@ -30,28 +30,7 @@ require("core-js/modules/esnext.set.union.v2.js");
|
|
|
30
30
|
require("core-js/modules/esnext.set.union.js");
|
|
31
31
|
var _imports = require("../imports");
|
|
32
32
|
const DEFAULT_LOG_FILE_SIZE = 512;
|
|
33
|
-
const isTrueValue = value => {
|
|
34
|
-
return value === 'true' || !!value;
|
|
35
|
-
};
|
|
36
|
-
exports.isTrueValue = isTrueValue;
|
|
37
|
-
const getCoreIpList = parameters => {
|
|
38
|
-
return parameters?.core?.coreIpList;
|
|
39
|
-
};
|
|
40
|
-
exports.getCoreIpList = getCoreIpList;
|
|
41
|
-
const getEasemobChatIpList = parameters => {
|
|
42
|
-
return parameters?.core?.easemobChatIpList;
|
|
43
|
-
};
|
|
44
|
-
exports.getEasemobChatIpList = getEasemobChatIpList;
|
|
45
|
-
const getEasemobRestIpList = parameters => {
|
|
46
|
-
return parameters?.core?.easemobRestIpList;
|
|
47
|
-
};
|
|
48
|
-
exports.getEasemobRestIpList = getEasemobRestIpList;
|
|
49
|
-
const isEndpointRegionDisabled = parameters => {
|
|
50
|
-
return isTrueValue(parameters?.core?.disableEndpointRegion);
|
|
51
|
-
};
|
|
52
|
-
|
|
53
33
|
/** RTC preset parameters configuration mapping table */
|
|
54
|
-
exports.isEndpointRegionDisabled = isEndpointRegionDisabled;
|
|
55
34
|
const RTC_PRESET_PARAMS_MAP = {
|
|
56
35
|
[_imports.FcrApplicationPlatform.WINDOWS]: [{
|
|
57
36
|
'rtc.video.default_hw_decoder_thres': 921600
|
|
@@ -63,11 +42,14 @@ const RTC_PRESET_PARAMS_MAP = {
|
|
|
63
42
|
}],
|
|
64
43
|
[_imports.FcrApplicationPlatform.WEB_DESKTOP]: [{
|
|
65
44
|
RESTRICTION_SET_PLAYBACK_DEVICE: false
|
|
45
|
+
}],
|
|
46
|
+
[_imports.FcrApplicationPlatform.HARMONY]: [{
|
|
47
|
+
'engine.video.enable_hw_encoder': false
|
|
66
48
|
}]
|
|
67
49
|
};
|
|
68
50
|
|
|
69
|
-
/**
|
|
70
|
-
const
|
|
51
|
+
/** HARMONY or ELECTRON common parameters */
|
|
52
|
+
const HARMONY_OR_ELECTRON_COMMON_PARAMS = [
|
|
71
53
|
// audio parameters settings
|
|
72
54
|
{
|
|
73
55
|
'che.audio.bitrate_level': 1
|
|
@@ -76,19 +58,13 @@ const DESKTOP_COMMON_PARAMS = [
|
|
|
76
58
|
},
|
|
77
59
|
// video parameters settings
|
|
78
60
|
{
|
|
79
|
-
'rtc.video.color_space_enable': true
|
|
80
|
-
}, {
|
|
81
|
-
'rtc.video.videoFullrange': 1
|
|
82
|
-
}, {
|
|
83
|
-
'rtc.video.matrixCoefficients': 5
|
|
84
|
-
}, {
|
|
85
61
|
'rtc.video.new_complexity': true
|
|
86
62
|
}, {
|
|
87
63
|
'rtc.video.default_complexity': 1027
|
|
88
64
|
}, {
|
|
89
65
|
'che.video.videoCodecIndex': 1
|
|
90
66
|
}, {
|
|
91
|
-
'
|
|
67
|
+
'che.video.minQP': 21
|
|
92
68
|
}, {
|
|
93
69
|
'rtc.video.enable_doc_screen_share_sr': true
|
|
94
70
|
}, {
|
|
@@ -102,11 +78,52 @@ const DESKTOP_COMMON_PARAMS = [
|
|
|
102
78
|
'che.video.brightness_detection_enable': false
|
|
103
79
|
}, {
|
|
104
80
|
'che.video.lowest_dev_score_4_seg': 0
|
|
81
|
+
}, {
|
|
82
|
+
'che.video.lowest_dev_score_4_beauty': 0
|
|
105
83
|
}, {
|
|
106
84
|
'rtc.video.downMaxRetryTimes': 5
|
|
107
85
|
}, {
|
|
108
|
-
'
|
|
86
|
+
'rtc.video.low_stream_enable_hw_encoder': false
|
|
87
|
+
}, {
|
|
88
|
+
'rtc.video.enable_minor_stream_intra_request': true
|
|
109
89
|
}];
|
|
90
|
+
|
|
91
|
+
/** ELECTRON common parameters */
|
|
92
|
+
const ELECTRON_COMMON_PARAMS = [
|
|
93
|
+
// video parameters settings
|
|
94
|
+
{
|
|
95
|
+
'rtc.video.color_space_enable': true
|
|
96
|
+
}, {
|
|
97
|
+
'rtc.video.videoFullrange': 1
|
|
98
|
+
}, {
|
|
99
|
+
'rtc.video.matrixCoefficients': 5
|
|
100
|
+
}];
|
|
101
|
+
|
|
102
|
+
/** ELECTRON platforms set */
|
|
103
|
+
const ELECTRON_PLATFORMS = new Set([_imports.FcrApplicationPlatform.WINDOWS, _imports.FcrApplicationPlatform.MACOS]);
|
|
104
|
+
|
|
105
|
+
/** HARMONY or ELECTRON platforms set */
|
|
106
|
+
const HARMONY_OR_ELECTRON_PLATFORMS = new Set([_imports.FcrApplicationPlatform.HARMONY, ...ELECTRON_PLATFORMS]);
|
|
107
|
+
const isTrueValue = value => {
|
|
108
|
+
return value === 'true' || !!value;
|
|
109
|
+
};
|
|
110
|
+
exports.isTrueValue = isTrueValue;
|
|
111
|
+
const getCoreIpList = parameters => {
|
|
112
|
+
return parameters?.core?.coreIpList;
|
|
113
|
+
};
|
|
114
|
+
exports.getCoreIpList = getCoreIpList;
|
|
115
|
+
const getEasemobChatIpList = parameters => {
|
|
116
|
+
return parameters?.core?.easemobChatIpList;
|
|
117
|
+
};
|
|
118
|
+
exports.getEasemobChatIpList = getEasemobChatIpList;
|
|
119
|
+
const getEasemobRestIpList = parameters => {
|
|
120
|
+
return parameters?.core?.easemobRestIpList;
|
|
121
|
+
};
|
|
122
|
+
exports.getEasemobRestIpList = getEasemobRestIpList;
|
|
123
|
+
const isEndpointRegionDisabled = parameters => {
|
|
124
|
+
return isTrueValue(parameters?.core?.disableEndpointRegion);
|
|
125
|
+
};
|
|
126
|
+
exports.isEndpointRegionDisabled = isEndpointRegionDisabled;
|
|
110
127
|
const getNeedLogUpload = parameters => {
|
|
111
128
|
if ((0, _imports.isBoolean)(parameters?.core?.needLogUpload)) {
|
|
112
129
|
return parameters.core.needLogUpload;
|
|
@@ -140,7 +157,8 @@ const DESKTOP_PLATFORMS = new Set([_imports.FcrApplicationPlatform.WINDOWS, _imp
|
|
|
140
157
|
const getRtcPresetParameters = () => {
|
|
141
158
|
const platform = (0, _imports.getPlatform)();
|
|
142
159
|
const platformParams = RTC_PRESET_PARAMS_MAP[platform] ?? [];
|
|
143
|
-
const
|
|
144
|
-
|
|
160
|
+
const electronParams = ELECTRON_PLATFORMS.has(platform) ? ELECTRON_COMMON_PARAMS : [];
|
|
161
|
+
const harmonyOrElectronParams = HARMONY_OR_ELECTRON_PLATFORMS.has(platform) ? HARMONY_OR_ELECTRON_COMMON_PARAMS : [];
|
|
162
|
+
return [...platformParams, ...electronParams, ...harmonyOrElectronParams].map(p => JSON.stringify(p));
|
|
145
163
|
};
|
|
146
164
|
exports.getRtcPresetParameters = getRtcPresetParameters;
|
|
@@ -15,11 +15,11 @@ const COMMON_HIGH_CAMERA_CONFIG = {
|
|
|
15
15
|
};
|
|
16
16
|
const COMMON_LOW_CAMERA_CONFIG = {
|
|
17
17
|
dimensions: {
|
|
18
|
-
width:
|
|
19
|
-
height:
|
|
18
|
+
width: 384,
|
|
19
|
+
height: 216
|
|
20
20
|
},
|
|
21
|
-
bitrate:
|
|
22
|
-
frameRate:
|
|
21
|
+
bitrate: 300,
|
|
22
|
+
frameRate: 10
|
|
23
23
|
};
|
|
24
24
|
const COMMON_FULL_HIGH_CAMERA_CONFIG = {
|
|
25
25
|
dimensions: {
|
|
@@ -51,7 +51,7 @@ const MOBILE_HIGH_CAMERA_CONFIG = {
|
|
|
51
51
|
height: 540
|
|
52
52
|
},
|
|
53
53
|
bitrate: 1000,
|
|
54
|
-
frameRate:
|
|
54
|
+
frameRate: 15
|
|
55
55
|
};
|
|
56
56
|
const HIGH_CAMERA_CONFIG_MAP = {
|
|
57
57
|
[_imports.FcrApplicationPlatform.HARMONY]: MOBILE_HIGH_CAMERA_CONFIG,
|
package/lib-es/imports.js
CHANGED
|
@@ -40,6 +40,7 @@ export { AgoraError as FcrError } from 'agora-foundation/lib/utilities/error/ago
|
|
|
40
40
|
export { AgoraRteConnectionState, AgoraRteEngine, convertStreamTypeToPublishState, AgoraRteLatencyLevel } from 'agora-rte-sdk';
|
|
41
41
|
export { AgoraRteRoomConnectorType, AgoraRteStreamPrivilegeOperation, AgoraRteStreamPrivilegeVideoSourceType, AgoraRteStreamPrivilegeAudioSourceType, AgoraRteMediaStreamType } from 'agora-rte-sdk/lib/core/scene/type';
|
|
42
42
|
export { AgoraRtcRegion, AgoraRtcVideoSourceType, AgoraRtcAudioSourceType, AgoraRtcMediaSourceState, AgoraRtcRenderMode, AgoraRtcVideoStreamType, AgoraRtcCapability, AgoraRtcAiDenoiseLevel, AgoraRtcAudioOutputRouting, AgoraRtcLatencyLevelType, AgoraRtcEncryptionMode } from 'agora-rte-sdk/lib/core/rtc/type';
|
|
43
|
+
export { AgoraRteStreamLayer } from 'agora-rte-sdk/lib/type';
|
|
43
44
|
export { AgoraRtmRegion } from 'agora-rte-sdk/lib/core/rtm/type';
|
|
44
45
|
export { AgoraRteRegion, AgoraRteAudioSourceType, AgoraRteVideoSourceType, AgoraRteMediaPublishState, AgoraRteScreenScenarioType as FcrScreenScenarioType, AgoraRteMediaSourceState } from 'agora-rte-sdk/lib/type';
|
|
45
46
|
export { AgoraRestfulClientError } from 'agora-rte-sdk/lib/core/services/client';
|
|
@@ -29,13 +29,13 @@ function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.descrip
|
|
|
29
29
|
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
30
30
|
import { AgoraObservable, bound, convertStreamTypeToPublishState, objectSchema, trace, AgoraRteVideoSourceType, v4 } from '../../imports';
|
|
31
31
|
import { FcrReturnCode, FcrUserRoleToStringMap } from '../../type';
|
|
32
|
-
import { FcrVideoSourceType, FcrAudioSourceType, FcrMediaSourceState } from '../../type';
|
|
32
|
+
import { FcrVideoStreamType, FcrVideoSourceType, FcrAudioSourceType, FcrMediaSourceState } from '../../type';
|
|
33
33
|
import { convertRteUserToFcrUser } from '../../utilities/user';
|
|
34
34
|
import { handleRequestError } from '../../utilities/error';
|
|
35
35
|
import { createLogger, generateLogObserver } from '../../utilities/logger';
|
|
36
36
|
import validateParams from '../../utilities/validate-params';
|
|
37
37
|
import { stringArraySchema, stringSchema, numberSchema, fcrStreamBindConfigArrySchema, agoraRtcVideoEncoderConfigurationSchema, fcrVideoStreamTypeSchema, fcrRenderConfigSchema, fcrRenderViewSchema, fcrScreenStreamCreateConfigSchema, fcrLocalStreamCreateArrayConfigSchema, fcrUpdateStreamPrivilegeScopeSchema, fcrUpdateStreamCustomSchema, createUnionSchema, fcrSizeSchema, fcrScreenScenarioTypeSchema } from '../../schema';
|
|
38
|
-
import { AgoraRteStreamPrivilegeOperation } from '../../imports';
|
|
38
|
+
import { AgoraRteStreamPrivilegeOperation, AgoraRteStreamLayer } from '../../imports';
|
|
39
39
|
import { ErrorModuleCode } from '../../imports';
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -268,7 +268,8 @@ export class FcrStreamControlImpl {
|
|
|
268
268
|
return res;
|
|
269
269
|
}
|
|
270
270
|
setVideoEncoderConfig(streamId, config, streamType) {
|
|
271
|
-
|
|
271
|
+
const streamLayer = this._convertToStreamLayer(streamType);
|
|
272
|
+
return this._scene.localUser.setVideoEncoderConfig(config, streamLayer, streamId);
|
|
272
273
|
}
|
|
273
274
|
setDualStreamMode(streamId, enable) {
|
|
274
275
|
return this._scene.localUser.setDualStreamMode(streamId, enable);
|
|
@@ -279,7 +280,10 @@ export class FcrStreamControlImpl {
|
|
|
279
280
|
startRenderRemoteVideoStream(streamId, type, config, element) {
|
|
280
281
|
const startTime = Date.now();
|
|
281
282
|
const parameters = `streamId: ${streamId}, config: ${JSON.stringify(config)}, type: ${type}, element: ${element}`;
|
|
282
|
-
|
|
283
|
+
|
|
284
|
+
// 将 FcrVideoStreamType 转换为 AgoraRteStreamLayer
|
|
285
|
+
const streamLayer = this._convertToStreamLayer(type);
|
|
286
|
+
this._scene.streamPlayer.subscribeRemoteVideoStream(streamId, streamLayer);
|
|
283
287
|
try {
|
|
284
288
|
this._scene.streamPlayer.startRenderRemoteVideoStream(streamId, config.renderMode, config.isMirror, element);
|
|
285
289
|
const viewId = this._subscribedStreamsControl.getViewId(element);
|
|
@@ -433,6 +437,16 @@ export class FcrStreamControlImpl {
|
|
|
433
437
|
cause: event.cause
|
|
434
438
|
};
|
|
435
439
|
};
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* 将 FcrVideoStreamType 转换为 AgoraRteStreamLayer
|
|
443
|
+
* @param streamType - FcrVideoStreamType (HIGH_STREAM=0, LOW_STREAM=1)
|
|
444
|
+
* @returns AgoraRteStreamLayer (HIGH=1, LOW=0)
|
|
445
|
+
* @version 3.10.0
|
|
446
|
+
*/
|
|
447
|
+
_convertToStreamLayer(streamType) {
|
|
448
|
+
return streamType === FcrVideoStreamType.HIGH_STREAM ? AgoraRteStreamLayer.HIGH : AgoraRteStreamLayer.LOW;
|
|
449
|
+
}
|
|
436
450
|
_putUserStream = (userId, stream) => {
|
|
437
451
|
if (!this._streamMapByUserId[userId]) {
|
|
438
452
|
this._streamMapByUserId[userId] = [];
|
|
@@ -24,22 +24,6 @@ import "core-js/modules/esnext.set.union.v2.js";
|
|
|
24
24
|
import "core-js/modules/esnext.set.union.js";
|
|
25
25
|
import { FcrApplicationPlatform, getPlatform, isBoolean, isNumber } from '../imports';
|
|
26
26
|
const DEFAULT_LOG_FILE_SIZE = 512;
|
|
27
|
-
export const isTrueValue = value => {
|
|
28
|
-
return value === 'true' || !!value;
|
|
29
|
-
};
|
|
30
|
-
export const getCoreIpList = parameters => {
|
|
31
|
-
return parameters?.core?.coreIpList;
|
|
32
|
-
};
|
|
33
|
-
export const getEasemobChatIpList = parameters => {
|
|
34
|
-
return parameters?.core?.easemobChatIpList;
|
|
35
|
-
};
|
|
36
|
-
export const getEasemobRestIpList = parameters => {
|
|
37
|
-
return parameters?.core?.easemobRestIpList;
|
|
38
|
-
};
|
|
39
|
-
export const isEndpointRegionDisabled = parameters => {
|
|
40
|
-
return isTrueValue(parameters?.core?.disableEndpointRegion);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
27
|
/** RTC preset parameters configuration mapping table */
|
|
44
28
|
const RTC_PRESET_PARAMS_MAP = {
|
|
45
29
|
[FcrApplicationPlatform.WINDOWS]: [{
|
|
@@ -52,11 +36,14 @@ const RTC_PRESET_PARAMS_MAP = {
|
|
|
52
36
|
}],
|
|
53
37
|
[FcrApplicationPlatform.WEB_DESKTOP]: [{
|
|
54
38
|
RESTRICTION_SET_PLAYBACK_DEVICE: false
|
|
39
|
+
}],
|
|
40
|
+
[FcrApplicationPlatform.HARMONY]: [{
|
|
41
|
+
'engine.video.enable_hw_encoder': false
|
|
55
42
|
}]
|
|
56
43
|
};
|
|
57
44
|
|
|
58
|
-
/**
|
|
59
|
-
const
|
|
45
|
+
/** HARMONY or ELECTRON common parameters */
|
|
46
|
+
const HARMONY_OR_ELECTRON_COMMON_PARAMS = [
|
|
60
47
|
// audio parameters settings
|
|
61
48
|
{
|
|
62
49
|
'che.audio.bitrate_level': 1
|
|
@@ -65,19 +52,13 @@ const DESKTOP_COMMON_PARAMS = [
|
|
|
65
52
|
},
|
|
66
53
|
// video parameters settings
|
|
67
54
|
{
|
|
68
|
-
'rtc.video.color_space_enable': true
|
|
69
|
-
}, {
|
|
70
|
-
'rtc.video.videoFullrange': 1
|
|
71
|
-
}, {
|
|
72
|
-
'rtc.video.matrixCoefficients': 5
|
|
73
|
-
}, {
|
|
74
55
|
'rtc.video.new_complexity': true
|
|
75
56
|
}, {
|
|
76
57
|
'rtc.video.default_complexity': 1027
|
|
77
58
|
}, {
|
|
78
59
|
'che.video.videoCodecIndex': 1
|
|
79
60
|
}, {
|
|
80
|
-
'
|
|
61
|
+
'che.video.minQP': 21
|
|
81
62
|
}, {
|
|
82
63
|
'rtc.video.enable_doc_screen_share_sr': true
|
|
83
64
|
}, {
|
|
@@ -91,11 +72,47 @@ const DESKTOP_COMMON_PARAMS = [
|
|
|
91
72
|
'che.video.brightness_detection_enable': false
|
|
92
73
|
}, {
|
|
93
74
|
'che.video.lowest_dev_score_4_seg': 0
|
|
75
|
+
}, {
|
|
76
|
+
'che.video.lowest_dev_score_4_beauty': 0
|
|
94
77
|
}, {
|
|
95
78
|
'rtc.video.downMaxRetryTimes': 5
|
|
96
79
|
}, {
|
|
97
|
-
'
|
|
80
|
+
'rtc.video.low_stream_enable_hw_encoder': false
|
|
81
|
+
}, {
|
|
82
|
+
'rtc.video.enable_minor_stream_intra_request': true
|
|
98
83
|
}];
|
|
84
|
+
|
|
85
|
+
/** ELECTRON common parameters */
|
|
86
|
+
const ELECTRON_COMMON_PARAMS = [
|
|
87
|
+
// video parameters settings
|
|
88
|
+
{
|
|
89
|
+
'rtc.video.color_space_enable': true
|
|
90
|
+
}, {
|
|
91
|
+
'rtc.video.videoFullrange': 1
|
|
92
|
+
}, {
|
|
93
|
+
'rtc.video.matrixCoefficients': 5
|
|
94
|
+
}];
|
|
95
|
+
|
|
96
|
+
/** ELECTRON platforms set */
|
|
97
|
+
const ELECTRON_PLATFORMS = new Set([FcrApplicationPlatform.WINDOWS, FcrApplicationPlatform.MACOS]);
|
|
98
|
+
|
|
99
|
+
/** HARMONY or ELECTRON platforms set */
|
|
100
|
+
const HARMONY_OR_ELECTRON_PLATFORMS = new Set([FcrApplicationPlatform.HARMONY, ...ELECTRON_PLATFORMS]);
|
|
101
|
+
export const isTrueValue = value => {
|
|
102
|
+
return value === 'true' || !!value;
|
|
103
|
+
};
|
|
104
|
+
export const getCoreIpList = parameters => {
|
|
105
|
+
return parameters?.core?.coreIpList;
|
|
106
|
+
};
|
|
107
|
+
export const getEasemobChatIpList = parameters => {
|
|
108
|
+
return parameters?.core?.easemobChatIpList;
|
|
109
|
+
};
|
|
110
|
+
export const getEasemobRestIpList = parameters => {
|
|
111
|
+
return parameters?.core?.easemobRestIpList;
|
|
112
|
+
};
|
|
113
|
+
export const isEndpointRegionDisabled = parameters => {
|
|
114
|
+
return isTrueValue(parameters?.core?.disableEndpointRegion);
|
|
115
|
+
};
|
|
99
116
|
export const getNeedLogUpload = parameters => {
|
|
100
117
|
if (isBoolean(parameters?.core?.needLogUpload)) {
|
|
101
118
|
return parameters.core.needLogUpload;
|
|
@@ -125,6 +142,7 @@ const DESKTOP_PLATFORMS = new Set([FcrApplicationPlatform.WINDOWS, FcrApplicatio
|
|
|
125
142
|
export const getRtcPresetParameters = () => {
|
|
126
143
|
const platform = getPlatform();
|
|
127
144
|
const platformParams = RTC_PRESET_PARAMS_MAP[platform] ?? [];
|
|
128
|
-
const
|
|
129
|
-
|
|
145
|
+
const electronParams = ELECTRON_PLATFORMS.has(platform) ? ELECTRON_COMMON_PARAMS : [];
|
|
146
|
+
const harmonyOrElectronParams = HARMONY_OR_ELECTRON_PLATFORMS.has(platform) ? HARMONY_OR_ELECTRON_COMMON_PARAMS : [];
|
|
147
|
+
return [...platformParams, ...electronParams, ...harmonyOrElectronParams].map(p => JSON.stringify(p));
|
|
130
148
|
};
|
|
@@ -9,11 +9,11 @@ const COMMON_HIGH_CAMERA_CONFIG = {
|
|
|
9
9
|
};
|
|
10
10
|
const COMMON_LOW_CAMERA_CONFIG = {
|
|
11
11
|
dimensions: {
|
|
12
|
-
width:
|
|
13
|
-
height:
|
|
12
|
+
width: 384,
|
|
13
|
+
height: 216
|
|
14
14
|
},
|
|
15
|
-
bitrate:
|
|
16
|
-
frameRate:
|
|
15
|
+
bitrate: 300,
|
|
16
|
+
frameRate: 10
|
|
17
17
|
};
|
|
18
18
|
const COMMON_FULL_HIGH_CAMERA_CONFIG = {
|
|
19
19
|
dimensions: {
|
|
@@ -45,7 +45,7 @@ const MOBILE_HIGH_CAMERA_CONFIG = {
|
|
|
45
45
|
height: 540
|
|
46
46
|
},
|
|
47
47
|
bitrate: 1000,
|
|
48
|
-
frameRate:
|
|
48
|
+
frameRate: 15
|
|
49
49
|
};
|
|
50
50
|
const HIGH_CAMERA_CONFIG_MAP = {
|
|
51
51
|
[FcrApplicationPlatform.HARMONY]: MOBILE_HIGH_CAMERA_CONFIG,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fcr-core",
|
|
3
3
|
"description": "Core APIs for building online scenes",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.10.0-alpha",
|
|
5
5
|
"module": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@types/lodash": "^4.14.168",
|
|
42
42
|
"@types/sinon": "^17.0.2",
|
|
43
43
|
"@types/uuid": "^8.3.0",
|
|
44
|
-
"agora-toolchain": "3.
|
|
44
|
+
"agora-toolchain": "3.10.0-alpha",
|
|
45
45
|
"core-js": "^3.33.3",
|
|
46
46
|
"decomment": "^0.9.5",
|
|
47
47
|
"husky": "^9.0.11",
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
"@netless/video-js-plugin": "^0.3.8",
|
|
62
62
|
"@netless/white-snapshot": "^0.4.2",
|
|
63
63
|
"@netless/window-manager": "^1.0.7-beta.6",
|
|
64
|
-
"agora-foundation": "3.
|
|
65
|
-
"agora-rte-sdk": "3.
|
|
64
|
+
"agora-foundation": "3.10.0-alpha",
|
|
65
|
+
"agora-rte-sdk": "3.10.0-alpha",
|
|
66
66
|
"await-to-js": "^3.0.0",
|
|
67
67
|
"dayjs": "^1.10.4",
|
|
68
68
|
"easemob-websdk": "4.13.0",
|