Skip to main content
mattiaa1910034
Participant
February 4, 2015
Question

FLVPlayback false event complete triggered

  • February 4, 2015
  • 1 reply
  • 344 views

I am facing a problem with FLVPlayback complete event with AS3 publishing for FlashPlayer 11.1

The trouble is that after a few seconds of the video starts the complete event is triggered and the problem always occurs only after a few hours of playing a playlist of videos.

Some code here:

var my_player:FLVPlayback = new FLVPlayback();

function makePlayer():void{
  my_player
.scaleMode = "exactFit";
  my_player
.x = video_x;
  my_player
.y = video_y;
  my_player
.width = video_width;
  my_player
.height = video_height;

if(bBordi)
  my_player
.mask = mask_mc;

  video
.addChild(my_player);
  my_player
.source = my_path + my_videos[nVideo].@URL;
  my_player
.addEventListener(fl.video.VideoEvent.COMPLETE, completePlay);
  my_player
.volume=video_volume;
}

function completePlay(e:fl.video.VideoEvent😞void
{
  
if(!my_player.stopped)
  
return;

  trace
("VIDEO ENDED: " + my_path + my_videos[nVideo].@URL)
  nVideo
++;
  
if(nVideo >= my_total)
  nVideo
= 0;
  playPlayer
();
}

function playPlayer():void{
  my_player
.source=(my_path + my_videos[nVideo].@URL);
  my_player
.play();
}
This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
February 4, 2015

does this occur while playing a video that's already played previously or is does this occur with a video that's not played previously?  is it always the same video that triggers the erroneous complete event?

mattiaa1910034
Participant
February 4, 2015

This occur for all playlist's videos and that's already played previously and usually after 5 hours of correct playing.

So after this time the video are played only for few seconds and then event complete is triggered.

kglad
Community Expert
Community Expert
February 4, 2015

there may be some problem when retrieving the flv from the browser's cache, then.  you could prevent caching by using something like:

my_player.source = my_path + my_videos[nVideo].@URL+"?"+getTimer();