我试图实现视频通话,直到android-client收到onSessionClosed
事件才能正常工作。之后onReceiveNewSession
从未调用,但我可以在日志中看到新的<signalType>call</signalType>
信号。
成功登录后设置回调:
private boolean addSignalingManagerListener() {
Log.e(TAG, "isSignedIn = " + isSignedIn());
if (QBChatService.getInstance().isLoggedIn()) {
QBChatService.getInstance().getVideoChatWebRTCSignalingManager()
.addSignalingManagerListener((qbSignaling, createdLocally) -> {
if (!createdLocally) QBRTCClient.getInstance(this).addSignaling(qbSignaling);
});
initAudio();
QBRTCClient.getInstance(this).addSessionCallbacksListener(this);
QBRTCClient.getInstance(this).prepareToProcessCalls();
return true;
}
return false;
}
接听来电:
@Override
public void onReceiveNewSession(QBRTCSession qbrtcSession) { //- Called only once
qbrtcSession.removeSessionCallbacksListener(this);
qbrtcSession.removeVideoTrackCallbacksListener(this);
qbrtcSession.removeAudioTrackCallbacksListener(this);
qbrtcSession.addSessionCallbacksListener(this);
qbrtcSession.addVideoTrackCallbacksListener(this);
qbrtcSession.addAudioTrackCallbacksListener(this);
qbrtcSession.acceptCall(null);
}
在接受QuickBlox中的新来电视频通话之前,我是否必须致电QBChatService.getInstance().logout()
?问,因为我发现重新解决问题但解决了问题 - https://github.com/QuickBlox/quickblox-android-sdk/issues/450。