@rongcloud/plugin-rtc 5.1.10 → 5.2.2
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.d.ts +76 -13
- package/dist/index.esm.js +2 -2
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.2.2
|
|
3
|
+
* CommitId - cbd066a7185af8c1b56ef6bf88f1332ec9444daa
|
|
4
|
+
* Thu Nov 25 2021 17:52:32 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
|
-
import { EventEmitter, LogLevel, RTCMode, IRuntime, RTCPluginContext, IServerRTCRoomEntry, IJoinRTCRoomData, IReceivedMessage, KVString,
|
|
7
|
+
import { EventEmitter, LogLevel, RTCMode, IRuntime, RTCPluginContext, IServerRTCRoomEntry, IJoinRTCRoomData, IReceivedMessage, KVString, RTCJoinType, IRTCJoinedInfo, IPluginGenerator } from '@rongcloud/engine';
|
|
8
|
+
export { RTCJoinType } from '@rongcloud/engine';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* 错误码,与移动端对齐
|
|
@@ -79,7 +80,11 @@ declare enum RCRTCCode {
|
|
|
79
80
|
/** 单个用户发布资源超过限制 ( MediaServer 限制最多 10 个 track ) */
|
|
80
81
|
PUBLISH_TRACK_LIMIT_EXCEEDED = 53026,
|
|
81
82
|
/** 房间内无主播推 CDN */
|
|
82
|
-
CDN_RESOURCE_IS_EMPTY = 53027
|
|
83
|
+
CDN_RESOURCE_IS_EMPTY = 53027,
|
|
84
|
+
/** 加入 RTC 房间 joinTYype 为 1 时,当前有其他端在房间时的应答码 */
|
|
85
|
+
SIGNAL_JOIN_RTC_ROOM_REFUSED = 53028,
|
|
86
|
+
/** 设置音频输出设备时,无权限使用请求的设备 */
|
|
87
|
+
NO_PERMISSION_TO_USE_REQUESTED_DEVICE = 53029
|
|
83
88
|
}
|
|
84
89
|
|
|
85
90
|
/**
|
|
@@ -218,6 +223,7 @@ declare abstract class RCTrack extends EventEmitter {
|
|
|
218
223
|
*/
|
|
219
224
|
play(element?: HTMLVideoElement, options?: {
|
|
220
225
|
volume?: number;
|
|
226
|
+
audioDeviceId: string;
|
|
221
227
|
}): Promise<{
|
|
222
228
|
code: RCRTCCode;
|
|
223
229
|
}>;
|
|
@@ -401,6 +407,36 @@ declare enum RCInnerCDNPullIsHttps {
|
|
|
401
407
|
HTTPS = 1
|
|
402
408
|
}
|
|
403
409
|
|
|
410
|
+
declare enum RCKickReason {
|
|
411
|
+
/**
|
|
412
|
+
* Server 主动踢(掉 Server API 踢出)
|
|
413
|
+
*/
|
|
414
|
+
SERVER_KICK = 1,
|
|
415
|
+
/**
|
|
416
|
+
* 其他设备登陆后,本端被踢
|
|
417
|
+
*/
|
|
418
|
+
OTHER_KICK = 2
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
declare enum RCRTCPingResult {
|
|
422
|
+
SUCCESS = "Success",
|
|
423
|
+
FAIL = "Fail"
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* 直播角色
|
|
428
|
+
*/
|
|
429
|
+
declare enum RCRTCLiveRole {
|
|
430
|
+
/**
|
|
431
|
+
* 主播
|
|
432
|
+
*/
|
|
433
|
+
ANCHOR = 1,
|
|
434
|
+
/**
|
|
435
|
+
* 观众
|
|
436
|
+
*/
|
|
437
|
+
AUDIENCE = 2
|
|
438
|
+
}
|
|
439
|
+
|
|
404
440
|
interface IRCTrackBitrate {
|
|
405
441
|
/**
|
|
406
442
|
* 最大码率
|
|
@@ -706,7 +742,7 @@ interface IRCRTCReportListener {
|
|
|
706
742
|
onStateReport?(report: IRCRTCStateReport): void;
|
|
707
743
|
/**
|
|
708
744
|
* ~ICE 连接状态变更通知~
|
|
709
|
-
* @
|
|
745
|
+
* @since version 5.1.5
|
|
710
746
|
*/
|
|
711
747
|
onICEConnectionStateChange?(state: RTCIceConnectionState): void;
|
|
712
748
|
/**
|
|
@@ -734,7 +770,7 @@ interface IRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
734
770
|
* 另一种可能是己方 rtcPing 失败次数超出上限
|
|
735
771
|
* @param byServer 当值为 `false` 时,说明本端 rtcPing 超时;当值为 `true` 时,说明本端收到被踢出房间通知
|
|
736
772
|
*/
|
|
737
|
-
onKickOff?(byServer: boolean): void;
|
|
773
|
+
onKickOff?(byServer: boolean, state?: RCKickReason): void;
|
|
738
774
|
/**
|
|
739
775
|
* 接收到房间信令时回调,用户可通过房间实例的 sendMessage 接口发送信令
|
|
740
776
|
* @param name 信令名
|
|
@@ -784,6 +820,15 @@ interface IRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
784
820
|
* 主播开启、停止推 CDN 状态通知
|
|
785
821
|
*/
|
|
786
822
|
onCDNEnableChange?(enable: boolean): void;
|
|
823
|
+
/**
|
|
824
|
+
* RTC 每次 Ping 的结果
|
|
825
|
+
* @since version: 5.1.5
|
|
826
|
+
*/
|
|
827
|
+
onPing?(result: RCRTCPingResult): void;
|
|
828
|
+
/**
|
|
829
|
+
* 主播和观众切换身份通知
|
|
830
|
+
*/
|
|
831
|
+
onSwitchRole?(userId: string, role: RCRTCLiveRole): void;
|
|
787
832
|
}
|
|
788
833
|
/**
|
|
789
834
|
* RTCClient 初始化配置
|
|
@@ -1031,6 +1076,15 @@ interface IExchangeResponse extends IRTCResponse {
|
|
|
1031
1076
|
* 主播发布为具体资源,会议模式为空数组
|
|
1032
1077
|
*/
|
|
1033
1078
|
mcuPublishList?: IResource[];
|
|
1079
|
+
/**
|
|
1080
|
+
* 订阅成功的资源
|
|
1081
|
+
*/
|
|
1082
|
+
subscribedList?: {
|
|
1083
|
+
mediaType: RCMediaType.AUDIO_ONLY | RCMediaType.VIDEO_ONLY;
|
|
1084
|
+
msid: string;
|
|
1085
|
+
userId: string;
|
|
1086
|
+
simulcast?: RCStreamType;
|
|
1087
|
+
}[];
|
|
1034
1088
|
}
|
|
1035
1089
|
interface IBroadcastSubReqBody {
|
|
1036
1090
|
/**
|
|
@@ -1734,6 +1788,7 @@ declare class RCAudienceLivingRoom {
|
|
|
1734
1788
|
*/
|
|
1735
1789
|
subscribe(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
1736
1790
|
code: RCRTCCode;
|
|
1791
|
+
failedList?: ISubscribeAttr[];
|
|
1737
1792
|
}>;
|
|
1738
1793
|
private __unsubscribe;
|
|
1739
1794
|
/**
|
|
@@ -1742,6 +1797,7 @@ declare class RCAudienceLivingRoom {
|
|
|
1742
1797
|
*/
|
|
1743
1798
|
unsubscribe(tracks: RCRemoteTrack[]): Promise<{
|
|
1744
1799
|
code: RCRTCCode;
|
|
1800
|
+
failedList?: ISubscribeAttr[];
|
|
1745
1801
|
}>;
|
|
1746
1802
|
/**
|
|
1747
1803
|
* 退出房间并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
@@ -1978,6 +2034,7 @@ declare abstract class RCAbstractRoom {
|
|
|
1978
2034
|
private _audioLevelReport;
|
|
1979
2035
|
constructor(_context: RTCPluginContext, _runtime: IRuntime, _roomId: string, data: IJoinRTCRoomData, _roomMode: RTCMode, _service: RCMediaService, _initOptions: IRCRTCInitOptions, _ntfClearRoomItem: Function, isUpgrade?: boolean);
|
|
1980
2036
|
private _initRemoteTracks;
|
|
2037
|
+
private _handlePingResult;
|
|
1981
2038
|
/**
|
|
1982
2039
|
* 设置房间上行资源的总码率配置
|
|
1983
2040
|
* @description
|
|
@@ -2195,6 +2252,7 @@ declare abstract class RCAbstractRoom {
|
|
|
2195
2252
|
*/
|
|
2196
2253
|
subscribe(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
2197
2254
|
code: RCRTCCode;
|
|
2255
|
+
failedList?: ISubscribeAttr[];
|
|
2198
2256
|
}>;
|
|
2199
2257
|
private __subscribe;
|
|
2200
2258
|
/**
|
|
@@ -2203,6 +2261,7 @@ declare abstract class RCAbstractRoom {
|
|
|
2203
2261
|
*/
|
|
2204
2262
|
unsubscribe(tracks: RCRemoteTrack[]): Promise<{
|
|
2205
2263
|
code: RCRTCCode;
|
|
2264
|
+
failedList?: ISubscribeAttr[];
|
|
2206
2265
|
}>;
|
|
2207
2266
|
private __unsubscribe;
|
|
2208
2267
|
protected _assertRoomDestroyed(): RCRTCCode | undefined;
|
|
@@ -2261,10 +2320,6 @@ declare abstract class RCAbstractRoom {
|
|
|
2261
2320
|
* 观众切换为主播后直接处理人员变更及资源变更
|
|
2262
2321
|
*/
|
|
2263
2322
|
protected _afterChangedRole(data: IJoinRTCRoomData): void;
|
|
2264
|
-
/**
|
|
2265
|
-
* 主播身份降级,取消己端已发布的所有资源
|
|
2266
|
-
*/
|
|
2267
|
-
__unpublishToSingal(): Promise<ErrorCode>;
|
|
2268
2323
|
/**
|
|
2269
2324
|
* 销毁远端资源
|
|
2270
2325
|
*/
|
|
@@ -2620,7 +2675,7 @@ declare class RCRTCClient {
|
|
|
2620
2675
|
* 加入普通音视频房间
|
|
2621
2676
|
* @param roomId
|
|
2622
2677
|
*/
|
|
2623
|
-
joinRTCRoom(roomId: string): Promise<{
|
|
2678
|
+
joinRTCRoom(roomId: string, joinType?: RTCJoinType): Promise<{
|
|
2624
2679
|
room?: RCRTCRoom;
|
|
2625
2680
|
code: RCRTCCode;
|
|
2626
2681
|
userIds?: string[];
|
|
@@ -2778,6 +2833,14 @@ declare class RCRTCClient {
|
|
|
2778
2833
|
room?: RCAudienceLivingRoom;
|
|
2779
2834
|
code: RCRTCCode;
|
|
2780
2835
|
}>;
|
|
2836
|
+
/**
|
|
2837
|
+
* 获取在房间内用户信息
|
|
2838
|
+
* @since version 5.2.1
|
|
2839
|
+
*/
|
|
2840
|
+
getJoinedRoomInfo(): Promise<{
|
|
2841
|
+
code: RCRTCCode;
|
|
2842
|
+
data?: IRTCJoinedInfo[];
|
|
2843
|
+
}>;
|
|
2781
2844
|
}
|
|
2782
2845
|
|
|
2783
2846
|
/**
|
|
@@ -2827,4 +2890,4 @@ declare const helper: {
|
|
|
2827
2890
|
ifSupportScreenShare: typeof ifSupportScreenShare;
|
|
2828
2891
|
};
|
|
2829
2892
|
|
|
2830
|
-
export { BackgroundPictureFillMode, ICameraVideoProfile, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IRoomEventListener, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCCameraVideoTrack, RCFrameRate, RCInnerCDNPullIsHttps, RCInnerCDNPullKind, RCLivingRoom, RCLivingType, RCLocalAudioTrack, RCLocalFileAudioTrack, RCLocalFileTrack, RCLocalFileVideoTrack, RCLocalTrack, RCLocalVideoTrack, RCMCUConfigBuilder, RCMediaType, RCMicphoneAudioTrack, RCRTCClient, RCRTCCode, RCRTCRoom, RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack, RCResolution, RCScreenVideoTrack, RCTag, RCTrack, device, helper, installer };
|
|
2893
|
+
export { BackgroundPictureFillMode, ICameraVideoProfile, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IRoomEventListener, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCCameraVideoTrack, RCFrameRate, RCInnerCDNPullIsHttps, RCInnerCDNPullKind, RCKickReason, RCLivingRoom, RCLivingType, RCLocalAudioTrack, RCLocalFileAudioTrack, RCLocalFileTrack, RCLocalFileVideoTrack, RCLocalTrack, RCLocalVideoTrack, RCMCUConfigBuilder, RCMediaType, RCMicphoneAudioTrack, RCRTCClient, RCRTCCode, RCRTCLiveRole, RCRTCPingResult, RCRTCRoom, RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack, RCResolution, RCScreenVideoTrack, RCTag, RCTrack, device, helper, installer };
|