RTC Room Engine SDK to implement video setting related features.RTC Room Engine SDK, you need to log in to the SDK.openLocalCamera and closeLocalCamera.openLocalCamera API requires the input of two parameters: select front or rear camera isFront and video quality quality. isFront is a Boolean value, where true means opening the front camera and false means opening the rear camera. quality is an enumeration of type TUIVideoQuality.Enumeration Value Type | Meaning |
quality360P | Low-definition 360P |
quality540P | Standard-definition 540P |
quality720P | HD 720P |
quality1080P | Ultra HD 1080P |
quality1080P as an example.openLocalCamera and closeLocalCamera.openLocalCamera API requires the input of two parameters: select front or rear camera isFront and video quality quality. isFront is a Boolean value, where true means opening the front camera and false means opening the rear camera. quality is an enumeration of type VideoQuality.Enumeration Value Type | Meaning |
Q_360P | Low-definition 360P |
Q_540P | Standard-definition 540P |
Q_720P | HD 720P |
Q_1080P | Ultra HD 1080P |
Q_1080P as an example.import RTCRoomEnginelet roomEngine = TUIRoomEngine.sharedInstance()// Turn on local cameralet isFrontCamera = truelet videoQuality: TUIVideoQuality = .quality1080ProomEngine.openLocalCamera(isFront: isFrontCamera, quality: videoQuality) {// Successful activation} onError: { code, message in// Activation fail}// Turn off local cameraroomEngine.closeLocalCamera()
TUIRoomEngine roomEngine = TUIRoomEngine.sharedInstance();// Turn on local cameraboolean isFrontCamera = true;TUIRoomDefine.VideoQuality videoQuality = TUIRoomDefine.VideoQuality.Q_1080P;roomEngine.openLocalCamera(isFrontCamera, videoQuality, new TUIRoomDefine.ActionCallback() {@Overridepublic void onSuccess() {// Successful activation}@Overridepublic void onError(TUICommonDefine.Error error, String message) {// Activation fail}});// Turn off local cameraroomEngine.closeLocalCamera();
import RTCRoomEngineimport TXLiteAVSDK_Professionallet trtcCloud = TUIRoomEngine.sharedInstance().getTRTCCloud()let params = TRTCRenderParams()params.mirrorType =.enable // To turn off the mirror, just set this parameter to.disable heretrtcCloud.setLocalRenderParams(params)trtcCloud.setVideoEncoderMirror(true)
TRTCCloud trtcCloud = TUIRoomEngine.sharedInstance().getTRTCCloud();TRTCCloudDef.TRTCRenderParams params = new TRTCCloudDef.TRTCRenderParams();params.mirrorType = TRTC_VIDEO_MIRROR_TYPE_ENABLE; // To turn off the mirror, just set this parameter to TRTC_VIDEO_MIRROR_TYPE_DISABLE heretrtcCloud.setLocalRenderParams(params);trtcCloud.setVideoEncoderMirror(true);
switchCamera API to switch the camera, a Bool parameter frontCamera is required. Passing in true switches to the front-facing camera, and passing in false switches to the rear camera. The following is the example code for switching to the front-facing camera:import RTCRoomEngineTUIRoomEngine.sharedInstance().getMediaDeviceManager().switchCamera(true)
TUIRoomEngine.sharedInstance().getMediaDeviceManager().switchCamera(true);
TUIVideoQuality required is the same as mentioned above. Below is an example of using the default mode to call the updateVideoQuality API to update the encoding quality of the local video:import RTCRoomEnginelet videoQuality: TUIVideoQuality = .quality1080PTUIRoomEngine.sharedInstance().updateVideoQuality(videoQuality)
VideoQuality required is the same as mentioned above. Below is an example of using the default mode to call the updateVideoQuality API to update the encoding quality of the local video:TUIRoomDefine.VideoQuality videoQuality = TUIRoomDefine.VideoQuality.Q_1080P;TUIRoomEngine.sharedInstance().updateVideoQuality(videoQuality);
TUIRoomVideoEncoderParams is required. Below is an example of using the default mode to call the updateVideoQualityEx API to update the encoding quality of the local video:TUIRoomVideoEncoderParams ParametersParameter Item | Parameter Name |
Resolution | videoResolution |
Frame Rate | fps |
Resolution Mode | resolutionMode |
Maximum Bit Rate | bitrate |
import RTCRoomEnginelet roomEngine = TUIRoomEngine.sharedInstance()let params = TUIRoomVideoEncoderParams()params.fps = 10 //Here replace it with the value actually required by youparams.resolutionMode =.portrait //Portrait resolutionparams.bitrate =.1600 //Here replace it with the value actually required hereparams.videoResolution =.quality720P //Here replace it with the value you needroomEngine.updateVideoQualityEx(streamType: .screenStream, params: params)
TUIRoomDefine.RoomVideoEncoderParams is required. Below is an example of using the default mode to call the updateVideoQualityEx API to update the encoding quality of the local video:TUIRoomDefine.RoomVideoEncoderParams ParametersParameter Item | Parameter Name |
Resolution | videoResolution |
Frame Rate | fps |
Resolution Mode | resolutionMode |
Maximum Bit Rate | bitrate |
TUIRoomEngine roomEngine = TUIRoomEngine.sharedInstance();TUIRoomDefine.RoomVideoEncoderParams params = new TUIRoomDefine.RoomVideoEncoderParams();params.videoResolution = TUIRoomDefine.VideoQuality.Q_720P; //Here replace it with the actual value you needparams.bitrate = 1600; //Here replace it with the actual value you needparams.fps = 10; //Here replace it with the actual value you needparams.resolutionMode = TUIRoomDefine.ResolutionMode.PORTRAIT; //Portrait resolutionroomEngine.updateVideoQualityEx(TUIRoomDefine.RoomVideoEncoderParams params)
import RTCRoomEnginelet roomEngine = TUIRoomEngine.sharedInstance()// Start pushing local video (enabled by default)roomEngine.startPushLocalVideo()// Stop pushing local videoroomEngine.stopPushLocalVideo()
TUIRoomEngine roomEngine = TUIRoomEngine.sharedInstance();// Start pushing local video (enabled by default)roomEngine.startPushLocalVideo();// Stop pushing local videoroomEngine.stopPushLocalVideo();
TUIRoomObserver with the onUserVideoStateChanged callback.Apakah halaman ini membantu?
Anda juga dapat Menghubungi Penjualan atau Mengirimkan Tiket untuk meminta bantuan.
masukan