Quickblox callback when participant get away or stopped the call

巧了我就是萌 提交于 2019-12-13 21:04:26

问题


I am working on video chat application using QuickBlox. Here is the situation, when i call from device-A to device-B and if activity on device-A just get paused or application get closed stream on device-B stop (offcourse). o when i try to call again from device-A i have to restart the application on device-B then it pick the call otherwise no call accepted on device-B and QBVideoStreamView just show the image on which it get hanged.

So what callback should be called when participant stopped the call, Actually there is a onStop() CallBack method but it gets called after so long or some time never get called.

So my question is how can get a callback if participant stopped the call or participant get away? Or any better way to recycling to get ready to receive the next call?

Actually i want to get thing smoother if call get disconnected or stopped. I can easily call back without restarting.

Edit: Crashed on recall When i recall i got this some times

01-08 11:40:14.708: E/WEBRTC-JC(4465): startCapture failed
01-08 11:40:14.708: E/WEBRTC-JC(4465): java.lang.RuntimeException: Fail to connect to camera service
01-08 11:40:14.708: E/WEBRTC-JC(4465):  at android.hardware.Camera.native_setup(Native Method)
01-08 11:40:14.708: E/WEBRTC-JC(4465):  at android.hardware.Camera.<init>(Camera.java:351)
01-08 11:40:14.708: E/WEBRTC-JC(4465):  at android.hardware.Camera.open(Camera.java:310)
01-08 11:40:14.708: E/WEBRTC-JC(4465):  at org.webrtc.videoengine.VideoCaptureAndroid.startCaptureOnCameraThread(VideoCaptureAndroid.java:145)
01-08 11:40:14.708: E/WEBRTC-JC(4465):  at org.webrtc.videoengine.VideoCaptureAndroid.access$400(VideoCaptureAndroid.java:40)
01-08 11:40:14.708: E/WEBRTC-JC(4465):  at org.webrtc.videoengine.VideoCaptureAndroid$2.run(VideoCaptureAndroid.java:132)
01-08 11:40:14.708: E/WEBRTC-JC(4465):  at android.os.Handler.handleCallback(Handler.java:733)
01-08 11:40:14.708: E/WEBRTC-JC(4465):  at android.os.Handler.dispatchMessage(Handler.java:95)
01-08 11:40:14.708: E/WEBRTC-JC(4465):  at android.os.Looper.loop(Looper.java:136)
01-08 11:40:14.708: E/WEBRTC-JC(4465):  at org.webrtc.videoengine.VideoCaptureAndroid$CameraThread.run(VideoCaptureAndroid.java:107)
01-08 11:40:14.708: E/libjingle(4465): Error(webrtcvideocapturer.cc:274): Camera 'Camera 1, Facing front, Orientation 270' failed to start
01-08 11:40:14.708: E/libjingle(4465): Error(common.cc:76): ../../talk/app/webrtc/videosource.cc(458): ASSERT FAILED: state_ != new_state @ SetState

回答1:


When your call gets cancelled ..before making your call again, you can call

QBVideoChatController.getInstance().finishVideoChat(videoChatConfig);   

that ensures your call is finished, and the rest can begin like a normal call. If it is not absolutely necessary in your case to check for an active call



来源:https://stackoverflow.com/questions/27819697/quickblox-callback-when-participant-get-away-or-stopped-the-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!