Create Dynamic FLV Player in Flash - getW3Help.com - Free Web Tutorials and Resources
Subscribe
Stay Updated
Create Dynamic FLV Player in Flash
Posted on May 27, 2008 by Makubex, 21 comments
In this tutorial, you will learn how to create dynamic FLV player in Flash. The FLV file URL will be passed to the player in the embed code with the help of FlahVars.
Flash 8



Output:




Download Source File

Step 01: Create a new flash document and save it as "flvplayer.fla"

Step 02: Click Window and select Components (or) press Ctrl + F7 to open the Components panel.



Step 03: In the Components panel, locate FLV Playback. Click and drag it to the board.







Step 04: Resize the FLV Playback component to your desired dimension.

Step 05: Left click the FLV Playback component, open properties panel (Ctrl + F3).
Give "flv" as the instance name to the component.




Step 06: Now click the frame at the top and open the action script panel, press F9 to open it.



Ste 07: Copy and Paste this action script code in that frame:



flv.contentPath = flvurl;



Step 08: Your FLV player is ready, Now we need to make use of FlashVars to pass the flv file URL. FlashVars are used in the PARAM tag in the embed code.

Step 09: Create a HTML page in the same location of the flvplayer.fla and save the HTML page as flvplayer.html

Copy and paste this code in that HTML page:



< embed src="flvplayer.swf" flashvars="flvurl=movie.flv" type="application/x-shockwave-flash" height="290" width="300">< /embed>



Step 10: In the above code, change the value of the flvurl variable to the the location where your FLV file is located.

- End of Tutorial.

Labels: , , , ,

Comments
Post a Comment

i find this tutoriol realy nice and easy one. i never thought creating a dynamic movie is is so easy. thanke


but i have question...
what if i have more then one flv file to play dynamically one by one plz solv this prob.


thak you onecagain

By Blogger mahatab, at May 29, 2008 1:05 AM  

I think you should make changes in the FLV player itself. I will do some search on this issue, and post a good tutorial soon on your question.

By Blogger makubex, at May 29, 2008 4:07 AM  

Very nice! I used 3days to search for this solution!

Thanks mate!

By Blogger Olav, at June 15, 2008 5:40 AM  

flv.contentPath = flvurl; works in Flash9? I cannot find the way to make it work to take advantage of the full screen option template

By Blogger guillermo, at August 26, 2008 7:54 PM  

Spent a few hours on an different, older tutorial that left me scratching my head. This one worked exactly as planned. Thanks for sharing.

By Blogger asdf, at September 3, 2008 8:49 AM  

in AS 3.0 flv.source = flvurl

By Blogger Jakub Nerad, at February 18, 2009 1:12 AM  

hi, your tutorial helped me a lot. i would like to know how can i add total time/ time remaining in this video player.

vineet

By Blogger vinweb, at March 4, 2009 7:18 AM  

Simple and very useful

Thanks!

By Blogger Tass P, at March 24, 2009 9:56 AM  

I tried this and it doesn't work. I also downloaded the source files and that doesn't work either.
Please help

By OpenID davidadelsberg, at May 5, 2009 11:53 AM  

This tutorial is really nice, simple and effective. I like it.
Another software that I like is on playerdiy.com - http://www.playerdiy.com/
It is a very easy to use web FLV player creator. No code knowledge is required. Here is the tutorial - http://www.playerdiy.com/support/tutorial/customize-flash-video-player.html

By Blogger Stephen Wong, at September 9, 2009 1:53 AM  

Thanks for updating us with the nice information.

By Anonymous Flv Player, at April 25, 2010 11:48 PM  

i use mac and i cannot see player in web!
is all blank, i don't see player on this site too!

By Blogger jack.turkey, at June 28, 2010 10:15 AM  

Really thnx.... u make it so simple..i saw to many thing but,,it too cool

By Blogger zayeem, at July 12, 2010 10:08 PM  

THANKS... THANKS.... THANKS... SAVE MY LIFE

By Anonymous simei, at August 11, 2010 3:14 PM  

I thought I was never going to find a relevant document on dynamic contentPath with FlashVars.

Thank you.

By Anonymous uncleSoWise, at September 10, 2010 2:18 PM  

Thank you.. Your documentation helped me a lot...

By Anonymous Anonymous, at September 28, 2010 5:34 AM  

This particular blog is really informative. I really may have acquired various extremely desired details.

By Anonymous Flv Player, at October 29, 2010 12:10 AM  

I came to know how dynamic Flv player in flash is been created after seeing your tutorial. Exellent guide go ahead with it...... Thanks!

By Anonymous Flv player, at January 19, 2011 10:44 PM  

nice stuff you guys have here..

By Anonymous drm remover, at July 10, 2011 5:18 AM  

hello, I know this is a noobie question, but what program did you use to make this?

Is it Adobe Flash Professional CS5?

I'm using a windows 7 OS.

By Anonymous Anonymous, at December 15, 2011 10:50 AM  

Never mind the post above, I figured that out, but now I have a different problem. I don't know how to use the param tags. My html displays a blank screen. Can you please write the full code?

This is my full code...

<html
<head
<title </titl
</head

<body

<param name="movie" value="flvplayer.swf" /
<param name="flashvars" value='ncm.flv' /
<embed src="flvplayer.swf" flashvars="flvurl=ncm.flv" type="application/x-shockwave-flash" height="290" width="300" </embed

</body
</htm

By Anonymous Anonymous, at December 15, 2011 12:45 PM  


Hi, I am Karthikeyan VJ (aka makubex). I am a independent Interactive Developer and I am currently focusing on Flash, Flex and AIR