Tisch
Tisch

Reputation: 2647

FLVplayback - Stop the file automatically downloading

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.

Upvotes: 2

Views: 4171

Answers (2)

Bryan Grezeszak
Bryan Grezeszak

Reputation: 959

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.

Upvotes: 6

jsims281
jsims281

Reputation: 2206

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");
 }

Upvotes: 3

Related Questions