WebRTC多连接不会触发onstream()事件,a = sendrecv

时间:2018-02-07 07:39:09

标签: ionic-framework server socket.io webrtc sdp

我正在使用视频聊天开发Ionic 3应用程序。 到目前为止,主代码似乎运行良好(在2个浏览器选项卡之间)。 使用我的Android手机加入房间时,远程流的onstream()事件不会被触发。 这意味着,手机视频不会被追加。但建立了连接,我可以发送,例如文本数据。

是否可能有任何特定的端口要打开? 到目前为止,手机已连接到webrtcweb.com:7788转服务器(在浏览器中打开)和我们的私人信令服务器。可悲的是,我不知道如何测试与stun.l.google.com:19302的连接。

我很感谢任何建议。

修改

加入Android App时,桌面用户会获得以下输出:

Remote peer's sdp: v=0
o=- 7170415342919352598 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE audio video data
a=msid-semantic: WMS
m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 0 8 110 112 113 126
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:yGlN
a=ice-pwd:zcWTohvOYAJLPcqU/XXcHchf
a=ice-options:trickle
a=fingerprint:sha-256 7E:2C:7F:E2:13:22:2A:43:50:B6:D6:B5:2E:E2:95:6D:77:78:59:44:47:19:51:DB:DE:03:DD:A9:12:9C:A3:BF
a=setup:active
a=mid:audio
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=recvonly
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:103 ISAC/16000
a=rtpmap:104 ISAC/32000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:112 telephone-event/32000
a=rtpmap:113 telephone-event/16000
a=rtpmap:126 telephone-event/8000
m=video 9 UDP/TLS/RTP/SAVPF 98 96 97 99 100 101 108 109 124
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:yGlN
a=ice-pwd:zcWTohvOYAJLPcqU/XXcHchf
a=ice-options:trickle
a=fingerprint:sha-256 7E:2C:7F:E2:13:22:2A:43:50:B6:D6:B5:2E:E2:95:6D:77:78:59:44:47:19:51:DB:DE:03:DD:A9:12:9C:A3:BF
a=setup:active
a=mid:video
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:4 urn:3gpp:video-orientation
a=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
a=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
a=recvonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:100 H264/90000
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:108 red/90000
a=rtpmap:109 rtx/90000
a=fmtp:109 apt=108
a=rtpmap:124 ulpfec/90000
m=application 9 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
b=AS:30
a=ice-ufrag:yGlN
a=ice-pwd:zcWTohvOYAJLPcqU/XXcHchf
a=ice-options:trickle
a=fingerprint:sha-256 7E:2C:7F:E2:13:22:2A:43:50:B6:D6:B5:2E:E2:95:6D:77:78:59:44:47:19:51:DB:DE:03:DD:A9:12:9C:A3:BF
a=setup:active
a=mid:data
a=sctpmap:5000 webrtc-datachannel 1024
  

a = mid:audio
  a = extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
  一个= recvonly

     

a = mid:video a = extmap:2 urn:ietf:params:rtp-hdrext:toffset a = extmap:3
  http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time a = extmap:4
  urn:3gpp:视频方向a = extmap:5
  http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
  a = extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
  一个= extmap:7
  http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
  a = extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
  一个= recvonly

这些线条对我来说似乎很有趣。好像 Android应用程序只接收,但它设置了这个:

this.connection.sdpConstraints.mandatory = {
      OfferToReceiveAudio: true,
      OfferToReceiveVideo: true
    };

运行两个浏览器标签时,输出正确显示a=sendrecv

EDIT2:

我刚尝试使用公共测试签名服务器:https://rtcmulticonnection.herokuapp.com:443/

哦哇,它正在从Android到桌面工作!

这意味着,我的私有配置错误或在某些未知端口后面。 为了进行设置,我使用了本教程:

https://github.com/muaz-khan/WebRTC-Experiment/tree/master/socketio-over-nodejs

有什么建议吗?感谢

0 个答案:

没有答案