Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Flvplayback component seamless loop

New Here ,
Apr 25, 2014 Apr 25, 2014

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();

}

TOPICS
ActionScript
795
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 25, 2014 Apr 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;

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 25, 2014 Apr 25, 2014
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines