javascript - WebRTC。信号已完成,但远程视频不工作

标签 javascript html node.js webrtc

所以,我正在尝试让 webRTC 正常工作,peerConnection 协商成功,一切正常,但远程视频无法播放。

链接 - fb.privetbureau.com控制台日志详细,

这是发信号的 node.js 服务器日志:

Mon May 13 2013 19:40:23 GMT+0700 (ICT) Connection accepted.
{ type: 'GETROOM', value: '' }
789597
Mon May 13 2013 19:40:30 GMT+0700 (ICT) Connection accepted.
{ type: 'INVITE', value: '789597' }
{ type: 'INVITE', value: '789597' }
{ sdp: 'v=0\r\no=- 2849312103 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WL\r\nm=audio 1 RTP/SAVPF 103 104 111 0 8 107 106 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:kgB+lG2PSvFmOhgk\r\na=ice-pwd:YSQ9vft4qjB2GHCvMspO04pj\r\na=ice-options:google-ice\r\na=fingerprint:sha-256 AE:2F:2C:D7:4C:7C:C5:3A:FD:9D:0B:FA:17:D9:DB:D3:A0:93:55:6F:87:4C:00:B8:D1:7E:DE:02:E1:7F:3B:9E\r\na=sendrecv\r\na=mid:audio\r\na=rtcp-mux\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:PyoGMx+ZRIOQhsuN6Y3R6TIKFIDruPxwgiKpAeaL\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 CN/48000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\na=ssrc:1780678205 cname:/kqb1h3CdeQQm5px\r\na=ssrc:1780678205 msid:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WL b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WLa0\r\na=ssrc:1780678205 mslabel:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WL\r\na=ssrc:1780678205 label:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WLa0\r\nm=video 1 RTP/SAVPF 100 116 117\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:kgB+lG2PSvFmOhgk\r\na=ice-pwd:YSQ9vft4qjB2GHCvMspO04pj\r\na=ice-options:google-ice\r\na=fingerprint:sha-256 AE:2F:2C:D7:4C:7C:C5:3A:FD:9D:0B:FA:17:D9:DB:D3:A0:93:55:6F:87:4C:00:B8:D1:7E:DE:02:E1:7F:3B:9E\r\na=sendrecv\r\na=mid:video\r\na=rtcp-mux\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:PyoGMx+ZRIOQhsuN6Y3R6TIKFIDruPxwgiKpAeaL\r\na=rtpmap:100 VP8/90000\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=ssrc:188448368 cname:/kqb1h3CdeQQm5px\r\na=ssrc:188448368 msid:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WL b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WLv0\r\na=ssrc:188448368 mslabel:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WL\r\na=ssrc:188448368 label:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WLv0\r\n',
  type: 'offer' }
{ sdp: 'v=0\r\no=- 2849312103 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WL\r\nm=audio 1 RTP/SAVPF 103 104 111 0 8 107 106 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:kgB+lG2PSvFmOhgk\r\na=ice-pwd:YSQ9vft4qjB2GHCvMspO04pj\r\na=ice-options:google-ice\r\na=fingerprint:sha-256 AE:2F:2C:D7:4C:7C:C5:3A:FD:9D:0B:FA:17:D9:DB:D3:A0:93:55:6F:87:4C:00:B8:D1:7E:DE:02:E1:7F:3B:9E\r\na=sendrecv\r\na=mid:audio\r\na=rtcp-mux\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:PyoGMx+ZRIOQhsuN6Y3R6TIKFIDruPxwgiKpAeaL\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 CN/48000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\na=ssrc:1780678205 cname:/kqb1h3CdeQQm5px\r\na=ssrc:1780678205 msid:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WL b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WLa0\r\na=ssrc:1780678205 mslabel:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WL\r\na=ssrc:1780678205 label:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WLa0\r\nm=video 1 RTP/SAVPF 100 116 117\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:kgB+lG2PSvFmOhgk\r\na=ice-pwd:YSQ9vft4qjB2GHCvMspO04pj\r\na=ice-options:google-ice\r\na=fingerprint:sha-256 AE:2F:2C:D7:4C:7C:C5:3A:FD:9D:0B:FA:17:D9:DB:D3:A0:93:55:6F:87:4C:00:B8:D1:7E:DE:02:E1:7F:3B:9E\r\na=sendrecv\r\na=mid:video\r\na=rtcp-mux\r\na=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:PyoGMx+ZRIOQhsuN6Y3R6TIKFIDruPxwgiKpAeaL\r\na=rtpmap:100 VP8/90000\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=ssrc:188448368 cname:/kqb1h3CdeQQm5px\r\na=ssrc:188448368 msid:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WL b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WLv0\r\na=ssrc:188448368 mslabel:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WL\r\na=ssrc:188448368 label:b0UqS5IWISA5d00eMJLyveHUIxbUVYd717WLv0\r\n',
  type: 'offer' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:3022624816 1 udp 2113937151 192.168.1.4 61929 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:3022624816 1 udp 2113937151 192.168.1.4 61929 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:3022624816 2 udp 2113937151 192.168.1.4 61929 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:3022624816 2 udp 2113937151 192.168.1.4 61929 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:3022624816 1 udp 2113937151 192.168.1.4 61929 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:3022624816 1 udp 2113937151 192.168.1.4 61929 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:3022624816 2 udp 2113937151 192.168.1.4 61929 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:3022624816 2 udp 2113937151 192.168.1.4 61929 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:494278629 1 udp 1845501695 58.186.129.32 12490 typ srflx raddr 192.168.1.4 rport 61929 generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:494278629 1 udp 1845501695 58.186.129.32 12490 typ srflx raddr 192.168.1.4 rport 61929 generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:494278629 2 udp 1845501695 58.186.129.32 12490 typ srflx raddr 192.168.1.4 rport 61929 generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:494278629 2 udp 1845501695 58.186.129.32 12490 typ srflx raddr 192.168.1.4 rport 61929 generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:494278629 1 udp 1845501695 58.186.129.32 12490 typ srflx raddr 192.168.1.4 rport 61929 generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:494278629 1 udp 1845501695 58.186.129.32 12490 typ srflx raddr 192.168.1.4 rport 61929 generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:494278629 2 udp 1845501695 58.186.129.32 12490 typ srflx raddr 192.168.1.4 rport 61929 generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:494278629 2 udp 1845501695 58.186.129.32 12490 typ srflx raddr 192.168.1.4 rport 61929 generation 0\r\n' }
{ sdp: 'v=0\r\no=- 2803182277 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaT\r\nm=audio 1 RTP/SAVPF 103 104 111 0 8 107 106 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:+EOwL2ay5PL3ECaf\r\na=ice-pwd:+fdbJtby/5rASgPp2pEdvX67\r\na=fingerprint:sha-256 78:F3:F6:BF:A6:94:F6:8E:B6:FB:D6:D2:32:C7:AB:F2:21:3C:BB:C2:DB:2A:F1:D9:8D:D5:B2:51:96:DB:67:10\r\na=sendrecv\r\na=mid:audio\r\na=rtcp-mux\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 CN/48000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\na=ssrc:783261737 cname:WTJ7BbZRj6o1rGFr\r\na=ssrc:783261737 msid:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaT RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaTa0\r\na=ssrc:783261737 mslabel:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaT\r\na=ssrc:783261737 label:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaTa0\r\nm=video 1 RTP/SAVPF 100 116 117\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:+EOwL2ay5PL3ECaf\r\na=ice-pwd:+fdbJtby/5rASgPp2pEdvX67\r\na=fingerprint:sha-256 78:F3:F6:BF:A6:94:F6:8E:B6:FB:D6:D2:32:C7:AB:F2:21:3C:BB:C2:DB:2A:F1:D9:8D:D5:B2:51:96:DB:67:10\r\na=sendrecv\r\na=mid:video\r\na=rtcp-mux\r\na=rtpmap:100 VP8/90000\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=ssrc:1576397023 cname:WTJ7BbZRj6o1rGFr\r\na=ssrc:1576397023 msid:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaT RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaTv0\r\na=ssrc:1576397023 mslabel:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaT\r\na=ssrc:1576397023 label:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaTv0\r\n',
  type: 'answer' }
{ sdp: 'v=0\r\no=- 2803182277 2 IN IP4 127.0.0.1\r\ns=-\r\nt=0 0\r\na=group:BUNDLE audio video\r\na=msid-semantic: WMS RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaT\r\nm=audio 1 RTP/SAVPF 103 104 111 0 8 107 106 105 13 126\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:+EOwL2ay5PL3ECaf\r\na=ice-pwd:+fdbJtby/5rASgPp2pEdvX67\r\na=fingerprint:sha-256 78:F3:F6:BF:A6:94:F6:8E:B6:FB:D6:D2:32:C7:AB:F2:21:3C:BB:C2:DB:2A:F1:D9:8D:D5:B2:51:96:DB:67:10\r\na=sendrecv\r\na=mid:audio\r\na=rtcp-mux\r\na=rtpmap:103 ISAC/16000\r\na=rtpmap:104 ISAC/32000\r\na=rtpmap:111 opus/48000/2\r\na=fmtp:111 minptime=10\r\na=rtpmap:0 PCMU/8000\r\na=rtpmap:8 PCMA/8000\r\na=rtpmap:107 CN/48000\r\na=rtpmap:106 CN/32000\r\na=rtpmap:105 CN/16000\r\na=rtpmap:13 CN/8000\r\na=rtpmap:126 telephone-event/8000\r\na=maxptime:60\r\na=ssrc:783261737 cname:WTJ7BbZRj6o1rGFr\r\na=ssrc:783261737 msid:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaT RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaTa0\r\na=ssrc:783261737 mslabel:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaT\r\na=ssrc:783261737 label:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaTa0\r\nm=video 1 RTP/SAVPF 100 116 117\r\nc=IN IP4 0.0.0.0\r\na=rtcp:1 IN IP4 0.0.0.0\r\na=ice-ufrag:+EOwL2ay5PL3ECaf\r\na=ice-pwd:+fdbJtby/5rASgPp2pEdvX67\r\na=fingerprint:sha-256 78:F3:F6:BF:A6:94:F6:8E:B6:FB:D6:D2:32:C7:AB:F2:21:3C:BB:C2:DB:2A:F1:D9:8D:D5:B2:51:96:DB:67:10\r\na=sendrecv\r\na=mid:video\r\na=rtcp-mux\r\na=rtpmap:100 VP8/90000\r\na=rtpmap:116 red/90000\r\na=rtpmap:117 ulpfec/90000\r\na=ssrc:1576397023 cname:WTJ7BbZRj6o1rGFr\r\na=ssrc:1576397023 msid:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaT RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaTv0\r\na=ssrc:1576397023 mslabel:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaT\r\na=ssrc:1576397023 label:RJJxixhu6EeXzGytOIWbjzooUqc2iZ9VwQaTv0\r\n',
  type: 'answer' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:3022624816 1 udp 2113937151 192.168.1.4 50193 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:3022624816 1 udp 2113937151 192.168.1.4 50193 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:3022624816 1 udp 2113937151 192.168.1.4 50193 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:3022624816 1 udp 2113937151 192.168.1.4 50193 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:494278629 1 udp 1845501695 58.186.129.32 12493 typ srflx raddr 192.168.1.4 rport 50193 generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:494278629 1 udp 1845501695 58.186.129.32 12493 typ srflx raddr 192.168.1.4 rport 50193 generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:494278629 1 udp 1845501695 58.186.129.32 12493 typ srflx raddr 192.168.1.4 rport 50193 generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:494278629 1 udp 1845501695 58.186.129.32 12493 typ srflx raddr 192.168.1.4 rport 50193 generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:4205470912 1 tcp 1509957375 192.168.1.4 53603 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:4205470912 1 tcp 1509957375 192.168.1.4 53603 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:4205470912 1 tcp 1509957375 192.168.1.4 53603 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:4205470912 1 tcp 1509957375 192.168.1.4 53603 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:4205470912 1 tcp 1509957375 192.168.1.4 53604 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 0,
  id: 'audio',
  candidate: 'a=candidate:4205470912 1 tcp 1509957375 192.168.1.4 53604 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:4205470912 1 tcp 1509957375 192.168.1.4 53604 typ host generation 0\r\n' }
{ type: 'candidate',
  label: 1,
  id: 'video',
  candidate: 'a=candidate:4205470912 1 tcp 1509957375 192.168.1.4 53604 typ host generation 0\r\n' }
Mon May 13 2013 19:41:05 GMT+0700 (ICT) Peer 192.168.1.4 disconnected.
Mon May 13 2013 19:41:15 GMT+0700 (ICT) Peer 192.168.1.4 disconnected.

最佳答案

你可以获得remotestreams onaddstream 回调,你必须在添加流后重新协商(提供和回答交换)。

关于javascript - WebRTC。信号已完成,但远程视频不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16522960/

相关文章:

javascript - jquery中模糊事件忽略点击事件

node.js - 即使 key 不存在,如何插入DynamoDb

node.js - 无法确定 Architect 命令 Angular 的项目或目标

javascript - vis.js - 手动放置节点

javascript - 选项 资源加载失败,仅在 Chrome 中

javascript - 如何动态更改动态div的div文本

node.js - Excel 的 csv 文件中的重音字符串无法正确显示

javascript - 如何在 Angular 可见时刷新组件

javascript - .html() 返回空

jquery - Bootstrap 模式确实显示正确