As I see it, you can use JS -> PHP -> JS call and response time, but this is pretty inaccurate. In addition, you will need to use enough data (excessive bandwidth usage) and will never get an explicit answer due to server headers that exist / do not exist between browsers. There are also worries about service providers (comcast cough cough), where they give you 12 Mbps for the first few seconds, but then put you down to 3mbits, so now your βTestβ will say that they are on the OC line, but the stream is now will have a data deficit and is constantly buffered.
The best solution is to build the logic in the stream protocol, which can be adjusted depending on how much / small data comes in. Perhaps it starts with low quality bandwidth and raises the bar when it notices that the buffer grows faster than the data plays (this is what Hulu, YouTube or Amazon videos do).
source share