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 : Initalize ActivityResultLauncher with TruvideoSdkCameraConfiguration

public class YourActivity extends AppCompatActivity{
    ActivityResultLauncher<TruvideoSdkCameraConfiguration> cameraScreenLauncher;
    @Override 
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        cameraScreenLauncher = registerForActivityResult(
                    new TruvideoSdkCameraContract(),
                    result -> {
                        // Handle result
                    }
        );
        //...rest of your code
    }
}

Step 2 : Get the Camera Information

This function will provide the default configuration of the camera

Step 3 : Create new configuration to give to the camera

Step 4 : Present the camera with the configuration using TruvideoSdkCameraConfiguration

Finalize :

After completing this steps the function should look like

Final Result -

Last updated

Was this helpful?