QuickBlox Chat:无法进行视频通话
Posted
技术标签:
【中文标题】QuickBlox Chat:无法进行视频通话【英文标题】:QuickBlox Chat: can't perform video call 【发布时间】:2013-09-11 12:57:40 【问题描述】:我正在使用 quickblox 开发视频聊天应用程序。而且我在进行视频通话时遇到了麻烦。有一次启动的两个应用程序实例的日志:
Sep 11 16:43:40 iPod-touch DimChat[3823] <Warning>: QBChat/didConnect
Sep 11 16:43:40 iPod-touch DimChat[3823] <Warning>: -[QBChat xmppStreamDidAuthenticate:] -> user: 290427, supportsStartTLS: 1, isSecure: 0
Sep 11 16:43:40 iPod-touch DimChat[3823] <Warning>: -[QBChat xmppStream:didSendPresence:] -> Presence: <presence/>
Sep 11 16:43:40 iPod-touch DimChat[3823] <Warning>: -[QBChat xmppStream:didSendIQ:] -> IQ: <iq type="get" id="561006823"><query xmlns="jabber:iq:roster"/></iq>
Sep 11 16:43:41 iPod-touch DimChat[3823] <Warning>: -[QBChat xmppStream:didReceiveIQ:] -> <iq xmlns="jabber:client" id="561006823" type="result" to="290427-3936@chat.quickblox.com/tigase-3171"><query xmlns="jabber:iq:roster"/></iq>
Sep 11 16:44:00 iPod-touch DimChat[3823] <Warning>: -[QBChat xmppStream:didSendPresence:] -> Presence: <presence/>
Sep 11 16:44:18 iPod-touch wifid[14] <Error>: WiFi:[400596258.779212]: Disable WoW requested by "UserEventAgent"
Sep 11 16:44:18 iPod-touch DimChat[3823] <Warning>: QBChat/didDisconnect, error: Error Domain=GCDAsyncSocketErrorDomain Code=7 "Socket closed by remote peer" UserInfo=0x1ed273e0 NSLocalizedDescription=Socket closed by remote peer
Sep 11 16:44:20 iPod-touch DimChat[3823] <Warning>: -[QBChat sendPresence] -> return. You have to be logged in in order to use Chat API
调用第一个实例的第二个实例:
2013-09-11 16:43:46.408 DimChat[55216:b10f] QBChat/didConnect
2013-09-11 16:43:47.053 DimChat[55216:a207] -[QBChat xmppStreamDidAuthenticate:] -> user: 503867, supportsStartTLS: 1, isSecure: 0
2013-09-11 16:43:47.053 DimChat[55216:a207] -[QBChat xmppStream:didSendIQ:] -> IQ: <iq type="get" id="561006823"><query xmlns="jabber:iq:roster"/></iq>
2013-09-11 16:43:47.053 DimChat[55216:a207] -[QBChat xmppStream:didSendPresence:] -> Presence: <presence/>
2013-09-11 16:43:47.215 DimChat[55216:b10f] -[QBChat xmppStream:didReceiveIQ:] -> <iq xmlns="jabber:client" id="561006823" type="result" to="503867-3936@chat.quickblox.com/tigase-3170"><query xmlns="jabber:iq:roster"/></iq>
2013-09-11 16:43:56.295 DimChat[55216:b10f] -[QBVideoChat init] ->
2013-09-11 16:43:56.295 DimChat[55216:b10f] -[QBVideoChat orientatioDidChange:] -> LandscapeLeft
2013-09-11 16:43:56.296 DimChat[55216:b10f] -[QBVideoChat callUser:conferenceType:customParameters:] -> VideoChat configuration:
kQBVideoChatBadConnectionTimeout = 5;
kQBVideoChatCallTimeout = 15;
kQBVideoChatFrameQualityPreset = AVCaptureSessionPresetLow;
kQBVideoChatP2PTimeout = "1.5";
kQBVideoChatTURNServerEndPoint = "turnserver.quickblox.com";
kQBVideoChatVideoFramesPerSecond = 10;
kQBVideoChatWriteQueueMaxAudioOperationsThreshold = 25;
kQBVideoChatWriteQueueMaxVideoOperationsThreshold = 25;
2013-09-11 16:43:56.296 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="282475249" type="qbvideochat_call" to="290427-3936@chat.quickblox.com" from="503867-3936@chat.quickblox.com"><body>1</body></message>
2013-09-11 16:43:58.297 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="1622650073" type="qbvideochat_call" to="290427-3936@chat.quickblox.com" from="503867-3936@chat.quickblox.com"><body>1</body></message>
2013-09-11 16:44:00.298 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="984943658" type="qbvideochat_call" to="290427-3936@chat.quickblox.com" from="503867-3936@chat.quickblox.com"><body>1</body></message>
2013-09-11 16:44:02.300 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="1144108930" type="qbvideochat_call" to="290427-3936@chat.quickblox.com" from="503867-3936@chat.quickblox.com"><body>1</body></message>
2013-09-11 16:44:04.300 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="470211272" type="qbvideochat_call" to="290427-3936@chat.quickblox.com" from="503867-3936@chat.quickblox.com"><body>1</body></message>
2013-09-11 16:44:06.302 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="101027544" type="qbvideochat_call" to="290427-3936@chat.quickblox.com" from="503867-3936@chat.quickblox.com"><body>1</body></message>
2013-09-11 16:44:07.065 DimChat[55216:b10f] -[QBChat xmppStream:didSendPresence:] -> Presence: <presence/>
2013-09-11 16:44:08.303 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="1457850878" type="qbvideochat_call" to="290427-3936@chat.quickblox.com" from="503867-3936@chat.quickblox.com"><body>1</body></message>
2013-09-11 16:44:10.303 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="1458777923" type="qbvideochat_call" to="290427-3936@chat.quickblox.com" from="503867-3936@chat.quickblox.com"><body>1</body></message>
2013-09-11 16:44:11.304 DimChat[55216:b10f] -[QBVideoChat finishCallWithStatus:customParameters:] -> kStopVideoChatCallStatus_OpponentDidNotAnswer
2013-09-11 16:44:11.305 DimChat[55216:b10f] -[QBVideoChat deinitialization] ->
2013-09-11 16:44:11.305 DimChat[55216:b10f] -[QBVideoChat releaseVideoCapture] ->
2013-09-11 16:44:11.306 DimChat[55216:b10f] -[QBVideoChat releaseAudioCapture] ->
2013-09-11 16:44:11.306 DimChat[55216:b10f] -[QBVideoChat releaseSocketConnection] ->
2013-09-11 16:44:11.306 DimChat[55216:b10f] -[QBChat xmppStream:didSendMessage:] -> Message: <message id="2007237709" type="qbvideochat_stopCall" to="290427-3936@chat.quickblox.com" from="503867-3936@chat.quickblox.com"><body>kStopVideoChatCallStatus_OpponentDidNotAnswer</body></message>
2013-09-11 16:44:25.264 DimChat[55216:b10f] QBChat/didDisconnect, error: Error Domain=GCDAsyncSocketErrorDomain Code=7 "Socket closed by remote peer" UserInfo=0x9ca1260 NSLocalizedDescription=Socket closed by remote peer
2013-09-11 16:44:27.074 DimChat[55216:b10f] -[QBChat sendPresence] -> return. You have to be logged in in order to use Chat API
其实问题是第一个实例没有收到来电。 我检查了 quickblox 的 github 上的视频聊天示例。它适用于我的用户/密码,所以我的代码有错误,但我真的不知道应该在哪里搜索。
如您所见,两个实例都有相同的问题:“远程对等方关闭了套接字”。但是这个问题发生在调用超时之后,所以它不是主要问题的原因。
【问题讨论】:
【参考方案1】:我终于找到了解决方案。问题出在 QBVideoChat 对象中。我认为当另一个用户呼叫我时 QBChat 会向我发送信号,然后我将创建 QBVideoChat 对象并在屏幕上显示它的视图。
可悲的事实是,在我创建 QBVideoChat 之前,QBChat 不会发送任何视频关系信号。所以我必须在程序开始时创建它才能接收 chatDidReceiveCallRequestFromUser 信号。
【讨论】:
好的。那你是怎么解决的?我遇到了同样的问题。检查 2 天 我在程序启动时创建了一个 QBVideoChat 对象。 _videoChat = [[QBChat 实例] createAndRegisterVideoChatInstance];以上是关于QuickBlox Chat:无法进行视频通话的主要内容,如果未能解决你的问题,请参考以下文章