@rongcloud/plugin-rtc 5.4.7-alpha.4 → 5.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Invoker.d.ts +3 -2
- package/dist/core/PolarisReporter.d.ts +3 -2
- package/dist/core/RCAudienceClient.d.ts +3 -2
- package/dist/core/RCMediaStreamCapture.d.ts +3 -3
- package/dist/core/RCRTCClient.d.ts +25 -3
- package/dist/core/Store.d.ts +5 -3
- package/dist/core/codec/RTCContext.d.ts +76 -0
- package/dist/core/codec/interface.d.ts +168 -0
- package/dist/core/codec/proto.d.ts +94 -0
- package/dist/core/codec/rtc-helper.d.ts +17 -0
- package/dist/core/command/JoinRoomCommand.d.ts +4 -1
- package/dist/core/command/OnSignalReconnectedCommand.d.ts +1 -1
- package/dist/core/command/PubCommand.d.ts +34 -0
- package/dist/core/command/RTCIdentityChangeCommand.d.ts +2 -1
- package/dist/core/constants.d.ts +2 -0
- package/dist/core/enums/RCLoggerTag.d.ts +9 -1
- package/dist/core/enums/RCRTCCode.d.ts +3 -0
- package/dist/core/enums/RCResolution.d.ts +8 -8
- package/dist/core/enums/RTCJoinType.d.ts +18 -0
- package/dist/core/enums/RTCMode.d.ts +22 -0
- package/dist/core/enums/inner/LiveRole.d.ts +11 -0
- package/dist/core/enums/inner/LiveType.d.ts +14 -0
- package/dist/core/enums/inner/RTCApiType.d.ts +5 -0
- package/dist/core/enums/inner/RTCIdentityChangeType.d.ts +5 -0
- package/dist/core/interfaces.d.ts +11 -0
- package/dist/core/room/Pinger.d.ts +3 -2
- package/dist/core/room/RCAbstractRoom.d.ts +7 -3
- package/dist/core/room/RCAudienceLivingRoom.d.ts +7 -2
- package/dist/core/room/RCLivingPKHandler.d.ts +3 -2
- package/dist/core/room/RCLivingRoom.d.ts +6 -2
- package/dist/core/room/RCRTCRoom.d.ts +5 -3
- package/dist/core/service/RCMediaService.d.ts +27 -2
- package/dist/core/service/helper.d.ts +11 -1
- package/dist/core/service/interface.d.ts +6 -1
- package/dist/helper.d.ts +3 -1
- package/dist/index.d.ts +399 -31
- package/dist/index.esm.js +15 -19394
- package/dist/index.js +15 -19426
- package/dist/index.umd.js +15 -19430
- package/package.json +3 -3
package/dist/core/Invoker.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { RTCMode, RTCPluginContext } from '@rongcloud/engine';
|
|
2
1
|
import { BaseCommand } from './command/BaseCommand';
|
|
3
2
|
import { RCRTCCode } from './enums/RCRTCCode';
|
|
4
3
|
import PolarisReporter from './PolarisReporter';
|
|
5
4
|
import { RCMediaService } from './service';
|
|
6
5
|
import { ReadableStore, Store } from './Store';
|
|
7
6
|
import RCRTCPeerCManager from './webrtc/RCRTCPeerCManager';
|
|
7
|
+
import { RTCContext } from './codec/RTCContext';
|
|
8
|
+
import { RTCMode } from './enums/RTCMode';
|
|
8
9
|
export declare class BaseInvoker<STORE> {
|
|
9
10
|
/**
|
|
10
11
|
* 内存数据管理实例
|
|
@@ -44,7 +45,7 @@ export declare class BaseInvoker<STORE> {
|
|
|
44
45
|
* 房间任务队列管理
|
|
45
46
|
*/
|
|
46
47
|
export declare class Invoker extends BaseInvoker<Store> {
|
|
47
|
-
constructor(context:
|
|
48
|
+
constructor(context: RTCContext, service: RCMediaService, peerMrg: RCRTCPeerCManager, roomId: string, crtUserId: string, mode: RTCMode, reporter: PolarisReporter, isUpgrade?: boolean, isMainRoom?: boolean);
|
|
48
49
|
/**
|
|
49
50
|
* 获取 store 存储实例,返回值类型 `ReadableStore`,避免非 command 定义中修改内存
|
|
50
51
|
*/
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IRuntime } from '@rongcloud/engine';
|
|
2
2
|
import { IInnerRCRTCStateReport } from './interfaces';
|
|
3
3
|
import RCAbstractRoom from './room/RCAbstractRoom';
|
|
4
4
|
import RCAudienceLivingRoom from './room/RCAudienceLivingRoom';
|
|
5
5
|
import { PolarisRole } from './enums/inner/PolarisRole';
|
|
6
|
+
import { RTCContext } from './codec/RTCContext';
|
|
6
7
|
export default class PolarisReporter {
|
|
7
8
|
private readonly _context;
|
|
8
9
|
private readonly _runtime;
|
|
9
10
|
private readonly _roomId;
|
|
10
11
|
private readonly _crtRTCRoom;
|
|
11
12
|
private readonly _userRole;
|
|
12
|
-
constructor(_context:
|
|
13
|
+
constructor(_context: RTCContext, _runtime: IRuntime, _roomId: string, _crtRTCRoom: RCAbstractRoom | RCAudienceLivingRoom, _userRole?: PolarisRole);
|
|
13
14
|
private _send;
|
|
14
15
|
private _getClientID;
|
|
15
16
|
/**
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { IRuntime
|
|
1
|
+
import { IRuntime } from '@rongcloud/engine';
|
|
2
2
|
import { IRCRTCReportListener, IRCRTCTrackEventListener, IRCRTCInitOptions } from './interfaces';
|
|
3
3
|
import { RCRemoteTrack } from './tracks/RCRemoteTrack';
|
|
4
4
|
import { RCLivingType } from './enums/RCLivingType';
|
|
5
5
|
import { RCRTCCode } from './enums/RCRTCCode';
|
|
6
6
|
import { RCMediaType } from './enums/RCMediaType';
|
|
7
|
+
import { RTCContext } from './codec/RTCContext';
|
|
7
8
|
/**
|
|
8
9
|
* 直播观众客户端
|
|
9
10
|
*/
|
|
@@ -40,7 +41,7 @@ export default class RCAudienceClient {
|
|
|
40
41
|
*/
|
|
41
42
|
private _peerCManager;
|
|
42
43
|
private readonly _clientSessionId;
|
|
43
|
-
constructor(_context:
|
|
44
|
+
constructor(_context: RTCContext, runtime: IRuntime, _initOption: IRCRTCInitOptions,
|
|
44
45
|
/**
|
|
45
46
|
* 是否使用多 peerConnection
|
|
46
47
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { RCRTCCode } from './enums/RCRTCCode';
|
|
2
2
|
import { ICameraVideoProfile, ICreateLocalTrackOptions, IMicphoneAudioProfile, IScreenVideoProfile } from './interfaces';
|
|
3
3
|
import { RCCameraVideoTrack, RCLocalAudioTrack, RCLocalFileTrack, RCLocalTrack, RCLocalVideoTrack, RCMicphoneAudioTrack, RCScreenAudioTrack, RCScreenVideoTrack } from './tracks/RCLocalTrack';
|
|
4
|
-
import {
|
|
4
|
+
import { RTCContext } from './codec/RTCContext';
|
|
5
5
|
export default class RCMediaStreamCapture {
|
|
6
|
-
protected readonly _context:
|
|
7
|
-
constructor(_context:
|
|
6
|
+
protected readonly _context: RTCContext;
|
|
7
|
+
constructor(_context: RTCContext);
|
|
8
8
|
private _isElectron;
|
|
9
9
|
private _getMediaStream;
|
|
10
10
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ErrorCode, IRuntime
|
|
1
|
+
import { ErrorCode, IRuntime } from '@rongcloud/engine';
|
|
2
2
|
import RCLivingRoom from './room/RCLivingRoom';
|
|
3
3
|
import RCRTCRoom from './room/RCRTCRoom';
|
|
4
4
|
import RCAudienceClient from './RCAudienceClient';
|
|
@@ -9,17 +9,25 @@ import { RCLivingType } from './enums/RCLivingType';
|
|
|
9
9
|
import { RCRemoteTrack } from './tracks/RCRemoteTrack';
|
|
10
10
|
import RCAudienceLivingRoom from './room/RCAudienceLivingRoom';
|
|
11
11
|
import RCMediaStreamCapture from './RCMediaStreamCapture';
|
|
12
|
+
import { RTCContext } from './codec/RTCContext';
|
|
13
|
+
import { RTCMode } from './enums/RTCMode';
|
|
14
|
+
import { RTCJoinType } from './enums/RTCJoinType';
|
|
15
|
+
import { IRTCUserData, IRTCJoinedInfo } from './codec/interface';
|
|
12
16
|
/**
|
|
13
17
|
* RTC 业务客户端
|
|
14
18
|
* @public
|
|
15
19
|
*/
|
|
16
20
|
export default class RCRTCClient extends RCMediaStreamCapture {
|
|
17
|
-
protected readonly _context:
|
|
21
|
+
protected readonly _context: RTCContext;
|
|
18
22
|
private readonly _runtime;
|
|
19
23
|
private readonly _options;
|
|
20
24
|
private readonly _service;
|
|
21
|
-
constructor(_context:
|
|
25
|
+
constructor(_context: RTCContext, _runtime: IRuntime, _options: IRCRTCInitOptions);
|
|
22
26
|
private _handleMessage;
|
|
27
|
+
/**
|
|
28
|
+
* voip 变更、jwt 变更需要触发重走嗅探逻辑
|
|
29
|
+
*/
|
|
30
|
+
private naviDataChange;
|
|
23
31
|
/**
|
|
24
32
|
* 获取加入的连麦房间
|
|
25
33
|
*/
|
|
@@ -44,6 +52,20 @@ export default class RCRTCClient extends RCMediaStreamCapture {
|
|
|
44
52
|
userIds?: string[];
|
|
45
53
|
tracks?: RCRemoteTrack[];
|
|
46
54
|
}>;
|
|
55
|
+
/**
|
|
56
|
+
* 加入跨AppKey音视频房间
|
|
57
|
+
* @param roomId
|
|
58
|
+
* @param joinType 多端处理方式
|
|
59
|
+
* @param outerUserDatas 业务层设置人员属性
|
|
60
|
+
* @param useMutilPeerC 是否使用多 peerConnection 发布资源
|
|
61
|
+
* @param roomType 加入房间的类型 默认参数 RTCMode.CROSS_MUTI
|
|
62
|
+
*/
|
|
63
|
+
joinCrossRTCRoom(roomId: string, joinType?: RTCJoinType, outerUserDatas?: IRTCUserData, useMutilPeerC?: boolean, roomType?: RTCMode): Promise<{
|
|
64
|
+
room?: RCRTCRoom;
|
|
65
|
+
code: RCRTCCode;
|
|
66
|
+
userIds?: string[];
|
|
67
|
+
tracks?: RCRemoteTrack[];
|
|
68
|
+
}>;
|
|
47
69
|
/**
|
|
48
70
|
* 主播加入直播房间或观众上麦场景调用,观众上麦之前需先取消已订阅的直播间资源
|
|
49
71
|
* @param roomId 房间 Id
|
package/dist/core/Store.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IJoinRTCRoomData, RTCMode, RTCPluginContext } from '@rongcloud/engine';
|
|
2
1
|
import { IPublishedResource, ISubscribeAttr, RoomData } from './interfaces';
|
|
3
2
|
import PolarisReporter from './PolarisReporter';
|
|
4
3
|
import { RCMediaService } from './service';
|
|
@@ -6,9 +5,12 @@ import { ICDNUris } from './service/interface';
|
|
|
6
5
|
import { RCLocalTrack } from './tracks/RCLocalTrack';
|
|
7
6
|
import { RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack } from './tracks/RCRemoteTrack';
|
|
8
7
|
import RCRTCPeerCManager from './webrtc/RCRTCPeerCManager';
|
|
8
|
+
import { RTCContext } from './codec/RTCContext';
|
|
9
|
+
import { RTCMode } from './enums/RTCMode';
|
|
10
|
+
import { IJoinRTCRoomData } from './codec/interface';
|
|
9
11
|
export declare const StoreEvent: {};
|
|
10
12
|
export declare abstract class ReadableStore {
|
|
11
|
-
readonly context:
|
|
13
|
+
readonly context: RTCContext;
|
|
12
14
|
readonly service: RCMediaService;
|
|
13
15
|
readonly peerMgr: RCRTCPeerCManager;
|
|
14
16
|
readonly roomId: string;
|
|
@@ -46,7 +48,7 @@ export declare abstract class ReadableStore {
|
|
|
46
48
|
protected _CDNUris: ICDNUris | null;
|
|
47
49
|
protected _CDNEnable: boolean;
|
|
48
50
|
protected _destroyed: boolean;
|
|
49
|
-
constructor(context:
|
|
51
|
+
constructor(context: RTCContext, service: RCMediaService, peerMgr: RCRTCPeerCManager, roomId: string, crtUserId: string, roomMode: RTCMode, polarisReport: PolarisReporter, isUpgrade?: boolean | undefined, isMainRoom?: boolean | undefined);
|
|
50
52
|
get useMutilPeerC(): boolean;
|
|
51
53
|
getResourcesByUserId(userId: string): IPublishedResource[] | undefined;
|
|
52
54
|
getRemoteTrack(trackId: string): RCRemoteTrack | undefined;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AbsCodec, ErrorCode, IAsyncRes, IPromiseResult, KVString, RTCPluginContext, ConversationType, ISendMsgOptions, IReceivedMessage, ConnectionStatus } from '@rongcloud/engine';
|
|
2
|
+
import { RTCMode } from '../enums/RTCMode';
|
|
3
|
+
import { RTCJoinType } from '../enums/RTCJoinType';
|
|
4
|
+
import { RTCApiType } from '../enums/inner/RTCApiType';
|
|
5
|
+
import { RTCIdentityChangeType } from '../enums/inner/RTCIdentityChangeType';
|
|
6
|
+
import { IChrmKVPullData } from '../interfaces';
|
|
7
|
+
import { RTCKeyMaps } from './proto';
|
|
8
|
+
import { IRTCUserData, IJoinRTCRoomData, IRTCRoomInfo, IRTCUsers, IRtcTokenData, IServerRTCRoomEntry, IReqRoomPKOptions, ICancelRoomPKOptions, IResRoomPKOptions, IEndRoomPKOptions, IRTCJoinedInfo } from './interface';
|
|
9
|
+
export declare class RTCContext {
|
|
10
|
+
private context;
|
|
11
|
+
private codec;
|
|
12
|
+
constructor(context: RTCPluginContext, codec: AbsCodec<RTCKeyMaps>);
|
|
13
|
+
joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData): IPromiseResult<IJoinRTCRoomData>;
|
|
14
|
+
quitRTCRoom(roomId: string): Promise<ErrorCode>;
|
|
15
|
+
getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
|
|
16
|
+
getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
|
|
17
|
+
getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
|
|
18
|
+
removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
|
|
19
|
+
setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
|
|
20
|
+
name: string;
|
|
21
|
+
content: string;
|
|
22
|
+
}): Promise<ErrorCode>;
|
|
23
|
+
/**
|
|
24
|
+
* 全量订阅资源修改
|
|
25
|
+
* @param roomId 房间 Id
|
|
26
|
+
* @param message 向前兼容的消息内容
|
|
27
|
+
* @param valueInfo 全量资源数据
|
|
28
|
+
* @param objectName 全量 URI 消息名
|
|
29
|
+
*/
|
|
30
|
+
setRTCTotalRes(roomId: string, message: {
|
|
31
|
+
name: string;
|
|
32
|
+
content: string;
|
|
33
|
+
}, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
|
|
34
|
+
setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
|
|
35
|
+
getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
|
|
36
|
+
removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
|
|
37
|
+
name: string;
|
|
38
|
+
content: string;
|
|
39
|
+
}): Promise<ErrorCode>;
|
|
40
|
+
setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
|
|
41
|
+
getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
|
|
42
|
+
getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
|
|
43
|
+
setRTCState(roomId: string, report: string): Promise<ErrorCode>;
|
|
44
|
+
getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
|
|
45
|
+
joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
|
|
46
|
+
token: string;
|
|
47
|
+
kvEntries: IServerRTCRoomEntry[];
|
|
48
|
+
}>>;
|
|
49
|
+
quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
|
|
50
|
+
rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
|
|
51
|
+
requestRoomPK(options: IReqRoomPKOptions): Promise<ErrorCode>;
|
|
52
|
+
cancelRoomPK(options: ICancelRoomPKOptions): Promise<ErrorCode>;
|
|
53
|
+
responseRoomPK(options: IResRoomPKOptions): Promise<ErrorCode>;
|
|
54
|
+
endRoomPK(options: IEndRoomPKOptions): Promise<ErrorCode>;
|
|
55
|
+
getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
|
|
56
|
+
pullRTCRoomEntry(roomId: string): Promise<IAsyncRes<IChrmKVPullData>>;
|
|
57
|
+
decodeRtcNotify(buffer: Uint8Array): {
|
|
58
|
+
time: any;
|
|
59
|
+
type: any;
|
|
60
|
+
roomId: any;
|
|
61
|
+
};
|
|
62
|
+
getCurrentId(): string;
|
|
63
|
+
getNaviInfo(): import("@rongcloud/engine").INaviInfo | null;
|
|
64
|
+
getConnectionStatus(): ConnectionStatus;
|
|
65
|
+
getAppkey(): string;
|
|
66
|
+
rtcPing(roomId: string, roomMode: number, broadcastType?: number): Promise<ErrorCode>;
|
|
67
|
+
sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions): IPromiseResult<IReceivedMessage>;
|
|
68
|
+
registerRTCSignalListener(listener?: ((buffer: Uint8Array) => void) | undefined): void;
|
|
69
|
+
registerConnectionStateChangeListener(listener: (status: ConnectionStatus) => void): void;
|
|
70
|
+
registerDisconnectListener(listener: () => void): void;
|
|
71
|
+
registerDestroyListener(listener: () => void): void;
|
|
72
|
+
registerMessageListener(listener: (message: IReceivedMessage) => boolean): void;
|
|
73
|
+
getCoreVersion(): string;
|
|
74
|
+
getPluginContext(): RTCPluginContext;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=RTCContext.d.ts.map
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 设置 RTC 人员 inner、outer 数据
|
|
3
|
+
*/
|
|
4
|
+
export interface IRTCUserData {
|
|
5
|
+
[key: string]: string;
|
|
6
|
+
}
|
|
7
|
+
export interface IRtcTokenData {
|
|
8
|
+
rtcToken: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 加入 RTC 房间的用户信息
|
|
12
|
+
*/
|
|
13
|
+
export interface IRTCJoinedInfo {
|
|
14
|
+
/**
|
|
15
|
+
* 设备 ID
|
|
16
|
+
*/
|
|
17
|
+
deviceId: string;
|
|
18
|
+
/**
|
|
19
|
+
* RTC 房间 ID
|
|
20
|
+
*/
|
|
21
|
+
roomId: string;
|
|
22
|
+
/**
|
|
23
|
+
* 加入的时间戳
|
|
24
|
+
*/
|
|
25
|
+
joinTime: number;
|
|
26
|
+
}
|
|
27
|
+
export interface IRTCRoomInfo {
|
|
28
|
+
roomId: string;
|
|
29
|
+
roomData: unknown[];
|
|
30
|
+
userCount: number;
|
|
31
|
+
list: unknown[];
|
|
32
|
+
}
|
|
33
|
+
export interface IServerRTCRoomEntry {
|
|
34
|
+
key: string;
|
|
35
|
+
value: string;
|
|
36
|
+
status: number;
|
|
37
|
+
timestamp: number;
|
|
38
|
+
uid: string;
|
|
39
|
+
}
|
|
40
|
+
export interface IRTCUsers {
|
|
41
|
+
users: {
|
|
42
|
+
[userId: string]: {
|
|
43
|
+
/**
|
|
44
|
+
* 发布的资源数据,是一个 JSON 字符串,解析后为发布的资源列表
|
|
45
|
+
*/
|
|
46
|
+
uris?: string;
|
|
47
|
+
/**
|
|
48
|
+
* 加房间的身份标识,保存主房间 roomId
|
|
49
|
+
*/
|
|
50
|
+
extra?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface IJoinRTCRoomData extends IRTCUsers {
|
|
55
|
+
token: string;
|
|
56
|
+
sessionId: string;
|
|
57
|
+
roomInfo: {
|
|
58
|
+
key: string;
|
|
59
|
+
value: string;
|
|
60
|
+
}[];
|
|
61
|
+
kvEntries: IServerRTCRoomEntry[];
|
|
62
|
+
offlineKickTime: number;
|
|
63
|
+
}
|
|
64
|
+
export interface IReqRoomPKOptions {
|
|
65
|
+
/**
|
|
66
|
+
* 当前房间 ID
|
|
67
|
+
*/
|
|
68
|
+
roomId: string;
|
|
69
|
+
/**
|
|
70
|
+
* 被邀请房间 ID
|
|
71
|
+
*/
|
|
72
|
+
invitedRoomId: string;
|
|
73
|
+
/**
|
|
74
|
+
* 被邀请用户 ID
|
|
75
|
+
*/
|
|
76
|
+
invitedUserId: string;
|
|
77
|
+
/**
|
|
78
|
+
* 本次邀请超时时间
|
|
79
|
+
*/
|
|
80
|
+
inviteTimeout: number;
|
|
81
|
+
/**
|
|
82
|
+
* 本次邀请额外信息
|
|
83
|
+
*/
|
|
84
|
+
inviteInfo: string;
|
|
85
|
+
/**
|
|
86
|
+
* 本次邀请唯一 ID
|
|
87
|
+
*/
|
|
88
|
+
inviteSessionId: string;
|
|
89
|
+
}
|
|
90
|
+
export interface ICancelRoomPKOptions {
|
|
91
|
+
/**
|
|
92
|
+
* 当前房间 ID
|
|
93
|
+
*/
|
|
94
|
+
roomId: string;
|
|
95
|
+
/**
|
|
96
|
+
* 被邀请房间 ID
|
|
97
|
+
*/
|
|
98
|
+
invitedRoomId: string;
|
|
99
|
+
/**
|
|
100
|
+
* 被邀请用户 ID
|
|
101
|
+
*/
|
|
102
|
+
invitedUserId: string;
|
|
103
|
+
/**
|
|
104
|
+
* 本次邀请额外信息
|
|
105
|
+
*/
|
|
106
|
+
inviteInfo: string;
|
|
107
|
+
/**
|
|
108
|
+
* 本次邀请唯一 ID
|
|
109
|
+
*/
|
|
110
|
+
inviteSessionId: string;
|
|
111
|
+
}
|
|
112
|
+
export interface IResRoomPKOptions {
|
|
113
|
+
/**
|
|
114
|
+
* 当前房间 ID
|
|
115
|
+
*/
|
|
116
|
+
roomId: string;
|
|
117
|
+
/**
|
|
118
|
+
* 邀请者 ID
|
|
119
|
+
*/
|
|
120
|
+
inviteUserId: string;
|
|
121
|
+
/**
|
|
122
|
+
* 邀请者房间 ID
|
|
123
|
+
*/
|
|
124
|
+
inviteRoomId: string;
|
|
125
|
+
/**
|
|
126
|
+
* 邀请的 session ID
|
|
127
|
+
*/
|
|
128
|
+
inviteSessionId: string;
|
|
129
|
+
/**
|
|
130
|
+
* 需要转发的信息
|
|
131
|
+
*/
|
|
132
|
+
content: string;
|
|
133
|
+
/**
|
|
134
|
+
* 同意邀请时要设置的 key, 放在room级别的k和v,新加入房间的能拉取到
|
|
135
|
+
*/
|
|
136
|
+
key: string;
|
|
137
|
+
/**
|
|
138
|
+
* 同意邀请时要设置的 value, 放在room级别的k和v,新加入房间的能拉取到
|
|
139
|
+
*/
|
|
140
|
+
value: string;
|
|
141
|
+
/**
|
|
142
|
+
* 是否同意邀请
|
|
143
|
+
*/
|
|
144
|
+
agree: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface IEndRoomPKOptions {
|
|
147
|
+
/**
|
|
148
|
+
* 当前房间 ID
|
|
149
|
+
*/
|
|
150
|
+
roomId: string;
|
|
151
|
+
/**
|
|
152
|
+
* 需要结束的连麦房间 ID
|
|
153
|
+
*/
|
|
154
|
+
endRoomId: string;
|
|
155
|
+
/**
|
|
156
|
+
* 需要结束连麦的 sessionID
|
|
157
|
+
*/
|
|
158
|
+
sessionId: string;
|
|
159
|
+
/**
|
|
160
|
+
* 结束连麦的信息
|
|
161
|
+
*/
|
|
162
|
+
content: string;
|
|
163
|
+
/**
|
|
164
|
+
* 需要删除连麦的信息的 keys
|
|
165
|
+
*/
|
|
166
|
+
keys: string[];
|
|
167
|
+
}
|
|
168
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* signal 服务 RTC 业务的接口定义
|
|
3
|
+
*/
|
|
4
|
+
export declare const RTC_API: {
|
|
5
|
+
rtcRJoin_data: string;
|
|
6
|
+
rtcRExit: string;
|
|
7
|
+
rtcRInfo: string;
|
|
8
|
+
rtcUData: string;
|
|
9
|
+
rtcUDel: string;
|
|
10
|
+
rtcSetData: string;
|
|
11
|
+
/** 全量资源 URI 变更接口 */
|
|
12
|
+
userSetData: string;
|
|
13
|
+
rtcQryData: string;
|
|
14
|
+
rtcDelData: string;
|
|
15
|
+
rtcToken: string;
|
|
16
|
+
rtcUserState: string;
|
|
17
|
+
rtcUList: string;
|
|
18
|
+
/** RTC 直播观众加房间 */
|
|
19
|
+
viewerJoinR: string;
|
|
20
|
+
/** RTC 直播观众退出房间 */
|
|
21
|
+
viewerExitR: string;
|
|
22
|
+
/** RTC 观众端 kv 通知拉取 (kv 为主播加入/退出人员列表、发布/取消发布的资源) */
|
|
23
|
+
rtcPullKv: string;
|
|
24
|
+
/** RTC 直播身份切换 */
|
|
25
|
+
rtcIdentityChange: string;
|
|
26
|
+
/** 直播连麦邀请 */
|
|
27
|
+
rtcInvite: string;
|
|
28
|
+
/** 直播连麦取消邀请 */
|
|
29
|
+
rtcCancelInvite: string;
|
|
30
|
+
/** 直播连麦邀请响应 */
|
|
31
|
+
rtcInviteAnswer: string;
|
|
32
|
+
/** 结束直播连麦邀请 */
|
|
33
|
+
rtcEndInvite: string;
|
|
34
|
+
/** RTC 查询用户信息(是否在房间内) */
|
|
35
|
+
rtcQueryJoined: string;
|
|
36
|
+
};
|
|
37
|
+
export declare enum RTCPB {
|
|
38
|
+
RtcInput = "RtcInput",
|
|
39
|
+
RtcUserListOutput = "RtcUserListOutput",
|
|
40
|
+
SetUserStatusInput = "SetUserStatusInput",
|
|
41
|
+
RtcSetDataInput = "RtcSetDataInput",
|
|
42
|
+
RtcUserSetDataInput = "RtcUserSetDataInput",
|
|
43
|
+
RtcDataInput = "RtcDataInput",
|
|
44
|
+
RtcSetOutDataInput = "RtcSetOutDataInput",
|
|
45
|
+
MCFollowInput = "MCFollowInput",
|
|
46
|
+
RtcTokenOutput = "RtcTokenOutput",
|
|
47
|
+
RtcQryOutput = "RtcQryOutput",
|
|
48
|
+
RtcQryUserOutDataInput = "RtcQryUserOutDataInput",
|
|
49
|
+
RtcUserOutDataOutput = "RtcUserOutDataOutput",
|
|
50
|
+
RtcQueryListInput = "RtcQueryListInput",
|
|
51
|
+
RtcRoomInfoOutput = "RtcRoomInfoOutput",
|
|
52
|
+
RtcValueInfo = "RtcValueInfo",
|
|
53
|
+
RtcKeyDeleteInput = "RtcKeyDeleteInput",
|
|
54
|
+
RtcNotifyMsg = "RtcNotifyMsg",
|
|
55
|
+
RtcPullKV = "RtcPullKV",
|
|
56
|
+
RtcKVOutput = "RtcKVOutput",
|
|
57
|
+
RtcQueryUserJoinedInput = "RtcQueryUserJoinedInput",
|
|
58
|
+
RtcQueryUserJoinedOutput = "RtcQueryUserJoinedOutput",
|
|
59
|
+
RtcViewerJoinedOutput = "RtcViewerJoinedOutput",
|
|
60
|
+
RtcInviteInput = "RtcInviteInput",
|
|
61
|
+
RtcCancelInviteInput = "RtcCancelInviteInput",
|
|
62
|
+
RtcInviteAnswerInput = "RtcInviteAnswerInput",
|
|
63
|
+
RtcEndInviteInput = "RtcEndInviteInput"
|
|
64
|
+
}
|
|
65
|
+
export declare const keymaps: {
|
|
66
|
+
readonly RtcInput: readonly ["roomType", "broadcastType", "extraInnerData", "needSysChatroom", "identityChangeType", "joinType", "innerDatas", "outerDatas"];
|
|
67
|
+
readonly RtcUserListOutput: readonly ["users", "token", "sessionId", "roomInfo"];
|
|
68
|
+
readonly SetUserStatusInput: readonly ["status"];
|
|
69
|
+
readonly RtcSetDataInput: readonly ["interior", "target", "key", "value", "objectName", "content"];
|
|
70
|
+
readonly RtcUserSetDataInput: readonly ["valueInfo", "objectName", "content"];
|
|
71
|
+
readonly RtcDataInput: readonly ["interior", "target", "key", "objectName", "content"];
|
|
72
|
+
readonly RtcSetOutDataInput: readonly ["target", "valueInfo", "objectName", "content"];
|
|
73
|
+
readonly MCFollowInput: readonly ["state"];
|
|
74
|
+
readonly RtcTokenOutput: readonly ["rtcToken"];
|
|
75
|
+
readonly RtcQryOutput: readonly ["outInfo"];
|
|
76
|
+
readonly RtcQryUserOutDataInput: readonly ["userId"];
|
|
77
|
+
readonly RtcUserOutDataOutput: readonly ["user"];
|
|
78
|
+
readonly RtcQueryListInput: readonly ["order"];
|
|
79
|
+
readonly RtcRoomInfoOutput: readonly ["roomId", "roomData", "userCount", "list"];
|
|
80
|
+
readonly RtcValueInfo: readonly ["key", "value"];
|
|
81
|
+
readonly RtcKeyDeleteInput: readonly ["key"];
|
|
82
|
+
readonly RtcNotifyMsg: readonly ["type", "time", "roomId"];
|
|
83
|
+
readonly RtcPullKV: readonly ["timestamp", "roomId"];
|
|
84
|
+
readonly RtcKVOutput: readonly ["entries", "bFullUpdate", "syncTime"];
|
|
85
|
+
readonly RtcQueryUserJoinedInput: readonly ["userId"];
|
|
86
|
+
readonly RtcQueryUserJoinedOutput: readonly ["info"];
|
|
87
|
+
readonly RtcInviteInput: readonly ["invitedUserId", "timeoutTime", "invitedRoomId", "inviteInfo", "inviteSessionId"];
|
|
88
|
+
readonly RtcCancelInviteInput: readonly ["invitedUserId", "invitedRoomId", "inviteInfo", "inviteSessionId"];
|
|
89
|
+
readonly RtcInviteAnswerInput: readonly ["inviteUserId", "answerCode", "inviteRoomId", "inviteSessionId", "content", "key", "value"];
|
|
90
|
+
readonly RtcEndInviteInput: readonly ["inviteRoomId", "inviteSessionId", "inviteContent", "inviteRoomKeys"];
|
|
91
|
+
};
|
|
92
|
+
export declare type RTCKeyMaps = typeof keymaps;
|
|
93
|
+
export declare const desc: string;
|
|
94
|
+
//# sourceMappingURL=proto.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AbsCodec } from '@rongcloud/engine';
|
|
2
|
+
import { RTCMode } from '../enums/RTCMode';
|
|
3
|
+
import { RTCJoinType } from '../enums/RTCJoinType';
|
|
4
|
+
import { RTCKeyMaps } from './proto';
|
|
5
|
+
import { IRTCUserData, IJoinRTCRoomData } from './interface';
|
|
6
|
+
export declare const encodeRtcInput: (codec: AbsCodec<RTCKeyMaps>, roomType: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData) => ArrayBuffer | {
|
|
7
|
+
roomType?: any;
|
|
8
|
+
broadcastType?: any;
|
|
9
|
+
extraInnerData?: any;
|
|
10
|
+
needSysChatroom?: any;
|
|
11
|
+
identityChangeType?: any;
|
|
12
|
+
joinType?: any;
|
|
13
|
+
innerDatas?: any;
|
|
14
|
+
outerDatas?: any;
|
|
15
|
+
};
|
|
16
|
+
export declare const decodeRtcUserListOutput: (codec: AbsCodec<RTCKeyMaps>, buffer: Uint8Array | string) => IJoinRTCRoomData;
|
|
17
|
+
//# sourceMappingURL=rtc-helper.d.ts.map
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { RCRTCCode } from '../enums/RCRTCCode';
|
|
2
2
|
import { BaseCommand } from './BaseCommand';
|
|
3
3
|
import { Store } from '../Store';
|
|
4
|
-
import { ErrorCode
|
|
4
|
+
import { ErrorCode } from '@rongcloud/engine';
|
|
5
5
|
import { RCLivingType } from '../enums/RCLivingType';
|
|
6
6
|
import { Invoker } from '../Invoker';
|
|
7
7
|
import { RCCommandKind } from '../enums/RCCommandKind';
|
|
8
|
+
import { RTCMode } from '../enums/RTCMode';
|
|
9
|
+
import { RTCJoinType } from '../enums/RTCJoinType';
|
|
10
|
+
import { IJoinRTCRoomData, IRTCUserData } from '../codec/interface';
|
|
8
11
|
/**
|
|
9
12
|
* 资源发布命令
|
|
10
13
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { IJoinRTCRoomData } from '@rongcloud/engine';
|
|
2
1
|
import { RCLivingType } from '../enums/RCLivingType';
|
|
3
2
|
import { Invoker } from '../Invoker';
|
|
4
3
|
import { Store } from '../Store';
|
|
5
4
|
import { RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack } from '../tracks/RCRemoteTrack';
|
|
6
5
|
import { BaseCommand, CommandPriority } from './BaseCommand';
|
|
7
6
|
import { Subscribehook } from './UpdateSubscribeListCommand';
|
|
7
|
+
import { IJoinRTCRoomData } from '../codec/interface';
|
|
8
8
|
export declare type ReconnectedCommandCallback = {
|
|
9
9
|
onPeerClosed: () => void;
|
|
10
10
|
onUserJoin: (userIds: string[]) => void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BaseCommand } from './BaseCommand';
|
|
2
|
+
import { IMutilPeerC, IPublishAttrs, IPubSuccessRes } from '../interfaces';
|
|
3
|
+
import { Store } from '../Store';
|
|
4
|
+
import { RCLocalTrack } from '../tracks/RCLocalTrack';
|
|
5
|
+
import { IPushOtherRooms, IRTCReqHeader } from '../service';
|
|
6
|
+
import { Invoker } from '../Invoker';
|
|
7
|
+
export declare type PubhookPeerItem = IMutilPeerC & {
|
|
8
|
+
headers: IRTCReqHeader;
|
|
9
|
+
};
|
|
10
|
+
export declare type PubhookRes = {
|
|
11
|
+
plist: PubhookPeerItem[];
|
|
12
|
+
pushOtherRooms: IPushOtherRooms[];
|
|
13
|
+
};
|
|
14
|
+
export declare type Pubhook = (tracks: (RCLocalTrack | IPublishAttrs)[]) => PubhookRes;
|
|
15
|
+
/**
|
|
16
|
+
* 资源发布命令
|
|
17
|
+
*/
|
|
18
|
+
export declare class PubCommand extends BaseCommand<IPubSuccessRes> {
|
|
19
|
+
private tracks;
|
|
20
|
+
private pubhook;
|
|
21
|
+
constructor(tracks: (RCLocalTrack | IPublishAttrs)[], pubhook: Pubhook);
|
|
22
|
+
/**
|
|
23
|
+
* 从 pc 移除当次发布失败的资源
|
|
24
|
+
*/
|
|
25
|
+
private _removePubFailedTracks;
|
|
26
|
+
private __publish;
|
|
27
|
+
/**
|
|
28
|
+
* 处理批量 /exhcange 的返回数据,作为一次 publish 接口返回
|
|
29
|
+
* @param pubResList 每一个 tag 的发布结果[]
|
|
30
|
+
*/
|
|
31
|
+
private _mergePublishRes;
|
|
32
|
+
execute(store: Store, invoker: Invoker): Promise<IPubSuccessRes>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=PubCommand.d.ts.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ErrorCode
|
|
1
|
+
import { ErrorCode } from '@rongcloud/engine';
|
|
2
2
|
import { RCLivingType } from '../enums/RCLivingType';
|
|
3
3
|
import { BaseInvoker } from '../Invoker';
|
|
4
4
|
import { Store } from '../Store';
|
|
5
5
|
import { BaseCommand } from './BaseCommand';
|
|
6
|
+
import { IJoinRTCRoomData } from '../codec/interface';
|
|
6
7
|
export declare class RTCIdentityChangeCommand extends BaseCommand<{
|
|
7
8
|
code: ErrorCode;
|
|
8
9
|
data?: IJoinRTCRoomData;
|
package/dist/core/constants.d.ts
CHANGED
|
@@ -618,7 +618,15 @@ export declare enum RCLoggerTag {
|
|
|
618
618
|
/**
|
|
619
619
|
* 3A 降噪
|
|
620
620
|
*/
|
|
621
|
-
L_RTC_3ANOISE_NODE_STOP_O = "L_RTC_AAAnoiseNode_Stop_O"
|
|
621
|
+
L_RTC_3ANOISE_NODE_STOP_O = "L_RTC_AAAnoiseNode_Stop_O",
|
|
622
|
+
/**
|
|
623
|
+
* 加入跨appkey互通房间的任务
|
|
624
|
+
*/
|
|
625
|
+
L_RTC_CLIENT_JOIN_CROSS_RTC_ROOM_T = "L_rtc_client_join_cross_rtc_room_T",
|
|
626
|
+
/**
|
|
627
|
+
* 加入跨appkey互通房间的结果
|
|
628
|
+
*/
|
|
629
|
+
L_RTC_CLIENT_JOIN_CROSS_RTC_ROOM_R = "L_rtc_client_join_cross_rtc_room_R"
|
|
622
630
|
}
|
|
623
631
|
export declare enum RCLoggerStatus {
|
|
624
632
|
/**
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* 3. `53000 - 53199` 为 Web RTC 专用段
|
|
7
7
|
* 4. `53200 - 53499` 为 Web Call 专用段
|
|
8
8
|
* 5. `53500 - 53999` 为 Web 保留段
|
|
9
|
+
* 6. 1004 jwt token 过期
|
|
9
10
|
*/
|
|
10
11
|
export declare enum RCRTCCode {
|
|
11
12
|
/** 成功 */
|
|
@@ -82,6 +83,8 @@ export declare enum RCRTCCode {
|
|
|
82
83
|
SOME_TRACKS_PUBLISH_FAILED = 53031,
|
|
83
84
|
/** electron 中 mac 系统暂不支持屏幕共享采集声音 */
|
|
84
85
|
MAC_IN_ELECTRON_NOT_SUPPORT_SCREEN_SHARE_WITH_AUDIO = 53032,
|
|
86
|
+
/** JWT token 解析超时,需要刷新 navi 重新获取 */
|
|
87
|
+
JWT_TIME_OUT = 1004,
|
|
85
88
|
/** 获取媒体资源时,无系统权限 */
|
|
86
89
|
SYSTEM_PERMISSION_DENIED = 53033,
|
|
87
90
|
/** 发布时无有效资源,如 track 已被销毁 */
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
export declare enum RCResolution {
|
|
2
2
|
W176_H132 = "W176_H132",
|
|
3
3
|
W176_H144 = "W176_H144",
|
|
4
|
+
W180_H180 = "W180_H180",
|
|
5
|
+
W240_H180 = "W240_H180",
|
|
6
|
+
W240_H240 = "W240_H240",
|
|
4
7
|
W256_H144 = "W256_H144",
|
|
5
8
|
W320_H180 = "W320_H180",
|
|
6
|
-
W240_H240 = "W240_H240",
|
|
7
9
|
W320_H240 = "W320_H240",
|
|
10
|
+
W360_H360 = "W360_H360",
|
|
8
11
|
W480_H360 = "W480_H360",
|
|
9
|
-
W640_H360 = "W640_H360",
|
|
10
12
|
W480_H480 = "W480_H480",
|
|
13
|
+
W640_H360 = "W640_H360",
|
|
11
14
|
W640_H480 = "W640_H480",
|
|
12
15
|
W720_H480 = "W720_H480",
|
|
13
|
-
W1280_H720 = "W1280_H720",
|
|
14
|
-
W1920_H1080 = "W1920_H1080",
|
|
15
|
-
W180_H180 = "W180_H180",
|
|
16
|
-
W240_H180 = "W240_H180",
|
|
17
|
-
W360_H360 = "W360_H360",
|
|
18
16
|
W848_H480 = "W848_H480",
|
|
19
|
-
W960_H720 = "W960_H720"
|
|
17
|
+
W960_H720 = "W960_H720",
|
|
18
|
+
W1280_H720 = "W1280_H720",
|
|
19
|
+
W1920_H1080 = "W1920_H1080"
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=RCResolution.d.ts.map
|