Skip to content Skip to sidebar Skip to footer

Opentok Android Sdk 2.0, Setpublishvideo(false) Does Not Free The Camera. Any Workarounds Known?

I'm trying to take a picture while there's an ongoing OpenTok video conference in an Android application. I use OpenTok SDK 2.0 for Android. I tried to use publisher.setPublishVide

Solution 1:

Late response, but figured this may help for anyone who comes across the same issue.

My solution was to destroy capturer prior to starting intent to take picture

mPublisher.setPublishVideo(false);
BaseVideoCapturerbvc= mPublisher.getCapturer();
if(bvc != null){
    bvc.destroy();
}
//intent to start picture capture (Ex. ACTION_IMAGE_CAPTURE)

When you resume after taking the picture, you will need to initialize again

BaseVideoCapturer bvc = mPublisher.getCapturer();
if(bvc != null){
    if(bvc.isCaptureStarted() == false){
        bvc.init();
        bvc.startCapture();
        mPublisher.setPublishVideo(true);
    }           
}

Solution 2:

Solution 3:

I personally have never tried it, but using Android 2.0 beta 2, you might be able to use PublisherKit to accomplish something like that. There are methods like setRenderer(BaseVideoRenderer renderer) and setCapturer(BaseVideoCapturer capturer) that might allow you to programmatically free the camera on setPublishVideo( false )

Good luck!

Post a Comment for "Opentok Android Sdk 2.0, Setpublishvideo(false) Does Not Free The Camera. Any Workarounds Known?"