From 2c36a343e9498b96b670da6cb5676c2183595d66 Mon Sep 17 00:00:00 2001 From: Timotheos Constambeys Date: Sun, 12 May 2024 10:39:28 +0300 Subject: [PATCH] fix start/stop preview --- library/src/main/java/com/pedro/library/base/Camera1Base.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/main/java/com/pedro/library/base/Camera1Base.java b/library/src/main/java/com/pedro/library/base/Camera1Base.java index bd2c253bf..51ecf6b98 100644 --- a/library/src/main/java/com/pedro/library/base/Camera1Base.java +++ b/library/src/main/java/com/pedro/library/base/Camera1Base.java @@ -468,7 +468,7 @@ private void replaceGlInterface(GlInterface glInterface) { * com.pedro.encoder.input.video.CameraHelper#getCameraOrientation(Context)} */ public void startPreview(CameraHelper.Facing cameraFacing, int width, int height, int fps, int rotation) { - if (!isStreaming() && !onPreview) { + if (!onPreview) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && (glInterface instanceof GlStreamInterface)) { // if you are using background mode startPreview only work to indicate // that you want start with front or back camera @@ -561,7 +561,7 @@ public void startPreview() { * @stopStream to release camera properly if you will close activity. */ public void stopPreview() { - if (!isStreaming() && !isRecording() && onPreview) { + if (onPreview) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 && (glInterface instanceof GlStreamInterface)) { return; }