|
|
@ -20,6 +20,8 @@ import com.otaliastudios.cameraview.PictureResult; |
|
|
|
import com.otaliastudios.cameraview.Mode; |
|
|
|
import com.otaliastudios.cameraview.Mode; |
|
|
|
import com.otaliastudios.cameraview.VideoResult; |
|
|
|
import com.otaliastudios.cameraview.VideoResult; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class CameraActivity extends AppCompatActivity implements View.OnClickListener, ControlView.Callback { |
|
|
|
public class CameraActivity extends AppCompatActivity implements View.OnClickListener, ControlView.Callback { |
|
|
|
|
|
|
|
|
|
|
@ -163,7 +165,7 @@ public class CameraActivity extends AppCompatActivity implements View.OnClickLis |
|
|
|
} |
|
|
|
} |
|
|
|
if (camera.isTakingPicture() || camera.isTakingVideo()) return; |
|
|
|
if (camera.isTakingPicture() || camera.isTakingVideo()) return; |
|
|
|
message("Recording for 5 seconds...", true); |
|
|
|
message("Recording for 5 seconds...", true); |
|
|
|
camera.takeVideo(null, 5000); |
|
|
|
camera.takeVideo(new File(getFilesDir(), "video.mp4"), 5000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void captureVideoSnapshot() { |
|
|
|
private void captureVideoSnapshot() { |
|
|
@ -172,7 +174,7 @@ public class CameraActivity extends AppCompatActivity implements View.OnClickLis |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
message("Recording snapshot for 5 seconds...", true); |
|
|
|
message("Recording snapshot for 5 seconds...", true); |
|
|
|
camera.takeVideoSnapshot(null, 5000); |
|
|
|
camera.takeVideoSnapshot(new File(getFilesDir(), "video.mp4"), 5000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void toggleCamera() { |
|
|
|
private void toggleCamera() { |
|
|
|