OpenTok Android SDK versions 2.17.+ failed to close an Android wearable's camera after publish session closed.

OpenTok Android SDK versions 2.17.+ failed to close an Android wearable's camera after publish session closed.

Question

  • Android Camera is not get closed, even after session get closed.
  • After closing session, Android Camera:
    • Does not ( close / turn off / ( end / stop / finish ) ) capture.
    • Is not ( available / released ) for other applications.
    • Is still ( on / open / capturing / in use / running ).

Context

On Android wearable (Moverio BT-300, Android 5.1), OpenTok Android SDK versions 2.17.+ failed to close camera after a publish session was closed.
This issue was not observed on OpenTok Android SDK versions 2.15.+.

Answer

It has been reported by a user that the OpenTok Android SDK versions 2.17.+ sometimes failed to close an Android wearable's (like the Moverio BT-300) camera after a publish session had been closed.
This issue was likely due to the SDK (versions 2.17.+) relying on the garbage collector for deallocating resources, including the publisher, hence sometimes not releasing the camera soon enough.
It can be resolved by calling the following to specifically release the camera:

publisher.getCapturer().stopCapture()

This issue should be improved in 2.18.0.
Additional notes:

  • This issue was not observed for Android phones tested (including Xiaomi Redmi 5 and Xiaomi Redmi Note 8) on OpenTok Android SDK versions 2.15.+.
  • Version "2.17.+" refers to versions from 2.17.0 and higher, but below 2.18.0.
Have more questions? Submit a request