如何解决为什么 webrtc Ice Candidate 类型与两个对等连接不同
我在网络浏览器 (chrome) 和 Android 应用程序之间建立了对等连接。 当我查询统计信息以检查两个对等点之间的连接类型时。我猜信息应该是一样的,但是我看到两个结果是不同的。
谁能给我解释一下?
安卓版
boolean success = peerConnection.getStats(statsReports -> {
for (StatsReport report : statsReports) {
Log.i(TAG,"report " + report.toString());
}
},null);
android 上的结果(我手动过滤了 Conn-audio 文件)
[googLocalAddress: 192.168.123.13:47063],[localCandidateId: Cand-b6zAa+KI],[googLocalCandidateType: local],[googRemoteAddress: 192.168.123.49:50663],[remoteCandidateId: Cand-2rJUPD95],[googRemoteCandidateType: local],
在网络浏览器(chrome)中
const reqFields = [
'googLocalAddress','googLocalCandidateType','googRemoteAddress','googRemoteCandidateType'
];
const connectionDetails = {};
peerConnection.getStats(stats => {
// console.log("peer starts",stats.result());
const filtered = stats.result().filter(e => {
return e.id.indexOf('Conn-audio') === 0 && e.stat('googActiveConnection') === 'true';
})[0];
if (!filtered) return resolve({});
reqFields.forEach(e => {
connectionDetails[e.replace('goog','')] = filtered.stat(e);
});
console.log('1111111',connectionDetails);
});
网络浏览器结果
LocalAddress: "192.168.123.49:50663"
LocalCandidateType: "local"
RemoteAddress: ":47063"
RemoteCandidateType: "prflx"
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。