WebRTC:OperationError:未知的碎片(...)

时间:2020-04-18 16:57:49

标签: ajax firefox webrtc

开始之前:我必须将“ http; //”更改为“ http; //”(这不是我的代码中的错误)。 我正在尝试创建WebRTC视频和音频连接,并尝试使用ajax和数据库进行信号传输。但是我总是在控制台中获得以下信息:“ OperationError:未知ufrag(71c0b048)”

我是否在同一台计算机上进行操作(Firefox中的两个选项卡或私有模式下的选项卡,“正常”模式下的一个选项卡或同一连接上的两台不同的计算机或使用智能手机的一台计算机)都无所谓。 / p>

这是我的代码:

/* ``` */
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">&nbsp;</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:未知ufrag(71c0b048)”(似乎不知道用户片段)

...不久后: “ ICE失败,添加TURN服务器并查看about:webrtc了解更多详细信息”。 (我已经添加了STUN服务器...(在他告诉我要添加STUN服务器之前)

您知道那里发生了什么吗?我在互联网上进行了搜索,但我只能找到Firefox或Chrome错误跟踪系统中的固定错误。

在服务器端有一个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}

外部SDP(要约)

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

2 个答案:

答案 0 :(得分:1)

“ uFrag”是“ usernameFragment”的缩写,它是ICE候选者的属性。来自w3 specification

如果候选人。用户名片段不为null,并且不等于应用的远程描述的相应媒体描述中存在的任何用户名片段,请使用新创建的OperationError拒绝p并中止这些步骤。

我还没有自己做这件事,但是如果您正在寻找一种快速而肮脏的解决方案,那么从规格上看,您可以像这样将uFrag设置为null

evt.candidate.usernameFragment = null;
peer_con.addIceCandidate( new RTCIceCandidate( evt.candidate ) );

答案 1 :(得分:0)

我有同样的错误信息。 我的错误是我试图将来自远程用户的ICE候选者添加到错误的对等连接中(即,我在错误的对等连接pc.addIceCandidate(theIceCandidate)上呼叫了pc)。