title: How to measure connection speed when streaming HTML5 video?
body: <p>I have a website where the users are going to watch videos. I want to serve them the best quality possible without it pausing for buffering, and so I need a way to measure the connection speed. </p>
  
  <p>Now I've set up some code that as soon as possible figures out where the buffer is, waits for three seconds and then measures it again. And since we know the bit rate, it can calculate the connection speed.</p>
  
  <p>The problem is that the browser is throttling the buffer....
  So if the user has a fast connection, it buffers for only one second before it slows down the buffering a lot, since there is no need to buffer at max speed anyway. So since I'm measuring for three seconds, it gives a bit rate that is way to low than the connection is in reality. However, if the connection is about the same speed as the video bit rate, it works perfectly.</p>
  
  <p>How can this be solved? Google has made it over at YouTube, so it should be possible.</p>