@rongcloud/plugin-rtc 5.34.0-alpha.1 → 5.34.0-alpha.3
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.cjs.js +1 -1
- package/dist/index.d.ts +1215 -1435
- package/dist/index.esm.js +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _rongcloud_engine from '@rongcloud/engine';
|
|
2
|
-
import { EventEmitter, BasicLogger, INaviInfo, RTCPluginContext, Codec, IPromiseResult, ErrorCode, KVString, IRuntime, IAsyncRes, RCConnectionStatus, ConversationType, ISendMsgOptions, IReceivedMessage,
|
|
2
|
+
import { EventEmitter, BasicLogger, INaviInfo, LogL, EnableLogL, RTCPluginContext, Codec, IPromiseResult, ErrorCode, KVString, IRuntime, IAsyncRes, RCConnectionStatus, ConversationType, ISendMsgOptions, IReceivedMessage, RTCMode as RTCMode$1, IPluginGenerator } from '@rongcloud/engine';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* 错误码,与移动端对齐
|
|
@@ -28,10 +28,6 @@ declare enum RCRTCCode {
|
|
|
28
28
|
SERVICE_INVALID = 50004,
|
|
29
29
|
/** RTC Token 无效 */
|
|
30
30
|
RTC_TOKEN_INVALID = 50006,
|
|
31
|
-
/** 后台未开通语音识别服务 */
|
|
32
|
-
ASR_NOT_AVAILABLE = 50034,
|
|
33
|
-
/** 此房间未开启语音识别服务 */
|
|
34
|
-
ASR_NOT_START = 50035,
|
|
35
31
|
/** 底层信令调用错误 */
|
|
36
32
|
SIGNAL_ERROR = 53001,
|
|
37
33
|
/** 创建 Offer 失败 */
|
|
@@ -602,24 +598,6 @@ declare enum RTCMode {
|
|
|
602
598
|
CALL = 5
|
|
603
599
|
}
|
|
604
600
|
|
|
605
|
-
/**
|
|
606
|
-
* ASR 状态枚举
|
|
607
|
-
*/
|
|
608
|
-
declare enum RCRTCASRStatus {
|
|
609
|
-
/**
|
|
610
|
-
* 无效值
|
|
611
|
-
*/
|
|
612
|
-
VOID = "0",
|
|
613
|
-
/**
|
|
614
|
-
* 打开
|
|
615
|
-
*/
|
|
616
|
-
OPEN = "2",
|
|
617
|
-
/**
|
|
618
|
-
* 关闭
|
|
619
|
-
*/
|
|
620
|
-
CLOSE = "1"
|
|
621
|
-
}
|
|
622
|
-
|
|
623
601
|
/**
|
|
624
602
|
* 与 MediaServer 交互所需的 Request Header 信息
|
|
625
603
|
*/
|
|
@@ -724,10 +702,6 @@ interface IExchangeReqBody {
|
|
|
724
702
|
* 是否支持 ipv6
|
|
725
703
|
*/
|
|
726
704
|
ipType: number;
|
|
727
|
-
/**
|
|
728
|
-
* asr 开关状态
|
|
729
|
-
*/
|
|
730
|
-
asr_status: RCRTCASRStatus;
|
|
731
705
|
}
|
|
732
706
|
interface ILiveUrls {
|
|
733
707
|
/**
|
|
@@ -916,11 +890,6 @@ interface ICDNUris {
|
|
|
916
890
|
'pull_safe': boolean;
|
|
917
891
|
}
|
|
918
892
|
|
|
919
|
-
declare enum RCRTCAISwitchType {
|
|
920
|
-
OPEN = 1,
|
|
921
|
-
CLOSE = 0
|
|
922
|
-
}
|
|
923
|
-
|
|
924
893
|
/**
|
|
925
894
|
* 设置 RTC 人员 inner、outer 数据
|
|
926
895
|
*/
|
|
@@ -1109,10 +1078,6 @@ interface IRTCNaviInfo extends INaviInfo {
|
|
|
1109
1078
|
* openGzip 开启标识,默认是false,开启使用true
|
|
1110
1079
|
*/
|
|
1111
1080
|
openGzip?: boolean;
|
|
1112
|
-
/**
|
|
1113
|
-
* AI 开关是否打开,1: 打开,0: 关闭
|
|
1114
|
-
*/
|
|
1115
|
-
rtcAISwitch?: RCRTCAISwitchType;
|
|
1116
1081
|
}
|
|
1117
1082
|
|
|
1118
1083
|
declare abstract class ReadableStore {
|
|
@@ -1159,32 +1124,6 @@ declare abstract class ReadableStore {
|
|
|
1159
1124
|
protected _trackIdSSRCMap: Map<number, string>;
|
|
1160
1125
|
protected _roomStatusVersion: number;
|
|
1161
1126
|
protected _supportNtf: boolean;
|
|
1162
|
-
/**
|
|
1163
|
-
* asr 的打开状态
|
|
1164
|
-
*/
|
|
1165
|
-
protected _asrStatus: RCRTCASRStatus;
|
|
1166
|
-
/**
|
|
1167
|
-
* asr 是否被启用
|
|
1168
|
-
*/
|
|
1169
|
-
protected _asrEnable: boolean;
|
|
1170
|
-
/**
|
|
1171
|
-
* asr 输入语言,用于精准识别语音
|
|
1172
|
-
*/
|
|
1173
|
-
protected _srcLanguage: string;
|
|
1174
|
-
/**
|
|
1175
|
-
* asr sei uris 信息
|
|
1176
|
-
*/
|
|
1177
|
-
protected _asrSeiUris: {
|
|
1178
|
-
[userId: string]: IPublishedResource[];
|
|
1179
|
-
};
|
|
1180
|
-
/**
|
|
1181
|
-
* 是否开启实时翻译
|
|
1182
|
-
*/
|
|
1183
|
-
protected _isStartRealTranslate: boolean;
|
|
1184
|
-
/**
|
|
1185
|
-
* 翻译目标语言
|
|
1186
|
-
*/
|
|
1187
|
-
protected _translationLang: string;
|
|
1188
1127
|
constructor(_logger: BasicLogger, clientSessionId: string, appkey: string, roomId: string, crtUserId: string, roomMode: RTCMode, isUpgrade?: boolean | undefined, isMainRoom?: boolean | undefined);
|
|
1189
1128
|
getResourcesByUserId(userId: string): IPublishedResource[] | undefined;
|
|
1190
1129
|
getRemoteTrack(trackId: string): RCRemoteAudioTrack | RCRemoteVideoTrack | undefined;
|
|
@@ -1205,13 +1144,6 @@ declare abstract class ReadableStore {
|
|
|
1205
1144
|
getTrackIdBySSRC(ssrc: number): string | undefined;
|
|
1206
1145
|
getRTCRequestHeader(): IRTCReqHeader;
|
|
1207
1146
|
getSupportNtf(): boolean;
|
|
1208
|
-
getASRIsAvailable(): boolean;
|
|
1209
|
-
getASRStatus(): RCRTCASRStatus;
|
|
1210
|
-
getASREnable(): boolean;
|
|
1211
|
-
getSrcLanguage(): string;
|
|
1212
|
-
getASRSeiUris(): IPublishedResource[];
|
|
1213
|
-
getIsStartRealTranslate(): boolean;
|
|
1214
|
-
getTranslationLang(): string;
|
|
1215
1147
|
}
|
|
1216
1148
|
declare class Store extends ReadableStore {
|
|
1217
1149
|
/**
|
|
@@ -1232,197 +1164,6 @@ declare class Store extends ReadableStore {
|
|
|
1232
1164
|
resetSubscribedList(subscribeList: ISubscribeAttr[]): void;
|
|
1233
1165
|
resetCollectSubscribeList(collectSubscribeList: ISubscribeAttr[]): void;
|
|
1234
1166
|
setRoomStatusVersion(version: number): void;
|
|
1235
|
-
setASRStatus(status: RCRTCASRStatus): void;
|
|
1236
|
-
setASREnable(enable: boolean): void;
|
|
1237
|
-
setSrcLanguage(srcLanguage: string): void;
|
|
1238
|
-
setASRSeiUris(uris: IPublishedResource[]): void;
|
|
1239
|
-
addSeiRemoteTrack(uris: IPublishedResource[]): void;
|
|
1240
|
-
removeSeiRemoteTrack(): void;
|
|
1241
|
-
setIsStartRealTranslate(isStart: boolean): void;
|
|
1242
|
-
setTranslationLang(lang: string): void;
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
/**
|
|
1246
|
-
* 多端登录时,加入房间时的踢人策略
|
|
1247
|
-
*/
|
|
1248
|
-
declare enum RTCJoinType {
|
|
1249
|
-
/**
|
|
1250
|
-
* 踢出已存在于房间的设备,以便于当前设备加入房间
|
|
1251
|
-
*/
|
|
1252
|
-
KICK = 0,
|
|
1253
|
-
/**
|
|
1254
|
-
* 保持已存在于房间的设备,拒绝当前设备加入房间
|
|
1255
|
-
*/
|
|
1256
|
-
REFUSE = 1
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
declare enum RTCApiType {
|
|
1260
|
-
ROOM = 1,
|
|
1261
|
-
PERSON = 2
|
|
1262
|
-
}
|
|
1263
|
-
|
|
1264
|
-
declare enum RTCIdentityChangeType {
|
|
1265
|
-
AnchorToViewer = 1,
|
|
1266
|
-
ViewerToAnchor = 2
|
|
1267
|
-
}
|
|
1268
|
-
|
|
1269
|
-
declare const keymaps: {
|
|
1270
|
-
readonly RtcInput: readonly ["roomType", "broadcastType", "extraInnerData", "needSysChatroom", "identityChangeType", "joinType", "innerDatas", "outerDatas", "supportNtf"];
|
|
1271
|
-
readonly RtcOutput: readonly ["version"];
|
|
1272
|
-
readonly RtcUserListOutput: readonly ["users", "token", "sessionId", "roomInfo", "version"];
|
|
1273
|
-
readonly SetUserStatusInput: readonly ["status"];
|
|
1274
|
-
readonly RtcSetDataInput: readonly ["interior", "target", "key", "value", "objectName", "content"];
|
|
1275
|
-
readonly RtcUserSetDataInput: readonly ["valueInfo", "objectName", "content"];
|
|
1276
|
-
readonly RtcDataInput: readonly ["interior", "target", "key", "objectName", "content"];
|
|
1277
|
-
readonly RtcSetOutDataInput: readonly ["target", "valueInfo", "objectName", "content"];
|
|
1278
|
-
readonly MCFollowInput: readonly ["state"];
|
|
1279
|
-
readonly RtcTokenOutput: readonly ["rtcToken"];
|
|
1280
|
-
readonly RtcQryOutput: readonly ["outInfo"];
|
|
1281
|
-
readonly RtcQryUserOutDataInput: readonly ["userId"];
|
|
1282
|
-
readonly RtcUserOutDataOutput: readonly ["user"];
|
|
1283
|
-
readonly RtcQueryListInput: readonly ["order"];
|
|
1284
|
-
readonly RtcRoomInfoOutput: readonly ["roomId", "roomData", "userCount", "list"];
|
|
1285
|
-
readonly RtcValueInfo: readonly ["key", "value"];
|
|
1286
|
-
readonly RtcKeyDeleteInput: readonly ["key"];
|
|
1287
|
-
readonly RtcNotifyMsg: readonly ["type", "time", "roomId"];
|
|
1288
|
-
readonly RtcPullKV: readonly ["timestamp", "roomId"];
|
|
1289
|
-
readonly RtcKVOutput: readonly ["entries", "bFullUpdate", "syncTime"];
|
|
1290
|
-
readonly RtcQueryUserJoinedInput: readonly ["userId"];
|
|
1291
|
-
readonly RtcQueryUserJoinedOutput: readonly ["info"];
|
|
1292
|
-
readonly RtcInviteInput: readonly ["invitedUserId", "timeoutTime", "invitedRoomId", "inviteInfo", "inviteSessionId"];
|
|
1293
|
-
readonly RtcCancelInviteInput: readonly ["invitedUserId", "invitedRoomId", "inviteInfo", "inviteSessionId"];
|
|
1294
|
-
readonly RtcInviteAnswerInput: readonly ["inviteUserId", "answerCode", "inviteRoomId", "inviteSessionId", "content", "key", "value"];
|
|
1295
|
-
readonly RtcEndInviteInput: readonly ["inviteRoomId", "inviteSessionId", "inviteContent", "inviteRoomKeys"];
|
|
1296
|
-
readonly RtcRoomStatusInput: readonly ["version"];
|
|
1297
|
-
readonly RtcRoomStatusOutput: readonly ["bFullStatus", "version", "usersData", "roomStatus"];
|
|
1298
|
-
readonly RtcReportSDKInput: readonly ["sdkInfo"];
|
|
1299
|
-
readonly RCRTCPBPolaris: readonly ["type", "appKey", "sessionId", "roomId", "roomCreateTime", "userId", "userRole", "joinTime", "signalDataCenter", "r1Info", "r2Info", "r3Info", "r4Info"];
|
|
1300
|
-
readonly RCRTCPBR1Info: readonly ["joinTime", "rtcVersion", "imVersion", "platform", "device", "os", "browserName", "browserVersion"];
|
|
1301
|
-
readonly RCRTCPBR2Info: readonly ["joinTime", "sendTime", "rtcActionType", "rtcActionStatus", "trackId"];
|
|
1302
|
-
readonly RCRTCPBR3Info: readonly ["info"];
|
|
1303
|
-
readonly RCRTCPBR4Info: readonly ["info"];
|
|
1304
|
-
readonly RCRTCPBStatusInfo: readonly ["joinTime", "receiveTime", "totalBitRate", "appCPUUsage", "systemCPUUsage", "systemCPUFrequency", "networkStatus", "googleRTTNetwork", "ipAddress", "useReceiveBroadBand", "useSendBroadBand", "packetLossCount", "streams"];
|
|
1305
|
-
readonly RCRTCPBStreamInfo: readonly ["trackId", "codeName", "volume", "samplingRate", "bitRate", "packetLossRate", "frameRate", "resolution", "blockTime", "jitterData", "nAckCount", "pliCount", "googleRTTTotalTime", "isReceiveFirstFrameRate", "codeType", "isEnabled"];
|
|
1306
|
-
readonly AsrTextMsg: readonly ["bms", "t", "isEnd", "msgId", "lang"];
|
|
1307
|
-
readonly AsrResTextMsg: readonly ["type", "uid", "asr"];
|
|
1308
|
-
};
|
|
1309
|
-
declare type RTCKeyMaps = typeof keymaps;
|
|
1310
|
-
|
|
1311
|
-
/**
|
|
1312
|
-
* 自定义上报北极星数据响应 code
|
|
1313
|
-
*/
|
|
1314
|
-
declare enum RCSendCode {
|
|
1315
|
-
NOT_REPORT = -1,
|
|
1316
|
-
REPORT_SUCCESS = 10000,
|
|
1317
|
-
REPORT_FAIL = 0,
|
|
1318
|
-
PB_ERROR = 40001
|
|
1319
|
-
}
|
|
1320
|
-
|
|
1321
|
-
declare class RTCContext {
|
|
1322
|
-
private context;
|
|
1323
|
-
logger: BasicLogger;
|
|
1324
|
-
private codec;
|
|
1325
|
-
roomCreateTime: number | undefined;
|
|
1326
|
-
userJoinTime: number | undefined;
|
|
1327
|
-
constructor(context: RTCPluginContext, logger: BasicLogger, codec: Codec<RTCKeyMaps>);
|
|
1328
|
-
joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData, supportNtf?: boolean): IPromiseResult<IJoinRTCRoomData>;
|
|
1329
|
-
quitRTCRoom(roomId: string): Promise<ErrorCode>;
|
|
1330
|
-
getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
|
|
1331
|
-
/**
|
|
1332
|
-
* 移动端用来获取副房间资源
|
|
1333
|
-
*/
|
|
1334
|
-
getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
|
|
1335
|
-
getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
|
|
1336
|
-
removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
|
|
1337
|
-
setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
|
|
1338
|
-
name: string;
|
|
1339
|
-
content: string;
|
|
1340
|
-
}): Promise<ErrorCode>;
|
|
1341
|
-
/**
|
|
1342
|
-
* 全量订阅资源修改
|
|
1343
|
-
* @param roomId 房间 Id
|
|
1344
|
-
* @param message 向前兼容的消息内容
|
|
1345
|
-
* @param valueInfo 全量资源数据
|
|
1346
|
-
* @param objectName 全量 URI 消息名
|
|
1347
|
-
*/
|
|
1348
|
-
setRTCTotalRes(roomId: string, messageList: {
|
|
1349
|
-
name: string;
|
|
1350
|
-
content: string;
|
|
1351
|
-
}[], valueInfo: string, objectName: string, mcuValInfo?: string, cdnValInfo?: string): Promise<ErrorCode>;
|
|
1352
|
-
setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
|
|
1353
|
-
getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
|
|
1354
|
-
removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
|
|
1355
|
-
name: string;
|
|
1356
|
-
content: string;
|
|
1357
|
-
}): Promise<ErrorCode>;
|
|
1358
|
-
setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
|
|
1359
|
-
getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
|
|
1360
|
-
getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
|
|
1361
|
-
setRTCState(roomId: string, report: string): Promise<ErrorCode>;
|
|
1362
|
-
/**
|
|
1363
|
-
* 通过 http 方式上报 rtc state
|
|
1364
|
-
*/
|
|
1365
|
-
setRTCStateByHttp(logServer: string, runtime: IRuntime, report: IRCRTCReportData, reportType: string): Promise<RCSendCode | RCRTCCode>;
|
|
1366
|
-
getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
|
|
1367
|
-
joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
|
|
1368
|
-
token: string;
|
|
1369
|
-
kvEntries: IServerRTCRoomEntry[];
|
|
1370
|
-
}>>;
|
|
1371
|
-
quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
|
|
1372
|
-
rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
|
|
1373
|
-
requestRoomPK(options: IReqRoomPKOptions): Promise<ErrorCode>;
|
|
1374
|
-
cancelRoomPK(options: ICancelRoomPKOptions): Promise<ErrorCode>;
|
|
1375
|
-
responseRoomPK(options: IResRoomPKOptions): Promise<ErrorCode>;
|
|
1376
|
-
endRoomPK(options: IEndRoomPKOptions): Promise<ErrorCode>;
|
|
1377
|
-
getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
|
|
1378
|
-
pullRTCRoomEntry(roomId: string): Promise<IAsyncRes<IChrmKVPullData>>;
|
|
1379
|
-
/**
|
|
1380
|
-
* 通知拉取房间数据
|
|
1381
|
-
* @param roomId 房间 id
|
|
1382
|
-
* @param version 本地最大得房间数据版本号
|
|
1383
|
-
*/
|
|
1384
|
-
pullRTCRoomStatus(roomId: string, version: number): Promise<{
|
|
1385
|
-
code: ErrorCode;
|
|
1386
|
-
data?: IPullRTCRoomStatus;
|
|
1387
|
-
}>;
|
|
1388
|
-
decodeRtcNotify(buffer: Uint8Array): {
|
|
1389
|
-
time: number;
|
|
1390
|
-
type: any;
|
|
1391
|
-
roomId: any;
|
|
1392
|
-
};
|
|
1393
|
-
getCurrentId(): string;
|
|
1394
|
-
getNaviInfo(): IRTCNaviInfo | null;
|
|
1395
|
-
getConnectionStatus(): RCConnectionStatus;
|
|
1396
|
-
getAppkey(): string;
|
|
1397
|
-
/** web 端发 rtcPing */
|
|
1398
|
-
webRtcPing(roomId: string, roomMode: RTCMode, broadcastType?: number): Promise<{
|
|
1399
|
-
code: ErrorCode;
|
|
1400
|
-
data?: {
|
|
1401
|
-
version: number;
|
|
1402
|
-
};
|
|
1403
|
-
}>;
|
|
1404
|
-
/**
|
|
1405
|
-
* 协议栈 rtcping 依赖 imlib 编解码数据
|
|
1406
|
-
* web 单独走 imlib 提供的 rtcSignaling 方法,减少对 imlib 的依赖
|
|
1407
|
-
*/
|
|
1408
|
-
rtcPing(roomId: string, roomMode: RTCMode, broadcastType?: number): Promise<_rongcloud_engine.RCResult<any>> | Promise<{
|
|
1409
|
-
code: ErrorCode;
|
|
1410
|
-
data?: {
|
|
1411
|
-
version: number;
|
|
1412
|
-
} | undefined;
|
|
1413
|
-
}>;
|
|
1414
|
-
sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
1415
|
-
registerRTCSignalListener(listener?: ((buffer: Uint8Array) => void) | undefined): void;
|
|
1416
|
-
registerConnectionStateChangeListener(listener: (status: RCConnectionStatus, code: ErrorCode) => void): void;
|
|
1417
|
-
registerDisconnectListener(listener: () => void): void;
|
|
1418
|
-
registerDestroyListener(listener: () => void): void;
|
|
1419
|
-
registerMessageListener(listener: (message: IReceivedMessage) => boolean): void;
|
|
1420
|
-
getCoreVersion(): string;
|
|
1421
|
-
getPluginContext(): RTCPluginContext;
|
|
1422
|
-
reportSDKInfo(versionInfo: {
|
|
1423
|
-
[name: string]: string;
|
|
1424
|
-
}): void;
|
|
1425
|
-
decodeAsrText(buffer: Uint8Array): (RCRTCASRContent | RCRTCRealtimeTranslationContent)[];
|
|
1426
1167
|
}
|
|
1427
1168
|
|
|
1428
1169
|
declare type ISdpSemantics = 'plan-b' | 'unified-plan';
|
|
@@ -2184,28 +1925,6 @@ interface IRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
2184
1925
|
* 主播和观众切换身份通知
|
|
2185
1926
|
*/
|
|
2186
1927
|
onSwitchRole?(userId: string, role: RCRTCLiveRole): void;
|
|
2187
|
-
/**
|
|
2188
|
-
* 语音识别服务开启通知
|
|
2189
|
-
* 如需要语音识别内容和语音实时翻译,可在此时机依次调用 room 的
|
|
2190
|
-
* setSrcLanguageCode 方法,设置输入语言代码,用于语音识别精准识别
|
|
2191
|
-
* setEnableASR 方法,设置房间内的语音识别资源为可用,语音识别内容通过 `onReceiveASRContent` 回调给业务层
|
|
2192
|
-
* startRealtimeTranslation 方法,开启语音实时翻译,实时翻译内容通过 `onReceiveRealtimeTranslationContent` 回调给业务层
|
|
2193
|
-
*/
|
|
2194
|
-
onReceiveStartASR?(): void;
|
|
2195
|
-
/**
|
|
2196
|
-
* 语音识别服务停止通知
|
|
2197
|
-
*/
|
|
2198
|
-
onReceiveStopASR?(): void;
|
|
2199
|
-
/**
|
|
2200
|
-
* 语音识别内容回调
|
|
2201
|
-
* @param asrContent
|
|
2202
|
-
*/
|
|
2203
|
-
onReceiveASRContent?(asrContent: RCRTCASRContent): void;
|
|
2204
|
-
/**
|
|
2205
|
-
* 语音翻译结果回调
|
|
2206
|
-
* @param content
|
|
2207
|
-
*/
|
|
2208
|
-
onReceiveRealtimeTranslationContent?(content: RCRTCRealtimeTranslationContent): void;
|
|
2209
1928
|
}
|
|
2210
1929
|
/**
|
|
2211
1930
|
* RTCClient 初始化配置
|
|
@@ -2501,37 +2220,6 @@ interface IPullRTCRoomUsersData {
|
|
|
2501
2220
|
value: string;
|
|
2502
2221
|
}[];
|
|
2503
2222
|
}
|
|
2504
|
-
/**
|
|
2505
|
-
* ASR 内容
|
|
2506
|
-
*/
|
|
2507
|
-
interface RCRTCASRContent {
|
|
2508
|
-
/**
|
|
2509
|
-
* 当前语音识别关联用户的 ID,
|
|
2510
|
-
*/
|
|
2511
|
-
userID: string;
|
|
2512
|
-
/**
|
|
2513
|
-
* 当前语音识别的 ID, 用于关联当前语音识别结果
|
|
2514
|
-
*/
|
|
2515
|
-
msgId: string;
|
|
2516
|
-
/**
|
|
2517
|
-
* 当前语音识别的时间戳, 单位为秒
|
|
2518
|
-
*/
|
|
2519
|
-
timeUTC: number;
|
|
2520
|
-
/**
|
|
2521
|
-
* 当前语音识别结果
|
|
2522
|
-
*/
|
|
2523
|
-
msg: string;
|
|
2524
|
-
/**
|
|
2525
|
-
* 当前语音识别是否结束, 如果为 true, 则表示当前语音识别已结束
|
|
2526
|
-
*/
|
|
2527
|
-
isEnd: boolean;
|
|
2528
|
-
}
|
|
2529
|
-
interface RCRTCRealtimeTranslationContent extends RCRTCASRContent {
|
|
2530
|
-
/**
|
|
2531
|
-
* 当前语音翻译的目标语言码
|
|
2532
|
-
*/
|
|
2533
|
-
destLangCode: string;
|
|
2534
|
-
}
|
|
2535
2223
|
|
|
2536
2224
|
/**
|
|
2537
2225
|
* 直播布局模式定义
|
|
@@ -2810,20 +2498,200 @@ interface ISetEnableCDN {
|
|
|
2810
2498
|
}
|
|
2811
2499
|
|
|
2812
2500
|
/**
|
|
2813
|
-
*
|
|
2501
|
+
* 多端登录时,加入房间时的踢人策略
|
|
2814
2502
|
*/
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2503
|
+
declare enum RTCJoinType {
|
|
2504
|
+
/**
|
|
2505
|
+
* 踢出已存在于房间的设备,以便于当前设备加入房间
|
|
2506
|
+
*/
|
|
2507
|
+
KICK = 0,
|
|
2508
|
+
/**
|
|
2509
|
+
* 保持已存在于房间的设备,拒绝当前设备加入房间
|
|
2510
|
+
*/
|
|
2511
|
+
REFUSE = 1
|
|
2820
2512
|
}
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2513
|
+
|
|
2514
|
+
declare enum RTCApiType {
|
|
2515
|
+
ROOM = 1,
|
|
2516
|
+
PERSON = 2
|
|
2517
|
+
}
|
|
2518
|
+
|
|
2519
|
+
declare enum RTCIdentityChangeType {
|
|
2520
|
+
AnchorToViewer = 1,
|
|
2521
|
+
ViewerToAnchor = 2
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
declare const keymaps: {
|
|
2525
|
+
readonly RtcInput: readonly ["roomType", "broadcastType", "extraInnerData", "needSysChatroom", "identityChangeType", "joinType", "innerDatas", "outerDatas", "supportNtf"];
|
|
2526
|
+
readonly RtcOutput: readonly ["version"];
|
|
2527
|
+
readonly RtcUserListOutput: readonly ["users", "token", "sessionId", "roomInfo", "version"];
|
|
2528
|
+
readonly SetUserStatusInput: readonly ["status"];
|
|
2529
|
+
readonly RtcSetDataInput: readonly ["interior", "target", "key", "value", "objectName", "content"];
|
|
2530
|
+
readonly RtcUserSetDataInput: readonly ["valueInfo", "objectName", "content"];
|
|
2531
|
+
readonly RtcDataInput: readonly ["interior", "target", "key", "objectName", "content"];
|
|
2532
|
+
readonly RtcSetOutDataInput: readonly ["target", "valueInfo", "objectName", "content"];
|
|
2533
|
+
readonly MCFollowInput: readonly ["state"];
|
|
2534
|
+
readonly RtcTokenOutput: readonly ["rtcToken"];
|
|
2535
|
+
readonly RtcQryOutput: readonly ["outInfo"];
|
|
2536
|
+
readonly RtcQryUserOutDataInput: readonly ["userId"];
|
|
2537
|
+
readonly RtcUserOutDataOutput: readonly ["user"];
|
|
2538
|
+
readonly RtcQueryListInput: readonly ["order"];
|
|
2539
|
+
readonly RtcRoomInfoOutput: readonly ["roomId", "roomData", "userCount", "list"];
|
|
2540
|
+
readonly RtcValueInfo: readonly ["key", "value"];
|
|
2541
|
+
readonly RtcKeyDeleteInput: readonly ["key"];
|
|
2542
|
+
readonly RtcNotifyMsg: readonly ["type", "time", "roomId"];
|
|
2543
|
+
readonly RtcPullKV: readonly ["timestamp", "roomId"];
|
|
2544
|
+
readonly RtcKVOutput: readonly ["entries", "bFullUpdate", "syncTime"];
|
|
2545
|
+
readonly RtcQueryUserJoinedInput: readonly ["userId"];
|
|
2546
|
+
readonly RtcQueryUserJoinedOutput: readonly ["info"];
|
|
2547
|
+
readonly RtcInviteInput: readonly ["invitedUserId", "timeoutTime", "invitedRoomId", "inviteInfo", "inviteSessionId"];
|
|
2548
|
+
readonly RtcCancelInviteInput: readonly ["invitedUserId", "invitedRoomId", "inviteInfo", "inviteSessionId"];
|
|
2549
|
+
readonly RtcInviteAnswerInput: readonly ["inviteUserId", "answerCode", "inviteRoomId", "inviteSessionId", "content", "key", "value"];
|
|
2550
|
+
readonly RtcEndInviteInput: readonly ["inviteRoomId", "inviteSessionId", "inviteContent", "inviteRoomKeys"];
|
|
2551
|
+
readonly RtcRoomStatusInput: readonly ["version"];
|
|
2552
|
+
readonly RtcRoomStatusOutput: readonly ["bFullStatus", "version", "usersData", "roomStatus"];
|
|
2553
|
+
readonly RtcReportSDKInput: readonly ["sdkInfo"];
|
|
2554
|
+
readonly RCRTCPBPolaris: readonly ["type", "appKey", "sessionId", "roomId", "roomCreateTime", "userId", "userRole", "joinTime", "signalDataCenter", "r1Info", "r2Info", "r3Info", "r4Info"];
|
|
2555
|
+
readonly RCRTCPBR1Info: readonly ["joinTime", "rtcVersion", "imVersion", "platform", "device", "os", "browserName", "browserVersion"];
|
|
2556
|
+
readonly RCRTCPBR2Info: readonly ["joinTime", "sendTime", "rtcActionType", "rtcActionStatus", "trackId"];
|
|
2557
|
+
readonly RCRTCPBR3Info: readonly ["info"];
|
|
2558
|
+
readonly RCRTCPBR4Info: readonly ["info"];
|
|
2559
|
+
readonly RCRTCPBStatusInfo: readonly ["joinTime", "receiveTime", "totalBitRate", "appCPUUsage", "systemCPUUsage", "systemCPUFrequency", "networkStatus", "googleRTTNetwork", "ipAddress", "useReceiveBroadBand", "useSendBroadBand", "packetLossCount", "streams"];
|
|
2560
|
+
readonly RCRTCPBStreamInfo: readonly ["trackId", "codeName", "volume", "samplingRate", "bitRate", "packetLossRate", "frameRate", "resolution", "blockTime", "jitterData", "nAckCount", "pliCount", "googleRTTTotalTime", "isReceiveFirstFrameRate", "codeType", "isEnabled"];
|
|
2561
|
+
};
|
|
2562
|
+
declare type RTCKeyMaps = typeof keymaps;
|
|
2563
|
+
|
|
2564
|
+
/**
|
|
2565
|
+
* 自定义上报北极星数据响应 code
|
|
2566
|
+
*/
|
|
2567
|
+
declare enum RCSendCode {
|
|
2568
|
+
NOT_REPORT = -1,
|
|
2569
|
+
REPORT_SUCCESS = 10000,
|
|
2570
|
+
REPORT_FAIL = 0,
|
|
2571
|
+
PB_ERROR = 40001
|
|
2572
|
+
}
|
|
2573
|
+
|
|
2574
|
+
declare class RTCContext {
|
|
2575
|
+
private context;
|
|
2576
|
+
logger: BasicLogger;
|
|
2577
|
+
private codec;
|
|
2578
|
+
roomCreateTime: number | undefined;
|
|
2579
|
+
userJoinTime: number | undefined;
|
|
2580
|
+
constructor(context: RTCPluginContext, logger: BasicLogger, codec: Codec<RTCKeyMaps>);
|
|
2581
|
+
joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData, supportNtf?: boolean): IPromiseResult<IJoinRTCRoomData>;
|
|
2582
|
+
quitRTCRoom(roomId: string): Promise<ErrorCode>;
|
|
2583
|
+
getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
|
|
2584
|
+
/**
|
|
2585
|
+
* 移动端用来获取副房间资源
|
|
2586
|
+
*/
|
|
2587
|
+
getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
|
|
2588
|
+
getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
|
|
2589
|
+
removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
|
|
2590
|
+
setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
|
|
2591
|
+
name: string;
|
|
2592
|
+
content: string;
|
|
2593
|
+
}): Promise<ErrorCode>;
|
|
2594
|
+
/**
|
|
2595
|
+
* 全量订阅资源修改
|
|
2596
|
+
* @param roomId 房间 Id
|
|
2597
|
+
* @param message 向前兼容的消息内容
|
|
2598
|
+
* @param valueInfo 全量资源数据
|
|
2599
|
+
* @param objectName 全量 URI 消息名
|
|
2600
|
+
*/
|
|
2601
|
+
setRTCTotalRes(roomId: string, messageList: {
|
|
2602
|
+
name: string;
|
|
2603
|
+
content: string;
|
|
2604
|
+
}[], valueInfo: string, objectName: string, mcuValInfo?: string, cdnValInfo?: string): Promise<ErrorCode>;
|
|
2605
|
+
setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
|
|
2606
|
+
getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
|
|
2607
|
+
removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
|
|
2608
|
+
name: string;
|
|
2609
|
+
content: string;
|
|
2610
|
+
}): Promise<ErrorCode>;
|
|
2611
|
+
setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
|
|
2612
|
+
getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
|
|
2613
|
+
getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
|
|
2614
|
+
setRTCState(roomId: string, report: string): Promise<ErrorCode>;
|
|
2615
|
+
/**
|
|
2616
|
+
* 通过 http 方式上报 rtc state
|
|
2617
|
+
*/
|
|
2618
|
+
setRTCStateByHttp(logServer: string, runtime: IRuntime, report: IRCRTCReportData, reportType: string): Promise<RCSendCode | RCRTCCode>;
|
|
2619
|
+
getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
|
|
2620
|
+
joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
|
|
2621
|
+
token: string;
|
|
2622
|
+
kvEntries: IServerRTCRoomEntry[];
|
|
2623
|
+
}>>;
|
|
2624
|
+
quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
|
|
2625
|
+
rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
|
|
2626
|
+
requestRoomPK(options: IReqRoomPKOptions): Promise<ErrorCode>;
|
|
2627
|
+
cancelRoomPK(options: ICancelRoomPKOptions): Promise<ErrorCode>;
|
|
2628
|
+
responseRoomPK(options: IResRoomPKOptions): Promise<ErrorCode>;
|
|
2629
|
+
endRoomPK(options: IEndRoomPKOptions): Promise<ErrorCode>;
|
|
2630
|
+
getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
|
|
2631
|
+
pullRTCRoomEntry(roomId: string): Promise<IAsyncRes<IChrmKVPullData>>;
|
|
2632
|
+
/**
|
|
2633
|
+
* 通知拉取房间数据
|
|
2634
|
+
* @param roomId 房间 id
|
|
2635
|
+
* @param version 本地最大得房间数据版本号
|
|
2636
|
+
*/
|
|
2637
|
+
pullRTCRoomStatus(roomId: string, version: number): Promise<{
|
|
2638
|
+
code: ErrorCode;
|
|
2639
|
+
data?: IPullRTCRoomStatus;
|
|
2640
|
+
}>;
|
|
2641
|
+
decodeRtcNotify(buffer: Uint8Array): {
|
|
2642
|
+
time: number;
|
|
2643
|
+
type: any;
|
|
2644
|
+
roomId: any;
|
|
2645
|
+
};
|
|
2646
|
+
getCurrentId(): string;
|
|
2647
|
+
getNaviInfo(): IRTCNaviInfo | null;
|
|
2648
|
+
getConnectionStatus(): RCConnectionStatus;
|
|
2649
|
+
getAppkey(): string;
|
|
2650
|
+
/** web 端发 rtcPing */
|
|
2651
|
+
webRtcPing(roomId: string, roomMode: RTCMode, broadcastType?: number): Promise<{
|
|
2652
|
+
code: ErrorCode;
|
|
2653
|
+
data?: {
|
|
2654
|
+
version: number;
|
|
2655
|
+
};
|
|
2656
|
+
}>;
|
|
2657
|
+
/**
|
|
2658
|
+
* 协议栈 rtcping 依赖 imlib 编解码数据
|
|
2659
|
+
* web 单独走 imlib 提供的 rtcSignaling 方法,减少对 imlib 的依赖
|
|
2660
|
+
*/
|
|
2661
|
+
rtcPing(roomId: string, roomMode: RTCMode, broadcastType?: number): Promise<{
|
|
2662
|
+
code: ErrorCode;
|
|
2663
|
+
data?: {
|
|
2664
|
+
version: number;
|
|
2665
|
+
} | undefined;
|
|
2666
|
+
}> | Promise<_rongcloud_engine.RCResult<any>>;
|
|
2667
|
+
sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
2668
|
+
registerRTCSignalListener(listener?: ((buffer: Uint8Array) => void) | undefined): void;
|
|
2669
|
+
registerConnectionStateChangeListener(listener: (status: RCConnectionStatus, code: ErrorCode) => void): void;
|
|
2670
|
+
registerDisconnectListener(listener: () => void): void;
|
|
2671
|
+
registerDestroyListener(listener: () => void): void;
|
|
2672
|
+
registerMessageListener(listener: (message: IReceivedMessage) => boolean): void;
|
|
2673
|
+
getCoreVersion(): string;
|
|
2674
|
+
getPluginContext(): RTCPluginContext;
|
|
2675
|
+
reportSDKInfo(versionInfo: {
|
|
2676
|
+
[name: string]: string;
|
|
2677
|
+
}): void;
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
/**
|
|
2681
|
+
* mediaServer 交互数据
|
|
2682
|
+
*/
|
|
2683
|
+
interface IMediaServerQualityData {
|
|
2684
|
+
rsid: string;
|
|
2685
|
+
rsdur: number;
|
|
2686
|
+
msa: string;
|
|
2687
|
+
rscod: number;
|
|
2688
|
+
}
|
|
2689
|
+
/**
|
|
2690
|
+
* signal 交互数据
|
|
2691
|
+
*/
|
|
2692
|
+
interface ISignalQualityData {
|
|
2693
|
+
dur: number;
|
|
2694
|
+
cod: number;
|
|
2827
2695
|
}
|
|
2828
2696
|
declare enum RCRTCResourceAction {
|
|
2829
2697
|
PUB = "pub",
|
|
@@ -2832,6 +2700,139 @@ declare enum RCRTCResourceAction {
|
|
|
2832
2700
|
UNSUB = "unsub"
|
|
2833
2701
|
}
|
|
2834
2702
|
|
|
2703
|
+
declare class RCMediaService {
|
|
2704
|
+
private readonly _runtime;
|
|
2705
|
+
private readonly _context;
|
|
2706
|
+
/**
|
|
2707
|
+
* 自定义 MediaServer 地址,当有值时,不再使用导航内的地址
|
|
2708
|
+
*/
|
|
2709
|
+
private readonly _msUrl?;
|
|
2710
|
+
/**
|
|
2711
|
+
* 请求超时时长
|
|
2712
|
+
*/
|
|
2713
|
+
private readonly _timeout;
|
|
2714
|
+
/**
|
|
2715
|
+
* 已失败的请求地址
|
|
2716
|
+
*/
|
|
2717
|
+
private readonly _failedMs;
|
|
2718
|
+
/**
|
|
2719
|
+
* 服务器指纹数据,客户端不得修改,直接透传
|
|
2720
|
+
*/
|
|
2721
|
+
private _rtcFinger;
|
|
2722
|
+
/**
|
|
2723
|
+
* 服务器接口返回的 clusterId 数据,当此数据有值时,后续所有请求向此服务发送
|
|
2724
|
+
*/
|
|
2725
|
+
private _clusterId;
|
|
2726
|
+
/**
|
|
2727
|
+
* MCU 服务地址
|
|
2728
|
+
*/
|
|
2729
|
+
private _configUrl;
|
|
2730
|
+
/**
|
|
2731
|
+
* 排好序的探测地址
|
|
2732
|
+
*/
|
|
2733
|
+
private static msInDetector;
|
|
2734
|
+
private static detectorTime;
|
|
2735
|
+
private static detectValidMinute;
|
|
2736
|
+
private _msList;
|
|
2737
|
+
private _qualityMsList;
|
|
2738
|
+
private readonly _logger;
|
|
2739
|
+
constructor(_runtime: IRuntime, _context: RTCContext,
|
|
2740
|
+
/**
|
|
2741
|
+
* 自定义 MediaServer 地址,当有值时,不再使用导航内的地址
|
|
2742
|
+
*/
|
|
2743
|
+
_msUrl?: string | undefined,
|
|
2744
|
+
/**
|
|
2745
|
+
* 请求超时时长
|
|
2746
|
+
*/
|
|
2747
|
+
_timeout?: number);
|
|
2748
|
+
/**
|
|
2749
|
+
* 是否需要嗅探
|
|
2750
|
+
* im 未连接,无 navi 数据时,不需要嗅探
|
|
2751
|
+
* 客户端手动配置 mediaServer 时,不需要嗅探
|
|
2752
|
+
* navi 数据中 detectionServer 为空时,不需要嗅探
|
|
2753
|
+
* navi 数据中 jwt 为空时,不需要嗅探
|
|
2754
|
+
* 在探测有效期内不需要嗅探
|
|
2755
|
+
* RCMediaService.detectorTime 为 0 时,代表未探测过,需要嗅探
|
|
2756
|
+
*/
|
|
2757
|
+
isNededDetector(): boolean;
|
|
2758
|
+
detectorMediaSever(): void;
|
|
2759
|
+
/**
|
|
2760
|
+
* 地址探测
|
|
2761
|
+
* RTC 初始化时检测是否可以拿到 navi,可以拿到开始嗅探
|
|
2762
|
+
* 拿不到等 IM 链接成功后,再回调中调用开始嗅探
|
|
2763
|
+
*/
|
|
2764
|
+
private _startDetector;
|
|
2765
|
+
/**
|
|
2766
|
+
* 清空 msList 列表,重新请求导航后需清空 msList 列表
|
|
2767
|
+
*/
|
|
2768
|
+
clearMSList(): void;
|
|
2769
|
+
getMsList(): string[];
|
|
2770
|
+
/**
|
|
2771
|
+
* _mslist 列表排序:[_clusterId, ping1DetectorUrl, 主域名, ping2DetectorUrl, ..., pingNDetectorUrl, 备用域名list ]
|
|
2772
|
+
* ping1 :ping 结果返回最快值
|
|
2773
|
+
*/
|
|
2774
|
+
private _sortMediaServiceList;
|
|
2775
|
+
/**
|
|
2776
|
+
* 配置 gzip 请求头和请求体
|
|
2777
|
+
*/
|
|
2778
|
+
private _openGzip;
|
|
2779
|
+
/**
|
|
2780
|
+
* 处理 request 成功的结果
|
|
2781
|
+
*/
|
|
2782
|
+
private _dealRequestSuccessResult;
|
|
2783
|
+
/**
|
|
2784
|
+
* 发送请求,请求发送若失败,会继续尝试使用后续可用地址直到无地址可用,此时认为请求失败
|
|
2785
|
+
* @param path
|
|
2786
|
+
* @param header
|
|
2787
|
+
* @param body
|
|
2788
|
+
*/
|
|
2789
|
+
private _request;
|
|
2790
|
+
/**
|
|
2791
|
+
* 资源协商接口,订阅、发布、变更资源均可以使用此接口。该接口通过 sdp 字段交换 SDP 信息,
|
|
2792
|
+
* 并通过 subscribeList 和 publishList 表明最终发布和订阅的资源。本端产出 offer,服务器产出 answer
|
|
2793
|
+
* 每次接口调用,都会全量覆盖发布和订阅的资源。
|
|
2794
|
+
* @param header
|
|
2795
|
+
* @param body
|
|
2796
|
+
*/
|
|
2797
|
+
exchange(headers: IRTCReqHeader, body: IExchangeReqBody, traceId: string, isNeedUpdateMsas?: boolean): Promise<{
|
|
2798
|
+
code: RCRTCCode;
|
|
2799
|
+
data?: IExchangeResponse | undefined;
|
|
2800
|
+
qualityMsList?: IMediaServerQualityData[] | undefined;
|
|
2801
|
+
}>;
|
|
2802
|
+
/**
|
|
2803
|
+
* 退出房间
|
|
2804
|
+
*/
|
|
2805
|
+
exit(headers: IRTCReqHeader): Promise<RCRTCCode>;
|
|
2806
|
+
/**
|
|
2807
|
+
* 观众端订阅主播资源
|
|
2808
|
+
*/
|
|
2809
|
+
broadcastSubscribe(headers: IRTCReqHeader, body: IBroadcastSubReqBody): Promise<{
|
|
2810
|
+
code: RCRTCCode;
|
|
2811
|
+
data?: IBroadcastSubRespBody | undefined;
|
|
2812
|
+
qualityMsList?: IMediaServerQualityData[] | undefined;
|
|
2813
|
+
}>;
|
|
2814
|
+
/**
|
|
2815
|
+
* 观众端退出订阅
|
|
2816
|
+
*/
|
|
2817
|
+
broadcastExit(headers: IRTCReqHeader): Promise<{
|
|
2818
|
+
code: RCRTCCode;
|
|
2819
|
+
}>;
|
|
2820
|
+
/**
|
|
2821
|
+
* 直播推流、自定义布局配置
|
|
2822
|
+
*/
|
|
2823
|
+
setMcuConfig(headers: IMCUReqHeaders, body: IMCUConfig | ISetEnableCDN): Promise<{
|
|
2824
|
+
code: RCRTCCode;
|
|
2825
|
+
res?: any;
|
|
2826
|
+
}>;
|
|
2827
|
+
/**
|
|
2828
|
+
* 房间内观众获取 CDN 资源信息、拉流地址
|
|
2829
|
+
*/
|
|
2830
|
+
getCDNResourceInfo(headers: ICDNPlayUrlReqHeaders, url: string, traceId: string): Promise<{
|
|
2831
|
+
code: RCRTCCode;
|
|
2832
|
+
res?: ICDNPlayUrlResponse;
|
|
2833
|
+
}>;
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2835
2836
|
declare enum RCCommandKind {
|
|
2836
2837
|
/**
|
|
2837
2838
|
* 发信令取消加入房间之前的资源
|
|
@@ -2963,82 +2964,12 @@ declare class ReportMediaActionLogger {
|
|
|
2963
2964
|
recordQualityIceStatusData(iceCandidatePair: IRCCandidatePairStat, status: RTCIceConnectionState, time: number): void;
|
|
2964
2965
|
}
|
|
2965
2966
|
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
|
|
2971
|
-
|
|
2972
|
-
* 增量资源发布消息
|
|
2973
|
-
* @deprecated
|
|
2974
|
-
*/
|
|
2975
|
-
PUBLISH = "RCRTC:PublishResource",
|
|
2976
|
-
/**
|
|
2977
|
-
* 增量资源取消发布消息
|
|
2978
|
-
* @deprecated
|
|
2979
|
-
*/
|
|
2980
|
-
UNPUBLISH = "RCRTC:UnpublishResource",
|
|
2981
|
-
/**
|
|
2982
|
-
* 增量资源状态变更消息
|
|
2983
|
-
* @deprecated
|
|
2984
|
-
*/
|
|
2985
|
-
MODIFY = "RCRTC:ModifyResource",
|
|
2986
|
-
/**
|
|
2987
|
-
* 全量资源变更消息
|
|
2988
|
-
*/
|
|
2989
|
-
TOTAL_CONTENT_RESOURCE = "RCRTC:TotalContentResources",
|
|
2990
|
-
/**
|
|
2991
|
-
* 房间人员变更
|
|
2992
|
-
*/
|
|
2993
|
-
STATE = "RCRTC:state",
|
|
2994
|
-
/**
|
|
2995
|
-
* 房间属性变更
|
|
2996
|
-
*/
|
|
2997
|
-
ROOM_NOTIFY = "RCRTC:RoomNtf",
|
|
2998
|
-
/**
|
|
2999
|
-
* 房间用户属性变更
|
|
3000
|
-
*/
|
|
3001
|
-
USER_NOTIFY = "RCRTC:UserNtf",
|
|
3002
|
-
/**
|
|
3003
|
-
* 被服务踢出房间
|
|
3004
|
-
*/
|
|
3005
|
-
KICK = "RCRTC:kick",
|
|
3006
|
-
/**
|
|
3007
|
-
* 跨房间连麦 PK 请求消息
|
|
3008
|
-
*/
|
|
3009
|
-
PK_INVITE = "RCRTC:invite",
|
|
3010
|
-
/**
|
|
3011
|
-
* 连麦请求超时
|
|
3012
|
-
*/
|
|
3013
|
-
PK_INVITE_TIMEOUT = "RCRTC:inviteTimeout",
|
|
3014
|
-
/**
|
|
3015
|
-
* 跨房间连麦 PK 取消请求消息
|
|
3016
|
-
*/
|
|
3017
|
-
PK_CANCEL_INVITE = "RCRTC:cancelInvite",
|
|
3018
|
-
/**
|
|
3019
|
-
* 跨房间连麦 PK 请求响应消息
|
|
3020
|
-
*/
|
|
3021
|
-
PK_INVITE_ANSWER = "RCRTC:answerInvite",
|
|
3022
|
-
/**
|
|
3023
|
-
* 结束跨房间连麦 PK 消息
|
|
3024
|
-
*/
|
|
3025
|
-
PK_END = "RCRTC:endInvite",
|
|
3026
|
-
/**
|
|
3027
|
-
* 连麦的房间不再了或离线了,主直播房间会收到的消息通知
|
|
3028
|
-
*/
|
|
3029
|
-
OTHER_ROOM_OFFLINE = "RCRTC:otherRoomOffline",
|
|
3030
|
-
/**
|
|
3031
|
-
* 订阅、取消订阅动作成功
|
|
3032
|
-
*/
|
|
3033
|
-
ROOM_TASK_FINISH = "RCRTC:roomTaskFinish",
|
|
3034
|
-
/**
|
|
3035
|
-
* ASR 状态变更
|
|
3036
|
-
*/
|
|
3037
|
-
ASR_STATUS = "RCRTC:AsrStatus",
|
|
3038
|
-
/**
|
|
3039
|
-
* ASR SEI 变更
|
|
3040
|
-
*/
|
|
3041
|
-
ASR_SEI = "RCRTC:PublishSeiAi"
|
|
2967
|
+
declare class RCLocalMediaStream {
|
|
2968
|
+
readonly msid: string;
|
|
2969
|
+
readonly mediaStream: MediaStream;
|
|
2970
|
+
readonly tinyStream: MediaStream;
|
|
2971
|
+
readonly tag: string;
|
|
2972
|
+
constructor(msid: string);
|
|
3042
2973
|
}
|
|
3043
2974
|
|
|
3044
2975
|
/**
|
|
@@ -3048,1461 +2979,1310 @@ declare enum RCLivingType {
|
|
|
3048
2979
|
/**
|
|
3049
2980
|
* 音视频直播
|
|
3050
2981
|
*/
|
|
3051
|
-
VIDEO = 0,
|
|
3052
|
-
/**
|
|
3053
|
-
* 音频直播
|
|
3054
|
-
*/
|
|
3055
|
-
AUDIO = 1
|
|
3056
|
-
}
|
|
3057
|
-
|
|
3058
|
-
declare type IOnRecvPKMsg = (msg: IReceivedMessage) => void;
|
|
3059
|
-
interface IRoomPKEventListener {
|
|
3060
|
-
/**
|
|
3061
|
-
* 收到连麦邀请
|
|
3062
|
-
*/
|
|
3063
|
-
onRequestJoinOtherRoom: (info: IPKInviteInfo) => {};
|
|
3064
|
-
/**
|
|
3065
|
-
* 收到取消连麦邀请
|
|
3066
|
-
*/
|
|
3067
|
-
onCancelRequestOtherRoom: (info: IPKInviteInfo) => {};
|
|
3068
|
-
/**
|
|
3069
|
-
* 收到连麦 PK 请求响应结果
|
|
3070
|
-
*/
|
|
3071
|
-
onResponseJoinOtherRoom: (info: IPKInviteAnswerInfo) => {};
|
|
3072
|
-
/**
|
|
3073
|
-
* 收到 PK 结束
|
|
3074
|
-
*/
|
|
3075
|
-
onFinishOtherRoom: (info: IPKEndInfo) => {};
|
|
3076
|
-
}
|
|
3077
|
-
declare class RCLivingPKHandler {
|
|
3078
|
-
private _invoker;
|
|
3079
|
-
private _PKInfo;
|
|
3080
|
-
private readonly _context;
|
|
3081
|
-
private readonly _runtime;
|
|
3082
|
-
private readonly _service;
|
|
3083
|
-
private readonly _initOptions;
|
|
3084
|
-
/**
|
|
3085
|
-
* 主直播房间
|
|
3086
|
-
*/
|
|
3087
|
-
private readonly _mainLivingRoom;
|
|
3088
|
-
private readonly _registerPKMsgListener;
|
|
3089
|
-
/**
|
|
3090
|
-
* 加入 PK 房间回调
|
|
3091
|
-
*/
|
|
3092
|
-
private readonly _onJoinedPKRoom;
|
|
3093
|
-
protected readonly _clientSessionId?: string | undefined;
|
|
3094
|
-
/**
|
|
3095
|
-
* PK 邀请超时时间,默认 30s
|
|
3096
|
-
*/
|
|
3097
|
-
private readonly _inviteTimeout;
|
|
3098
|
-
private _appListener;
|
|
3099
|
-
private _mainRoomId;
|
|
3100
|
-
/**
|
|
3101
|
-
* 跨房间连麦加入的 PK 房间
|
|
3102
|
-
*/
|
|
3103
|
-
private _joinedPKRooms;
|
|
3104
|
-
private readonly _logger;
|
|
3105
|
-
constructor(_invoker: Invoker, _PKInfo: IPKInfo, _context: RTCContext, _runtime: IRuntime, _service: RCMediaService, _initOptions: IRCRTCInitOptions,
|
|
3106
|
-
/**
|
|
3107
|
-
* 主直播房间
|
|
3108
|
-
*/
|
|
3109
|
-
_mainLivingRoom: RCLivingRoom, _registerPKMsgListener: (listener: IOnRecvPKMsg) => void,
|
|
3110
|
-
/**
|
|
3111
|
-
* 加入 PK 房间回调
|
|
3112
|
-
*/
|
|
3113
|
-
_onJoinedPKRoom: (roomId: string, traceId: string) => Promise<void>, _clientSessionId?: string | undefined);
|
|
3114
|
-
private _callAppListener;
|
|
3115
|
-
/**
|
|
3116
|
-
* 收到连麦邀请
|
|
3117
|
-
*/
|
|
3118
|
-
private _onInvite;
|
|
3119
|
-
/**
|
|
3120
|
-
* 收到取消连麦
|
|
3121
|
-
*/
|
|
3122
|
-
private _onCancelInvite;
|
|
3123
|
-
private _onInviteTimeout;
|
|
3124
|
-
/**
|
|
3125
|
-
* 收到响应连麦
|
|
3126
|
-
*/
|
|
3127
|
-
private _onInviteAnswer;
|
|
3128
|
-
private createLeaveOtherRoomCommand;
|
|
3129
|
-
/**
|
|
3130
|
-
* 收到连麦结束
|
|
3131
|
-
*/
|
|
3132
|
-
private _onPKEnd;
|
|
3133
|
-
/**
|
|
3134
|
-
* 处理跨房间连麦相关消息
|
|
3135
|
-
*/
|
|
3136
|
-
private _onRecvPKMsg;
|
|
2982
|
+
VIDEO = 0,
|
|
3137
2983
|
/**
|
|
3138
|
-
*
|
|
2984
|
+
* 音频直播
|
|
3139
2985
|
*/
|
|
3140
|
-
|
|
2986
|
+
AUDIO = 1
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2989
|
+
interface IAudienceRoomEventListener extends IRCRTCTrackEventListener {
|
|
3141
2990
|
/**
|
|
3142
|
-
*
|
|
3143
|
-
* @param
|
|
3144
|
-
* @param inviteeUserId 被邀请者 userId
|
|
3145
|
-
* @param options.autoMix 是否将本房间资源合并到被邀请者所处房间的 MCU 合流中
|
|
3146
|
-
* @param options.extra 拓展字段,可随邀请连麦消息透传给被邀请者
|
|
2991
|
+
* 主播加入
|
|
2992
|
+
* @param userIds 加入主播的 id 列表
|
|
3147
2993
|
*/
|
|
3148
|
-
|
|
3149
|
-
code: RCRTCCode | ErrorCode;
|
|
3150
|
-
}>;
|
|
2994
|
+
onAnchorJoin?(userId: string[]): void;
|
|
3151
2995
|
/**
|
|
3152
|
-
*
|
|
3153
|
-
* @param
|
|
3154
|
-
* @param inviteeUserId 被邀请者 userId
|
|
3155
|
-
* @param extra 附加信息,可随取消邀请连麦消息透传给被邀请者
|
|
2996
|
+
* 主播退出
|
|
2997
|
+
* @param userIds 退出主播的 id 列表
|
|
3156
2998
|
*/
|
|
3157
|
-
|
|
3158
|
-
code: RCRTCCode | ErrorCode;
|
|
3159
|
-
}>;
|
|
2999
|
+
onAnchorLeave?(userId: string[]): void;
|
|
3160
3000
|
/**
|
|
3161
|
-
*
|
|
3162
|
-
* @param
|
|
3163
|
-
* @
|
|
3164
|
-
*
|
|
3165
|
-
* @param options.autoMix 是否将本房间资源合并到邀请者所处房间的 MCU 合流中
|
|
3166
|
-
* @param options.extra 附加信息,可随响应连麦消息透传给邀请者
|
|
3001
|
+
* 房间内合流发布资源
|
|
3002
|
+
* @param tracks 新发布的合流音轨与视轨数据列表,包含新发布的 RCRemoteAudioTrack 与 RCRemoteVideoTrack 实例
|
|
3003
|
+
* @description
|
|
3004
|
+
* 当房间内某个主播第一次发布资源时触发
|
|
3167
3005
|
*/
|
|
3168
|
-
|
|
3169
|
-
code: RCRTCCode | ErrorCode;
|
|
3170
|
-
}>;
|
|
3006
|
+
onTrackPublish?(tracks: RCRemoteTrack[]): void;
|
|
3171
3007
|
/**
|
|
3172
|
-
*
|
|
3173
|
-
* @
|
|
3008
|
+
* 房间内取消合流发布资源
|
|
3009
|
+
* @param tracks 被取消发布的合流音轨与视轨数据列表
|
|
3010
|
+
* @description
|
|
3011
|
+
* 当房间内全部主播退出房间时,SDK 内部会取消对资源的订阅,业务层仅需处理 UI 业务
|
|
3174
3012
|
*/
|
|
3175
|
-
|
|
3176
|
-
code: RCRTCCode;
|
|
3177
|
-
room?: RCLivingRoom;
|
|
3178
|
-
userIds?: string[];
|
|
3179
|
-
tracks?: RCRemoteTrack[];
|
|
3180
|
-
CDNEnable?: boolean;
|
|
3181
|
-
}>;
|
|
3013
|
+
onTrackUnpublish?(tracks: RCRemoteTrack[]): void;
|
|
3182
3014
|
/**
|
|
3183
|
-
*
|
|
3184
|
-
* @param
|
|
3185
|
-
* @param isQuitPK 是否要结束连麦
|
|
3015
|
+
* 房间内主播发布资源
|
|
3016
|
+
* @param tracks 主播新发布的音轨与视轨数据列表,包含新发布的 RCRemoteAudioTrack 与 RCRemoteVideoTrack 实例
|
|
3186
3017
|
*/
|
|
3187
|
-
|
|
3188
|
-
code: RCRTCCode;
|
|
3189
|
-
}>;
|
|
3018
|
+
onAnchorTrackPublish?(tracks: RCRemoteTrack[]): void;
|
|
3190
3019
|
/**
|
|
3191
|
-
*
|
|
3192
|
-
* @param
|
|
3020
|
+
* 房间内主播取消发布资源
|
|
3021
|
+
* @param tracks 被主播取消发布的音轨与视轨数据列表
|
|
3022
|
+
* @description 当资源被取消发布时,SDK 内部会取消对相关资源的订阅,业务层仅需处理 UI 业务
|
|
3193
3023
|
*/
|
|
3194
|
-
|
|
3195
|
-
inviteSessionId: string;
|
|
3196
|
-
inviterRoomId: string;
|
|
3197
|
-
inviterUserId: string;
|
|
3198
|
-
inviterUserAutoMix?: boolean | undefined;
|
|
3199
|
-
inviteeRoomId: string;
|
|
3200
|
-
inviteeUserAutoMix?: boolean | undefined;
|
|
3201
|
-
};
|
|
3024
|
+
onAnchorTrackUnpublish?(tracks: RCRemoteTrack[]): void;
|
|
3202
3025
|
/**
|
|
3203
|
-
*
|
|
3026
|
+
* 房间主播禁用/启用音频
|
|
3027
|
+
* @param audioTrack RCRemoteAudioTrack 类实例
|
|
3204
3028
|
*/
|
|
3205
|
-
|
|
3029
|
+
onAudioMuteChange?(audioTrack: RCRemoteAudioTrack): void;
|
|
3206
3030
|
/**
|
|
3207
|
-
|
|
3031
|
+
* 房间主播禁用/启用视频
|
|
3032
|
+
* @param videoTrack RCRemoteVideoTrack 类实例对象
|
|
3033
|
+
*/
|
|
3034
|
+
onVideoMuteChange?(videoTrack: RCRemoteVideoTrack): void;
|
|
3035
|
+
/**
|
|
3036
|
+
* 房间内主播把发布的资源推至 CDN
|
|
3208
3037
|
*/
|
|
3209
|
-
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
}
|
|
3213
|
-
|
|
3214
|
-
declare type ResourceMsgContent = {
|
|
3038
|
+
onCDNInfoEnable?(CDNInfo: {
|
|
3039
|
+
resolution: RCResolution;
|
|
3040
|
+
fps: RCFrameRate;
|
|
3041
|
+
}): void;
|
|
3215
3042
|
/**
|
|
3216
|
-
*
|
|
3217
|
-
* * ignore 值为 `true` 表示该消息由 signal server 向旧版本 RTCLib 提供的兼容消息,无需处理
|
|
3218
|
-
* * 否则认为该消息是由旧版本 RTCLib 主动发出的增量变更消息,需要处理
|
|
3043
|
+
* 主播停止推 CDN
|
|
3219
3044
|
*/
|
|
3220
|
-
|
|
3045
|
+
onCDNInfoDisable?(): void;
|
|
3221
3046
|
/**
|
|
3222
|
-
*
|
|
3047
|
+
* 主播改变推 CDN 的分辨率或帧率
|
|
3223
3048
|
*/
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3049
|
+
onCDNInfoChange?(CDNInfo: {
|
|
3050
|
+
resolution: RCResolution;
|
|
3051
|
+
fps: RCFrameRate;
|
|
3052
|
+
}): void;
|
|
3053
|
+
}
|
|
3228
3054
|
/**
|
|
3229
|
-
*
|
|
3055
|
+
* 观众直播房间类
|
|
3056
|
+
* 处理:
|
|
3057
|
+
* 1、通知观众房间内 人员变更、资源变更
|
|
3058
|
+
* 2、观众订阅、取消订阅资源
|
|
3230
3059
|
*/
|
|
3231
|
-
declare
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
readonly
|
|
3235
|
-
|
|
3236
|
-
|
|
3060
|
+
declare class RCAudienceLivingRoom {
|
|
3061
|
+
private readonly _context;
|
|
3062
|
+
private readonly _runtime;
|
|
3063
|
+
private readonly _initOptions;
|
|
3064
|
+
private readonly _roomId;
|
|
3065
|
+
private readonly _joinResData;
|
|
3066
|
+
readonly livingType: RCLivingType;
|
|
3237
3067
|
protected readonly _clientSessionId: string;
|
|
3068
|
+
private readonly _service;
|
|
3238
3069
|
/**
|
|
3239
|
-
*
|
|
3070
|
+
* 主播列表
|
|
3240
3071
|
*/
|
|
3241
|
-
private
|
|
3072
|
+
private _roomAnchorList;
|
|
3242
3073
|
/**
|
|
3243
|
-
*
|
|
3074
|
+
* 合流、分流资源
|
|
3244
3075
|
*/
|
|
3245
|
-
|
|
3076
|
+
private _roomRes;
|
|
3246
3077
|
/**
|
|
3247
|
-
*
|
|
3078
|
+
* 主播分流资源
|
|
3248
3079
|
*/
|
|
3249
|
-
private
|
|
3250
|
-
protected readonly _peerConnection: RCRTCPeerConnection;
|
|
3251
|
-
protected readonly _invoker: Invoker;
|
|
3252
|
-
protected readonly _store: ReadableStore;
|
|
3253
|
-
private readonly _reportMediaActionLogger;
|
|
3254
|
-
protected readonly _logger: BasicLogger;
|
|
3255
|
-
protected readonly _executeCtx: CommandExecuteContext;
|
|
3080
|
+
private _roomAnchorRes;
|
|
3256
3081
|
/**
|
|
3257
|
-
*
|
|
3258
|
-
* @param {RTCContext} _context - RTC上下文,
|
|
3259
|
-
* @param {IRuntime} _runtime - 运行时
|
|
3260
|
-
* @param {string} _roomId - 房间号
|
|
3261
|
-
* @param {RTCMode} _roomMode - RTC模式,
|
|
3262
|
-
* @param {RCMediaService} _service - RCMediaService
|
|
3263
|
-
* @param {IRCRTCInitOptions} _initOptions - IRCRTCInitOptions
|
|
3264
|
-
* @param {boolean} [isUpgrade] - 是否是升级,如果是升级则不会创建新的peerConnection
|
|
3265
|
-
* @param {boolean} [isMainRoom] - 无论是主房间,主房间都是用户创建的房间,子房间是用户创建的房间。
|
|
3266
|
-
* @param {string} _clientSessionId - 客户端会话 ID,用于标识客户端。
|
|
3082
|
+
* 合流、分流 remoteTracks
|
|
3267
3083
|
*/
|
|
3268
|
-
|
|
3084
|
+
private _remoteTracks;
|
|
3085
|
+
private _appListener;
|
|
3086
|
+
private readonly _pc;
|
|
3087
|
+
private _subscribedList;
|
|
3088
|
+
private _sessionId;
|
|
3089
|
+
private _destroyed;
|
|
3269
3090
|
/**
|
|
3270
|
-
*
|
|
3091
|
+
* 北极星上报实例
|
|
3271
3092
|
*/
|
|
3272
|
-
|
|
3273
|
-
/** 注册命令执行中的事件监听器 */
|
|
3274
|
-
private setCommandEventListener;
|
|
3093
|
+
protected readonly _polarisReport: PolarisReporter;
|
|
3275
3094
|
/**
|
|
3276
|
-
*
|
|
3277
|
-
* @param roomId 房间 id
|
|
3095
|
+
* 音量上报实例
|
|
3278
3096
|
*/
|
|
3279
|
-
private
|
|
3097
|
+
private readonly _audioLevelReport;
|
|
3280
3098
|
/**
|
|
3281
|
-
*
|
|
3099
|
+
* cdn_uris 资源
|
|
3282
3100
|
*/
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
private
|
|
3101
|
+
private _CDNUris;
|
|
3102
|
+
private _isPulling;
|
|
3103
|
+
private _pullTime;
|
|
3104
|
+
private readonly _store;
|
|
3105
|
+
private _crtUserId;
|
|
3106
|
+
private readonly _reportMediaActionLogger;
|
|
3289
3107
|
/**
|
|
3290
|
-
*
|
|
3291
|
-
* @deprecated use RCLocalTrack.setBitrate instead of setBitrate
|
|
3292
|
-
* @description
|
|
3293
|
-
* * 自 v5.1.0 版本开始,推荐使用 `RCLocalTrack.setBitrate` 对不同流分别指定码率。
|
|
3294
|
-
* * 该方法仅在 SDP `plan-b` 协议下(Chrome 92 与 Safari 11 之前的版本)有效。
|
|
3295
|
-
* @param max 音视频发送码率上限,不可小于 200 且不可小于 `min`
|
|
3296
|
-
* @param min 音视频发送码率下限,默认值为 1,且不可小于 1,不可大于 `max`
|
|
3297
|
-
* @param start 起始码率,默认为码率上限的 70%
|
|
3108
|
+
* track 对应的 mediaServer 信息
|
|
3298
3109
|
*/
|
|
3299
|
-
|
|
3300
|
-
private
|
|
3301
|
-
|
|
3302
|
-
|
|
3110
|
+
private _trackMediaMap;
|
|
3111
|
+
private readonly _logger;
|
|
3112
|
+
constructor(_context: RTCContext, _runtime: IRuntime, _initOptions: IRCRTCInitOptions, _roomId: string, _joinResData: {
|
|
3113
|
+
token: string;
|
|
3114
|
+
kvEntries: IServerRTCRoomEntry[];
|
|
3115
|
+
}, livingType: RCLivingType, _clientSessionId?: string);
|
|
3116
|
+
private _startPull;
|
|
3303
3117
|
/**
|
|
3304
|
-
*
|
|
3118
|
+
* 解析服务端返回的 KV 数据,赋值 room 内数据
|
|
3305
3119
|
*/
|
|
3306
|
-
|
|
3120
|
+
private _setInitData;
|
|
3121
|
+
protected _assertRoomDestroyed(): RCRTCCode | undefined;
|
|
3307
3122
|
/**
|
|
3308
|
-
*
|
|
3309
|
-
* @param
|
|
3310
|
-
*
|
|
3311
|
-
* *
|
|
3312
|
-
*
|
|
3123
|
+
* @description 信令数据处理
|
|
3124
|
+
* @param roomId 数据对应的房间 Id
|
|
3125
|
+
* @param singalData 拉取到的数据
|
|
3126
|
+
* * key RC_ANCHOR_LIST value: 为主播 ID 集合
|
|
3127
|
+
* * key RC_RES_`userId` value: 为主播发布的资源
|
|
3128
|
+
* * key RC_RTC_SESSIONID value: sessionId
|
|
3129
|
+
* * key RC_CDN value: CDN 资源数据
|
|
3313
3130
|
*/
|
|
3314
|
-
|
|
3315
|
-
private _rtcpeerClosed;
|
|
3316
|
-
private _onReceiveAsrSeiContent;
|
|
3131
|
+
private singalDataChange;
|
|
3317
3132
|
/**
|
|
3318
|
-
*
|
|
3319
|
-
* @param content
|
|
3320
|
-
* @param messageType 消息类型
|
|
3321
|
-
* @param userId 消息发送者
|
|
3133
|
+
* 计算加入离开的主播 ID 列表
|
|
3322
3134
|
*/
|
|
3323
|
-
|
|
3324
|
-
private
|
|
3135
|
+
private _diffAnchorList;
|
|
3136
|
+
private _handleNewJoinedAnchor;
|
|
3137
|
+
private _handleLeftedAnchor;
|
|
3325
3138
|
/**
|
|
3326
|
-
*
|
|
3327
|
-
* @param content
|
|
3139
|
+
* 计算新发布和取消发布的合流资源
|
|
3328
3140
|
*/
|
|
3329
|
-
private
|
|
3141
|
+
private _diffRoomResource;
|
|
3330
3142
|
/**
|
|
3331
|
-
*
|
|
3143
|
+
* 处理主播资源的新增发布
|
|
3332
3144
|
*/
|
|
3333
|
-
private
|
|
3145
|
+
private _dealPublished;
|
|
3334
3146
|
/**
|
|
3335
|
-
*
|
|
3147
|
+
* 处理主播资源的取消发布
|
|
3336
3148
|
*/
|
|
3337
|
-
|
|
3149
|
+
private _dealUnpublished;
|
|
3338
3150
|
/**
|
|
3339
|
-
*
|
|
3151
|
+
* 处理主播资源的变更
|
|
3340
3152
|
*/
|
|
3341
|
-
|
|
3153
|
+
private _dealModified;
|
|
3342
3154
|
/**
|
|
3343
|
-
*
|
|
3155
|
+
* 计算主播发布和取消发布的资源,以及资源的状态变更
|
|
3156
|
+
*/
|
|
3157
|
+
private _diffAnchorResource;
|
|
3158
|
+
private _onUserUnpublish;
|
|
3159
|
+
private _callAppListener;
|
|
3160
|
+
/**
|
|
3161
|
+
* ice 断线后,尝试重新走 exchange
|
|
3162
|
+
*/
|
|
3163
|
+
private _reTryExchange;
|
|
3164
|
+
/**
|
|
3165
|
+
* 获取 subscribe 接口的请求体数据
|
|
3166
|
+
* @param subscribeList 订阅清单
|
|
3167
|
+
* @param publishedStreams 已发布流
|
|
3168
|
+
* @param iceRestart
|
|
3344
3169
|
*/
|
|
3345
|
-
|
|
3170
|
+
protected _createSubscribeParams(subscribeList: ISubscribeAttr[], publishedStreams: {
|
|
3171
|
+
[msid: string]: RCLocalMediaStream;
|
|
3172
|
+
}, iceRestart: boolean): Promise<{
|
|
3173
|
+
reqBody: IBroadcastSubReqBody;
|
|
3174
|
+
offer: RTCSessionDescriptionInit;
|
|
3175
|
+
dynamicBitrate: {
|
|
3176
|
+
min: number;
|
|
3177
|
+
max: number;
|
|
3178
|
+
};
|
|
3179
|
+
}>;
|
|
3180
|
+
private _subscribeHandle;
|
|
3346
3181
|
/**
|
|
3347
|
-
*
|
|
3348
|
-
* @returns
|
|
3182
|
+
* 添加 peerConnection 事件
|
|
3349
3183
|
*/
|
|
3350
|
-
|
|
3184
|
+
private _addPeerCEvent;
|
|
3185
|
+
private _getReqHeaders;
|
|
3186
|
+
private _exchangeHandle;
|
|
3187
|
+
private _dealSubscribeResult;
|
|
3351
3188
|
/**
|
|
3352
|
-
*
|
|
3353
|
-
* @param userId
|
|
3354
|
-
* @returns
|
|
3189
|
+
* 去重、转化参数格式为 ISubscribeAttr
|
|
3355
3190
|
*/
|
|
3356
|
-
|
|
3191
|
+
private _getParams;
|
|
3192
|
+
private _reportPubOrSubQualityData;
|
|
3193
|
+
private _updateSubListHandle;
|
|
3357
3194
|
/**
|
|
3358
|
-
*
|
|
3195
|
+
* 对比 cdn_uris 资源
|
|
3196
|
+
* @param newCDNUris 新的 cdn_uris 数据
|
|
3359
3197
|
*/
|
|
3360
|
-
|
|
3198
|
+
private _diffCDNUris;
|
|
3361
3199
|
/**
|
|
3362
|
-
*
|
|
3363
|
-
*
|
|
3364
|
-
* @
|
|
3200
|
+
* 获取 CDN 资源对应的拉流地址
|
|
3201
|
+
* _CDNUris 无 url 时,说明未开启 CDN 推送
|
|
3202
|
+
* @returns CDNPlayUrl
|
|
3365
3203
|
*/
|
|
3366
|
-
|
|
3367
|
-
code: RCRTCCode;
|
|
3368
|
-
}>;
|
|
3204
|
+
private _getCDNPlayUrl;
|
|
3369
3205
|
/**
|
|
3370
|
-
*
|
|
3371
|
-
* @
|
|
3372
|
-
* @param value 属性值
|
|
3373
|
-
* @param message 是否在设置属性的时候携带消息内容,传空则不往房间中发送消息
|
|
3374
|
-
* @param isInner RTC 业务内部使用参数,用户忽略
|
|
3206
|
+
* 获取 CDN 资源对应的拉流地址
|
|
3207
|
+
* @returns CDNPlayUrl
|
|
3375
3208
|
*/
|
|
3376
|
-
|
|
3377
|
-
name: string;
|
|
3378
|
-
content: string;
|
|
3379
|
-
}, isInner?: boolean): Promise<{
|
|
3209
|
+
getCDNPlayUrl(resolution?: RCResolution, fps?: RCFrameRate): Promise<{
|
|
3380
3210
|
code: RCRTCCode;
|
|
3211
|
+
CDNPlayUrl?: string;
|
|
3381
3212
|
}>;
|
|
3382
3213
|
/**
|
|
3383
|
-
*
|
|
3384
|
-
* @param
|
|
3385
|
-
* @param message 是否在删除属性的时候携带消息内容,传空则不往房间中发送消息
|
|
3386
|
-
* @param isInner RTC 业务内部使用参数,用户忽略
|
|
3214
|
+
* 订阅资源
|
|
3215
|
+
* @param tracks
|
|
3387
3216
|
*/
|
|
3388
|
-
|
|
3389
|
-
name: string;
|
|
3390
|
-
content: string;
|
|
3391
|
-
}, isInner?: boolean): Promise<{
|
|
3217
|
+
subscribe(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
3392
3218
|
code: RCRTCCode;
|
|
3219
|
+
failedList?: ISubscribeAttr[];
|
|
3393
3220
|
}>;
|
|
3221
|
+
private __unsubscribe;
|
|
3394
3222
|
/**
|
|
3395
|
-
*
|
|
3396
|
-
* @param
|
|
3397
|
-
* @param isInner RTC 业务内部使用参数,用户忽略
|
|
3223
|
+
* 取消订阅资源
|
|
3224
|
+
* @param tracks
|
|
3398
3225
|
*/
|
|
3399
|
-
|
|
3226
|
+
unsubscribe(tracks: RCRemoteTrack[]): Promise<{
|
|
3400
3227
|
code: RCRTCCode;
|
|
3401
|
-
|
|
3228
|
+
failedList?: ISubscribeAttr[];
|
|
3402
3229
|
}>;
|
|
3403
3230
|
/**
|
|
3404
|
-
*
|
|
3405
|
-
* @
|
|
3406
|
-
* @param value 属性值
|
|
3407
|
-
* @param message 是否在设置属性的时候携带消息内容,传空则不往房间中发送消息
|
|
3408
|
-
*/
|
|
3409
|
-
private _setUserAttributeValue;
|
|
3410
|
-
/**
|
|
3411
|
-
* 删除当前用户属性(暂不开放)
|
|
3412
|
-
* @param keys 待删除的属性名数组
|
|
3413
|
-
* @param message 是否在删除属性的时候携带消息内容,传空则不往房间中发送消息
|
|
3231
|
+
* 退出房间并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
3232
|
+
* @private
|
|
3414
3233
|
*/
|
|
3415
|
-
|
|
3234
|
+
__destroy(quitRoom: boolean): Promise<void>;
|
|
3416
3235
|
/**
|
|
3417
|
-
*
|
|
3418
|
-
* @param
|
|
3236
|
+
* 根据 trackId 获取房间内的远端资源
|
|
3237
|
+
* @param trackId
|
|
3419
3238
|
*/
|
|
3420
|
-
|
|
3239
|
+
getRemoteTrack(trackId: string): RCRemoteTrack;
|
|
3421
3240
|
/**
|
|
3422
|
-
*
|
|
3241
|
+
* TODO 待优化
|
|
3242
|
+
* @param trackId
|
|
3423
3243
|
*/
|
|
3424
|
-
|
|
3244
|
+
getLocalTrack(trackId: string): RCRemoteTrack;
|
|
3425
3245
|
/**
|
|
3426
|
-
*
|
|
3246
|
+
* 断线重连后处理逻辑, SDK 内部处理调用
|
|
3427
3247
|
* @private
|
|
3428
3248
|
*/
|
|
3429
|
-
|
|
3430
|
-
/**
|
|
3431
|
-
* 退出房间之前禁用所有远端资源,避免退出动作耗时过长,
|
|
3432
|
-
* 导致在未完全退出的过程中仍能听到房间内的声音问题
|
|
3433
|
-
*/
|
|
3434
|
-
private _muteRemoteTracksBeforeQuit;
|
|
3435
|
-
private _leaveHandle;
|
|
3249
|
+
__onReconnected(): Promise<void>;
|
|
3436
3250
|
/**
|
|
3437
|
-
*
|
|
3251
|
+
* 观众房间事件注册
|
|
3252
|
+
* @param tag 参数描述
|
|
3438
3253
|
*/
|
|
3439
|
-
|
|
3440
|
-
private _onLocalTrackDestroied;
|
|
3254
|
+
registerRoomEventListener(listener: IAudienceRoomEventListener | null): void;
|
|
3441
3255
|
/**
|
|
3442
|
-
*
|
|
3443
|
-
* @param
|
|
3256
|
+
* 音量上报
|
|
3257
|
+
* @param handler 业务端传入的音量上报事件
|
|
3258
|
+
* @param _ - 参数已废弃
|
|
3444
3259
|
*/
|
|
3445
|
-
|
|
3260
|
+
onAudioLevelChange(handler: IAudioLevelChangeHandler | null, _?: number): void;
|
|
3261
|
+
private _reportListener;
|
|
3446
3262
|
/**
|
|
3447
|
-
*
|
|
3448
|
-
* @param
|
|
3449
|
-
* @returns
|
|
3263
|
+
* 注册房间数据监控
|
|
3264
|
+
* @param listener
|
|
3450
3265
|
*/
|
|
3451
|
-
|
|
3266
|
+
registerReportListener(listener: IRCRTCReportListener | null): void;
|
|
3452
3267
|
/**
|
|
3453
|
-
*
|
|
3268
|
+
* 获取房间 Id
|
|
3454
3269
|
*/
|
|
3455
|
-
|
|
3270
|
+
getRoomId(): string;
|
|
3456
3271
|
/**
|
|
3457
|
-
*
|
|
3272
|
+
* 获取当前 userId
|
|
3458
3273
|
*/
|
|
3459
|
-
|
|
3274
|
+
getCrtUserId(): string;
|
|
3460
3275
|
/**
|
|
3461
|
-
*
|
|
3462
|
-
* @param tracks 取消发布的 RCLocalTrack 列表
|
|
3276
|
+
* 获取房间当前会话 Id,当房间内已无成员时房间会回收,重新加入时 sessionId 将更新
|
|
3463
3277
|
*/
|
|
3464
|
-
|
|
3278
|
+
getSessionId(): string;
|
|
3465
3279
|
/**
|
|
3466
|
-
*
|
|
3467
|
-
* @param resourceId
|
|
3280
|
+
* 获取远程主播用户列表
|
|
3468
3281
|
*/
|
|
3469
|
-
|
|
3282
|
+
getRemoteUserIds(): string[];
|
|
3470
3283
|
/**
|
|
3471
|
-
*
|
|
3472
|
-
* @param
|
|
3284
|
+
* 获取远端用户的资源列表
|
|
3285
|
+
* @param userId
|
|
3286
|
+
* @returns
|
|
3473
3287
|
*/
|
|
3474
|
-
|
|
3475
|
-
code: RCRTCCode;
|
|
3476
|
-
failedList?: ISubscribeAttr[];
|
|
3477
|
-
}>;
|
|
3288
|
+
getRemoteTracksByUserId(userId: string): RCRemoteTrack[];
|
|
3478
3289
|
/**
|
|
3479
|
-
*
|
|
3480
|
-
* @
|
|
3290
|
+
* 获取房间内所有已发布的远端资源列表, 包含合流资源
|
|
3291
|
+
* @returns
|
|
3481
3292
|
*/
|
|
3482
|
-
|
|
3483
|
-
code: RCRTCCode;
|
|
3484
|
-
failedList?: ISubscribeAttr[];
|
|
3485
|
-
}>;
|
|
3293
|
+
getRemoteTracks(): RCRemoteTrack[];
|
|
3486
3294
|
/**
|
|
3487
|
-
*
|
|
3488
|
-
* 当参数为 `[]` 时,意味着不再订阅任何资源
|
|
3489
|
-
* @param tracks 变更的资源列表
|
|
3295
|
+
* 获取远端 RTC tracks
|
|
3490
3296
|
*/
|
|
3491
|
-
|
|
3492
|
-
code: RCRTCCode;
|
|
3493
|
-
failedList?: ISubscribeAttr[];
|
|
3494
|
-
}>;
|
|
3297
|
+
getRemoteRTCTracks(): RCRemoteTrack[];
|
|
3495
3298
|
/**
|
|
3496
|
-
*
|
|
3497
|
-
* @param trackId
|
|
3498
|
-
* @returns
|
|
3299
|
+
* 获取远端 MCU tracks
|
|
3499
3300
|
*/
|
|
3500
|
-
|
|
3301
|
+
getRemoteMCUTracks(): RCRemoteTrack[];
|
|
3501
3302
|
/**
|
|
3502
|
-
*
|
|
3303
|
+
* 获取房间内 CDN 信息
|
|
3503
3304
|
*/
|
|
3504
|
-
|
|
3305
|
+
getCDNInfo(): {
|
|
3306
|
+
resolution: RCResolution;
|
|
3307
|
+
fps: RCFrameRate;
|
|
3308
|
+
CDNEnable: boolean | undefined;
|
|
3309
|
+
} | {
|
|
3310
|
+
CDNEnable: boolean;
|
|
3311
|
+
resolution?: undefined;
|
|
3312
|
+
fps?: undefined;
|
|
3313
|
+
};
|
|
3314
|
+
getClientSessionId(): string;
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
/**
|
|
3318
|
+
* 北极星上报角色
|
|
3319
|
+
*/
|
|
3320
|
+
declare enum PolarisRole {
|
|
3505
3321
|
/**
|
|
3506
|
-
*
|
|
3507
|
-
* @param trackId
|
|
3508
|
-
* @returns
|
|
3322
|
+
* 会议参会者、主播
|
|
3509
3323
|
*/
|
|
3510
|
-
|
|
3324
|
+
MeetingOrAnchor = 1,
|
|
3511
3325
|
/**
|
|
3512
|
-
*
|
|
3513
|
-
* returns subscribedTracks ISubscribeAttr[]
|
|
3326
|
+
* 观众
|
|
3514
3327
|
*/
|
|
3515
|
-
|
|
3516
|
-
|
|
3328
|
+
Audience = 2
|
|
3329
|
+
}
|
|
3330
|
+
|
|
3331
|
+
declare class PolarisReporter {
|
|
3332
|
+
private readonly _context;
|
|
3333
|
+
private readonly _runtime;
|
|
3334
|
+
private readonly _roomId;
|
|
3335
|
+
private readonly _crtRTCRoom;
|
|
3336
|
+
private readonly _userRole;
|
|
3337
|
+
constructor(_context: RTCContext, _runtime: IRuntime, _roomId: string, _crtRTCRoom: RCAbstractRoom | RCAudienceLivingRoom, _userRole?: PolarisRole);
|
|
3338
|
+
private _send;
|
|
3339
|
+
private _getClientID;
|
|
3517
3340
|
/**
|
|
3518
|
-
*
|
|
3519
|
-
* @param listener
|
|
3341
|
+
* 小流需去掉 _tiny,小流 resourceId 为 userId_tag_mediaType_tiny
|
|
3520
3342
|
*/
|
|
3521
|
-
|
|
3343
|
+
private _getRealResourceId;
|
|
3522
3344
|
/**
|
|
3523
|
-
*
|
|
3524
|
-
* @param
|
|
3525
|
-
* @description 该方法暂仅支持 Chrome 浏览器
|
|
3345
|
+
* 生成北极星上报的 trackId
|
|
3346
|
+
* @param resourceId userId_11_1_tiny 改为 userId_11_tiny_video
|
|
3526
3347
|
*/
|
|
3527
|
-
|
|
3348
|
+
private _getPolarisTrackId;
|
|
3528
3349
|
/**
|
|
3529
|
-
*
|
|
3530
|
-
* @param handler 音量事件监听函数
|
|
3531
|
-
* @param _ - 参数已废弃,SDK 默认以每秒一次进行回调~~上报时间间隔~~
|
|
3350
|
+
* 上下行 track 包含的公共字段
|
|
3532
3351
|
*/
|
|
3533
|
-
|
|
3352
|
+
private _getBaseData;
|
|
3353
|
+
private _getAudioLevel;
|
|
3354
|
+
private _getBitrate;
|
|
3355
|
+
private _getPacketsLostRate;
|
|
3356
|
+
private _getFrameRate;
|
|
3357
|
+
private _getResolution;
|
|
3358
|
+
private _getJitter;
|
|
3359
|
+
private _getNackCount;
|
|
3360
|
+
private _getPliCount;
|
|
3361
|
+
private _getRTT;
|
|
3362
|
+
private _getTrackState;
|
|
3534
3363
|
/**
|
|
3535
|
-
*
|
|
3364
|
+
* 发送上行音视频资源数据
|
|
3365
|
+
* @param data peerConnection stats 解析出来业务所需的所有字段
|
|
3536
3366
|
*/
|
|
3367
|
+
sendR3Data(data: IInnerRCRTCStateReport): Promise<RCSendCode>;
|
|
3537
3368
|
/**
|
|
3538
|
-
*
|
|
3539
|
-
* @param
|
|
3369
|
+
* 发送下行音视频资源数据
|
|
3370
|
+
* @param data peerConnection stats 解析出来业务所需的所有字段
|
|
3540
3371
|
*/
|
|
3541
|
-
|
|
3542
|
-
private _onAudioMuteChange;
|
|
3543
|
-
private _onVideoMuteChange;
|
|
3372
|
+
sendR4Data(data: IInnerRCRTCStateReport): Promise<RCSendCode>;
|
|
3544
3373
|
/**
|
|
3545
|
-
*
|
|
3374
|
+
* 加入房间
|
|
3546
3375
|
*/
|
|
3547
|
-
|
|
3376
|
+
sendR1(): void;
|
|
3548
3377
|
/**
|
|
3549
|
-
*
|
|
3378
|
+
* RTC 和 LIVE 发布、取消发布
|
|
3379
|
+
* RTC 订阅、取消订阅
|
|
3550
3380
|
*/
|
|
3551
|
-
|
|
3381
|
+
sendR2(action: string, status: string, trackIds: string[]): void;
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
/**
|
|
3385
|
+
* PC 实例管理类
|
|
3386
|
+
*/
|
|
3387
|
+
declare class RCRTCPeerConnection extends EventEmitter {
|
|
3388
|
+
private _logger;
|
|
3552
3389
|
/**
|
|
3553
|
-
*
|
|
3390
|
+
* _reTryExchange 方法
|
|
3554
3391
|
*/
|
|
3555
|
-
|
|
3556
|
-
getClientSessionId(): string;
|
|
3392
|
+
private readonly _reTryExchange;
|
|
3557
3393
|
/**
|
|
3558
|
-
*
|
|
3559
|
-
* @param oldTrack 已经发布的视频轨道或音频轨道
|
|
3560
|
-
* @param newTrack 从新设备获取的视频轨道或音频轨道
|
|
3561
|
-
* @returns code 切换结果,RCRTCCode.SUCCESS 表示切换成功
|
|
3394
|
+
* 当前用户 id
|
|
3562
3395
|
*/
|
|
3563
|
-
|
|
3564
|
-
code: RCRTCCode;
|
|
3565
|
-
}>;
|
|
3396
|
+
private readonly _currentUserId;
|
|
3566
3397
|
/**
|
|
3567
|
-
*
|
|
3568
|
-
* @param srcLanguage 语言代码
|
|
3569
|
-
* @description 需要在 `setEnableASR` 开启语音识别接口之前调用
|
|
3570
|
-
* @return
|
|
3398
|
+
* store 实例
|
|
3571
3399
|
*/
|
|
3572
|
-
|
|
3400
|
+
private readonly _store;
|
|
3573
3401
|
/**
|
|
3574
|
-
*
|
|
3575
|
-
* @returns
|
|
3402
|
+
* 北极星上传实例
|
|
3576
3403
|
*/
|
|
3577
|
-
|
|
3578
|
-
code: RCRTCCode;
|
|
3579
|
-
}>;
|
|
3404
|
+
private readonly _polarisReport?;
|
|
3580
3405
|
/**
|
|
3581
|
-
*
|
|
3582
|
-
* @returns
|
|
3406
|
+
* 是否是房间内观众
|
|
3583
3407
|
*/
|
|
3584
|
-
|
|
3585
|
-
|
|
3586
|
-
|
|
3408
|
+
private readonly _isRoomAudience;
|
|
3409
|
+
static __INNER_EVENT_TRACK_READY__: string;
|
|
3410
|
+
static __INNER_AUDIOLEVEL_CHANGE__: string;
|
|
3411
|
+
static __INNER_ICE_STATE_CHANGE__: string;
|
|
3412
|
+
static __INNER_ICE_CONNECTED__: string;
|
|
3413
|
+
private readonly _rtcPeerConn;
|
|
3414
|
+
private readonly _sdpStrategy;
|
|
3415
|
+
reportParser: IStatParser | null;
|
|
3416
|
+
private pubLocalTracks;
|
|
3417
|
+
private _reTryExchangeTimer;
|
|
3418
|
+
private _reportStatsTimer;
|
|
3419
|
+
private _reportR3R4ToPolarisTimer;
|
|
3420
|
+
private _isDestroyed;
|
|
3421
|
+
private _formatStatsData?;
|
|
3422
|
+
constructor(_logger: BasicLogger,
|
|
3587
3423
|
/**
|
|
3588
|
-
*
|
|
3589
|
-
* @returns
|
|
3424
|
+
* _reTryExchange 方法
|
|
3590
3425
|
*/
|
|
3591
|
-
|
|
3426
|
+
_reTryExchange: () => Promise<ICommandResult<void>>,
|
|
3592
3427
|
/**
|
|
3593
|
-
*
|
|
3594
|
-
* @param enable 为 ture 时,sdk 会获取语音识别资源并解析,通过房间监听事件 `onReceiveASRContent` 事件,抛出语音识别内容
|
|
3595
|
-
* @description
|
|
3596
|
-
* @returns
|
|
3428
|
+
* 当前用户 id
|
|
3597
3429
|
*/
|
|
3598
|
-
|
|
3599
|
-
code: RCRTCCode;
|
|
3600
|
-
}>;
|
|
3430
|
+
_currentUserId: string,
|
|
3601
3431
|
/**
|
|
3602
|
-
*
|
|
3603
|
-
* @param destLangCode 翻译的目标语言
|
|
3604
|
-
* @description 执行时机:需在房间监听事件 `onReceiveStartASR` 中执行。
|
|
3605
|
-
* @description 执行条件:房间内语音识别资源被设置为可用
|
|
3606
|
-
* @returns
|
|
3432
|
+
* store 实例
|
|
3607
3433
|
*/
|
|
3608
|
-
|
|
3609
|
-
code: RCRTCCode;
|
|
3610
|
-
}>;
|
|
3434
|
+
_store: ReadableStore,
|
|
3611
3435
|
/**
|
|
3612
|
-
*
|
|
3613
|
-
* @returns
|
|
3436
|
+
* 北极星上传实例
|
|
3614
3437
|
*/
|
|
3615
|
-
|
|
3616
|
-
code: RCRTCCode;
|
|
3617
|
-
}>;
|
|
3618
|
-
}
|
|
3619
|
-
|
|
3620
|
-
declare class RCLocalMediaStream {
|
|
3621
|
-
readonly msid: string;
|
|
3622
|
-
readonly mediaStream: MediaStream;
|
|
3623
|
-
readonly tinyStream: MediaStream;
|
|
3624
|
-
readonly tag: string;
|
|
3625
|
-
constructor(msid: string);
|
|
3626
|
-
}
|
|
3627
|
-
|
|
3628
|
-
interface IAudienceRoomEventListener extends IRCRTCTrackEventListener {
|
|
3438
|
+
_polarisReport?: PolarisReporter | undefined,
|
|
3629
3439
|
/**
|
|
3630
|
-
*
|
|
3631
|
-
* @param userIds 加入主播的 id 列表
|
|
3440
|
+
* 是否是房间内观众
|
|
3632
3441
|
*/
|
|
3633
|
-
|
|
3442
|
+
_isRoomAudience?: boolean,
|
|
3634
3443
|
/**
|
|
3635
|
-
*
|
|
3636
|
-
* @param userIds 退出主播的 id 列表
|
|
3444
|
+
* 是否启用自定义加密
|
|
3637
3445
|
*/
|
|
3638
|
-
|
|
3446
|
+
encrypt?: boolean);
|
|
3447
|
+
getLocalTracks(): RCLocalTrack[];
|
|
3448
|
+
private _onConnectionStateChange;
|
|
3449
|
+
private startAutoExecute;
|
|
3450
|
+
private stopAutoExecute;
|
|
3451
|
+
private _onICEConnectionStateChange;
|
|
3452
|
+
private _inRetry;
|
|
3453
|
+
private _handleRetry;
|
|
3454
|
+
private _onTrackReady;
|
|
3639
3455
|
/**
|
|
3640
|
-
*
|
|
3641
|
-
* @param tracks 新发布的合流音轨与视轨数据列表,包含新发布的 RCRemoteAudioTrack 与 RCRemoteVideoTrack 实例
|
|
3642
|
-
* @description
|
|
3643
|
-
* 当房间内某个主播第一次发布资源时触发
|
|
3456
|
+
* @deprecated use RCLocalTrack.setBitrate instead of setBitrate
|
|
3644
3457
|
*/
|
|
3645
|
-
|
|
3458
|
+
setBitrate(max: number, min: number, start?: number): Promise<void>;
|
|
3646
3459
|
/**
|
|
3647
|
-
*
|
|
3648
|
-
* @param
|
|
3649
|
-
* @
|
|
3650
|
-
*
|
|
3460
|
+
* `createOffer` 是一个创建报价并记录报价 SDP 和 SDP 语义的函数
|
|
3461
|
+
* @param {boolean} iceRestart - 布尔值
|
|
3462
|
+
* @returns 具有两个属性的对象:
|
|
3463
|
+
* - sdp:SDP 字符串
|
|
3464
|
+
* - 语义:SDP 语义
|
|
3651
3465
|
*/
|
|
3652
|
-
|
|
3466
|
+
createOffer(iceRestart: boolean): Promise<IOfferInfo>;
|
|
3467
|
+
private _firstConnectFromPub;
|
|
3653
3468
|
/**
|
|
3654
|
-
*
|
|
3655
|
-
* @param
|
|
3469
|
+
* @param answer
|
|
3470
|
+
* @param fromPub 是否来自于发布动作,用来对外通知连接成功后统计
|
|
3656
3471
|
*/
|
|
3657
|
-
|
|
3472
|
+
setRemoteAnswer(answer: string, fromPub?: boolean): Promise<RCRTCCode>;
|
|
3473
|
+
getLocalTrack(trackId: string): RCLocalTrack | null;
|
|
3658
3474
|
/**
|
|
3659
|
-
*
|
|
3660
|
-
* @param
|
|
3661
|
-
* @description 当资源被取消发布时,SDK 内部会取消对相关资源的订阅,业务层仅需处理 UI 业务
|
|
3475
|
+
* 它将本地轨道添加到对等连接。
|
|
3476
|
+
* @param {RCLocalTrack} track - 要添加的本地轨道。
|
|
3662
3477
|
*/
|
|
3663
|
-
|
|
3478
|
+
addLocalTrack(track: RCLocalTrack): void;
|
|
3664
3479
|
/**
|
|
3665
|
-
*
|
|
3666
|
-
* @param
|
|
3480
|
+
* 按 ID 删除本地轨道
|
|
3481
|
+
* @param {string} trackId - 要移除的轨道的 ID。
|
|
3482
|
+
* @returns 正在删除的轨道。
|
|
3667
3483
|
*/
|
|
3668
|
-
|
|
3484
|
+
removeLocalTrackById(trackId: string): void;
|
|
3669
3485
|
/**
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
onVideoMuteChange?(videoTrack: RCRemoteVideoTrack): void;
|
|
3486
|
+
* 它会删除所有本地Track。
|
|
3487
|
+
*/
|
|
3488
|
+
removeAllLocalTrack(): void;
|
|
3674
3489
|
/**
|
|
3675
|
-
*
|
|
3490
|
+
* 从对等连接中删除本地轨道。
|
|
3491
|
+
* @param {RCLocalTrack} track - 要删除的本地轨道。
|
|
3676
3492
|
*/
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
}): void;
|
|
3493
|
+
removeLocalTrack(track: RCLocalTrack, isRemoveTiny?: boolean): void;
|
|
3494
|
+
private _updateRecvTransceiverMap;
|
|
3495
|
+
updateSubRemoteTracks(remoteTracks: RCRemoteTrack[]): void;
|
|
3681
3496
|
/**
|
|
3682
|
-
*
|
|
3497
|
+
* 获取当前已发布视频流信息
|
|
3683
3498
|
*/
|
|
3684
|
-
|
|
3499
|
+
getOutboundVideoInfo(): OutboundVideoInfo[];
|
|
3500
|
+
private _onLocalTrackMuted;
|
|
3501
|
+
private _onLocalTrackDestroied;
|
|
3502
|
+
private _reportListener;
|
|
3685
3503
|
/**
|
|
3686
|
-
*
|
|
3504
|
+
* 注册连接数据监控,开启质量数据上报定时器
|
|
3505
|
+
* @param listener
|
|
3687
3506
|
*/
|
|
3688
|
-
|
|
3689
|
-
resolution: RCResolution;
|
|
3690
|
-
fps: RCFrameRate;
|
|
3691
|
-
}): void;
|
|
3692
|
-
}
|
|
3693
|
-
/**
|
|
3694
|
-
* 观众直播房间类
|
|
3695
|
-
* 处理:
|
|
3696
|
-
* 1、通知观众房间内 人员变更、资源变更
|
|
3697
|
-
* 2、观众订阅、取消订阅资源
|
|
3698
|
-
*/
|
|
3699
|
-
declare class RCAudienceLivingRoom {
|
|
3700
|
-
private readonly _context;
|
|
3701
|
-
private readonly _runtime;
|
|
3702
|
-
private readonly _initOptions;
|
|
3703
|
-
private readonly _roomId;
|
|
3704
|
-
private readonly _joinResData;
|
|
3705
|
-
readonly livingType: RCLivingType;
|
|
3706
|
-
protected readonly _clientSessionId: string;
|
|
3707
|
-
private readonly _service;
|
|
3507
|
+
registerReportListener(listener: IRCRTCReportListener | null): void;
|
|
3708
3508
|
/**
|
|
3709
|
-
*
|
|
3509
|
+
* 组装上行质量报告数据
|
|
3710
3510
|
*/
|
|
3711
|
-
private
|
|
3511
|
+
private _createSenderReport;
|
|
3712
3512
|
/**
|
|
3713
|
-
*
|
|
3513
|
+
* 组装下行质量报告数据
|
|
3714
3514
|
*/
|
|
3715
|
-
private
|
|
3515
|
+
private _createReceiverReport;
|
|
3516
|
+
private _createRCRTCStateReport;
|
|
3716
3517
|
/**
|
|
3717
|
-
*
|
|
3518
|
+
* 获取 peerConnection stats 数据并格式化
|
|
3519
|
+
* @returns 返回格式化后的数据
|
|
3718
3520
|
*/
|
|
3719
|
-
private
|
|
3521
|
+
private _getStatsData;
|
|
3720
3522
|
/**
|
|
3721
|
-
*
|
|
3523
|
+
* 通知用户质量数据、peerConnection 北极星数据上报
|
|
3722
3524
|
*/
|
|
3723
|
-
private
|
|
3724
|
-
private _appListener;
|
|
3725
|
-
private readonly _pc;
|
|
3726
|
-
private _subscribedList;
|
|
3727
|
-
private _sessionId;
|
|
3728
|
-
private _destroyed;
|
|
3525
|
+
private _reportHandle;
|
|
3729
3526
|
/**
|
|
3730
|
-
*
|
|
3527
|
+
* 获取合流音源信息
|
|
3731
3528
|
*/
|
|
3732
|
-
|
|
3529
|
+
private _getLiveAudioState;
|
|
3733
3530
|
/**
|
|
3734
|
-
*
|
|
3531
|
+
* 北极星上报 R3、R4 数据
|
|
3735
3532
|
*/
|
|
3736
|
-
private
|
|
3533
|
+
private _sendR3R4Data;
|
|
3737
3534
|
/**
|
|
3738
|
-
*
|
|
3535
|
+
* 2s 给北极星上报一次 R3、R4
|
|
3739
3536
|
*/
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
private _pullTime;
|
|
3743
|
-
private readonly _store;
|
|
3744
|
-
private _crtUserId;
|
|
3745
|
-
private readonly _reportMediaActionLogger;
|
|
3537
|
+
__reportR3R4ToPolaris(): Promise<void>;
|
|
3538
|
+
getRTCPeerConn(): RTCPeerConnection;
|
|
3746
3539
|
/**
|
|
3747
|
-
*
|
|
3540
|
+
* 关闭 RTCPeerConnection 连接。其生命周期:
|
|
3541
|
+
* 1. 连接生命周期与房间实例一致(包含观众加房间),仅在退出房间时进行关闭。
|
|
3542
|
+
* 2. 观众客户端(观众不加房间)订阅时创建,取消订阅时销毁
|
|
3748
3543
|
*/
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3544
|
+
destroy(): void;
|
|
3545
|
+
clearReTryExchangeTimer(): void;
|
|
3546
|
+
isDestroyed(): boolean;
|
|
3547
|
+
}
|
|
3548
|
+
|
|
3549
|
+
/**
|
|
3550
|
+
* 命令执行上下文
|
|
3551
|
+
*/
|
|
3552
|
+
declare class CommandExecuteContext extends EventEmitter {
|
|
3756
3553
|
/**
|
|
3757
|
-
*
|
|
3554
|
+
* 日志工具
|
|
3758
3555
|
*/
|
|
3759
|
-
|
|
3760
|
-
protected _assertRoomDestroyed(): RCRTCCode | undefined;
|
|
3556
|
+
readonly logger: BasicLogger;
|
|
3761
3557
|
/**
|
|
3762
|
-
*
|
|
3763
|
-
* @param roomId 数据对应的房间 Id
|
|
3764
|
-
* @param singalData 拉取到的数据
|
|
3765
|
-
* * key RC_ANCHOR_LIST value: 为主播 ID 集合
|
|
3766
|
-
* * key RC_RES_`userId` value: 为主播发布的资源
|
|
3767
|
-
* * key RC_RTC_SESSIONID value: sessionId
|
|
3768
|
-
* * key RC_CDN value: CDN 资源数据
|
|
3558
|
+
* MediaServer 请求实例
|
|
3769
3559
|
*/
|
|
3770
|
-
|
|
3560
|
+
readonly service: RCMediaService;
|
|
3771
3561
|
/**
|
|
3772
|
-
*
|
|
3562
|
+
* IM 信令上下文
|
|
3773
3563
|
*/
|
|
3774
|
-
|
|
3775
|
-
private _handleNewJoinedAnchor;
|
|
3776
|
-
private _handleLeftedAnchor;
|
|
3564
|
+
readonly context: RTCContext;
|
|
3777
3565
|
/**
|
|
3778
|
-
*
|
|
3566
|
+
* 运行时
|
|
3779
3567
|
*/
|
|
3780
|
-
|
|
3568
|
+
readonly runtime: IRuntime;
|
|
3781
3569
|
/**
|
|
3782
|
-
*
|
|
3570
|
+
* PeerConenction 连接实例
|
|
3783
3571
|
*/
|
|
3784
|
-
|
|
3572
|
+
readonly peer: RCRTCPeerConnection;
|
|
3785
3573
|
/**
|
|
3786
|
-
*
|
|
3574
|
+
* 内存只读模块
|
|
3787
3575
|
*/
|
|
3788
|
-
|
|
3576
|
+
readonly store: ReadableStore;
|
|
3789
3577
|
/**
|
|
3790
|
-
*
|
|
3578
|
+
* 北极星统计工具
|
|
3791
3579
|
*/
|
|
3792
|
-
|
|
3580
|
+
readonly polarisReport: PolarisReporter;
|
|
3793
3581
|
/**
|
|
3794
|
-
*
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
private _callAppListener;
|
|
3582
|
+
* 行为数据采集工具
|
|
3583
|
+
*/
|
|
3584
|
+
readonly reportMediaActionLogger: ReportMediaActionLogger;
|
|
3585
|
+
constructor(
|
|
3799
3586
|
/**
|
|
3800
|
-
*
|
|
3801
|
-
|
|
3802
|
-
|
|
3587
|
+
* 日志工具
|
|
3588
|
+
*/
|
|
3589
|
+
logger: BasicLogger,
|
|
3803
3590
|
/**
|
|
3804
|
-
*
|
|
3805
|
-
* @param subscribeList 订阅清单
|
|
3806
|
-
* @param publishedStreams 已发布流
|
|
3807
|
-
* @param iceRestart
|
|
3591
|
+
* MediaServer 请求实例
|
|
3808
3592
|
*/
|
|
3809
|
-
|
|
3810
|
-
[msid: string]: RCLocalMediaStream;
|
|
3811
|
-
}, iceRestart: boolean): Promise<{
|
|
3812
|
-
reqBody: IBroadcastSubReqBody;
|
|
3813
|
-
offer: RTCSessionDescriptionInit;
|
|
3814
|
-
dynamicBitrate: {
|
|
3815
|
-
min: number;
|
|
3816
|
-
max: number;
|
|
3817
|
-
};
|
|
3818
|
-
}>;
|
|
3819
|
-
private _subscribeHandle;
|
|
3593
|
+
service: RCMediaService,
|
|
3820
3594
|
/**
|
|
3821
|
-
*
|
|
3595
|
+
* IM 信令上下文
|
|
3822
3596
|
*/
|
|
3823
|
-
|
|
3824
|
-
private _getReqHeaders;
|
|
3825
|
-
private _exchangeHandle;
|
|
3826
|
-
private _dealSubscribeResult;
|
|
3597
|
+
context: RTCContext,
|
|
3827
3598
|
/**
|
|
3828
|
-
*
|
|
3599
|
+
* 运行时
|
|
3829
3600
|
*/
|
|
3830
|
-
|
|
3831
|
-
private _reportPubOrSubQualityData;
|
|
3832
|
-
private _updateSubListHandle;
|
|
3601
|
+
runtime: IRuntime,
|
|
3833
3602
|
/**
|
|
3834
|
-
*
|
|
3835
|
-
* @param newCDNUris 新的 cdn_uris 数据
|
|
3603
|
+
* PeerConenction 连接实例
|
|
3836
3604
|
*/
|
|
3837
|
-
|
|
3605
|
+
peer: RCRTCPeerConnection,
|
|
3838
3606
|
/**
|
|
3839
|
-
*
|
|
3840
|
-
* _CDNUris 无 url 时,说明未开启 CDN 推送
|
|
3841
|
-
* @returns CDNPlayUrl
|
|
3607
|
+
* 内存只读模块
|
|
3842
3608
|
*/
|
|
3843
|
-
|
|
3609
|
+
store: ReadableStore,
|
|
3844
3610
|
/**
|
|
3845
|
-
*
|
|
3846
|
-
* @returns CDNPlayUrl
|
|
3611
|
+
* 北极星统计工具
|
|
3847
3612
|
*/
|
|
3848
|
-
|
|
3849
|
-
code: RCRTCCode;
|
|
3850
|
-
CDNPlayUrl?: string;
|
|
3851
|
-
}>;
|
|
3613
|
+
polarisReport: PolarisReporter,
|
|
3852
3614
|
/**
|
|
3853
|
-
*
|
|
3854
|
-
* @param tracks
|
|
3615
|
+
* 行为数据采集工具
|
|
3855
3616
|
*/
|
|
3856
|
-
|
|
3857
|
-
code: RCRTCCode;
|
|
3858
|
-
failedList?: ISubscribeAttr[];
|
|
3859
|
-
}>;
|
|
3860
|
-
private __unsubscribe;
|
|
3617
|
+
reportMediaActionLogger: ReportMediaActionLogger);
|
|
3861
3618
|
/**
|
|
3862
|
-
*
|
|
3863
|
-
* @param tracks
|
|
3619
|
+
* 代理房间实例以获取跨房间连麦时的推送配置
|
|
3864
3620
|
*/
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3621
|
+
getPushOtherRooms: () => IPushOtherRooms[];
|
|
3622
|
+
}
|
|
3623
|
+
|
|
3624
|
+
/**
|
|
3625
|
+
* @typeParams T - 事务执行上下文类型
|
|
3626
|
+
* @typeParams S - 内存读写模块类型
|
|
3627
|
+
*/
|
|
3628
|
+
declare class BaseInvoker<T, S> {
|
|
3629
|
+
protected readonly _logger: BasicLogger;
|
|
3869
3630
|
/**
|
|
3870
|
-
*
|
|
3871
|
-
* @private
|
|
3631
|
+
* 内存数据管理实例
|
|
3872
3632
|
*/
|
|
3873
|
-
|
|
3633
|
+
protected readonly _context: T;
|
|
3874
3634
|
/**
|
|
3875
|
-
*
|
|
3876
|
-
* @param trackId
|
|
3635
|
+
* 内存读写模块
|
|
3877
3636
|
*/
|
|
3878
|
-
|
|
3637
|
+
protected readonly _store: S;
|
|
3879
3638
|
/**
|
|
3880
|
-
*
|
|
3881
|
-
* @param trackId
|
|
3639
|
+
* 命令终止时返回的错误码定义
|
|
3882
3640
|
*/
|
|
3883
|
-
|
|
3641
|
+
private abortCode;
|
|
3642
|
+
constructor(_logger: BasicLogger,
|
|
3884
3643
|
/**
|
|
3885
|
-
*
|
|
3886
|
-
* @private
|
|
3644
|
+
* 内存数据管理实例
|
|
3887
3645
|
*/
|
|
3888
|
-
|
|
3646
|
+
_context: T,
|
|
3889
3647
|
/**
|
|
3890
|
-
*
|
|
3891
|
-
* @param tag 参数描述
|
|
3648
|
+
* 内存读写模块
|
|
3892
3649
|
*/
|
|
3893
|
-
|
|
3650
|
+
_store: S,
|
|
3894
3651
|
/**
|
|
3895
|
-
*
|
|
3896
|
-
* @param handler 业务端传入的音量上报事件
|
|
3897
|
-
* @param _ - 参数已废弃
|
|
3652
|
+
* 命令终止时返回的错误码定义
|
|
3898
3653
|
*/
|
|
3899
|
-
|
|
3900
|
-
private
|
|
3654
|
+
abortCode: RCRTCCode);
|
|
3655
|
+
private _queue;
|
|
3656
|
+
private _busy;
|
|
3657
|
+
private _next;
|
|
3658
|
+
private _execute;
|
|
3659
|
+
push<R>(command: BaseCommand<R, T, S>): Promise<ICommandResult<R>>;
|
|
3660
|
+
private _isDestroyed;
|
|
3661
|
+
isDestroyed(): boolean;
|
|
3662
|
+
destroy(): void;
|
|
3663
|
+
}
|
|
3664
|
+
/**
|
|
3665
|
+
* 房间任务队列管理
|
|
3666
|
+
*/
|
|
3667
|
+
declare class Invoker extends BaseInvoker<CommandExecuteContext, Store> {
|
|
3668
|
+
constructor(context: CommandExecuteContext, store: Store);
|
|
3901
3669
|
/**
|
|
3902
|
-
*
|
|
3903
|
-
* @param listener
|
|
3670
|
+
* 获取 store 存储实例,返回值类型 `ReadableStore`,避免非 command 定义中修改内存
|
|
3904
3671
|
*/
|
|
3905
|
-
|
|
3672
|
+
get store(): ReadableStore;
|
|
3673
|
+
destroy(): void;
|
|
3674
|
+
}
|
|
3675
|
+
|
|
3676
|
+
declare enum CommandPriority {
|
|
3677
|
+
LOW = 0,
|
|
3678
|
+
NORMAL = 1,
|
|
3679
|
+
HIGH = 2
|
|
3680
|
+
}
|
|
3681
|
+
declare type ICommandResult<R = void> = {
|
|
3682
|
+
code: number;
|
|
3683
|
+
data?: R;
|
|
3684
|
+
};
|
|
3685
|
+
/**
|
|
3686
|
+
* 命令基类
|
|
3687
|
+
* @typeParams R - 返回值类型声明
|
|
3688
|
+
* @typeParams T - 命令执行上下文类型
|
|
3689
|
+
* @typeParams S - 内存数据缓存模块
|
|
3690
|
+
*/
|
|
3691
|
+
declare abstract class BaseCommand<R = void, T = CommandExecuteContext, S = Store> {
|
|
3906
3692
|
/**
|
|
3907
|
-
*
|
|
3693
|
+
* 事务执行函数
|
|
3694
|
+
* @param context - 事务执行上下文
|
|
3695
|
+
* @param store - 内存读写模块
|
|
3696
|
+
* @param invoker - 任务队列
|
|
3908
3697
|
*/
|
|
3909
|
-
|
|
3698
|
+
abstract execute(context: T, store: S, invoker: BaseInvoker<T, S>): Promise<ICommandResult<R>>;
|
|
3910
3699
|
/**
|
|
3911
|
-
*
|
|
3700
|
+
* 获取指令优先级,必要时可 override 此函数
|
|
3912
3701
|
*/
|
|
3913
|
-
|
|
3702
|
+
get priority(): CommandPriority;
|
|
3914
3703
|
/**
|
|
3915
|
-
*
|
|
3704
|
+
* 它返回命令的种类。
|
|
3705
|
+
* @returns 命令的种类。
|
|
3916
3706
|
*/
|
|
3917
|
-
|
|
3707
|
+
get kind(): RCCommandKind;
|
|
3708
|
+
}
|
|
3709
|
+
|
|
3710
|
+
/**
|
|
3711
|
+
* RTC 消息类型常量
|
|
3712
|
+
* @private
|
|
3713
|
+
*/
|
|
3714
|
+
declare enum RCRTCMessageType {
|
|
3918
3715
|
/**
|
|
3919
|
-
*
|
|
3716
|
+
* 增量资源发布消息
|
|
3717
|
+
* @deprecated
|
|
3920
3718
|
*/
|
|
3921
|
-
|
|
3719
|
+
PUBLISH = "RCRTC:PublishResource",
|
|
3922
3720
|
/**
|
|
3923
|
-
*
|
|
3924
|
-
* @
|
|
3925
|
-
* @returns
|
|
3721
|
+
* 增量资源取消发布消息
|
|
3722
|
+
* @deprecated
|
|
3926
3723
|
*/
|
|
3927
|
-
|
|
3724
|
+
UNPUBLISH = "RCRTC:UnpublishResource",
|
|
3928
3725
|
/**
|
|
3929
|
-
*
|
|
3930
|
-
* @
|
|
3726
|
+
* 增量资源状态变更消息
|
|
3727
|
+
* @deprecated
|
|
3931
3728
|
*/
|
|
3932
|
-
|
|
3729
|
+
MODIFY = "RCRTC:ModifyResource",
|
|
3933
3730
|
/**
|
|
3934
|
-
*
|
|
3731
|
+
* 全量资源变更消息
|
|
3935
3732
|
*/
|
|
3936
|
-
|
|
3733
|
+
TOTAL_CONTENT_RESOURCE = "RCRTC:TotalContentResources",
|
|
3937
3734
|
/**
|
|
3938
|
-
*
|
|
3735
|
+
* 房间人员变更
|
|
3939
3736
|
*/
|
|
3940
|
-
|
|
3737
|
+
STATE = "RCRTC:state",
|
|
3941
3738
|
/**
|
|
3942
|
-
*
|
|
3739
|
+
* 房间属性变更
|
|
3943
3740
|
*/
|
|
3944
|
-
|
|
3945
|
-
resolution: RCResolution;
|
|
3946
|
-
fps: RCFrameRate;
|
|
3947
|
-
CDNEnable: boolean | undefined;
|
|
3948
|
-
} | {
|
|
3949
|
-
CDNEnable: boolean;
|
|
3950
|
-
resolution?: undefined;
|
|
3951
|
-
fps?: undefined;
|
|
3952
|
-
};
|
|
3953
|
-
getClientSessionId(): string;
|
|
3954
|
-
}
|
|
3955
|
-
|
|
3956
|
-
/**
|
|
3957
|
-
* 北极星上报角色
|
|
3958
|
-
*/
|
|
3959
|
-
declare enum PolarisRole {
|
|
3741
|
+
ROOM_NOTIFY = "RCRTC:RoomNtf",
|
|
3960
3742
|
/**
|
|
3961
|
-
*
|
|
3743
|
+
* 房间用户属性变更
|
|
3962
3744
|
*/
|
|
3963
|
-
|
|
3745
|
+
USER_NOTIFY = "RCRTC:UserNtf",
|
|
3964
3746
|
/**
|
|
3965
|
-
*
|
|
3747
|
+
* 被服务踢出房间
|
|
3966
3748
|
*/
|
|
3967
|
-
|
|
3968
|
-
}
|
|
3969
|
-
|
|
3970
|
-
declare class PolarisReporter {
|
|
3971
|
-
private readonly _context;
|
|
3972
|
-
private readonly _runtime;
|
|
3973
|
-
private readonly _roomId;
|
|
3974
|
-
private readonly _crtRTCRoom;
|
|
3975
|
-
private readonly _userRole;
|
|
3976
|
-
constructor(_context: RTCContext, _runtime: IRuntime, _roomId: string, _crtRTCRoom: RCAbstractRoom | RCAudienceLivingRoom, _userRole?: PolarisRole);
|
|
3977
|
-
private _send;
|
|
3978
|
-
private _getClientID;
|
|
3749
|
+
KICK = "RCRTC:kick",
|
|
3979
3750
|
/**
|
|
3980
|
-
*
|
|
3751
|
+
* 跨房间连麦 PK 请求消息
|
|
3981
3752
|
*/
|
|
3982
|
-
|
|
3753
|
+
PK_INVITE = "RCRTC:invite",
|
|
3983
3754
|
/**
|
|
3984
|
-
*
|
|
3985
|
-
* @param resourceId userId_11_1_tiny 改为 userId_11_tiny_video
|
|
3755
|
+
* 连麦请求超时
|
|
3986
3756
|
*/
|
|
3987
|
-
|
|
3757
|
+
PK_INVITE_TIMEOUT = "RCRTC:inviteTimeout",
|
|
3988
3758
|
/**
|
|
3989
|
-
*
|
|
3759
|
+
* 跨房间连麦 PK 取消请求消息
|
|
3990
3760
|
*/
|
|
3991
|
-
|
|
3992
|
-
private _getAudioLevel;
|
|
3993
|
-
private _getBitrate;
|
|
3994
|
-
private _getPacketsLostRate;
|
|
3995
|
-
private _getFrameRate;
|
|
3996
|
-
private _getResolution;
|
|
3997
|
-
private _getJitter;
|
|
3998
|
-
private _getNackCount;
|
|
3999
|
-
private _getPliCount;
|
|
4000
|
-
private _getRTT;
|
|
4001
|
-
private _getTrackState;
|
|
3761
|
+
PK_CANCEL_INVITE = "RCRTC:cancelInvite",
|
|
4002
3762
|
/**
|
|
4003
|
-
*
|
|
4004
|
-
* @param data peerConnection stats 解析出来业务所需的所有字段
|
|
3763
|
+
* 跨房间连麦 PK 请求响应消息
|
|
4005
3764
|
*/
|
|
4006
|
-
|
|
3765
|
+
PK_INVITE_ANSWER = "RCRTC:answerInvite",
|
|
4007
3766
|
/**
|
|
4008
|
-
*
|
|
4009
|
-
* @param data peerConnection stats 解析出来业务所需的所有字段
|
|
3767
|
+
* 结束跨房间连麦 PK 消息
|
|
4010
3768
|
*/
|
|
4011
|
-
|
|
3769
|
+
PK_END = "RCRTC:endInvite",
|
|
4012
3770
|
/**
|
|
4013
|
-
*
|
|
3771
|
+
* 连麦的房间不再了或离线了,主直播房间会收到的消息通知
|
|
4014
3772
|
*/
|
|
4015
|
-
|
|
3773
|
+
OTHER_ROOM_OFFLINE = "RCRTC:otherRoomOffline",
|
|
4016
3774
|
/**
|
|
4017
|
-
*
|
|
4018
|
-
* RTC 订阅、取消订阅
|
|
3775
|
+
* 订阅、取消订阅动作成功
|
|
4019
3776
|
*/
|
|
4020
|
-
|
|
3777
|
+
ROOM_TASK_FINISH = "RCRTC:roomTaskFinish"
|
|
4021
3778
|
}
|
|
4022
3779
|
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
*/
|
|
4026
|
-
declare class RCRTCPeerConnection extends EventEmitter {
|
|
4027
|
-
readonly _context: RTCContext;
|
|
4028
|
-
private _logger;
|
|
3780
|
+
declare type IOnRecvPKMsg = (msg: IReceivedMessage) => void;
|
|
3781
|
+
interface IRoomPKEventListener {
|
|
4029
3782
|
/**
|
|
4030
|
-
*
|
|
3783
|
+
* 收到连麦邀请
|
|
4031
3784
|
*/
|
|
4032
|
-
|
|
3785
|
+
onRequestJoinOtherRoom: (info: IPKInviteInfo) => {};
|
|
4033
3786
|
/**
|
|
4034
|
-
*
|
|
3787
|
+
* 收到取消连麦邀请
|
|
4035
3788
|
*/
|
|
4036
|
-
|
|
3789
|
+
onCancelRequestOtherRoom: (info: IPKInviteInfo) => {};
|
|
4037
3790
|
/**
|
|
4038
|
-
*
|
|
3791
|
+
* 收到连麦 PK 请求响应结果
|
|
4039
3792
|
*/
|
|
4040
|
-
|
|
3793
|
+
onResponseJoinOtherRoom: (info: IPKInviteAnswerInfo) => {};
|
|
4041
3794
|
/**
|
|
4042
|
-
*
|
|
3795
|
+
* 收到 PK 结束
|
|
4043
3796
|
*/
|
|
4044
|
-
|
|
3797
|
+
onFinishOtherRoom: (info: IPKEndInfo) => {};
|
|
3798
|
+
}
|
|
3799
|
+
declare class RCLivingPKHandler {
|
|
3800
|
+
private _invoker;
|
|
3801
|
+
private _PKInfo;
|
|
3802
|
+
private readonly _context;
|
|
3803
|
+
private readonly _runtime;
|
|
3804
|
+
private readonly _service;
|
|
3805
|
+
private readonly _initOptions;
|
|
4045
3806
|
/**
|
|
4046
|
-
*
|
|
3807
|
+
* 主直播房间
|
|
4047
3808
|
*/
|
|
4048
|
-
private readonly
|
|
4049
|
-
|
|
4050
|
-
static __INNER_AUDIOLEVEL_CHANGE__: string;
|
|
4051
|
-
static __INNER_ICE_STATE_CHANGE__: string;
|
|
4052
|
-
static __INNER_ICE_CONNECTED__: string;
|
|
4053
|
-
static __INNER_SEI_CONTENT__: string;
|
|
4054
|
-
private readonly _rtcPeerConn;
|
|
4055
|
-
private readonly _sdpStrategy;
|
|
4056
|
-
reportParser: IStatParser | null;
|
|
4057
|
-
private pubLocalTracks;
|
|
4058
|
-
private _reTryExchangeTimer;
|
|
4059
|
-
private _reportStatsTimer;
|
|
4060
|
-
private _reportR3R4ToPolarisTimer;
|
|
4061
|
-
private _isDestroyed;
|
|
4062
|
-
private _formatStatsData?;
|
|
4063
|
-
constructor(_context: RTCContext, _logger: BasicLogger,
|
|
3809
|
+
private readonly _mainLivingRoom;
|
|
3810
|
+
private readonly _registerPKMsgListener;
|
|
4064
3811
|
/**
|
|
4065
|
-
*
|
|
3812
|
+
* 加入 PK 房间回调
|
|
4066
3813
|
*/
|
|
4067
|
-
|
|
3814
|
+
private readonly _onJoinedPKRoom;
|
|
3815
|
+
protected readonly _clientSessionId?: string | undefined;
|
|
4068
3816
|
/**
|
|
4069
|
-
*
|
|
3817
|
+
* PK 邀请超时时间,默认 30s
|
|
4070
3818
|
*/
|
|
4071
|
-
|
|
3819
|
+
private readonly _inviteTimeout;
|
|
3820
|
+
private _appListener;
|
|
3821
|
+
private _mainRoomId;
|
|
4072
3822
|
/**
|
|
4073
|
-
*
|
|
3823
|
+
* 跨房间连麦加入的 PK 房间
|
|
4074
3824
|
*/
|
|
4075
|
-
|
|
3825
|
+
private _joinedPKRooms;
|
|
3826
|
+
private readonly _logger;
|
|
3827
|
+
constructor(_invoker: Invoker, _PKInfo: IPKInfo, _context: RTCContext, _runtime: IRuntime, _service: RCMediaService, _initOptions: IRCRTCInitOptions,
|
|
4076
3828
|
/**
|
|
4077
|
-
*
|
|
3829
|
+
* 主直播房间
|
|
4078
3830
|
*/
|
|
4079
|
-
|
|
3831
|
+
_mainLivingRoom: RCLivingRoom, _registerPKMsgListener: (listener: IOnRecvPKMsg) => void,
|
|
4080
3832
|
/**
|
|
4081
|
-
*
|
|
3833
|
+
* 加入 PK 房间回调
|
|
4082
3834
|
*/
|
|
4083
|
-
|
|
3835
|
+
_onJoinedPKRoom: (roomId: string, traceId: string) => Promise<void>, _clientSessionId?: string | undefined);
|
|
3836
|
+
private _callAppListener;
|
|
4084
3837
|
/**
|
|
4085
|
-
*
|
|
3838
|
+
* 收到连麦邀请
|
|
4086
3839
|
*/
|
|
4087
|
-
|
|
4088
|
-
getLocalTracks(): RCLocalTrack[];
|
|
4089
|
-
private _decodeSeiData;
|
|
4090
|
-
private _onConnectionStateChange;
|
|
4091
|
-
private startAutoExecute;
|
|
4092
|
-
private stopAutoExecute;
|
|
4093
|
-
private _onICEConnectionStateChange;
|
|
4094
|
-
private _inRetry;
|
|
4095
|
-
private _handleRetry;
|
|
4096
|
-
private _onTrackReady;
|
|
3840
|
+
private _onInvite;
|
|
4097
3841
|
/**
|
|
4098
|
-
*
|
|
3842
|
+
* 收到取消连麦
|
|
4099
3843
|
*/
|
|
4100
|
-
|
|
3844
|
+
private _onCancelInvite;
|
|
3845
|
+
private _onInviteTimeout;
|
|
4101
3846
|
/**
|
|
4102
|
-
*
|
|
4103
|
-
* @param {boolean} iceRestart - 布尔值
|
|
4104
|
-
* @returns 具有两个属性的对象:
|
|
4105
|
-
* - sdp:SDP 字符串
|
|
4106
|
-
* - 语义:SDP 语义
|
|
3847
|
+
* 收到响应连麦
|
|
4107
3848
|
*/
|
|
4108
|
-
|
|
4109
|
-
private
|
|
3849
|
+
private _onInviteAnswer;
|
|
3850
|
+
private createLeaveOtherRoomCommand;
|
|
4110
3851
|
/**
|
|
4111
|
-
*
|
|
4112
|
-
* @param fromPub 是否来自于发布动作,用来对外通知连接成功后统计
|
|
3852
|
+
* 收到连麦结束
|
|
4113
3853
|
*/
|
|
4114
|
-
|
|
4115
|
-
getLocalTrack(trackId: string): RCLocalTrack | null;
|
|
3854
|
+
private _onPKEnd;
|
|
4116
3855
|
/**
|
|
4117
|
-
*
|
|
4118
|
-
* @param {RCLocalTrack} track - 要添加的本地轨道。
|
|
3856
|
+
* 处理跨房间连麦相关消息
|
|
4119
3857
|
*/
|
|
4120
|
-
|
|
3858
|
+
private _onRecvPKMsg;
|
|
4121
3859
|
/**
|
|
4122
|
-
*
|
|
4123
|
-
* @param {string} trackId - 要移除的轨道的 ID。
|
|
4124
|
-
* @returns 正在删除的轨道。
|
|
3860
|
+
* 注册跨房间连麦监听事件
|
|
4125
3861
|
*/
|
|
4126
|
-
|
|
3862
|
+
registerRoomPKEventListener(listener: IRoomPKEventListener): void;
|
|
4127
3863
|
/**
|
|
4128
|
-
*
|
|
3864
|
+
* 发起跨房间连麦请求
|
|
3865
|
+
* @param inviteeRoomId 被邀请者所处的房间 roomId
|
|
3866
|
+
* @param inviteeUserId 被邀请者 userId
|
|
3867
|
+
* @param options.autoMix 是否将本房间资源合并到被邀请者所处房间的 MCU 合流中
|
|
3868
|
+
* @param options.extra 拓展字段,可随邀请连麦消息透传给被邀请者
|
|
4129
3869
|
*/
|
|
4130
|
-
|
|
3870
|
+
requestJoinOtherRoom(inviteeRoomId: string, inviteeUserId: string, options?: IReqResPKOptions): Promise<{
|
|
3871
|
+
code: RCRTCCode | ErrorCode;
|
|
3872
|
+
}>;
|
|
4131
3873
|
/**
|
|
4132
|
-
*
|
|
4133
|
-
* @param
|
|
3874
|
+
* 取消跨房间连麦请求
|
|
3875
|
+
* @param inviteeRoomId 被邀请者所处的房间 roomId
|
|
3876
|
+
* @param inviteeUserId 被邀请者 userId
|
|
3877
|
+
* @param extra 附加信息,可随取消邀请连麦消息透传给被邀请者
|
|
4134
3878
|
*/
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
3879
|
+
cancelRequestJoinOtherRoom(inviteeRoomId: string, inviteeUserId: string, extra?: string): Promise<{
|
|
3880
|
+
code: RCRTCCode | ErrorCode;
|
|
3881
|
+
}>;
|
|
3882
|
+
/**
|
|
3883
|
+
* 响应跨房间连麦请求
|
|
3884
|
+
* @param inviterRoomId 邀请者所处的房间 roomId
|
|
3885
|
+
* @param inviterUserId 邀请者 userId
|
|
3886
|
+
* @param agree 是否同意连麦
|
|
3887
|
+
* @param options.autoMix 是否将本房间资源合并到邀请者所处房间的 MCU 合流中
|
|
3888
|
+
* @param options.extra 附加信息,可随响应连麦消息透传给邀请者
|
|
3889
|
+
*/
|
|
3890
|
+
responseJoinOtherRoom(inviterRoomId: string, inviterUserId: string, agree: boolean, options?: IReqResPKOptions): Promise<{
|
|
3891
|
+
code: RCRTCCode | ErrorCode;
|
|
3892
|
+
}>;
|
|
4138
3893
|
/**
|
|
4139
|
-
*
|
|
3894
|
+
* 加入副直播房间
|
|
3895
|
+
* @roomId 副房间的 roomId
|
|
4140
3896
|
*/
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
3897
|
+
joinOtherRoom(roomId: string): Promise<{
|
|
3898
|
+
code: RCRTCCode;
|
|
3899
|
+
room?: RCLivingRoom;
|
|
3900
|
+
userIds?: string[];
|
|
3901
|
+
tracks?: RCRemoteTrack[];
|
|
3902
|
+
CDNEnable?: boolean;
|
|
3903
|
+
}>;
|
|
4145
3904
|
/**
|
|
4146
|
-
*
|
|
4147
|
-
* @param
|
|
3905
|
+
* 退出副房间
|
|
3906
|
+
* @param room 要退出的副房间的 room 实例
|
|
3907
|
+
* @param isQuitPK 是否要结束连麦
|
|
4148
3908
|
*/
|
|
4149
|
-
|
|
3909
|
+
leaveOtherRoom(room: RCLivingRoom, isQuitPK?: boolean): Promise<{
|
|
3910
|
+
code: RCRTCCode;
|
|
3911
|
+
}>;
|
|
4150
3912
|
/**
|
|
4151
|
-
*
|
|
3913
|
+
* 获取连麦信息
|
|
3914
|
+
* @param roomId 连麦房间的 roomId
|
|
4152
3915
|
*/
|
|
4153
|
-
|
|
3916
|
+
getPKInfo(roomId: string): {
|
|
3917
|
+
inviteSessionId: string;
|
|
3918
|
+
inviterRoomId: string;
|
|
3919
|
+
inviterUserId: string;
|
|
3920
|
+
inviterUserAutoMix?: boolean | undefined;
|
|
3921
|
+
inviteeRoomId: string;
|
|
3922
|
+
inviteeUserAutoMix?: boolean | undefined;
|
|
3923
|
+
};
|
|
4154
3924
|
/**
|
|
4155
|
-
*
|
|
3925
|
+
* 获取所有连麦信息
|
|
4156
3926
|
*/
|
|
4157
|
-
|
|
4158
|
-
private _createRCRTCStateReport;
|
|
3927
|
+
getAllPKInfo(): IPKInfo;
|
|
4159
3928
|
/**
|
|
4160
|
-
*
|
|
4161
|
-
* @returns 返回格式化后的数据
|
|
3929
|
+
* 获取已加入的副房间
|
|
4162
3930
|
*/
|
|
4163
|
-
|
|
3931
|
+
getJoinedPKRooms(): {
|
|
3932
|
+
[roomId: string]: RCLivingRoom;
|
|
3933
|
+
};
|
|
3934
|
+
}
|
|
3935
|
+
|
|
3936
|
+
declare type ResourceMsgContent = {
|
|
4164
3937
|
/**
|
|
4165
|
-
*
|
|
3938
|
+
* 旧版本兼容参数,当收到非 `RTCMessageName.TOTAL_CONTENT_RESOURCE` 时:
|
|
3939
|
+
* * ignore 值为 `true` 表示该消息由 signal server 向旧版本 RTCLib 提供的兼容消息,无需处理
|
|
3940
|
+
* * 否则认为该消息是由旧版本 RTCLib 主动发出的增量变更消息,需要处理
|
|
4166
3941
|
*/
|
|
4167
|
-
|
|
3942
|
+
ignore?: boolean;
|
|
4168
3943
|
/**
|
|
4169
|
-
*
|
|
3944
|
+
* 发布到房间内的资源列表,`RTCMessageName.TOTAL_CONTENT_RESOURCE` 消息携带全量数据,否则为增量数据
|
|
4170
3945
|
*/
|
|
4171
|
-
|
|
3946
|
+
uris: IPublishedResource[];
|
|
3947
|
+
cdn_uris?: ICDNUris[];
|
|
3948
|
+
};
|
|
3949
|
+
|
|
3950
|
+
/**
|
|
3951
|
+
* 房间抽象基类
|
|
3952
|
+
*/
|
|
3953
|
+
declare abstract class RCAbstractRoom extends EventEmitter {
|
|
3954
|
+
protected readonly _context: RTCContext;
|
|
3955
|
+
protected readonly _runtime: IRuntime;
|
|
3956
|
+
readonly _roomId: string;
|
|
3957
|
+
protected readonly _service: RCMediaService;
|
|
3958
|
+
protected readonly _initOptions: IRCRTCInitOptions;
|
|
3959
|
+
protected readonly _clientSessionId: string;
|
|
4172
3960
|
/**
|
|
4173
|
-
*
|
|
3961
|
+
* 房间保活 rtcPing
|
|
4174
3962
|
*/
|
|
4175
|
-
private
|
|
3963
|
+
private readonly _pinger;
|
|
4176
3964
|
/**
|
|
4177
|
-
*
|
|
3965
|
+
* 北极星上报实例
|
|
4178
3966
|
*/
|
|
4179
|
-
|
|
4180
|
-
getRTCPeerConn(): RTCPeerConnection;
|
|
3967
|
+
protected readonly _polarisReport: PolarisReporter;
|
|
4181
3968
|
/**
|
|
4182
|
-
*
|
|
4183
|
-
* 1. 连接生命周期与房间实例一致(包含观众加房间),仅在退出房间时进行关闭。
|
|
4184
|
-
* 2. 观众客户端(观众不加房间)订阅时创建,取消订阅时销毁
|
|
3969
|
+
* 音量上报实例
|
|
4185
3970
|
*/
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
*/
|
|
4194
|
-
declare class CommandExecuteContext extends EventEmitter {
|
|
3971
|
+
private readonly _audioLevelReport;
|
|
3972
|
+
protected readonly _peerConnection: RCRTCPeerConnection;
|
|
3973
|
+
protected readonly _invoker: Invoker;
|
|
3974
|
+
protected readonly _store: ReadableStore;
|
|
3975
|
+
private readonly _reportMediaActionLogger;
|
|
3976
|
+
protected readonly _logger: BasicLogger;
|
|
3977
|
+
protected readonly _executeCtx: CommandExecuteContext;
|
|
4195
3978
|
/**
|
|
4196
|
-
*
|
|
3979
|
+
* RCRTCRoom 类的构造函数。
|
|
3980
|
+
* @param {RTCContext} _context - RTC上下文,
|
|
3981
|
+
* @param {IRuntime} _runtime - 运行时
|
|
3982
|
+
* @param {string} _roomId - 房间号
|
|
3983
|
+
* @param {RTCMode} _roomMode - RTC模式,
|
|
3984
|
+
* @param {RCMediaService} _service - RCMediaService
|
|
3985
|
+
* @param {IRCRTCInitOptions} _initOptions - IRCRTCInitOptions
|
|
3986
|
+
* @param {boolean} [isUpgrade] - 是否是升级,如果是升级则不会创建新的peerConnection
|
|
3987
|
+
* @param {boolean} [isMainRoom] - 无论是主房间,主房间都是用户创建的房间,子房间是用户创建的房间。
|
|
3988
|
+
* @param {string} _clientSessionId - 客户端会话 ID,用于标识客户端。
|
|
4197
3989
|
*/
|
|
4198
|
-
|
|
3990
|
+
constructor(_context: RTCContext, _runtime: IRuntime, _roomId: string, _roomMode: RTCMode, _service: RCMediaService, _initOptions: IRCRTCInitOptions, isUpgrade?: boolean, isMainRoom?: boolean, _clientSessionId?: string, encrypt?: boolean);
|
|
4199
3991
|
/**
|
|
4200
|
-
*
|
|
3992
|
+
* 注册 RCRTCPeerConnection 事件监听器
|
|
4201
3993
|
*/
|
|
4202
|
-
|
|
3994
|
+
private _setPeerConnectionListener;
|
|
3995
|
+
/** 注册命令执行中的事件监听器 */
|
|
3996
|
+
private setCommandEventListener;
|
|
4203
3997
|
/**
|
|
4204
|
-
*
|
|
3998
|
+
* 拉取房间数据
|
|
3999
|
+
* @param roomId 房间 id
|
|
4205
4000
|
*/
|
|
4206
|
-
|
|
4001
|
+
private _startPullRTCRoomStatus;
|
|
4207
4002
|
/**
|
|
4208
|
-
*
|
|
4003
|
+
* @private
|
|
4209
4004
|
*/
|
|
4210
|
-
|
|
4005
|
+
__innerInit(mode: RTCMode, joinType?: RTCJoinType, livingType?: RCLivingType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData, traceId?: string): Promise<{
|
|
4006
|
+
code: RCRTCCode | ErrorCode;
|
|
4007
|
+
data?: IJoinRTCRoomData;
|
|
4008
|
+
}>;
|
|
4009
|
+
protected _initWithRoomData(offlineKickTime: number): void;
|
|
4010
|
+
private _handlePingResult;
|
|
4211
4011
|
/**
|
|
4212
|
-
*
|
|
4012
|
+
* 设置房间上行资源的总码率配置
|
|
4013
|
+
* @deprecated use RCLocalTrack.setBitrate instead of setBitrate
|
|
4014
|
+
* @description
|
|
4015
|
+
* * 自 v5.1.0 版本开始,推荐使用 `RCLocalTrack.setBitrate` 对不同流分别指定码率。
|
|
4016
|
+
* * 该方法仅在 SDP `plan-b` 协议下(Chrome 92 与 Safari 11 之前的版本)有效。
|
|
4017
|
+
* @param max 音视频发送码率上限,不可小于 200 且不可小于 `min`
|
|
4018
|
+
* @param min 音视频发送码率下限,默认值为 1,且不可小于 1,不可大于 `max`
|
|
4019
|
+
* @param start 起始码率,默认为码率上限的 70%
|
|
4213
4020
|
*/
|
|
4214
|
-
|
|
4021
|
+
setBitrate(max: number, min: number, start?: number): void;
|
|
4022
|
+
private _onTrackReady;
|
|
4023
|
+
protected _callAppListener(eventType: keyof IRoomEventListener, ...attrs: any[]): void;
|
|
4024
|
+
private _onTrackUnpublish;
|
|
4215
4025
|
/**
|
|
4216
|
-
*
|
|
4026
|
+
* @private
|
|
4217
4027
|
*/
|
|
4218
|
-
|
|
4028
|
+
__parseInnerMessage(message: IReceivedMessage, traceId: string): void;
|
|
4219
4029
|
/**
|
|
4220
|
-
*
|
|
4030
|
+
* 被踢出房间通知
|
|
4031
|
+
* @param byServer
|
|
4032
|
+
* * 当值为 false 时,说明本端 rtcPing 超时
|
|
4033
|
+
* * 当值为 true 时,说明本端收到被踢出房间通知
|
|
4034
|
+
* @private
|
|
4221
4035
|
*/
|
|
4222
|
-
|
|
4036
|
+
__kickoff(byServer: boolean, content?: IRCRTCKickContent): Promise<void>;
|
|
4037
|
+
private _rtcpeerClosed;
|
|
4223
4038
|
/**
|
|
4224
|
-
*
|
|
4039
|
+
* 处理资源变更事件
|
|
4040
|
+
* @param content
|
|
4041
|
+
* @param messageType 消息类型
|
|
4042
|
+
* @param userId 消息发送者
|
|
4225
4043
|
*/
|
|
4226
|
-
|
|
4227
|
-
|
|
4044
|
+
protected _resourceHandle(content: ResourceMsgContent, messageType: RCRTCMessageType.PUBLISH | RCRTCMessageType.UNPUBLISH | RCRTCMessageType.MODIFY | RCRTCMessageType.TOTAL_CONTENT_RESOURCE, userId: string, sentTime: number, traceId: string): Promise<void>;
|
|
4045
|
+
private _onTrackPublish;
|
|
4228
4046
|
/**
|
|
4229
|
-
*
|
|
4047
|
+
* 处理 `RCRTCMessageType.STATE` 消息
|
|
4048
|
+
* @param content
|
|
4230
4049
|
*/
|
|
4231
|
-
|
|
4050
|
+
private _stateHandle;
|
|
4232
4051
|
/**
|
|
4233
|
-
*
|
|
4052
|
+
* 处理人员应用层事件
|
|
4234
4053
|
*/
|
|
4235
|
-
|
|
4054
|
+
private _dealUserAppListener;
|
|
4236
4055
|
/**
|
|
4237
|
-
*
|
|
4056
|
+
* 获取房间 Id
|
|
4238
4057
|
*/
|
|
4239
|
-
|
|
4058
|
+
getRoomId(): string;
|
|
4240
4059
|
/**
|
|
4241
|
-
*
|
|
4060
|
+
* 获取当前 userId
|
|
4242
4061
|
*/
|
|
4243
|
-
|
|
4062
|
+
getCrtUserId(): string;
|
|
4244
4063
|
/**
|
|
4245
|
-
*
|
|
4064
|
+
* 获取远程用户列表,不包含当前用户
|
|
4246
4065
|
*/
|
|
4247
|
-
|
|
4066
|
+
getRemoteUserIds(): string[];
|
|
4248
4067
|
/**
|
|
4249
|
-
*
|
|
4068
|
+
* 获取所有房间已发布的远端资源列表
|
|
4069
|
+
* @returns
|
|
4250
4070
|
*/
|
|
4251
|
-
|
|
4071
|
+
getRemoteTracks(): RCRemoteTrack[];
|
|
4252
4072
|
/**
|
|
4253
|
-
*
|
|
4073
|
+
* 获取远端用户的资源列表
|
|
4074
|
+
* @param userId
|
|
4075
|
+
* @returns
|
|
4254
4076
|
*/
|
|
4255
|
-
|
|
4077
|
+
getRemoteTracksByUserId(userId: string): RCRemoteTrack[];
|
|
4256
4078
|
/**
|
|
4257
|
-
*
|
|
4079
|
+
* 获取房间当前会话 Id,当房间内已无成员时房间会回收,重新加入时 sessionId 将更新
|
|
4258
4080
|
*/
|
|
4259
|
-
|
|
4081
|
+
getSessionId(): string;
|
|
4260
4082
|
/**
|
|
4261
|
-
*
|
|
4083
|
+
* 向房间内发消息
|
|
4084
|
+
* @param name 消息名称
|
|
4085
|
+
* @param content 消息内容
|
|
4262
4086
|
*/
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
declare enum CommandPriority {
|
|
4267
|
-
LOW = 0,
|
|
4268
|
-
NORMAL = 1,
|
|
4269
|
-
HIGH = 2
|
|
4270
|
-
}
|
|
4271
|
-
declare type ICommandResult<R = void> = {
|
|
4272
|
-
code: number;
|
|
4273
|
-
data?: R;
|
|
4274
|
-
};
|
|
4275
|
-
/**
|
|
4276
|
-
* 命令基类
|
|
4277
|
-
* @typeParams R - 返回值类型声明
|
|
4278
|
-
* @typeParams T - 命令执行上下文类型
|
|
4279
|
-
* @typeParams S - 内存数据缓存模块
|
|
4280
|
-
*/
|
|
4281
|
-
declare abstract class BaseCommand<R = void, T = CommandExecuteContext, S = Store> {
|
|
4087
|
+
sendMessage(name: string, content: any): Promise<{
|
|
4088
|
+
code: RCRTCCode;
|
|
4089
|
+
}>;
|
|
4282
4090
|
/**
|
|
4283
|
-
*
|
|
4284
|
-
* @param
|
|
4285
|
-
* @param
|
|
4286
|
-
* @param
|
|
4091
|
+
* 设置房间属性
|
|
4092
|
+
* @param key 属性名
|
|
4093
|
+
* @param value 属性值
|
|
4094
|
+
* @param message 是否在设置属性的时候携带消息内容,传空则不往房间中发送消息
|
|
4095
|
+
* @param isInner RTC 业务内部使用参数,用户忽略
|
|
4287
4096
|
*/
|
|
4288
|
-
|
|
4097
|
+
setRoomAttribute(key: string, value: string, message?: {
|
|
4098
|
+
name: string;
|
|
4099
|
+
content: string;
|
|
4100
|
+
}, isInner?: boolean): Promise<{
|
|
4101
|
+
code: RCRTCCode;
|
|
4102
|
+
}>;
|
|
4289
4103
|
/**
|
|
4290
|
-
*
|
|
4104
|
+
* 删除房间属性
|
|
4105
|
+
* @param keys 待删除的属性名数组
|
|
4106
|
+
* @param message 是否在删除属性的时候携带消息内容,传空则不往房间中发送消息
|
|
4107
|
+
* @param isInner RTC 业务内部使用参数,用户忽略
|
|
4291
4108
|
*/
|
|
4292
|
-
|
|
4109
|
+
deleteRoomAttributes(keys: string[], message?: {
|
|
4110
|
+
name: string;
|
|
4111
|
+
content: string;
|
|
4112
|
+
}, isInner?: boolean): Promise<{
|
|
4113
|
+
code: RCRTCCode;
|
|
4114
|
+
}>;
|
|
4293
4115
|
/**
|
|
4294
|
-
*
|
|
4295
|
-
* @
|
|
4116
|
+
* 获取房间属性
|
|
4117
|
+
* @param keys 要查询的属性名数组,当数组长度为空时,取所有已设置的 kv 值
|
|
4118
|
+
* @param isInner RTC 业务内部使用参数,用户忽略
|
|
4296
4119
|
*/
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
* @typeParams T - 事务执行上下文类型
|
|
4302
|
-
* @typeParams S - 内存读写模块类型
|
|
4303
|
-
*/
|
|
4304
|
-
declare class BaseInvoker<T, S> {
|
|
4305
|
-
protected readonly _logger: BasicLogger;
|
|
4120
|
+
getRoomAttributes(keys?: string[], isInner?: boolean): Promise<{
|
|
4121
|
+
code: RCRTCCode;
|
|
4122
|
+
data?: KVString;
|
|
4123
|
+
}>;
|
|
4306
4124
|
/**
|
|
4307
|
-
*
|
|
4125
|
+
* 设置当前用户属性(暂不开放)
|
|
4126
|
+
* @param key 属性名
|
|
4127
|
+
* @param value 属性值
|
|
4128
|
+
* @param message 是否在设置属性的时候携带消息内容,传空则不往房间中发送消息
|
|
4308
4129
|
*/
|
|
4309
|
-
|
|
4130
|
+
private _setUserAttributeValue;
|
|
4310
4131
|
/**
|
|
4311
|
-
*
|
|
4132
|
+
* 删除当前用户属性(暂不开放)
|
|
4133
|
+
* @param keys 待删除的属性名数组
|
|
4134
|
+
* @param message 是否在删除属性的时候携带消息内容,传空则不往房间中发送消息
|
|
4312
4135
|
*/
|
|
4313
|
-
|
|
4136
|
+
private _deleteUserAttributes;
|
|
4314
4137
|
/**
|
|
4315
|
-
*
|
|
4138
|
+
* 获取当前用户属性(暂不开放)
|
|
4139
|
+
* @param keys 要查询的属性名数组
|
|
4316
4140
|
*/
|
|
4317
|
-
private
|
|
4318
|
-
constructor(_logger: BasicLogger,
|
|
4141
|
+
private _getUserAttributes;
|
|
4319
4142
|
/**
|
|
4320
|
-
*
|
|
4143
|
+
* 查询房间是否已销毁
|
|
4321
4144
|
*/
|
|
4322
|
-
|
|
4145
|
+
isDestroyed(): boolean;
|
|
4323
4146
|
/**
|
|
4324
|
-
*
|
|
4147
|
+
* 退出并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
4148
|
+
* @private
|
|
4325
4149
|
*/
|
|
4326
|
-
|
|
4150
|
+
__destroy(quitRoom: boolean): Promise<void>;
|
|
4327
4151
|
/**
|
|
4328
|
-
*
|
|
4152
|
+
* 退出房间之前禁用所有远端资源,避免退出动作耗时过长,
|
|
4153
|
+
* 导致在未完全退出的过程中仍能听到房间内的声音问题
|
|
4329
4154
|
*/
|
|
4330
|
-
|
|
4331
|
-
private
|
|
4332
|
-
private _busy;
|
|
4333
|
-
private _next;
|
|
4334
|
-
private _execute;
|
|
4335
|
-
push<R>(command: BaseCommand<R, T, S>): Promise<ICommandResult<R>>;
|
|
4336
|
-
private _isDestroyed;
|
|
4337
|
-
isDestroyed(): boolean;
|
|
4338
|
-
destroy(): void;
|
|
4339
|
-
}
|
|
4340
|
-
/**
|
|
4341
|
-
* 房间任务队列管理
|
|
4342
|
-
*/
|
|
4343
|
-
declare class Invoker extends BaseInvoker<CommandExecuteContext, Store> {
|
|
4344
|
-
constructor(context: CommandExecuteContext, store: Store);
|
|
4155
|
+
private _muteRemoteTracksBeforeQuit;
|
|
4156
|
+
private _leaveHandle;
|
|
4345
4157
|
/**
|
|
4346
|
-
*
|
|
4158
|
+
* 释放 PCManager 上的资源
|
|
4347
4159
|
*/
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
}
|
|
4351
|
-
|
|
4352
|
-
declare enum RCRTCRealtimeTranslationType {
|
|
4353
|
-
OPEN = 1,
|
|
4354
|
-
CLOSE = 0
|
|
4355
|
-
}
|
|
4356
|
-
|
|
4357
|
-
declare class RCMediaService {
|
|
4358
|
-
private readonly _runtime;
|
|
4359
|
-
private readonly _context;
|
|
4160
|
+
private _releasePCManager;
|
|
4161
|
+
private _onLocalTrackDestroied;
|
|
4360
4162
|
/**
|
|
4361
|
-
*
|
|
4163
|
+
* 本端流状态修改,需通知房间内其他成员
|
|
4164
|
+
* @param localTrack
|
|
4362
4165
|
*/
|
|
4363
|
-
private
|
|
4166
|
+
private _onLocalTrackMuted;
|
|
4364
4167
|
/**
|
|
4365
|
-
*
|
|
4168
|
+
* 增量发布资源,若发布的资源 tag 及媒体类型重复,后者将覆盖前者进行发布。
|
|
4169
|
+
* @param tracks 待发布的 RCLocalTrack 实例
|
|
4170
|
+
* @returns
|
|
4366
4171
|
*/
|
|
4367
|
-
|
|
4172
|
+
publish(tracks: (RCLocalTrack | IPublishAttrs)[]): Promise<IPubSuccessRes>;
|
|
4368
4173
|
/**
|
|
4369
|
-
*
|
|
4174
|
+
* 获取跨房间连麦需携带参数 pushOtherRooms 的值
|
|
4370
4175
|
*/
|
|
4371
|
-
|
|
4176
|
+
protected _getPushOtherRoomsParams(): IPushOtherRooms[];
|
|
4372
4177
|
/**
|
|
4373
|
-
*
|
|
4178
|
+
* ice 断线后,尝试重新走 exchange
|
|
4374
4179
|
*/
|
|
4375
|
-
|
|
4180
|
+
protected _reTryExchange(): Promise<ICommandResult<void>>;
|
|
4376
4181
|
/**
|
|
4377
|
-
*
|
|
4182
|
+
* 增量取消资源发布,若相应资源中存在小流资源,则同时取消发布
|
|
4183
|
+
* @param tracks 取消发布的 RCLocalTrack 列表
|
|
4378
4184
|
*/
|
|
4379
|
-
|
|
4185
|
+
unpublish(tracks: RCLocalTrack[]): Promise<IPubSuccessRes>;
|
|
4380
4186
|
/**
|
|
4381
|
-
*
|
|
4187
|
+
* resourceId 有效性验证
|
|
4188
|
+
* @param resourceId
|
|
4382
4189
|
*/
|
|
4383
|
-
|
|
4190
|
+
protected _isValidResourceId(resourceId: string): boolean;
|
|
4384
4191
|
/**
|
|
4385
|
-
*
|
|
4192
|
+
* 订阅资源
|
|
4193
|
+
* @param tracks
|
|
4386
4194
|
*/
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
private _qualityMsList;
|
|
4392
|
-
private readonly _logger;
|
|
4393
|
-
constructor(_runtime: IRuntime, _context: RTCContext,
|
|
4195
|
+
subscribe(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
4196
|
+
code: RCRTCCode;
|
|
4197
|
+
failedList?: ISubscribeAttr[];
|
|
4198
|
+
}>;
|
|
4394
4199
|
/**
|
|
4395
|
-
*
|
|
4200
|
+
* 取消订阅资源
|
|
4201
|
+
* @param tracks 预取消远端资源
|
|
4396
4202
|
*/
|
|
4397
|
-
|
|
4203
|
+
unsubscribe(tracks: RCRemoteTrack[]): Promise<{
|
|
4204
|
+
code: RCRTCCode;
|
|
4205
|
+
failedList?: ISubscribeAttr[];
|
|
4206
|
+
}>;
|
|
4398
4207
|
/**
|
|
4399
|
-
*
|
|
4208
|
+
* 强制修改订阅列表,仅订阅数组中的资源,取消订阅其他已订阅资源。
|
|
4209
|
+
* 当参数为 `[]` 时,意味着不再订阅任何资源
|
|
4210
|
+
* @param tracks 变更的资源列表
|
|
4400
4211
|
*/
|
|
4401
|
-
|
|
4212
|
+
updateSubList(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
4213
|
+
code: RCRTCCode;
|
|
4214
|
+
failedList?: ISubscribeAttr[];
|
|
4215
|
+
}>;
|
|
4402
4216
|
/**
|
|
4403
|
-
*
|
|
4404
|
-
*
|
|
4405
|
-
*
|
|
4406
|
-
* navi 数据中 detectionServer 为空时,不需要嗅探
|
|
4407
|
-
* navi 数据中 jwt 为空时,不需要嗅探
|
|
4408
|
-
* 在探测有效期内不需要嗅探
|
|
4409
|
-
* RCMediaService.detectorTime 为 0 时,代表未探测过,需要嗅探
|
|
4217
|
+
* 获取已发布的本地资源
|
|
4218
|
+
* @param trackId
|
|
4219
|
+
* @returns
|
|
4410
4220
|
*/
|
|
4411
|
-
|
|
4412
|
-
detectorMediaSever(): void;
|
|
4221
|
+
getLocalTrack(trackId: string): RCLocalTrack | null;
|
|
4413
4222
|
/**
|
|
4414
|
-
*
|
|
4415
|
-
* RTC 初始化时检测是否可以拿到 navi,可以拿到开始嗅探
|
|
4416
|
-
* 拿不到等 IM 链接成功后,再回调中调用开始嗅探
|
|
4223
|
+
* 获取所有已发布的资源
|
|
4417
4224
|
*/
|
|
4418
|
-
|
|
4225
|
+
getLocalTracks(): RCLocalTrack[];
|
|
4419
4226
|
/**
|
|
4420
|
-
*
|
|
4227
|
+
* 根据 trackId 获取房间内的远端资源
|
|
4228
|
+
* @param trackId
|
|
4229
|
+
* @returns
|
|
4421
4230
|
*/
|
|
4422
|
-
|
|
4423
|
-
getMsList(): string[];
|
|
4231
|
+
getRemoteTrack(trackId: string): RCRemoteAudioTrack | RCRemoteVideoTrack | null;
|
|
4424
4232
|
/**
|
|
4425
|
-
*
|
|
4426
|
-
*
|
|
4233
|
+
* 获取当前已经订阅的全量资源
|
|
4234
|
+
* returns subscribedTracks ISubscribeAttr[]
|
|
4427
4235
|
*/
|
|
4428
|
-
|
|
4236
|
+
get subscribedTracks(): ISubscribeAttr[];
|
|
4237
|
+
private _appListener;
|
|
4429
4238
|
/**
|
|
4430
|
-
*
|
|
4239
|
+
* 注册事件监听器,多次注册会导致后者覆盖前者,可以通过使用 `registerRoomEventListener(null)` 取消注册
|
|
4240
|
+
* @param listener
|
|
4431
4241
|
*/
|
|
4432
|
-
|
|
4242
|
+
registerRoomEventListener(listener: IRoomEventListener | null): void;
|
|
4433
4243
|
/**
|
|
4434
|
-
*
|
|
4244
|
+
* 注册房间数据监控
|
|
4245
|
+
* @param listener
|
|
4246
|
+
* @description 该方法暂仅支持 Chrome 浏览器
|
|
4435
4247
|
*/
|
|
4436
|
-
|
|
4248
|
+
registerReportListener(listener: IRCRTCReportListener | null): void;
|
|
4437
4249
|
/**
|
|
4438
|
-
*
|
|
4439
|
-
* @param
|
|
4440
|
-
* @param
|
|
4441
|
-
* @param body
|
|
4250
|
+
* 音量上报
|
|
4251
|
+
* @param handler 音量事件监听函数
|
|
4252
|
+
* @param _ - 参数已废弃,SDK 默认以每秒一次进行回调~~上报时间间隔~~
|
|
4442
4253
|
*/
|
|
4443
|
-
|
|
4254
|
+
onAudioLevelChange(handler: IAudioLevelChangeHandler | null, _?: number): void;
|
|
4444
4255
|
/**
|
|
4445
|
-
*
|
|
4446
|
-
* 并通过 subscribeList 和 publishList 表明最终发布和订阅的资源。本端产出 offer,服务器产出 answer
|
|
4447
|
-
* 每次接口调用,都会全量覆盖发布和订阅的资源。
|
|
4448
|
-
* @param header
|
|
4449
|
-
* @param body
|
|
4256
|
+
* 断线重连后尝试补发断线过程中的通知信息
|
|
4450
4257
|
*/
|
|
4451
|
-
exchange(headers: IRTCReqHeader, body: IExchangeReqBody, traceId: string, isNeedUpdateMsas?: boolean): Promise<{
|
|
4452
|
-
code: RCRTCCode;
|
|
4453
|
-
data?: IExchangeResponse | undefined;
|
|
4454
|
-
qualityMsList?: IMediaServerQualityData[] | undefined;
|
|
4455
|
-
}>;
|
|
4456
4258
|
/**
|
|
4457
|
-
*
|
|
4259
|
+
* @private
|
|
4260
|
+
* @param livingType
|
|
4458
4261
|
*/
|
|
4459
|
-
|
|
4262
|
+
__onReconnected(livingType?: RCLivingType): void;
|
|
4263
|
+
private _onAudioMuteChange;
|
|
4264
|
+
private _onVideoMuteChange;
|
|
4460
4265
|
/**
|
|
4461
|
-
*
|
|
4266
|
+
* 存储连麦监听事件
|
|
4462
4267
|
*/
|
|
4463
|
-
|
|
4464
|
-
code: RCRTCCode;
|
|
4465
|
-
data?: IBroadcastSubRespBody | undefined;
|
|
4466
|
-
qualityMsList?: IMediaServerQualityData[] | undefined;
|
|
4467
|
-
}>;
|
|
4268
|
+
private _onRecvPKMsg;
|
|
4468
4269
|
/**
|
|
4469
|
-
*
|
|
4270
|
+
* 注册 PK 业务监听方法
|
|
4470
4271
|
*/
|
|
4471
|
-
|
|
4472
|
-
code: RCRTCCode;
|
|
4473
|
-
}>;
|
|
4272
|
+
protected _registerPKMsgListener(listener: IOnRecvPKMsg | null): void;
|
|
4474
4273
|
/**
|
|
4475
|
-
*
|
|
4274
|
+
* 退出 PK 房间
|
|
4476
4275
|
*/
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
res?: any;
|
|
4480
|
-
}>;
|
|
4276
|
+
protected _quitAllPKRoom(): Promise<void>;
|
|
4277
|
+
getClientSessionId(): string;
|
|
4481
4278
|
/**
|
|
4482
|
-
*
|
|
4279
|
+
* 切换已发布视频或音频的媒体设备
|
|
4280
|
+
* @param oldTrack 已经发布的视频轨道或音频轨道
|
|
4281
|
+
* @param newTrack 从新设备获取的视频轨道或音频轨道
|
|
4282
|
+
* @returns code 切换结果,RCRTCCode.SUCCESS 表示切换成功
|
|
4483
4283
|
*/
|
|
4484
|
-
|
|
4485
|
-
code: RCRTCCode;
|
|
4486
|
-
res?: ICDNPlayUrlResponse;
|
|
4487
|
-
}>;
|
|
4488
|
-
updateASRStatus(headers: IRTCReqHeader, body: {
|
|
4489
|
-
'asr_status': RCRTCASRStatus;
|
|
4490
|
-
}, traceId: string): Promise<{
|
|
4491
|
-
code: RCRTCCode;
|
|
4492
|
-
data?: {
|
|
4493
|
-
resultCode: number;
|
|
4494
|
-
} | undefined;
|
|
4495
|
-
qualityMsList?: IMediaServerQualityData[] | undefined;
|
|
4496
|
-
}>;
|
|
4497
|
-
operateRealtimeTranslation(headers: IRTCReqHeader, body: {
|
|
4498
|
-
status: RCRTCRealtimeTranslationType;
|
|
4499
|
-
destLanguage?: string;
|
|
4500
|
-
}, traceId: string): Promise<{
|
|
4284
|
+
changeMediaDevice(oldTrack: RCCameraVideoTrack | RCMicphoneAudioTrack, newTrack: RCCameraVideoTrack | RCMicphoneAudioTrack): Promise<{
|
|
4501
4285
|
code: RCRTCCode;
|
|
4502
|
-
data?: {
|
|
4503
|
-
resultCode: number;
|
|
4504
|
-
} | undefined;
|
|
4505
|
-
qualityMsList?: IMediaServerQualityData[] | undefined;
|
|
4506
4286
|
}>;
|
|
4507
4287
|
}
|
|
4508
4288
|
|
|
@@ -5272,4 +5052,4 @@ declare const helper: {
|
|
|
5272
5052
|
ifSupportScreenShare: typeof ifSupportScreenShare;
|
|
5273
5053
|
};
|
|
5274
5054
|
|
|
5275
|
-
export { BackgroundPictureFillMode, IAudienceRoomEventListener, IAudioLevelChangeHandler, ICameraVideoProfile, ICreateLocalTrackOptions, IJoinRTCRoomOptions, IJoinResCDNInfo, ILiveAudioState, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPKEndInfo, IPKInviteAnswerInfo, IPKInviteInfo, IPubSuccessRes, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCEncryptorHooks, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IRTCUserData, IReqResPKOptions, IRoomEventListener, IRoomPKEventListener, IScreenVideoProfile, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCAudioBitrate, RCCameraVideoTrack, RCEncryptFunction, RCFrameRate, RCInnerCDNPullIsHttps, RCInnerCDNPullKind, RCKickReason, RCLivingRoom, RCLivingType, RCLocalAudioTrack, RCLocalFileAudioTrack, RCLocalFileTrack, RCLocalFileVideoTrack, RCLocalTrack, RCLocalVideoTrack, RCMCUConfigBuilder, RCMediaStreamCapture, RCMediaType, RCMicphoneAudioTrack,
|
|
5055
|
+
export { BackgroundPictureFillMode, IAudienceRoomEventListener, IAudioLevelChangeHandler, ICameraVideoProfile, ICreateLocalTrackOptions, IJoinRTCRoomOptions, IJoinResCDNInfo, ILiveAudioState, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPKEndInfo, IPKInviteAnswerInfo, IPKInviteInfo, IPubSuccessRes, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCEncryptorHooks, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IRTCUserData, IReqResPKOptions, IRoomEventListener, IRoomPKEventListener, IScreenVideoProfile, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCAudioBitrate, RCCameraVideoTrack, RCEncryptFunction, RCFrameRate, RCInnerCDNPullIsHttps, RCInnerCDNPullKind, RCKickReason, RCLivingRoom, RCLivingType, RCLocalAudioTrack, RCLocalFileAudioTrack, RCLocalFileTrack, RCLocalFileVideoTrack, RCLocalTrack, RCLocalVideoTrack, RCMCUConfigBuilder, RCMediaStreamCapture, RCMediaType, RCMicphoneAudioTrack, RCRTCClient, RCRTCCode, RCRTCLiveRole, RCRTCPingResult, RCRTCRoom, RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack, RCResolution, RCScreenAudioTrack, RCScreenVideoTrack, RCTag, RCTrack, RCVideoBitrate, RTCJoinType, RTCMode, device, helper, installer };
|