Detecting connection speed and player version

Anybody have (or know a source for) an actionscript that will do all of the following:

  1. Detect the broadband connection speed of a site visitor.
  2. Detect the version of Flash Player they have.
  3. Use above information to steer the visitor (seamlessly and unbeknownst to them) to the one of several versions (on a streaming server) of an flv’d video that is the most appropriate for their connection speed/player version combo?

Also, what range of kbps versions would cover most situations (e.g., 100, 300, & 450?)

Thanks.