Skip to main content
Participant
April 25, 2014
Question

Flvplayback component seamless loop

  • April 25, 2014
  • 1 reply
  • 819 views

Hello,

I have two problems: my looping video has a seam and when i'm going to the next frame i get an 1009 error, because flvplayback component doesn't stop playing upon exitframe. I fixed first problem using kglad's code (see below). Second problem should be solved by adding this function (if i would have usual loop): FLVPlayback(e.currentTarget).stop();. But in my case it doesn't work and i still get an error when i'm trying to go to the next frame.

import fl.video.*;

var index:int = 0;

my_FLVPlybk.addEventListener(fl.video.VideoEvent.COMPLETE, completeHandler);

my_FLVPlybk.source = "test.flv";

my_FLVPlybk.play();

readyNextPlayerF();

function completeHandler(e: fl.video.VideoEvent):void{

    my_FLVPlybk.play();

    my_FLVPlybk.visibleVideoPlayerIndex = index;

    readyNextPlayerF();

}

function readyNextPlayerF():void{

    index++;   

    my_FLVPlybk.activeVideoPlayerIndex = index;

    my_FLVPlybk.source = "test.flv"; //assign the source

}

my_FLVPlybk.addEventListener(Event.REMOVED_FROM_STAGE, stopVideoF);

function stopVideoF(e:Event): void {

    FLVPlayback(e.currentTarget).stop();

}

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
April 25, 2014

i don't see a problem with your code, but just for fun try:

my_FLVPlybk.addEventListener(Event.REMOVED_FROM_STAGE, stopVideoF);

function stopVideoF(e:Event): void {

my_FLVPlybk.removeEventListener(Event.REMOVED_FROM_STAGE, stopVideoF);

    my_FLVPlybk.stop();

my_FLVPlybk=null;

}

MarnAuthor
Participant
April 25, 2014

I replaced:

my_FLVPlybk.removeEventListener(Event.REMOVED_FROM_STAGE, stopVideoF);

with

my_FLVPlybk.removeEventListener(fl.video.VideoEvent.COMPLETE, completeHandler);

and now it works fine, thank you.