gpt4 book ai didi

ios - QuickBlox WebRTC iOS : can't connect properly

转载 作者:行者123 更新时间:2023-11-29 01:14:55 34 4
gpt4 key购买 nike

我正在尝试使用 QuickBlox-WebRTC 创建一个带有视频聊天功能的 iOS 应用程序。

我的 Controller 是一个QBRTCClientDelegate,一切似乎都“运行良好”。执行以下调用(排名不分先后):

  • didReceiveNewSession
  • initializedLocalMediaStream
  • 收到RemoteVideoTrack
  • 用户接受

但不幸的是,startedConnectingToUserconnectedToUser 永远不会发生。

在调用方,我在日志中看到以下内容:

2016-02-09 23:28:38:105 TestProject[1194:4052297] rtc::Did receive signal: accept from: 8760016
2016-02-09 23:28:38:158 TestProject[1194:4052328] rtc::Did receive signal: iceCandidates from: 8760016
2016-02-09 23:28:38:259 TestProject[1194:4052295] rtc::Did receive signal: iceCandidates from: 8760016
2016-02-09 23:28:38:262 TestProject[1194:4052295] rtc::Did receive signal: iceCandidates from: 8760016
2016-02-09 23:28:38:318 TestProject[1194:4052295] rtc::Did receive signal: iceCandidates from: 8760016
2016-02-09 23:28:38:412 TestProject[1194:4052327] rtc::Did receive signal: iceCandidates from: 8760016
2016-02-09 23:28:40:878 TestProject[1194:4052297] rtc::<Peer:0x155793250, UID:8760016, r:Offer> Send local offer sdp
2016-02-09 23:28:45:839 TestProject[1194:4052297] rtc::<Peer:0x155793250, UID:8760016, r:Offer> Send local offer sdp
2016-02-09 23:28:50:876 TestProject[1194:4052299] rtc::<Peer:0x155793250, UID:8760016, r:Offer> Send local offer sdp
2016-02-09 23:28:55:865 TestProject[1194:4052297] rtc::Close connection for user 8760016
2016-02-09 23:28:55:866 TestProject[1194:4052297] rtc::Invalidate timer:dialing timer, background task id 5 ...
2016-02-09 23:28:55:874 TestProject[1194:4052308] rtc::<Peer:0x155793250, UID:8760016, r:Offer> Renegotiation needed
2016-02-09 23:28:55:876 TestProject[1194:4052297] rtc::<Peer:0x155793250, UID:8760016, r:Offer> Remove local media stream: [com.quickblox.mediastream.device-iphone.6.plus_ios-9.2.1_userid-8762474]:A=1:V=1]
2016-02-09 23:28:55.897 TestProject[1194:4052297] dealloc QBRTCLocalAudioTrack
2016-02-09 23:28:55:896 TestProject[1194:4052297] rtc::<Peer:0x155793250, UID:8760016, r:Offer> Ice connection change:Closed
2016-02-09 23:28:55.897 TestProject[1194:4052297] dealloc QBRTCLocalVideoTrack
2016-02-09 23:28:55:898 TestProject[1194:4052307] rtc::Stop rtc video capturer
2016-02-09 23:28:55.902 TestProject[1194:4052297] Destroy local media stream
2016-02-09 23:28:55:902 TestProject[1194:4052297] rtc::<Peer:0x155793250, UID:8760016, r:Offer> Signaling state changed: Closed
2016-02-09 23:28:55:902 TestProject[1194:4052297] rtc::Destroy dialing timer

在被调用方,我看到以下内容:

2016-02-09 23:28:36:418 TestProject[97959:2233683] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Signaling state changed: Stable
2016-02-09 23:28:36:418 TestProject[97959:2233683] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Send queued ICE candidates, count: 0
2016-02-09 23:28:37:500 TestProject[97959:2233685] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> ICE gathering changed: Gathering
2016-02-09 23:28:37:500 TestProject[97959:2234170] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Set session description
2016-02-09 23:28:37:500 TestProject[97959:2234170] rtc::Send Answer: <Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer>
2016-02-09 23:28:37:500 TestProject[97959:2234170] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Queued ICE candidates, count: 0
2016-02-09 23:28:37:500 TestProject[97959:2234170] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Send queued ICE candidates, count: 1
2016-02-09 23:28:37:612 TestProject[97959:2234066] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Queued ICE candidates, count: 0
2016-02-09 23:28:37:613 TestProject[97959:2234066] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Send queued ICE candidates, count: 1
2016-02-09 23:28:37:706 TestProject[97959:2234170] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Queued ICE candidates, count: 0
2016-02-09 23:28:37:706 TestProject[97959:2234170] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Send queued ICE candidates, count: 1
2016-02-09 23:28:37:881 TestProject[97959:2234173] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Queued ICE candidates, count: 0
2016-02-09 23:28:37:881 TestProject[97959:2234173] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Send queued ICE candidates, count: 1
2016-02-09 23:28:38:131 TestProject[97959:2233685] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> ICE gathering changed: Complete
2016-02-09 23:28:38:132 TestProject[97959:2234172] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Queued ICE candidates, count: 0
2016-02-09 23:28:38:132 TestProject[97959:2234172] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Send queued ICE candidates, count: 1
2016-02-09 23:28:41:914 TestProject[97959:2234172] rtc::Did receive signal: call from: 8762474
2016-02-09 23:28:41:914 TestProject[97959:2234172] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Queued Remote SDP
2016-02-09 23:28:46:708 TestProject[97959:2234172] rtc::Did receive signal: call from: 8762474
2016-02-09 23:28:46:709 TestProject[97959:2234170] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Queued Remote SDP
2016-02-09 23:28:51:891 TestProject[97959:2234170] rtc::Did receive signal: call from: 8762474
2016-02-09 23:28:51:891 TestProject[97959:2233683] rtc::<Peer:0x7fbbe3b54cb0, UID:8762474, r:Answer> Queued Remote SDP

...它重复最后两行。

我已经检查了它在示例应用程序中是如何发生的,当发生以下情况时,我的应用程序似乎永远无法到达该部分:

2016-02-09 12:48:49:006 sample-videochat-webrtc[278:20551] rtc::Did receive signal: iceCandidates from: 2436266
2016-02-09 12:48:49:007 sample-videochat-webrtc[278:19893] rtc::<Peer:0x1477ec80, UID:2436266, r:Answer> Set remote ICE candidates, count: 20
2016-02-09 12:48:50:921 sample-videochat-webrtc[278:20551] rtc::<Peer:0x1477ec80, UID:2436266, r:Answer> Ice connection change:Connected

我在这里缺少什么?比较我的实现和示例的实现,我看不出有什么不同。

最佳答案

事实证明这是一个简单的语法相关错误。创建 session 时,我使用了:

QBRTCSession *newSession = [QBRTCClient.instance
createNewSessionWithOpponents:@[receipientStr]
withConferenceType:QBRTCConferenceTypeVideo];

但是正确的语法是

QBRTCSession *newSession = [QBRTCClient.instance 
createNewSessionWithOpponents:@[@(receipientStr.intValue)]
withConferenceType:QBRTCConferenceTypeVideo];

经过此修改,视频现在可以正常工作了。

关于ios - QuickBlox WebRTC iOS : can't connect properly,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35303900/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com