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.

Tisch
  • 2,598
  • 4
  • 27
  • 34

2 Answers2

6

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
  • 959
  • 4
  • 6
  • 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 Jul 16 '10 at 23:21
  • Kind of a late reply, but I have been struggling with exactly the same problem. There is a ghost image of the previous video behind the videoplayer. I don't know if this is because I'm not probably unloading videos or s/t, but I found that the solution of jsims281 below works perfectly, if you use it in combination with the "clear()" function of the videoplayer. "FLVplayerInstanceName.getVideoPlayer(FLVplayer.activeVideoPlayerIndex).clear();". I hope this'll help somebody. – Zebaz Oct 23 '11 at 14:12
3

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
  • 2,206
  • 2
  • 30
  • 57