8000 [Android] falling back to the first available camera fix #580 (#581) · tmthecoder/flutter-webrtc@1ed16f9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ed16f9

Browse files
[Android] falling back to the first available camera fix flutter-webrtc#580 (flutter-webrtc#581)
Co-authored-by: Ayman-Barghout <ayman.a.barghout@gmail.com>
1 parent 47b0134 commit 1ed16f9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

android/src/main/java/com/cloudwebrtc/webrtc/GetUserMediaImpl.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,13 @@ private VideoCapturer createVideoCapturer(
279279
}
280280
}
281281
}
282-
// should we fallback to available camera automatically?
282+
283+
// falling back to the first available camera
284+
if (videoCapturer == null && deviceNames.length > 0){
285+
videoCapturer = enumerator.createCapturer(deviceNames[0], new CameraEventsHandler());
286+
Log.d(TAG, "Falling back to the first available camera");
287+
}
288+
283289
return videoCapturer;
284290
}
285291

0 commit comments

Comments
 (0)
0