views:

1081

answers:

2

I currently have the FLVplayback component on my stage, however, I have the autoPlay set to False. This is a problem because I want the stream to only start downloading when the user presses play.

Also, I would like to be able to stop the stream from downloading when I click away from the page with the video on.

Thanks in advance.

+2  A: 

Not sure on the first part but is this something similar to what you're after?

if (FLVplayerInstanceName)
 {
  FLVplayerInstanceName.stop();  
  FLVplayerInstanceName.getVideoPlayer(FLVplayer.activeVideoPlayerIndex).close();
  gotoAndStop("yourPageLabel");
 }
jsims281
+3  A: 

The video won't start loading until you set the source property, so just set it with code when you want it to start

sims281's answer works as long as you don't want to use that FLVPlayback again later, since his method will work, but will mess up the player. I made a class a while back that does stop the video stream effectively and still allows you to continue using that player though, you can see it here:

FLVPlaybackUtils

Using that class you can just do this:

import FLVPlaybackUtils;

FLVPlaybackUtils.reset(myFlvPlayback);

It will clear the player, stop any streaming or downloading, and reset the player to be usable again, just in case you want to use it again later in the program.

Bryan Grezeszak
great script... one thing... when the video script is executed and a new video pops up on top, you can see the past video behind. Any fix for this?
dcolumbus