Capture Media

This documentation provides guidelines on capturing images and recording videos using the TruVideo Camera SDK. The SDK offers simple methods to integrate camera functionalities into your application.

Prerequisites

  • Ensure you have integrated the TruVideo Core SDK into your project and completed with the authentication process

Capturing an Image

To capture an image, follow these steps:

Step 1 : CameraResult return by initCameraScreen

interface CameraResult {
  id: string,
  createdAt: number,
  filePath: string,
  type: CameraMediaType,
  lensFacing: LensFacing,
  orientation: Orientation,
  resolution: Resolution,
  duration: number,
}

Step 2: Create new configuration to give to the camera

const cameraConfiguration: CameraConfiguration = {

    lensFacing: LensFacing.Front,
    //lensFacing: LensFacing.Back,

    flashMode: FlashMode.Off,
    //flashMode: FlashMode.On

    orientation: Orientation.Portrait,
    //orientation: Orientation.LandscapeLeft,
    //orientation: Orientation.LandscapeRight,
    //orientation: Orientation.PortraitReverse,
    //orientation: Orientation.Portrait,

    outputPath: '',
    frontResolutions: [],
    frontResolution: 'nil',
    backResolutions: [],
    backResolution: 'nil',
    mode: CameraMode.image(),
    //mode: CameraMode.video()
    //mode: CameraMode.videoAndImage()
    
    imageFormat : ImageFormat.JPEG
    // imageFormat : ImageFormat.PNG
  };

Step 3 : Present the camera with the configuration

Finalize :

After completing this steps the function should look like

Last updated

Was this helpful?