Search code examples
google-chromefirefoxwebrtcsdprtcmulticonnection

WebRTC / rtcmulticonnection -> Chrome to Firefox -> No Video


I have a question and a problem with following situation: In my WebRTC-Application (based on rtcmulticonnection) I want Chrome (sender) connect with Firefox (Receiver).

The Datachannel is opened and I'm also able to send custom messages over the socket. But the main problem ist, that I'm not able to see the chrome-video in my Firefox-Receiver.

Chrome shows me following error:

setRemoteDescription failed 
 DOMException: Failed to set remote answer sdp: Failed to push down transport description: Failed to set SSL role for the channel. 

I already tried to set DtlsSrtpKeyAgreement to false, but nothing changed.

These are the two SDP's: Firefox 1: Remote peer's sdp: v=0

o=- 274606574180189315 2 IN IP4 127.0.0.1

s=-

t=0 0

a=group:BUNDLE sdparta_0

a=msid-semantic: WMS

m=application 9 DTLS/SCTP 5000

c=IN IP4 0.0.0.0

a=ice-ufrag:74Y5

a=ice-pwd:A8LqsLwstXZXz80HVY0rEexZ

a=ice-options:trickle

a=fingerprint:sha-256 EE:B8:F5:67:92:4C:14:15:34:2C:7C:90:3D:3F:0A:D1:0C:6B:43:E3:A1:DA:1C:29:DC:43:B3:75:0C:70:20:E0

a=setup:active

a=mid:sdparta_0

a=sctpmap:5000 webrtc-datachannel 1024

and Firefox 2:

12:11:11.560 Remote peer's sdp: "v=0
o=- 274606574180189315 3 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE sdparta_0 video
a=msid-semantic: WMS ZyYYGy4wOXFxay7ZeNkKR0YSjxXGvhwHSwZe
m=application 42300 DTLS/SCTP 5000
c=IN IP4 192.168.1.121
a=candidate:1910078557 1 udp 2122260223 192.168.1.121 42300 typ host generation 0 network-id 1
a=ice-ufrag:74Y5
a=ice-pwd:A8LqsLwstXZXz80HVY0rEexZ
a=ice-options:trickle
a=fingerprint:sha-256 EE:B8:F5:67:92:4C:14:15:34:2C:7C:90:3D:3F:0A:D1:0C:6B:43:E3:A1:DA:1C:29:DC:43:B3:75:0C:70:20:E0
a=setup:actpass
a=mid:sdparta_0
a=sctpmap:5000 webrtc-datachannel 1024
m=video 9 UDP/TLS/RTP/SAVPF 98 96 100 102 127 97 99 101 125
c=IN IP4 0.0.0.0
a=rtcp:9 IN IP4 0.0.0.0
a=ice-ufrag:74Y5
a=ice-pwd:A8LqsLwstXZXz80HVY0rEexZ
a=ice-options:trickle
a=fingerprint:sha-256 EE:B8:F5:67:92:4C:14:15:34:2C:7C:90:3D:3F:0A:D1:0C:6B:43:E3:A1:DA:1C:29:DC:43:B3:75:0C:70:20:E0
a=setup:actpass
a=mid:video
b=AS:600
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=sendonly
a=rtcp-mux
a=rtcp-rsize
a=rtpmap:96 VP8/90000
a=rtcp-fb:96 ccm fir
a=rtcp-fb:96 nack
a=rtcp-fb:96 nack pli
a=rtcp-fb:96 goog-remb
a=rtcp-fb:96 transport-cc
a=rtpmap:98 VP9/90000
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=rtcp-fb:98 goog-remb
a=rtcp-fb:98 transport-cc
a=rtpmap:100 H264/90000
a=rtcp-fb:100 ccm fir
a=rtcp-fb:100 nack
a=rtcp-fb:100 nack pli
a=rtcp-fb:100 goog-remb
a=rtcp-fb:100 transport-cc
a=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f
a=rtpmap:102 red/90000
a=rtpmap:127 ulpfec/90000
a=rtpmap:97 rtx/90000
a=fmtp:97 apt=96
a=fmtp:96 x-google-min-bitrate=1474560; x-google-max-bitrate=1474560
a=rtpmap:99 rtx/90000
a=fmtp:99 apt=98
a=rtpmap:101 rtx/90000
a=fmtp:101 apt=100
a=rtpmap:125 rtx/90000
a=fmtp:125 apt=102
a=ssrc-group:FID 3581008081 2076245827
a=ssrc:3581008081 cname:1t2rQehCkf48QVIU
a=ssrc:3581008081 msid:ZyYYGy4wOXFxay7ZeNkKR0YSjxXGvhwHSwZe 15ecfda4-75b7-4355-a3d0-fa371d630364
a=ssrc:3581008081 mslabel:ZyYYGy4wOXFxay7ZeNkKR0YSjxXGvhwHSwZe
a=ssrc:3581008081 label:15ecfda4-75b7-4355-a3d0-fa371d630364
a=ssrc:2076245827 cname:1t2rQehCkf48QVIU
a=ssrc:2076245827 msid:ZyYYGy4wOXFxay7ZeNkKR0YSjxXGvhwHSwZe 15ecfda4-75b7-4355-a3d0-fa371d630364
a=ssrc:2076245827 mslabel:ZyYYGy4wOXFxay7ZeNkKR0YSjxXGvhwHSwZe
a=ssrc:2076245827 label:15ecfda4-75b7-4355-a3d0-fa371d630364
" 1 index.php:681:21

