opentok / opentok-react-native

OpenTok React Native - a library for OpenTok iOS and Android SDKs
https://tokbox.com/
MIT License
210 stars 155 forks source link

Crashlytics error: com.opentok.android.Camera2VideoCapturer.stopCapture #676

Open cnx-caiobarroso opened 1 year ago

cnx-caiobarroso commented 1 year ago

Bug Report

Current behavior

There is no reproducible case, but crashlytics logs keeps growing.

Steps to reproduce

Can't reproduce locally.

What is the current bug behavior? image

image

What is the expected correct behavior? No crashlytics error logs.

Suggestions We could add an if condition to assert removal only if it was previously capturing video. Example:

OTScreenCapturer.java

...

@Override
    public int stopCapture() {
        if(capturing){
            capturing = false;
            mHandler.removeCallbacks(newFrame);
        }
        return 0;
}
marinaserranomontes commented 9 months ago

Hi @cnx-caiobarroso

Please, could you confirm if you are getting issues with the latest version v2.26.1 ?

Thanks

cnx-caiobarroso commented 7 months ago

Hi @marinaserranomontes, yes, v2.26.1 fixes this stopCapture crash on crashlytics, but initCamera still log is still present:

image

Is there any issue related to this?

beHaze commented 5 months ago

Thanks for verifying @cnx-caiobarroso we'll investigate.

jintgeorge commented 4 months ago

Hi @cnx-caiobarroso Can you find out why the camera 1 is disabled? Is it due to some security concern(corporate policy etc..)?

cnx-caiobarroso commented 4 months ago

Hi @jintgeorge, unfortunately, I can't reproduce this issue locally. It is a crash log provided by crashlytics and it occurs quite often. It does have its impact but it isn't so often that we can reproduce. It could happen when the user cycles through cameras. I'm sorry for not bringing much information.

jintgeorge commented 4 months ago

Hi @cnx-caiobarroso We had another similar issue reported with error camera is disabled due to policy. This can be due to scenario with corporate devices where the camera may be disabled by the administrator for security purposes. We already have a ticket to address this scenario and may be released in near future.

cnx-caiobarroso commented 4 months ago

Interesting... makes a lot of sense. Great! I'll be waiting anxiously for this to be fixed. In the meantime, if there is anything more that I can help, say the word!

cnx-caiobarroso commented 4 months ago

Oh, by the way on the same tree of crash logs regarding this issue, this other problem shows:

Fatal Exception: com.opentok.android.Camera2VideoCapturer$Camera2Exception: CAMERA_IN_USE (4): connectHelper:1898: Higher-priority client using camera, ID "1" currently unavailable at com.opentok.android.Camera2VideoCapturer.initCamera(:79) at com.opentok.android.Camera2VideoCapturer.a() at com.opentok.android.Camera2VideoCapturer.$r8$lambda$iZPyzxYK8LZvnz0l_i0v-wMBKYU() at com.opentok.android.Camera2VideoCapturer$$ExternalSyntheticLambda2.run(:2) at com.opentok.android.Camera2VideoCapturer.startCapture(:50) at com.opentok.android.PublisherKit.c(:4) at com.opentok.android.PublisherKit.$r8$lambda$uxAi0JWLDFGCk8olGpDhu5RomTA() at com.opentok.android.PublisherKit$$ExternalSyntheticLambda16.run(:2) at android.os.Handler.handleCallback(Handler.java:984) at android.os.Handler.dispatchMessage(Handler.java:104) at android.os.Looper.loopOnce(Looper.java:238) at android.os.Looper.loop(Looper.java:357) at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:228) at java.lang.Thread.run(Thread.java:1012)

beHaze commented 6 days ago

If you're still having issues please reach out to Vonage support (https://api.support.vonage.com/hc/en-us) to investigate further.