opentok / opentok-android-sdk-samples

Sample applications illustrating best practices using OpenTok Android SDK.
https://tokbox.com/developer/sdks/android/
MIT License
210 stars 169 forks source link

Crash issue Camera2VideoCapturer #460

Closed wlTrunks closed 1 year ago

wlTrunks commented 1 year ago

Describe the bug Crash in the sdk when disable camera

To Reproduce

  1. Start session
  2. disable camera

Expected behavior Not crashing

Device (please compete the following information):

Additional context Last Exception Backtrace: java.lang.IllegalStateException java.lang.IllegalStateException: Session has been closed; further changes are illegal. 0 android.hardware.camera2.impl.CameraCaptureSessionImpl.checkNotClosed(CameraCaptureSessionImpl.java:887) 1 android.hardware.camera2.impl.CameraCaptureSessionImpl.stopRepeating(CameraCaptureSessionImpl.java:418) 2 com.opentok.android.Camera2VideoCapturer.stopCapture(SourceFile:0) 3 com.opentok.android.Camera2VideoCapturer.onPause(SourceFile:0) 4 com.opentok.android.PublisherKit.onPause(SourceFile:0) 5 com.opentok.android.PublisherKit.update(SourceFile:0) 6 java.util.Observable.notifyObservers(Observable.java:177) 7 com.opentok.android.Session.onPause(SourceFile:0) STREAMLAYE-81-qppbHVZLOTMBpDCSyaZ-callstack.txt

DanielNovak commented 1 year ago

Same issue in our code. Calling the Publisher.publishVideo(...) several times and switching between true and false will quickly cause the SDK to crash.

vona-ben commented 1 year ago

Fixed on https://github.com/opentok/opentok-android-sdk-samples/pull/462