and chrome shows:

setRemoteDescription failed 
 DOMException: Failed to set remote answer sdp: Failed to push down transport description: Failed to set SSL role for the channel. 
 v=0
o=mozilla...THIS_IS_SDPARTA-55.0.3 2654848822326037754 1 IN IP4 0.0.0.0
s=-
t=0 0
a=fingerprint:sha-256 F5:B7:C9:E8:9D:F4:E3:05:E6:20:31:C7:91:2A:DA:02:70:12:1A:D4:F1:A9:A5:0B:7B:CA:04:A2:96:4E:DA:B0
a=group:BUNDLE sdparta_0 video
a=ice-options:trickle
a=msid-semantic:WMS *
m=application 54696 DTLS/SCTP 5000
c=IN IP4 5.189.131.23
a=candidate:0 1 UDP 2122252543 192.168.1.121 55554 typ host
a=candidate:2 1 TCP 2105508095 192.168.1.121 52341 typ host tcptype passive
a=candidate:2 1 TCP 2105524479 192.168.1.121 9 typ host tcptype active
a=candidate:1 1 UDP 1686052863 xx.xxx.xxx.xx 59602 typ srflx raddr 192.168.1.121 rport 55554
a=candidate:3 1 TCP 1669292031 77.244.108.51 56741 typ srflx raddr 192.168.1.121 rport 52341 tcptype passive
a=candidate:4 1 UDP 8331263 x.xxx.xxx.xx xxxxx typ relay raddr x.xxx.xxx.xx rport 54696
a=sendrecv
a=ice-pwd:529f56ca1ad4e65862fe4c8885cba1b7
a=ice-ufrag:5f58ee5e
a=mid:sdparta_0
a=sctpmap:5000 webrtc-datachannel 256
a=setup:active
m=video 9 UDP/TLS/RTP/SAVPF 98
c=IN IP4 0.0.0.0
a=recvonly
a=extmap:2 urn:ietf:params:rtp-hdrext:toffset
a=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=fmtp:98 max-fs=12288;max-fr=60
a=ice-pwd:529f56ca1ad4e65862fe4c8885cba1b7
a=ice-ufrag:5f58ee5e
a=mid:video
b=AS:600
a=rtcp-fb:98 nack
a=rtcp-fb:98 nack pli
a=rtcp-fb:98 ccm fir
a=rtcp-fb:98 goog-remb
a=rtcp-mux
a=rtpmap:98 VP9/90000
a=setup:active
a=ssrc:3597408388 cname:{7124bea1-2004-4f4a-91bc-2fb05d225669}

Does somebody have an idea how to solve this? This problem is well known for some years now, but it seems there is no proper solution for this. Thanks in advance!


Solution

  • To make sure RTCMultiConnection do not modify the SDP:

    // in your HTML file
    connection.processSdp = function(sdp) {
        return sdp; // return unchanged SDP
    };
    

    To make sure RTCMultiConnection do not pass DtlsSrtpKeyAgreement or ipv6 attributes:

    // in your HTML file
    connection.optionalArgument = {}; // ignore all DTLS/ipv6 parameters
    

    You can modify dist/RTCMultiConnection.js and remove following two lines:

    // in dist/RTCMultiConnection.js
    bundlePolicy: 'max-bundle',
    iceCandidatePoolSize: 0
    

    Now make sure that you are using dist/RTCMultiConnection.js instead of minified file. By default all demos are using minified file.

    Now both Chrome and Fireox will share non-modified SDP, and use similar API.