
Chief Technical Officer
HostCast
www.hostcast.com
A common set of requirements arise repeatedly when deploying Macromedia Flash Video on web pages. How often have you required Macromedia Flash Player to:
These requirements are quite difficult to satisfy simultaneously. Detecting bandwidth can take several seconds to measure. Allowing the default rtmp connection to fail-over and attempt to tunnel on rtmpt:80 can take up to a minute. So how can you bypass the firewall and proxy obstacles and prevent the empty box from appearing in your video window while Flash Player is waiting for content? In short, how do you maintain the usability of Flash Player? The Media class components will not help you—in fact they exacerbate this situation. You can only pass them a single protocol/port combination and they don't detect bandwidth natively.
A good solution would enable you to specify exactly which set of port and protocol combinations you wanted to use in your connection attempts. Such a solution would also measure bandwidth and detect stream length, and it would do all this while delivering the first frame of the video in as short a time as possible.
This tutorial demonstrates how you can create such a solution, using only some relatively simple client- and server-side ActionScript and no media or communication components. I've included a working example, which you are welcome to pick apart, copy, and extend to suit your own needs.
To complete this tutorial you will need to install the following software and files:
A working knowledge of ActionScript, including an understanding of client- and server-side NetConnection and client-side NetStream functions.