-
Notifications
You must be signed in to change notification settings - Fork 33
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
[Bug]: Android camera 'back' is used when camera prop is 'front' #81
Comments
Hi, It is a random issue. |
Hi, |
@ThibaultBee , I tried to test
The scenario it crashes is either (re) Mount or unmount of ApiVideoLiveStreamView.
Screens 1 & 2 just show the camera output. 3 does the streaming. |
@giantslogik Could you provide a sample where I can test directly? |
I'll try and modify the example in the repo. May take me a while to get to it. |
The exception comes from here: https://github.com/ThibaultBee/StreamPack/blob/079ff7da527d78ed7e60daeeb7ff8bc9015edd6e/core/src/main/java/io/github/thibaultbee/streampack/views/PreviewView.kt#L272 |
Instead of throwing an exception here, we can just log an error. But that might hide other issues. |
This worked without an Exception with api.video-reactnative-live-stream 2.0.0 Android. I'm trying to see what has changed in streampack and api.video-reactnative-live-stream since then. |
I think that this commit , introduced the issue: ThibaultBee/StreamPack@27d3a9e#diff-0e5bf720cab5ddf6afd6d26f19aa08330afc6d2615f80e6609c572eb0aa45cb1 |
I know but I want to be sure there isn't any side effect in the patch and if this would solve your issue. |
I haven't had the time to write a sample. I will pull main again , set shouldFailSilently = true and see if that works. (i.e. try the "Instead of throwing an exception here, we can just log an error." ) |
@giantslogik another way of dealing with this is to catch the exception when calling |
I also have this problem on my application. Only on android. I'm currently on the main branch because I had to fix another error I had before, which can be found on this issue. #82 Now, I got the "LifecycleScope" when I start a livestream, here is my log error:
Is the branch with the fix available? I could test it. |
@giantslogik @safee-cases Could you test #90? |
@ThibaultBee I tested with Still crashes.
This is a race condition between unmounting previous LiveStreamView and mounting another LiveStreamView. (Since i display it on two consecutive screens.)
Part of this logic is my workaround for original wrong camera being used bug, as well handling issues when using other camera libs (react-native-vision-camera) which MAY have camera ownership before i display ApiVideoLiveStreamView.
|
I still don't understand why it happens... |
Could you test the original issue on 2.0.1? |
Version
v2.0.0
Which operating systems have you used?
Environment that reproduces the issue
Google Pixel 7
Is it reproducible in the example application?
Not tested
RTMP Server
NA, happens before streaming
Reproduction steps
Expected result
'front' camera is used
Actual result
'back' camera is used.
Additional context
The bug report form did not have that version v2.0.0. !!!
Works correctly on iOS.
Workaround:
Relevant logs output
No response
The text was updated successfully, but these errors were encountered: