@rongcloud/plugin-rtc 5.4.4 → 5.4.6-alpha.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/README.md CHANGED
@@ -1 +1,50 @@
1
- # @rongcloud/plugin-rtc
1
+ # 使用说明
2
+ ## 安装依赖 @rongcloud/plugin-rtc
3
+
4
+ > RTC 消息通信需要依赖 IMLib 进行消息收发,所以需要先安装 IMLib
5
+ ### 一、 安装消息通信依赖 IMLib
6
+
7
+ 1. 查看最新包所依赖模块
8
+
9
+ ```
10
+ npm info "@rongcloud/imlib-next@latest" peerDependencies
11
+ ```
12
+
13
+ 2. 安装所依赖的模块
14
+
15
+ > npm version > 5.0
16
+ >
17
+ > 将所有依赖安装到 `dependencies` 的位置
18
+
19
+ ```
20
+ npx install-peerdeps -x "--save-prod" @rongcloud/imlib-next@latest
21
+ ```
22
+
23
+
24
+ ### 二、 安装音视频通信 RTCLib
25
+ 1. 查看最新包所依赖模块
26
+
27
+ ```
28
+ npm info "@rongcloud/plugin-rtc@latest" peerDependencies
29
+ ```
30
+
31
+ 2. 安装所依赖的模块
32
+
33
+ > npm version > 5.0
34
+ >
35
+ > 将所有依赖安装到 `dependencies` 的位置
36
+
37
+ ```
38
+ npx install-peerdeps -x "--save-prod" @rongcloud/plugin-rtc@latest
39
+ ```
40
+
41
+ ## RTC 使用
42
+
43
+ 1. 融云开发者文档 [^快速开始](https://doc.rongcloud.cn/live/Web/5.X/quickstart/init)
44
+
45
+ 2. demo 体验 [rongcloud-rtc-web-demo](https://github.com/rongcloud/rongcloud-rtc-web-demo)
46
+ 2. 流程说明
47
+ - [初始化](https://doc.rongcloud.cn/live/Web/5.X/quickstart/init)
48
+ - 创建房间并加入
49
+ - 在房间内发布资源
50
+ - 订阅房间内已经发布的资源
@@ -1,5 +1,5 @@
1
1
  import { IRCTrackBitrate } from '../../interfaces';
2
- import { ISdpSemantics } from './ASdpStrategy';
2
+ import { ISdpSemantics, RtpTransceiverDirection } from './ASdpStrategy';
3
3
  /**
4
4
  * 以字符串的形式 硬处理 SDP 信息
5
5
  * 对于 plan-b | unified-plan 数据的处理 方式是相同的。
@@ -12,6 +12,8 @@ export default abstract class ASdpBuilder {
12
12
  protected SDPHeader: string;
13
13
  protected videoStreams: string[];
14
14
  protected audioStreams: string[];
15
+ get videoSdps(): string[];
16
+ get audioSdps(): string[];
15
17
  constructor(SDP: string, type: ISdpSemantics);
16
18
  /**
17
19
  * 它从 SDP 中删除空行和尾随空格
@@ -37,7 +39,7 @@ export default abstract class ASdpBuilder {
37
39
  * @param {string} stream - string - 要修改的 SDP 字符串
38
40
  * @returns 正在返回流。
39
41
  */
40
- clearInactiveOrRecvonly(stream: string): string;
42
+ static clearInactiveOrRecvonly(stream: string): string;
41
43
  /**
42
44
  * 它采用 SDP 标头和音频和视频流并将它们连接到一个字符串中
43
45
  * @returns SDP 标头和音频和视频流的字符串。
@@ -54,6 +56,12 @@ export default abstract class ASdpBuilder {
54
56
  * @param {string} streamId - 音频流的媒体流 ID。
55
57
  */
56
58
  setAudioBitrateWithStreamId(bitrate: IRCTrackBitrate, streamId: string): ASdpBuilder;
59
+ /**
60
+ * 它设置特定 MID 的音频比特率。
61
+ * @param {IRCTrackBitrate} bitrate - 音频流的比特率,以 kbps 为单位。
62
+ * @param {string} mid - 音频流的媒体流 ID。
63
+ */
64
+ setAudioBitrateWithMid(bitrate: IRCTrackBitrate, mid: string): ASdpBuilder;
57
65
  /**
58
66
  * 它接受一个 SDP 音频块和一个比特率,并返回比特率设置为给定值的 SDP 音频块
59
67
  * @param {string} sdpAudioBlock - SDP 的音频块。
@@ -80,6 +88,12 @@ export default abstract class ASdpBuilder {
80
88
  * @param {string} streamId - 媒体流 ID。
81
89
  */
82
90
  setVideoBitrateWithStreamId(bitrate: IRCTrackBitrate, streamId: string): ASdpBuilder;
91
+ /**
92
+ * 它设置特定中间的视频比特率, 针对 SDP 中给定 mid 的 video 元素添加码率设置。
93
+ * @param {IRCTrackBitrate} bitrate - 您要设置的比特率。
94
+ * @param {string} streamId - 媒体流 ID。
95
+ */
96
+ setVideoBitrateWithMid(bitrate: IRCTrackBitrate, mid: string): ASdpBuilder;
83
97
  /**
84
98
  * 它设置视频项目的比特率。
85
99
  * @param {string} sdpVideoBlock - SDP 的视频块。
@@ -94,5 +108,7 @@ export default abstract class ASdpBuilder {
94
108
  * @returns 正在返回 sdpVideoBlock。
95
109
  */
96
110
  private addVideoBlineAS;
111
+ clearnSsrcWithMid(mid: string, direction: RtpTransceiverDirection): ASdpBuilder;
112
+ private clearSSRC;
97
113
  }
98
114
  //# sourceMappingURL=ASdpBuilder.d.ts.map
@@ -8,6 +8,11 @@ export declare enum SdpSemantics {
8
8
  PLANB = "plan-b",
9
9
  UNIFIEDPLAN = "unified-plan"
10
10
  }
11
+ export declare enum RtpTransceiverDirection {
12
+ SENDONLY = "sendonly",
13
+ RECVONLY = "recvonly",
14
+ INACTIVE = "inactive"
15
+ }
11
16
  export interface IOfferInfo {
12
17
  type: 'offer';
13
18
  sdp: string;
@@ -14,8 +14,12 @@ export declare class UnifiedPlanStrategy extends ASdpStrategy {
14
14
  private _subedTracks;
15
15
  updateRecvTransceiverMap(trackId: string, transceiver: RTCRtpTransceiver): void;
16
16
  updateSubRemoteTracks(tracks: RCRemoteTrack[]): void;
17
+ protected midMsid: {
18
+ [key: string]: string;
19
+ };
17
20
  createOffer(iceRestart: boolean): Promise<IOfferInfo>;
18
21
  setRemoteAnswer(sdp: string): Promise<RCRTCCode>;
19
- protected resetSdp(sdp: string): string;
22
+ protected resetOfferSdp(sdp: string): string;
23
+ protected resetAnswerSdp(sdp: string): string;
20
24
  }
21
25
  //# sourceMappingURL=UnifiedPlanStrategy.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * RCRTC - v5.4.4
3
- * CommitId - bc1f8f530851278c199d53868ad7c199d465f45e
4
- * Tue Aug 09 2022 15:25:48 GMT+0800 (China Standard Time)
2
+ * RCRTC - v5.4.6-alpha.1
3
+ * CommitId - d109ea1eb1987a80bf3299b86d39859d331d65b8
4
+ * Fri Aug 19 2022 11:59:39 GMT+0800 (中国标准时间)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  import { EventEmitter, RTCMode, IRuntime, RTCPluginContext, IJoinRTCRoomData, IReceivedMessage, ErrorCode, RTCJoinType, IRTCUserData, KVString, IServerRTCRoomEntry, LogLevel, IRTCJoinedInfo, IPluginGenerator } from '@rongcloud/engine';
@@ -3872,4 +3872,4 @@ declare const helper: {
3872
3872
  ifSupportScreenShare: typeof ifSupportScreenShare;
3873
3873
  };
3874
3874
 
3875
- export { BackgroundPictureFillMode, ICameraVideoProfile, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPKEndInfo, IPKInviteAnswerInfo, IPKInviteInfo, IPubSuccessRes, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IReqResPKOptions, IRoomEventListener, IRoomPKEventListener, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCAudioBitrate, RCCameraVideoTrack, 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, device, helper, installer };
3875
+ export { BackgroundPictureFillMode, IAudienceRoomEventListener, ICameraVideoProfile, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPKEndInfo, IPKInviteAnswerInfo, IPKInviteInfo, IPubSuccessRes, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IReqResPKOptions, IRoomEventListener, IRoomPKEventListener, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCAudioBitrate, RCCameraVideoTrack, 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, device, helper, installer };