Creating a Web FLV Player
Converting video files to FLV files can be a great way to reduce the amount of bandwidth used to stream videos from your web site. This tutorial will take you through the basics of creating a Flash FLV player the MediaDisplay component in Flash 8 Professional.
Step 1. Create a new flash file and select Components from the Window menu (Ctrl+F7) and also Component Inspector (Alt+F7) You will need both of these toolbars to work with the MediaDisplay component.
Step 2. Drag the MediaDisplay component off of the Components menu and onto your empty flash document. Resize it to the size you want the player to be on your page.
Step 3. Give it an instance name of “player” under properties.
Step 4. Bring up the component inspector and select the component in your flash file to get its settings. Make sure it is set to FLV and then choose the settings you want for it. Use preferred media size will limit the FLV file from becoming bigger then it originally was. With this disabled it will expand to fit the size of the player. The video length can be left at zero. The URL can be set to hardcode in a video, or it can be left blank and in the next steps we will make it dynamic.

Step 5. In order to use the same swf file to play a number of different videos we will make the URL dynamic. Add this code to the first keyframe of your document.
player.contentPath = file;
Then add these to your Flash HTML code.
<param name=”FlashVars” value=”file=myvideo.flv”/>
and the same to the embed tag
FlashVars=”file=myvideo.flv”
A simple variation for PHP would be to set it to a parameter variable so that it could be called with
/video.php?video=myvideo.flv
by adding some simple PHP code
FlashVars=”file=<? print($_GET["video"]); ?>”

You should now have a fully working FLV player that takes a file name from the HTML or URL and loads it into the player.
April 17th, 2007 at 9:24 pm
Dude. You are AWESOME. I’ve been looking all over for this answer, and you had exactly what I needed. Thankyousomuch!
May 3rd, 2007 at 12:55 am
Its been a horrendous experience getting to find this piece of information and its worth all the searches i have done on the net. Cheers!
May 7th, 2007 at 10:11 am
I need the same, but without php code.
Can i do it but with javascript or with simple html.
I only want a swf than i can use it with all of my .flv (only a flv player).
Because now i have to make a swf for each flv and if i want to change the desgin of my swf, i have to change all my old swf. Buf!!
please help me if you can!!
June 25th, 2007 at 1:17 pm
Thanks for the info. Is there a way to customize the media controls?
JT
June 26th, 2007 at 12:33 am
you can drop in just the screen part of the player and make your own controls. I haven’t tried making my own so I can’t help you there unfortunately.
September 13th, 2007 at 9:53 am
does anyone have a working example of this?
September 17th, 2007 at 10:11 pm
I have problem in this flv player. its not run properly.
September 17th, 2007 at 10:12 pm
any one can send me source file for this flv player.
October 29th, 2007 at 10:18 pm
Hi,
Its good but i want to add some custom controller. Please tell me how can i do this.
February 5th, 2008 at 12:16 pm
can anyone put the source file for download?