简体   繁体   English

WebRTC-如何检测上传/下载带宽的状态?

[英]WebRTC - how to detect the status of upload/download bandwidth?

For example: Peer 1 is located in Africa , Peer 2 is located in UK. 例如:Peer 1位于非洲,Peer 2位于英国。 Now P1 upload is very low and download is very slow also it get disconnected over and over 现在P1上传非常低,下载非常慢,而且一遍又一遍地断开

In such situation, how do we detect the Peer 1 bandwidth via WebRTC to determine weather is it 3G or 4G or WiFi or Lan? 在这种情况下,我们如何通过WebRTC检测对等1带宽以确定天气是3G还是4G或WiFi还是Lan?

I guess you can access to that information using the NetworkInformation interface: 我想您可以使用NetworkInformation界面访问该信息:

https://dvcs.w3.org/hg/dap/raw-file/tip/network-api/Overview.html https://dvcs.w3.org/hg/dap/raw-file/tip/network-api/Overview.html

Peer2 can send the information to Peer1 using the Data Channel. Peer2可以使用数据通道将信息发送到Peer1。

After that, you can customize the bandwidth using something like this: https://www.webrtc-experiment.com/RTCMultiConnection/bandwidth.html?audio=30&video=256 之后,您可以使用以下方式自定义带宽: https : //www.webrtc-experiment.com/RTCMultiConnection/bandwidth.html?audio=30&video=256

If you're interested specifically in whether the machine is from 3G/4G or landline there are services that can detect it based on the ip of the user, like this . 如果您对这台机器是3G / 4G还是固定电话特别感兴趣,则可以根据用户的IP来检测它, 例如这样的服务

Assuming such connectivity type, based on the throughput of the uplink/downlink is not consistent (for example if the user is on landline but downloads a file while in your service) 假设这种连接类型基于上行链路/下行链路的吞吐量是不一致的(例如,如果用户在固定电话上,但是在使用服务时下载文件)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM