在我们开始之前。我必须把 "http;/"改成 "http;/"(这不是我代码中的错误).我试图创建一个WebRTC视频&音频连接,并尝试使用ajax和数据库进行信号传输。但我总是在控制台得到这样的信息。"OperationError: Unknown ufrag (71c0b048)"
如果我在同一台电脑上这样做并不重要(Firefox中的两个标签或私人模式下的一个标签,一个在 "正常 "模式下,或在同一连接上的两台不同的电脑或使用我的智能手机的一个电热)。
这是我的代码。
/* ``` */
var opt;
var video_el_partner;
var video_el_local;
var peer_con;
var interval_gro;
var interval_gra;
var interval_grc;
var remote_offer_available = false;
var interval_time = 3000;
var already_used_can = new Object();
var remote_desc_set = false;
var service_url = "https;//xyz.de/webrtc";
var pwd = "xxx";
var signaling_url = "https;//xyz.de/webrtc/sdp_transfer.php";
var ice_setup = null;
ice_setup = {
'iceServers': [{'urls': 'stun:stun.schlund.de'}, {'urls': 'stun:iphone-stun.strato-iphone.de:3478'}]
};
function init_stream(video_partner_id, video_local_id, allow_video, allow_audio){
if (location.protocol === 'https:') { // only possible for https!
peer_con = new RTCPeerConnection(ice_setup);
if(document.getElementById(video_partner_id) != null && document.getElementById(video_local_id) != null){
video_el_partner = document.getElementById(video_partner_id);
video_el_local = document.getElementById(video_local_id);
if(allow_video == null){
allow_video = true;
}
if(allow_audio == null){
allow_audio = true;
}
opt = { audio: allow_audio, video: allow_video };
if(typeof navigator != 'undefined' && typeof navigator.mediaDevices != 'undefined' && navigator.mediaDevices.getUserMedia != null){
navigator.mediaDevices.getUserMedia(opt).then (
function (this_stream){
// local video directly into video element:
video_el_local.srcObject = this_stream;
// remote one is more insteresting:
peer_con.addStream(this_stream);
peer_con.createOffer().then(
function (this_sdp) {
// sdp (session dependend protocol object) is now available... this would need to go to a server somehow now.
// they use socket.io for that... maybe I can use my own thing to do that?
peer_con.setLocalDescription(this_sdp);
var this_sdp_json = JSON.stringify(this_sdp)
var params_ins = "mode=insert_offer&sdp_con=" + this_sdp_json + "&pass=" + pwd + "&service_url=" + service_url;
ajax_request_simple (
signaling_url,
params_ins,
function (res_ins) {
// insert done.
console.log('Set Interval: Offer!');
interval_gro = window.setInterval('get_remote_sdp(\'offer\');', interval_time); // listen for an offer of somebody else.
}
);
}
);
peer_con.onicecandidate = function (evt) {
console.log('Step 1');
if ( evt.candidate != null ) {
console.log('Step 2');
console.log(evt.candidate);
var i = 0;
var already_used = false;
while(already_used_can[i] != null){
if(already_used_can[i] == evt.candidate){
already_used = true;
}
i++;
}
// we add outself here:
if(already_used == false){
if(remote_desc_set == true){
already_used_can[already_used_can.length] = evt.candidate;
peer_con.addIceCandidate( new RTCIceCandidate( evt.candidate ) );
// and here we give our candidate to the database.
var this_sdp_json = JSON.stringify(evt.candidate);
var params_candidate = "mode=insert_candidate&sdp_con=" + this_sdp_json + "&pass=" + pwd + "&service_url=" + service_url;
ajax_request_simple(signaling_url, params_candidate, function (evt){
console.log("Saved candidate to db!");
console.log(evt);
});
if(interval_grc != null){
// window.clearInterval(interval_grc);
interval_grc = null;
console.log('Cleared Interval (candidate) => We found something!');
}
}
} else {
console.log('We already used that one!');
}
}
};
peer_con.ontrack = function (evt) {
console.log('Step 3');
video_el_partner.srcObject = evt.stream;
clear_the_intervals();
};
peer_con.oniceconnectionstatechange = function (evt) {
console.log("PeerCon-State: ");
console.log(peer_con.iceConnectionState);
if(peer_con.iceConnectionState == 'failed'){
clear_the_intervals();
}
}
}
).catch(
function (error) {
console.log('Problem: ');
console.log(error);
}
);
} else {
console.log("navgiator or navigator.mediaDevices is not defined.");
}
}
} else {
console.log('init_stream(): We can only do anything like that on https-connections! Http is not supported by the browser!');
}
}
window.onload = function () {
document.getElementById('button_start_stream').onclick = function () {
init_stream('video_partner', 'video_local', true, false);
}
}
function clear_the_intervals() {
if(interval_grc != null){
window.clearInterval(interval_grc);
}
if(interval_gra != null){
window.clearInterval(interval_gra);
}
if(interval_gro != null){
window.clearInterval(interval_gro);
}
}
function is_json_str(str) {
try {
JSON.parse(str);
} catch (e) {
return false;
}
return true;
}
function get_remote_sdp(type) {
console.log("Current Signaling State: " + peer_con.signalingState);
console.log("Current Iceconnection State: " + peer_con.iceConnectionState);
if(type != 'offer' && type != 'answer' && type != 'candidate'){
type = 'offer';
}
var params_read = "mode=get_" + type + "&pass=" + pwd + "&service_url=" + service_url;
ajax_request_simple (
signaling_url,
params_read,
function (res_read) {
// done.
if(is_json_str(res_read)){
// seems like we get one now.
// lets use that to connect and stream the video to the remote view.
var sdp_data = res_read;
sdp_data = JSON.parse(sdp_data);
// clear interval if found.
console.log('We got a/an ' + type + '!');
if(type == 'offer'){
peer_con.setRemoteDescription(
new RTCSessionDescription(sdp_data), function(){
remote_desc_set = true;
// clear offer interval.
if(interval_gro != null){
window.clearInterval(interval_gro);
interval_gro = null;
console.log('Cleared Interval (' + type + ') => We found something!');
}
peer_con.createAnswer(
function (answer) {
peer_con.setLocalDescription(answer);
var this_sdp_json = JSON.stringify(answer);
var params_answer = "mode=insert_answer&sdp_con=" + this_sdp_json + "&pass=" + pwd + "&service_url=" + service_url;
ajax_request_simple(signaling_url, params_answer, function (){
// answer worked... now lets see about candidates!
interval_grc = window.setInterval('get_remote_sdp(\'candidate\');', interval_time);
});
}, function (err) {
console.log('Error: ' + err);
}
);
},
function(e) {
console.log("Problem while doing client-answer: ", e);
}
);
}
if(type == 'candidate'){
if(typeof sdp_data == 'object' && typeof sdp_data.candidate != 'undefined'){
console.log("We found a candidate... lets add it!");
console.log(sdp_data);
// add candidates from partner source.
// we could try that here or we just use onicecandidate for it.
peer_con.addIceCandidate( new RTCIceCandidate(sdp_data),
function () {
console.log('IceCandidate added: ');
console.log(sdp_data);
console.log("Current Iceconnection State while added Can: " + peer_con.iceConnectionState);
// clear offer interval.
if(interval_grc != null){
window.clearInterval(interval_grc);
interval_grc = null;
console.log('Cleared Interval (' + type + ') => We found something!');
}
},
function (error) {
console.log('Could not add candidate from remote: ');
console.log(error);
}
);
} else {
console.log('Candidate seems not to be a candidate!');
console.log(sdp_data);
}
}
} else {
console.log("Can not parse: ");
console.log(res_read);
}
}
);
}
function ajax_request_simple(url, params, callback, callbackReadyState, callbackError) {
//erstellen des requests
var req = null;
try{
req = new XMLHttpRequest();
} catch (ms){
try{
req = new ActiveXObject("Msxml2.XMLHTTP");
} catch (nonms){
try{
req = new ActiveXObject("Microsoft.XMLHTTP");
} catch (failed){
req = null;
}
}
}
if (req == null) {
alert("Error creating request object!");
}
// request created
// request is asynchron
url = decodeURIComponent(url.replace(/\+/g, ' '));
req.open("POST", url, true);
// when request has finished, do this:
req.onreadystatechange = function(){
if(callbackReadyState != null)
callbackReadyState(req);
switch(req.readyState) {
case 4:
if(req.status != 200) {
if(callbackError != null)
callbackError(req);
} else {
if(req != null && req.responseText != null){
if(callback != null)
{
callback(req.responseText);
}
return req.responseText;
}
}
break;
default:
return false;
break;
}
};
req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
req.send(params);
}
/* ``` */
<html>
<head>
<title>WebRTC</title>
<script type="text/javascript" src="js.js"></script>
<script type="text/javascript" src="script/js_ajax_request_simple.js"></script>
<style>
video {
border: 1px solid rgba(0, 0, 0, 1.0);
}
</style>
</head>
<body>
<a id="button_start_stream" href="#" style="clear: both; margin-bottom: 1em; width: 100%; text-align: center; background-color: rgba(50, 200, 255, 1.0); padding: 0.5em;">Starte Stream!</a>
<div class="clear"> </div>
<div style="width: 40%; float: left;">
Your video (local): <br />
<video id="video_local" width="512" height="384" autoplay />
</div>
<div style="width: 40%; float: right;">
Partner video (external): <br />
<video id="video_partner" width="512" height="384" autoplay />
</div>
</body>
</html>
但现在我遇到了另一个关于候选者的问题:"OperationError: Unknown ufrag (71c0b048)" (似乎不知道用户片段)
...过了一小会儿:"ICE失败,添加TURN服务器,详情请看about:webrtc"。(我已经添加了一个STUN服务器... ... (在他告诉我添加STUN服务器之前,我已经添加了一个STUN服务器)
你知道这是怎么回事吗?我在网上搜索了一下,但能找到的都是Firefox或Chrome的bug跟踪系统中的固定错误。
在服务器端有一个mysql数据库,它将把不同的json对象放入数据库,并以不同的模式返回,如 "get_offer"、"get_answer "和 "get_candidate"。(这似乎是工作。它像它应该的那样保存不同的对象,而且似乎也能很好地返回它。
我不完全确定这是否与我的代码有关,或者是否与我的网络连接有关。
当我进入about:webrtc时,我在会话统计中得到这样的信息。
本地SDP (回答)
v=0
o=mozilla...THIS_IS_SDPARTA-76.0 6691071015214921257 1 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 09:C5:79:51:A7:61:00:44:14:7F:5F:3F:16:B3:8C:6E:3D:9E:C9:0C:83:66:57:72:69:25:94:B8:58:CB:F5:EC
a=group:BUNDLE 0
a=ice-options:trickle
a=msid-semantic:WMS *
m=video 65055 UDP/TLS/RTP/SAVPF 120 121 126 97
c=IN IP4 84.103.204.172
a=candidate:0 1 UDP 2122252543 2003:e8:4731:e00:9a0:72b1:6ccb:2352 65053 typ host
a=candidate:3 1 UDP 2122187007 2003:f4:4721:e01:f1da:ab8c:e8f3:5413 65054 typ host
a=candidate:6 1 UDP 2122121471 192.168.178.67 65055 typ host
a=candidate:9 1 TCP 2105524479 2003:e8:4731:e00:9a0:72b1:6ccb:2352 9 typ host tcptype active
a=candidate:10 1 TCP 2105458943 2003:f4:4721:e01:f1da:ab8c:e8f3:5413 9 typ host tcptype active
a=candidate:11 1 TCP 2105393407 192.168.178.67 9 typ host tcptype active
a=candidate:7 1 UDP 1685921791 84.109.214.122 65055 typ srflx raddr 192.168.178.67 rport 65055
a=sendrecv
a=end-of-candidates
a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 http;//www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:5 urn:ietf:params:rtp-hdrext:toffset
a=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1
a=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1
a=fmtp:120 max-fs=12288;max-fr=60
a=fmtp:121 max-fs=12288;max-fr=60
a=ice-pwd:6327ee3c3108793e412c2b050f48f0b6
a=ice-ufrag:286eca5e
a=mid:0
a=msid:{dbd45d86-df25-4a42-c737-89d745cdf212} {cf6231c0-c924-7b22-bd8d-b2652f46f26e}
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack pli
a=rtcp-fb:120 ccm fir
a=rtcp-fb:120 goog-remb
a=rtcp-fb:121 nack
a=rtcp-fb:121 nack pli
a=rtcp-fb:121 ccm fir
a=rtcp-fb:121 goog-remb
a=rtcp-fb:126 nack
a=rtcp-fb:126 nack pli
a=rtcp-fb:126 ccm fir
a=rtcp-fb:126 goog-remb
a=rtcp-fb:97 nack
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 ccm fir
a=rtcp-fb:97 goog-remb
a=rtcp-mux
a=rtpmap:120 VP8/90000
a=rtpmap:121 VP9/90000
a=rtpmap:126 H264/90000
a=rtpmap:97 H264/90000
a=setup:active
a=ssrc:1791964255 cname:{d0f6f8de-ec46-738f-1bbd-b17abbc4831}
外部可持续发展方案(提议)
v=0
o=mozilla...THIS_IS_SDPARTA-76.0 2334691361019050498 0 IN IP4 0.0.0.0
s=-
t=0 0
a=sendrecv
a=fingerprint:sha-256 DB:28:1E:DB:ED:3A:B2:01:31:DA:7D:01:8C:F9:98:49:66:4C:B3:F5:7F:A8:1D:F9:09:33:CE:D6:FC:63:7E:76
a=group:BUNDLE 0
a=ice-options:trickle
a=msid-semantic:WMS *
m=video 9 UDP/TLS/RTP/SAVPF 120 121 126 97
c=IN IP4 0.0.0.0
a=sendrecv
a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
a=extmap:4 http;//www.webrtc.org/experiments/rtp-hdrext/abs-send-time
a=extmap:5 urn:ietf:params:rtp-hdrext:toffset
a=extmap:6/recvonly http;//www.webrtc.org/experiments/rtp-hdrext/playout-delay
a=fmtp:126 profile-level-id=42e01f;level-asymmetry-allowed=1;packetization-mode=1
a=fmtp:97 profile-level-id=42e01f;level-asymmetry-allowed=1
a=fmtp:120 max-fs=12288;max-fr=60
a=fmtp:121 max-fs=12288;max-fr=60
a=ice-pwd:3391de6dc44272a622cb482b55b08f2
a=ice-ufrag:71c0b048
a=mid:0
a=msid:{72632409-82d5-4925-af57-8d2fc77fb5c2} {1653a39b-5de5-4055-8632-dbf58fdcf37d}
a=rtcp-fb:120 nack
a=rtcp-fb:120 nack pli
a=rtcp-fb:120 ccm fir
a=rtcp-fb:120 goog-remb
a=rtcp-fb:121 nack
a=rtcp-fb:121 nack pli
a=rtcp-fb:121 ccm fir
a=rtcp-fb:121 goog-remb
a=rtcp-fb:126 nack
a=rtcp-fb:126 nack pli
a=rtcp-fb:126 ccm fir
a=rtcp-fb:126 goog-remb
a=rtcp-fb:97 nack
a=rtcp-fb:97 nack pli
a=rtcp-fb:97 ccm fir
a=rtcp-fb:97 goog-remb
a=rtcp-mux
a=rtpmap:120 VP8/90000
a=rtpmap:121 VP9/90000
a=rtpmap:126 H264/90000
a=rtpmap:97 H264/90000
a=setup:actpass
a=ssrc:900017133 cname:{528ff569-d0ca-42f8-d665-341cd42e2b1c}
而这是连接日志(缩短......会有几百行)。
(registry/INFO) insert 'ice' (registry) succeeded: ice
(registry/INFO) insert 'ice.pref' (registry) succeeded: ice.pref
(registry/INFO) insert 'ice.pref.type' (registry) succeeded: ice.pref.type
(registry/INFO) insert 'ice.pref.type.srv_rflx' (UCHAR) succeeded: 0x64
(registry/INFO) insert 'ice.pref.type.peer_rflx' (UCHAR) succeeded: 0x6e
(registry/INFO) insert 'ice.pref.type.host' (UCHAR) succeeded: 0x7e
(registry/INFO) insert 'ice.pref.type.relayed' (UCHAR) succeeded: 0x05
(registry/INFO) insert 'ice.pref.type.srv_rflx_tcp' (UCHAR) succeeded: 0x63
(registry/INFO) insert 'ice.pref.type.peer_rflx_tcp' (UCHAR) succeeded: 0x6d
(registry/INFO) insert 'ice.pref.type.host_tcp' (UCHAR) succeeded: 0x7d
(registry/INFO) insert 'ice.pref.type.relayed_tcp' (UCHAR) succeeded: 0x00
(registry/INFO) insert 'stun' (registry) succeeded: stun
(registry/INFO) insert 'stun.client' (registry) succeeded: stun.client
(registry/INFO) insert 'stun.client.maximum_transmits' (UINT4) succeeded: 7
(registry/INFO) insert 'ice.trickle_grace_period' (UINT4) succeeded: 5000
(registry/INFO) insert 'ice.tcp' (registry) succeeded: ice.tcp
(registry/INFO) insert 'ice.tcp.so_sock_count' (INT4) succeeded: 0
(registry/INFO) insert 'ice.tcp.listen_backlog' (INT4) succeeded: 10
(registry/INFO) insert 'ice.tcp.disable' (char) succeeded: \000
(ice/INFO) /builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:173 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:)
(ice/INFO) /builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:173 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:)
(ice/WARNING) /builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): failed to create passive TCP host candidate: 3
(ice/INFO) /builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:173 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:)
(ice/INFO) /builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:173 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:)
(ice/WARNING) /builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:617 function nr_socket_multi_tcp_listen failed with error 3
(ice/WARNING) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): failed to create passive TCP host candidate: 3
(ice/WARNING) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): failed to resolve candidate srflx(IP6:[2007:f3:4235:f00:910:75c1:6deb:2421]:59764/UDP|stun.schlund.de:3478).
(ice/WARNING) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/))/CAND(srflx(IP6:[2007:f3:4235:f00:910:75c1:6deb:2421]:59764/UDP|stun.schlund.de:3478)): failed to initialize, 11 remaining
...
(stun/INFO) Skipping SOURCE-ADDRESS
(stun/INFO) Skipping CHANGED-ADDRESS
(stun/INFO) STUN-CLIENT(srflx(IP4:192.168.178.67:59766/UDP|stun.schlund.de:3478)): Received response; processing
Received response; processing
(stun/INFO) Skipping SOURCE-ADDRESS
(stun/INFO) Skipping CHANGED-ADDRESS
(stun/INFO) STUN-CLIENT(srflx(IP4:192.168.178.67:59766/UDP|iphone-stun.strato-iphone.de:3478)): Received response; processing
(ice/INFO) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): All candidates initialized
...
(ice/WARNING) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): peer (PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/):default) has no stream matching stream PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/) transport-id=transport_0 - 53c0f0cf:c226a179c3d3eefd94c1da8368e16fea
(ice/INFO) /builds/worker/checkouts/gecko/media/mtransport/third_party/nICEr/src/net/nr_socket_multi_tcp.c:173 function nr_socket_multi_tcp_create_stun_server_socket skipping UDP STUN server(addr:)
...
(ice/WARNING) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): peer (PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/):default) has no stream matching stream PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/) transport-id=transport_1 - 53c0f0cf:c226a179c3d3eefd94c1da8368e16fea
(ice/NOTICE) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): peer (PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/):default) no streams with non-empty check lists
(ice/NOTICE) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): peer (PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/):default) no streams with pre-answer requests
(ice/NOTICE) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): peer (PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/):default) no checks to start
(ice/ERR) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): peer (PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/):default) pairing local trickle ICE candidate host(IP6:[2007:f3:4235:f00:910:75c1:6deb:2421]:64034/UDP)
...
(ice/WARNING) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): failed to resolve candidate srflx(IP6:[2007:f3:4235:f00:910:75c1:6deb:2421]:64034/UDP|iphone-stun.strato-iphone.de:3478).
(ice/WARNING) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/))/CAND(srflx(IP6:[2007:f3:4235:f00:910:75c1:6deb:2421]:64034/UDP|iphone-stun.strato-iphone.de:3478)): failed to initialize, 5 remaining
...
(stun/INFO) Skipping SOURCE-ADDRESS
(stun/INFO) Skipping CHANGED-ADDRESS
(stun/INFO) STUN-CLIENT(srflx(IP4:192.168.178.67:64036/UDP|stun.schlund.de:3478)): Received response; processing
(ice/ERR) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): peer (PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/):default) pairing local trickle ICE candidate srflx(IP4:192.168.178.67:64036/UDP|stun.schlund.de:3478)
...
(ice/INFO) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/)): peer (PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/):default) Trickle grace period is over; marking every component with only failed pairs as failed.
(ice/INFO) ICE-PEER(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/):default)/STREAM(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/) transport-id=transport_1 - 53c0f0cf:c226a179c3d3eefd94c1da8368e16fea)/COMP(1): All pairs are failed, and grace period has elapsed. Marking component as failed.
(ice/ERR) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/))/STREAM(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/) transport-id=transport_1 - 53c0f0cf:c226a179c3d3eefd94c1da8368e16fea): state dump
(ice/ERR) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/))/ICE-STREAM(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/) transport-id=transport_1 - 53c0f0cf:c226a179c3d3eefd94c1da8368e16fea): Local component 1 - dumping candidates
(ice/ERR) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/))/ICE-STREAM(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/) transport-id=transport_1 - 53c0f0cf:c226a179c3d3eefd94c1da8368e16fea)/CAND(jH9H): host(IP6:[2007:f3:4235:f00:910:75c1:6deb:2421]:64034/UDP)
(ice/ERR) ICE(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/))/ICE-STREAM(PC:1586800727564000 (id=103079215106 url=https;//xyz.de/webrtc/) transport-id=transport_1 - 53c0f0cf:c226a179c3d3eefd94c1da8368e16fea)/CAND(r11H): srflx(IP6:[2007:f3:4235:f00:910:75c1:6deb:2421]:64034/UDP|stun.schlund.de:3478)
...
我为了这个帖子改了几个IP和哈希值 但希望不要改到无法阅读的程度。
有人知道这是怎么回事吗?
问好,非常感谢您的任何提示。Fuchur
"uFrag "是 "usernameFragment "的缩写,它是ICE候选人的一个属性。从 w3规范:
如果 candidate.usernameFragment 不是空的,并且不等于任何存在于应用的远程描述的相应媒体描述中的用户名片段,用一个新创建的 OperationError 拒绝 p 并中止这些步骤。
我自己还没有这样做,但是如果你正在寻找一个快速和肮脏的解决方案,从规范来看,似乎你可以将uFrag设置为 null
像这样。
evt.candidate.usernameFragment = null;
peer_con.addIceCandidate( new RTCIceCandidate( evt.candidate ) );
我也有同样的错误信息,我的错误在于我试图将远程用户的ICE候选者添加到错误的对等连接中(即,我调用了... ... pc.addIceCandidate(theIceCandidate)
在错误的对等连接上 pc
).