0

Is it possible to configure FLVPlayback so that it does not auto-load the associated video file, but instead waits for a click on a "play" button to load and then play it? (I'm building a site that will have a player for a rather large video on its front page, and I'd rather not have the video downloaded unless/until the user asks to see it.) I already have autoplay set to false, but I can still see the video getting downloaded in the progress bar.

sbuck
  • 1,846
  • 4
  • 24
  • 40

2 Answers2

0

Leave the source of the FLVPlayback blank. Set the source only when the user asks to see the video.

Amarghosh
  • 58,710
  • 11
  • 92
  • 121
0

add an invisible button, with a hit area as big as the video:

btnPlay.addEventListener(MouseEvent.CLICK, onPlayClick);

function onPlayClick(evt:MouseEvent):void
{
btnPlay.visible = false;
flvPlayer.load("filename.flv");
flvPlayer.play();
}

or something like that. the problem is: the FLVPlayback component shows an animated bar with stripes when there is no content assigned to it. if you don´t want to see that, you could set the "skinAutoHide" property to true. after that, there is only one more problem: the user doesn´t see your player, so you should add a play image in the button. if you click on the button, the button disappears and the video starts loading and playing.

andyrandy
  • 72,880
  • 8
  • 113
  • 130
  • you can also just delete the stripes in the skin directly, so it does not show up when there is no flv loaded. very easy solution, but very effective :) – andyrandy Jun 06 '11 at 10:44