startLocalPreview abstract method

void startLocalPreview(
  1. bool frontCamera,
  2. int viewId
)

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:

Implementation

void startLocalPreview(bool frontCamera, int viewId);