Skip to content Skip to sidebar Skip to footer

How To Set Up Camerax (android) To Stop Recording After 5 Seconds?

Here's the current code that I use. I don't know where to call mCameraView.stopRecording() if I want to stop recording the video automatically after 5 seconds. The current approac

Solution 1:

Run your code after a delay

 final Handler handler = new Handler(Looper.getMainLooper());
    handler.postDelayed(new Runnable() {
      @Override
      public void run() {
         mCameraView.stopRecording();
      }
    }, 5000);

Post a Comment for "How To Set Up Camerax (android) To Stop Recording After 5 Seconds?"