startLocalPreview abstract method
Enable the preview image of local camera
If this API is called before enterRoom , the SDK will only enable the camera and wait until enterRoom is called before starting push.
If it is called after enterRoom , the SDK will enable the camera and automatically start pushing the video stream.
When the first camera video frame starts to be rendered, you will receive the TRTCCloudListener.onCameraDidReady callback.
Parameters:
- frontCamera(bool):
- true: front camera; false: rear camera.
- Only works on mobile devices.
- view(int):
- Control that carries the video image.
Note
If you want to preview the camera image and adjust the beauty filter parameters through
BeautyManager
before going live, you can:
- Scheme 1: Call startLocalPreview before calling enterRoom.
- Scheme 2: Call startLocalPreview and muteLocalVideo (true) after calling enterRoom.
Implementation
void startLocalPreview(bool frontCamera, int viewId);