Closed janoonaj closed 1 year ago
We also in our company suffer from this bug, We will appreciate if you can fix this as soon as possible, thanks.
@v-kpheng Is it fixed in the new Android SDK version?
Thanks a lot
@janoonaj, we added some changes to fix some race conditions in the Camera2 capturer code in Android SDK 2.25.0. Can you please test if the issue can still be reproduced?
@v-kpheng Hello. No, it still happens. And, actually, now it is even more unstable. Change the videopublisher to false and then to true will probably crash your app.
@janoonaj Are you still reproducing this issue with Basic-Video-Capturer-Camera-2-Java app?
hello @jintgeorge @v-kpheng
It does NOT happen in PR #462 :)
It still happens in main branch, so it will be solved when the pr is passed.
Thanks a lot!!!!!!!!!
thanks a lot!
Hello,
in production we have seen that sometimes, when starting a call, the screen is black on the mobile and the publisher does not broadcast.
It happens once in ten or fifteen attempts. Tested and demonstrated with SDK 2.24.2
It is easily reproducible, just launch the camera2 example, connect it to an opentok playground session, and open and close the application ten or twenty times until it happens.
On some attempt the video will be black on the mobile screen, instead of playing the camera video.
The problem is here
https://github.com/opentok/opentok-android-sdk-samples/blob/main/Basic-Video-Capturer-Camera-2-Java/app/src/main/java/com/tokbox/sample/basicvideocapturercamera2/MirrorVideoCapturer.java#L398
the cameraOpen event triggered by Android arrives at the same millisecond that executeAfterCameraOpened is triggered.
When line 395 cameraState is executed, CameraState.SETUP . When line 399 executeAfterCameraOpened is executed it is null.
Possible solution: to change the SDK so that the post event is executed after the camera is open. This way you will not cause race conditions.