OpenTok的Andr​​oid SDK 2.0,setPublishVideo(假)不会释放相机。任何变通办法知道的? [英] OpenTok Android SDK 2.0, setPublishVideo(false) does not free the Camera. Any workarounds known?

查看:168
本文介绍了OpenTok的Andr​​oid SDK 2.0,setPublishVideo(假)不会释放相机。任何变通办法知道的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图拍摄一张照片,而有一个在Android应用程序正在进行OpenTok视频会议。我用OpenTok SDK 2.0为Android。

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.

我试图用publisher.setPublishVideo(假)暂时释放摄像头,这样的默认摄像头的活动可以用来拍照。不过貌似OpenTok不会释放摄像头硬件。

I tried to use publisher.setPublishVideo(false) to temporarily free the Camera so that the default Camera Activity can be used to take a picture. But looks like OpenTok does not free the Camera hardware.

作为一种变通方法使用我session.unpublish(发布者)试过了,这将释放照相机(它也减少了音频流这是不可取对我来说),但一旦我与拍照,这时候做一个/ v不与session.publish(发布者)恢复。

As a workaround I tried using session.unpublish(publisher), which frees the Camera (and it also cuts the audio stream which is not desirable for me) but once I'm done with taking a picture, this time the a/v is not restored with session.publish(publisher).

任何帮助?

推荐答案

晚回应,但想通这可能会帮助的人谁​​跨越了同样的问题来了。

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);
BaseVideoCapturer bvc = 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);
    }           
}

这篇关于OpenTok的Andr​​oid SDK 2.0,setPublishVideo(假)不会释放相机。任何变通办法知道的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