Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch camera #193

Open
arunsparki opened this issue Dec 10, 2019 · 1 comment
Open

switch camera #193

arunsparki opened this issue Dec 10, 2019 · 1 comment

Comments

@arunsparki
Copy link

Hi ,
I get an issue when i am adding switch camera function in RtcActivity.java
java.lang.RuntimeException: Fail to connect to camera service
at android.hardware.Camera.(Camera.java:545)
at android.hardware.Camera.open(Camera.java:385)
at org.webrtc.VideoCapturerAndroid.startCaptureOnCameraThread(VideoCapturerAndroid.java:414)
at org.webrtc.VideoCapturerAndroid.access$300(VideoCapturerAndroid.java:74)
at org.webrtc.VideoCapturerAndroid$2.run(VideoCapturerAndroid.java:401)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at org.webrtc.VideoCapturerAndroid$CameraThread.run(VideoCapturerAndroid.java:368)

@haojiufeng
Copy link

videoCapturerAndroid.switchCamera(new Runnable() {
        @Override
        public void run() {
        }
    }); // or  videoCapturerAndroid.switchCamera(null);

这两种方式都是可以的,需要注意videoCapturerAndroid 为全局唯一变量

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants