为什么QuickBlox的“onReceiveNewSession”只调用一次?

时间:2017-09-22 13:02:23

标签: android quickblox quickblox-android

我试图实现视频通话,直到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

0 个答案:

没有答案