Skip to content

Commit 74551d3

Browse files
committed
添加使能重力适配接口,默认关掉重力感应适配。
Change-Id: I674448b7316b9a2a5ac79387dfee70465df4a6f1
1 parent 30fc217 commit 74551d3

File tree

1 file changed

+11
-0
lines changed
  • video/video-advanced-device-android/src/main/java/com/tencent/iot/device/video/advanced/recorder/rtc

1 file changed

+11
-0
lines changed

video/video-advanced-device-android/src/main/java/com/tencent/iot/device/video/advanced/recorder/rtc/VideoNativeInteface.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import java.util.HashMap;
1818
import java.util.Map;
1919

20+
import static com.tencent.trtc.TRTCCloudDef.TRTC_GSENSOR_MODE_DISABLE;
21+
import static com.tencent.trtc.TRTCCloudDef.TRTC_GSENSOR_MODE_UIAUTOLAYOUT;
2022
import static com.tencent.trtc.TRTCCloudDef.TRTC_VIDEO_STREAM_TYPE_BIG;
2123

2224
public class VideoNativeInteface {
@@ -137,6 +139,14 @@ public void onFirstVideoFrame(String userId, int streamType, int width, int heig
137139
}
138140
};
139141

142+
public void setEnableGSensor(boolean enable) {
143+
if (enable) {
144+
mRTCCloud.setGSensorMode(TRTC_GSENSOR_MODE_UIAUTOLAYOUT);
145+
} else {
146+
mRTCCloud.setGSensorMode(TRTC_GSENSOR_MODE_DISABLE);
147+
}
148+
}
149+
140150
/**
141151
* rtc 进房
142152
*/
@@ -158,6 +168,7 @@ public void enterRoom(RoomKey roomKey) {
158168
roomKey.getUserId(), roomKey.getUserSig(), roomKey.getRoomId(), "", "");
159169
TRTCParams.role = TRTCCloudDef.TRTCRoleAnchor;
160170
mRTCCloud.enableAudioVolumeEvaluation(300);
171+
mRTCCloud.setGSensorMode(TRTC_GSENSOR_MODE_DISABLE);
161172
mRTCCloud.setAudioRoute(TRTCCloudDef.TRTC_AUDIO_ROUTE_SPEAKER);
162173
mRTCCloud.startLocalAudio(TRTCCloudDef.TRTC_AUDIO_QUALITY_SPEECH);
163174
// 收到来电,开始监听 trtc 的消息

0 commit comments

Comments
 (0)