Skip navigation
Currently Being Moderated

Looping FLV stutters.

Dec 27, 2013 7:07 AM

Tags: #flash #action_script_3

Hi All,

I'm experiencing a frustrating issue. Any help would be greatly appreciated:

 

I am looping a FLV (with Alpha) in a SWF. The FLV is an animation created in After Effects. In After Effects the animation was created to loop seemlessly (no jerk or stutter...a smooth repetitive cycle), however, when I loop it with the SWF, it stops for a split second at the end of its 8 second run before it starts over again. How can I make it loop smoothly without that stutter when it begins again?

 

I'm using Flash CS5.5. I export the flv from After effects and link that from the swf. Here's the Actionscript3 code I'm using to play and loop the flv:

import fl.video.*;

//Video component instance name
var flvControl:FLVPlayback = display;
var flvSource:String = "loopingFlv.flv";

//Loop the video when it completes
function completeHandler(e:fl.video.VideoEvent):void
{
flvControl.seek(0);
flvControl.play()
}
flvControl.addEventListener(fl.video.VideoEvent.COMPLETE, completeHandler);

//Set video
flvControl.source = flvSource;

Here is the short animation for you to see:

http://home.comcast.net/~samiri/director/mortals/froggy/loopingFlv.swf

-you can see the stutter every 8 seconds. (I'd also like it to start moving upon load...without that initial pause...but maybe that's too much to ask.)

 

Thanks for the help!

 
Replies
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 27, 2013 7:50 AM   in reply to paul_james123

    you might be able to use a loop (timer or enterframe) to detect the end of the video and use that to apply your seek and play methods, but the delay is probably caused by the seek method so you'll need to use two video instances (using activevideoplayerindex) to stitch that together seamlessly.

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 27, 2013 9:55 AM   in reply to paul_james123

    the 2nd solution is to switch between instances.  you'll still use the seek method to reset the video that ends but you won't play it until the next instance ends.  that will eliminate the pause between the end of one and the start of the other.

     

    you can eliminate an initial video pause unless your video plays as soon as the embedding swf loads.

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 27, 2013 10:50 AM   in reply to paul_james123

    it's not a typo (though it may be ambiguous and poorly worded).

     

    i meant, if you (for example), click a button to start your video, you can (probably) eliminate that (buffering) delay.

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 27, 2013 11:58 AM   in reply to paul_james123

    you're welcome.

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 27, 2013 5:11 PM   in reply to paul_james123

    that should be more like:

     

    import fl.video.*;

     

    var index:int = 0;

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

    my_FLVPlybk.source = "Froggytop.flv";

    my_FLVPlybk.play();

     

    readyNextPlayerF();

     

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

        my_FLVPlybk.play();

        my_FLVPlybk.visibleVideoPlayerIndex = index;

        readyNextPlayerF();

    }

    function readyNextPlayerF():void{

        index = 1-index;

        my_FLVPlybk.activeVideoPlayerIndex = index;

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

    }

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 28, 2013 10:24 AM   in reply to paul_james123

    i don't see a problem, http://www.kglad.com/Files/forums/test1.swf

     

    when i set index to repeatedly increment.

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 28, 2013 1:50 PM   in reply to paul_james123

    i used this:

     

    my_FLVPlybk.addEventListener(fl.video.MetadataEvent.METADATA_RECEIVED, metadataF);

    my_FLVPlybk.source = "FroggyTop.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 = "FroggyTop.flv"; //assign the source

     

    }

     
    |
    Mark as:
  • kglad
    72,189 posts
    Jul 21, 2002
    Currently Being Moderated
    Dec 28, 2013 2:47 PM   in reply to paul_james123

    you're welcome (and you're correct about that listener).

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points