Home > Flex > FLVPlayback in Flex

FLVPlayback in Flex

One thing clearly lacking in Flex is a Videoplayer component like the one found in Flash CS3.  Flex does have a VideoDisplay component , but it do not have controls to interact with video like  play, pause, seek etc.

In few simple steps we can easily use the FLash FLVPlayback in Flex

  1. On windows machine go to Program Files\Adobe\Adobe Flash CS3\en\Configuration\Component Source\ActionScript 3.0\FLVPlayback and copy the “fl” folder containing the FLVPlayback source and paste it in the flex application’s source folder .
  2. Create new actionscript class named Icon.as in the video folder with an empty constructor . This is to get rid of a compiler error like this ” Call to a possibly undefined method Icon.
  3. In the FLVPlayback class on line number 871, wrap the following lines of code in an if statement.

  4. boundingBox_mc.visible = false;
    removeChild(boundingBox_mc);
    boundingBox_mc = null;

The result will look like this

    if(boundingBox_mc){
    boundingBox_mc.visible = false;
    removeChild(boundingBox_mc);
    boundingBox_mc = null;
    };

Finally we need do is to copy the Video player controlbar skins . We can find them in this directory    Program Files\Adobe\Adobe Flash CS3\en\Configuration\FLVPlayback Skins\ActionScript 3.0
Thats it !! . We are good to go now . Click on the image below to view a sample ( Right click to view the source )

  1. November 11, 2008 at 2:06 am | #1

    Hello!
    Thanks for the tutorial… I am having issues though. I’m trying to get the FLVPlayback to stream from my FMS. Is there some secret why it won’t pull in the video?

  2. March 31, 2009 at 7:00 pm | #2

    awesome thanks!

  3. April 3, 2009 at 6:27 pm | #3

    thanks a lot! awesome, great help

  4. Wojtek
    April 23, 2010 at 10:01 am | #4

    “.2″ is not a advice. To solve it properly import “FLVPlaybackAS3.swc”,
    which by default (for CS4) is in the “C:/Program Files/Adobe/Adobe Flash CS4/Common/Configuration/Components/Video/FLVPlaybackAS3.swc” path.

    • subeesh
      April 23, 2010 at 10:05 am | #5

      Yeah. This was posted months back. Now there is a new spark video player control in Flex 4.

  5. Greg
    April 9, 2011 at 5:21 am | #6

    In order for the fullscreen button from a loaded FLVPlayback skin to work in Flash Builder or Flex project that you have imported the latest fl classes you need to give the argument to the compiler -define=CONFIG::PLAYER,true because the fullscreen method in UIManager is wrapped in the CONFIG::PLAYER namespace.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.