Skip to content

Commit 5e1f61d

Browse files
committed
拆分初始化和进房为两个接口。
Change-Id: I26cd86500ac21eebbb08fa9b5390efe5f6abcdbb
1 parent 3c77ac9 commit 5e1f61d

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

sdk/video-advanced-app-android/README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,26 +56,31 @@
5656
5757
#### com.tencent.iot.video.link.rtc.impl.TIoTCoreXP2PBridge
5858
59-
1、初始化开始链接 TIoTCoreXP2PBridge#startAppWith(Context context, RoomKey roomKey)
59+
1、初始化 TIoTCoreXP2PBridge#startAppWith(Context context)
6060
6161
| 参数 | 类型 | 描述 |
6262
|:-|:-|:-|
6363
| context | Context | 上下文 |
64-
| roomKey | RoomKey | 链接通话参数 |
6564
6665
| 返回值 | 描述 |
6766
|:-|:-|
6867
| TIoTCoreXP2PBridge | TIoTCoreXP2PBridge实例 |
6968
70-
2、设置回调 TIoTCoreXP2PBridge#setCallback(XP2PCallback callback)
69+
2、开始进房 TIoTCoreXP2PBridge#enterRoom(RoomKey roomKey)
70+
71+
| 参数 | 类型 | 描述 |
72+
|:-|:-|:-|
73+
| roomKey | RoomKey | 链接通话参数 |
74+
75+
3、设置回调 TIoTCoreXP2PBridge#setCallback(XP2PCallback callback)
7176
7277
| 参数 | 类型 | 描述 |
7378
|:-|:-|:-|
7479
| callback | XP2PCallback | 回调 |
7580
76-
3、释放链接 TIoTCoreXP2PBridge#release()
81+
4、释放链接 TIoTCoreXP2PBridge#release()
7782
78-
4、发送信令 TIoTCoreXP2PBridge#sendMsgToPeer(String msg)
83+
5、发送信令 TIoTCoreXP2PBridge#sendMsgToPeer(String msg)
7984
8085
| 参数 | 类型 | 描述 |
8186
|:-|:-|:-|
@@ -85,41 +90,41 @@
8590
|:-|:-|
8691
| boolean | 发送是否成功 |
8792
88-
5、打开摄像头预览 TIoTCoreXP2PBridge#openCamera(boolean isFrontCamera, TXCloudVideoView txCloudVideoView)
93+
6、打开摄像头预览 TIoTCoreXP2PBridge#openCamera(boolean isFrontCamera, TXCloudVideoView txCloudVideoView)
8994
9095
| 参数 | 类型 | 描述 |
9196
|:-|:-|:-|
9297
| isFrontCamera | boolean | 是否是前置摄像头 |
9398
| txCloudVideoView | TXCloudVideoView | 承载视频画面的控件 |
9499
95-
6、开始推流 TIoTCoreXP2PBridge#sendVoiceToServer()
100+
7、开始推流 TIoTCoreXP2PBridge#sendVoiceToServer()
96101
97-
7、绑定远端视频渲染控件 TIoTCoreXP2PBridge#startRemoteView(String userId, TXCloudVideoView txCloudVideoView)
102+
8、绑定远端视频渲染控件 TIoTCoreXP2PBridge#startRemoteView(String userId, TXCloudVideoView txCloudVideoView)
98103
99104
| 参数 | 类型 | 描述 |
100105
|:-|:-|:-|
101106
| userId | String | 远端用户id |
102107
| txCloudVideoView | TXCloudVideoView | 承载视频画面的控件 |
103108
104-
8、切换摄像头 TIoTCoreXP2PBridge#switchCamera(boolean isFrontCamera)
109+
9、切换摄像头 TIoTCoreXP2PBridge#switchCamera(boolean isFrontCamera)
105110
106111
| 参数 | 类型 | 描述 |
107112
|:-|:-|:-|
108113
| isFrontCamera | boolean | 是否是前置摄像头 |
109114
110-
9、设置麦克风是否静音 TIoTCoreXP2PBridge#setMicMute(boolean isMute)
115+
10、设置麦克风是否静音 TIoTCoreXP2PBridge#setMicMute(boolean isMute)
111116
112117
| 参数 | 类型 | 描述 |
113118
|:-|:-|:-|
114119
| isMute | boolean | 是否静音 |
115120
116-
10、设置是否免提 TIoTCoreXP2PBridge#setHandsFree(boolean isHandsFree)
121+
11、设置是否免提 TIoTCoreXP2PBridge#setHandsFree(boolean isHandsFree)
117122
118123
| 参数 | 类型 | 描述 |
119124
|:-|:-|:-|
120125
| isHandsFree | boolean | 是否免提 |
121126
122-
11、关闭摄像头预览 TIoTCoreXP2PBridge#closeCamera()
127+
12、关闭摄像头预览 TIoTCoreXP2PBridge#closeCamera()
123128
124129
125130
### iot-video-advanced-app-android SDK 回调callback 设计说明

sdk/video-advanced-app-android/src/main/java/com/tencent/iot/video/link/rtc/impl/TIoTCoreXP2PBridge.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,10 @@ public static synchronized TIoTCoreXP2PBridge getInstance() {
4040
return instance;
4141
}
4242

43-
public void startAppWith(Context context, RoomKey roomKey) {
43+
public void startAppWith(Context context) {
4444
this.mContext = context;
4545
mRTCCloud = TRTCCloud.sharedInstance(mContext);
4646
mRTCCloud.setListener(mRTCCloudListener);
47-
enterRTCRoom(roomKey);
4847
}
4948

5049
public void setCallback(XP2PCallback mXP2PCallback) {
@@ -139,7 +138,7 @@ public void onFirstVideoFrame(String userId, int streamType, int width, int heig
139138
/**
140139
* rtc 进房
141140
*/
142-
public void enterRTCRoom(RoomKey roomKey) {
141+
public void enterRoom(RoomKey roomKey) {
143142
if (roomKey == null) return;
144143

145144
// 进房前需要设置一下关键参数

sdkdemo/src/main/java/com/tencent/iot/explorer/link/demo/video/videocall/RTCVideoCallActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,9 @@ private void initData() {
268268
//自己的资料
269269
mCallType = intent.getIntExtra(PARAM_TYPE, TYPE_BEING_CALLED);
270270
// 初始化成员变量
271-
TIoTCoreXP2PBridge.getInstance().startAppWith(this, roomKey);
271+
TIoTCoreXP2PBridge.getInstance().startAppWith(this);
272272
TIoTCoreXP2PBridge.getInstance().setCallback(mXP2PCallback);
273+
TIoTCoreXP2PBridge.getInstance().enterRoom(roomKey);
273274
mTimeHandlerThread = new HandlerThread("time-count-thread");
274275
mTimeHandlerThread.start();
275276
mTimeHandler = new Handler(mTimeHandlerThread.getLooper());

0 commit comments

Comments
 (0)