Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix start/stop preview #1481

Merged
merged 1 commit into from
May 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions library/src/main/java/com/pedro/library/base/Camera1Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}
Expand Down