PDA

View Full Version : flvplayback does not fire complete event, sometimes


tapic
09-05-2007, 07:31 AM
my scenario is basic: a flvblayback component plays a list of flvs.
when one flv is finished, it plays the next flv.

there is nothing special in code:

private var _player:FLVPlayback;
.
.
_player.addEventListener(VideoEvent.COMPLETE,clipC ompleteListener);
.
.
private function clipCompleteListener(e:Event):void
{
playNext();
}
private function playNext();
{
.
.
}




the problem is that the complete event does not fire always and sometimes the screen ends up blank since the player keeps sitting at the end of the flv.

the weird thing is that the same FLV does not always hang up at the end.

For a very long time I could not find good solution for that. My solution in AS2 was to set an interval and check playHead regularly if its position is changed. If its position is not changed for a second or some time, that means that the movie is hanged up at the and, by not firing the complete event. So I 'virtually' call my completeEventListener method at this point.

In AS3 I hoped that the FLVPB component will not have such a bug (I really think that this is a bug:) but the same thing continues.

An argument I discovered was: this can be because of poor flv encoding and metadata.

Any ideas? What is the best way to encode movies into 'complete event friendly' flvs?

thanks in advance

somnamblst
09-06-2007, 03:23 AM
I have found that trimming any black or even a beginning of fade to black almost always fixes the FLVs that hang.

tapic
10-16-2007, 11:50 AM
still no solution.
A workaround: use a timer to check playhead position if it is changed since the last check.
If
it is not changed, your flv is hanged up so you should manually call your video event complete listener method.
Else,
your flv is still playing since the last check, take no action.