Open eebirke opened 3 weeks ago
I also am experiencing issues with Samsung Android devices. All other devices seem to work but samsung has a black screen when using the camera in web. The camera is loaded and shows as being used but its just black.
Thank you for filing this issue! This comment acknowledges we believe this may be a bug and there’s enough information to investigate it. However, we can’t promise any sort of timeline for resolution. We prioritize issues based on severity, breadth of impact, and alignment with our roadmap. If you’d like to help move it more quickly, you can continue to investigate it more deeply and/or you can open a pull request that fixes the cause.
Minimal reproducible example
https://github.com/eebirke/expo-camera-stabilization-bug
What platform(s) does this occur on?
Android
Where did you reproduce the issue?
in a development build, in a standalone app
Summary
Discovered this after a user complained that video recording was not working on Lenovo M10 tablets (Android 12) after upgrading expo-camera. Not sure if this is a Lenovo M10 issue only or if it impacts other older devices. I could only reproduce this on a Lenovo M10 unit, not in emulator or on e.g. a Huawei P20 on EMUI/Android 10.
Checking the error from the recorder only yields "Unknown error", and adding print statements to the
expo-camera
native code yields error code 8 when stopping the recording. This seems to correspond to theERROR_NO_VALID_DATA
error fromVideoRecordEvent.java
in androidx.camera – the only other clues are warnings that the muxer isn't receving frame data.Removing the line
setVideoStabilizationEnabled(true)
fromExpoCameraView.kt
fixed the issue on our end. The docstring for setVideoStabilizationEnabled mentions the following:As a fix to not completely disable video stabilization I run this patch locally for expo-camera (this yields stabilization supported false on first setup since camera is not initialized – but should be re-run as the camera object is recreated later if I understand the code correctly):
Edit: To be more concise, preview works and starting recording seems to work at first glance, but stopping recording causes an error to be thrown in the recordAsync Promise and no recording has been made/stored.
Environment
Expo Doctor Diagnostics