18.6. Detecting Bandwidth

Problem

You want to determine the bandwidth capabilities of a user’s computer.

Solution

Download a file using MovieClipLoader. Determine the amount of time it takes to download the file.

Discussion

Not all users have the same bandwidth capabilities. Users in many parts of the world still have dial-up access with 56k modems. And even for those users with broadband connections, actual bandwidth capabilities can vary greatly. Users on DSL networks might have speeds of 384 Kbps, 768 Kbps, or 1.5 Mbps, for example. Network traffic can also play a role. The more users are on a network, the less bandwidth is likely to be available to each user.

Video can require significant bandwidth capabilities when encoded at higher bit rates. Depending on your audience you might want to consider encoding videos at several bit rates. For example, you might encode a video at 800 Kbps, 400 Kbps, 200 Kbps, and 56 Kbps. In that case, each video will have four FLV files—one for each bitrate. You can name the files using a naming scheme such as videoName_bitrate. For example, you might have four FLV files named welcome_800.flv, welcome_400. flv, welcome_200.flv, and welcome_56.flv.

In order to present the user with the optimal video configuration, you’ll want to know the user’s bandwidth settings. If the user is capable of downloading data quickly, you’ll want to allow the user to view video encoded at high bit rates (and therefore high quality). A user with low bandwidth capabilities may ...

Get Flash 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.