我正在使用Simple Peer创建一个webrtc应用 我已成功连接到webrtc,我也接受了一个sdp。但问题是这个sdp太大 我想使用FCM作为我的信令服务器。但是当我通过FCM发送sdp时,我超出了FCM的大小限制。有没有办法摆脱这个问题?
sdp的大小约为4484字节,肯定高于FCM的大小限制 整个fcm有效负载看起来像这样
{ data:
{ callerId: '1',
callerPeerId: '{"type":"offer","sdp":"v=0\\r\\no=- 8126400233104797062 2 IN IP4 127.0.0.1\\r\\ns=-\\r\\nt=0 0\\r\\na=group:BUNDLE video data\\r\\na=msid-semantic: WMS NU02oAAWtFeYX0tsYQe5zMBQ1ayRMTu4lLzN\\r\\nm=video 60409 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 102 123 127 122 125 107 108 109 124\\r\\nc=IN IP4 103.217.232.209\\r\\na=rtcp:9 IN IP4 0.0.0.0\\r\\na=candidate:233611916 1 udp 2122260223 192.168.78.2 60408 typ host generation 0 network-id 1\\r\\na=candidate:2943013415 1 udp 2122194687 192.168.2.3 60409 typ host generation 0 network-id 2 network-cost 10\\r\\na=candidate:1131372156 1 tcp 1518280447 192.168.78.2 9 typ host tcptype active generation 0 network-id 1\\r\\na=candidate:3790155479 1 tcp 1518214911 192.168.2.3 9 typ host tcptype active generation 0 network-id 2 network-cost 10\\r\\na=candidate:104160754 1 udp 1685987071 103.217.232.209 60409 typ srflx raddr 192.168.2.3 rport 60409 generation 0 network-id 2 network-cost 10\\r\\na=ice-ufrag:eaJ2\\r\\na=ice-pwd:RDZ3zsDhRKZuvYMSq1/buu2I\\r\\na=ice-options:trickle\\r\\na=fingerprint:sha-256 F3:50:5E:C4:6C:F2:6D:D4:B7:AD:25:83:19:87:FA:54:BC:2D:0C:4F:76:A2:0D:01:F0:FE:57:0C:21:EE:F5:97\\r\\na=setup:actpass\\r\\na=mid:video\\r\\na=extmap:2 urn:ietf:params:rtp-hdrext:toffset\\r\\na=extmap:3 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time\\r\\na=extmap:4 urn:3gpp:video-orientation\\r\\na=extmap:5 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01\\r\\na=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay\\r\\na=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type\\r\\na=extmap:8 http://www.webrtc.org/experiments/rtp-hdrext/video-timing\\r\\na=sendrecv\\r\\na=rtcp-mux\\r\\na=rtcp-rsize\\r\\na=rtpmap:96 VP8/90000\\r\\na=rtcp-fb:96 goog-remb\\r\\na=rtcp-fb:96 transport-cc\\r\\na=rtcp-fb:96 ccm fir\\r\\na=rtcp-fb:96 nack\\r\\na=rtcp-fb:96 nack pli\\r\\na=rtpmap:97 rtx/90000\\r\\na=fmtp:97 apt=96\\r\\na=rtpmap:98 VP9/90000\\r\\na=rtcp-fb:98 goog-remb\\r\\na=rtcp-fb:98 transport-cc\\r\\na=rtcp-fb:98 ccm fir\\r\\na=rtcp-fb:98 nack\\r\\na=rtcp-fb:98 nack pli\\r\\na=rtpmap:99 rtx/90000\\r\\na=fmtp:99 apt=98\\r\\na=rtpmap:100 H264/90000\\r\\na=rtcp-fb:100 goog-remb\\r\\na=rtcp-fb:100 transport-cc\\r\\na=rtcp-fb:100 ccm fir\\r\\na=rtcp-fb:100 nack\\r\\na=rtcp-fb:100 nack pli\\r\\na=fmtp:100 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42001f\\r\\na=rtpmap:101 rtx/90000\\r\\na=fmtp:101 apt=100\\r\\na=rtpmap:102 H264/90000\\r\\na=rtcp-fb:102 goog-remb\\r\\na=rtcp-fb:102 transport-cc\\r\\na=rtcp-fb:102 ccm fir\\r\\na=rtcp-fb:102 nack\\r\\na=rtcp-fb:102 nack pli\\r\\na=fmtp:102 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=42e01f\\r\\na=rtpmap:123 rtx/90000\\r\\na=fmtp:123 apt=102\\r\\na=rtpmap:127 H264/90000\\r\\na=rtcp-fb:127 goog-remb\\r\\na=rtcp-fb:127 transport-cc\\r\\na=rtcp-fb:127 ccm fir\\r\\na=rtcp-fb:127 nack\\r\\na=rtcp-fb:127 nack pli\\r\\na=fmtp:127 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=4d0032\\r\\na=rtpmap:122 rtx/90000\\r\\na=fmtp:122 apt=127\\r\\na=rtpmap:125 H264/90000\\r\\na=rtcp-fb:125 goog-remb\\r\\na=rtcp-fb:125 transport-cc\\r\\na=rtcp-fb:125 ccm fir\\r\\na=rtcp-fb:125 nack\\r\\na=rtcp-fb:125 nack pli\\r\\na=fmtp:125 level-asymmetry-allowed=1;packetization-mode=1;profile-level-id=640032\\r\\na=rtpmap:107 rtx/90000\\r\\na=fmtp:107 apt=125\\r\\na=rtpmap:108 red/90000\\r\\na=rtpmap:109 rtx/90000\\r\\na=fmtp:109 apt=108\\r\\na=rtpmap:124 ulpfec/90000\\r\\na=ssrc-group:FID 994613299 1264501988\\r\\na=ssrc:994613299 cname:ycHTjHCz/9qUUE91\\r\\na=ssrc:994613299 msid:NU02oAAWtFeYX0tsYQe5zMBQ1ayRMTu4lLzN e1aa962c-e87a-4b65-8bee-137abb787f39\\r\\na=ssrc:994613299 mslabel:NU02oAAWtFeYX0tsYQe5zMBQ1ayRMTu4lLzN\\r\\na=ssrc:994613299 label:e1aa962c-e87a-4b65-8bee-137abb787f39\\r\\na=ssrc:1264501988 cname:ycHTjHCz/9qUUE91\\r\\na=ssrc:1264501988 msid:NU02oAAWtFeYX0tsYQe5zMBQ1ayRMTu4lLzN e1aa962c-e87a-4b65-8bee-137abb787f39\\r\\na=ssrc:1264501988 mslabel:NU02oAAWtFeYX0tsYQe5zMBQ1ayRMTu4lLzN\\r\\na=ssrc:1264501988 label:e1aa962c-e87a-4b65-8bee-137abb787f39\\r\\nm=application 60411 DTLS/SCTP 5000\\r\\nc=IN IP4 103.217.232.209\\r\\na=candidate:233611916 1 udp 2122260223 192.168.78.2 60410 typ host generation 0 network-id 1\\r\\na=candidate:2943013415 1 udp 2122194687 192.168.2.3 60411 typ host generation 0 network-id 2 network-cost 10\\r\\na=candidate:1131372156 1 tcp 1518280447 192.168.78.2 9 typ host tcptype active generation 0 network-id 1\\r\\na=candidate:3790155479 1 tcp 1518214911 192.168.2.3 9 typ host tcptype active generation 0 network-id 2 network-cost 10\\r\\na=candidate:104160754 1 udp 1685987071 103.217.232.209 60411 typ srflx raddr 192.168.2.3 rport 60411 generation 0 network-id 2 network-cost 10\\r\\na=ice-ufrag:eaJ2\\r\\na=ice-pwd:RDZ3zsDhRKZuvYMSq1/buu2I\\r\\na=ice-options:trickle\\r\\na=fingerprint:sha-256 F3:50:5E:C4:6C:F2:6D:D4:B7:AD:25:83:19:87:FA:54:BC:2D:0C:4F:76:A2:0D:01:F0:FE:57:0C:21:EE:F5:97\\r\\na=setup:actpass\\r\\na=mid:data\\r\\na=sctpmap:5000 webrtc-datachannel 1024\\r\\n"}' } }
感谢您的帮助!