Page 1 of 1

Determine when FLV video stops playing naturally?

Posted: Tue Oct 07, 2008 9:54 pm
by key88sf
Is there a way to be notified when playback of an FLV file ends because the end of the video is reached?

I tried FPCN_ONREADYSTATECHANGE, but that is called with state == 4 almost immediate when the video begins playing. I need to know when the end of the video has been reached normally.

Re: Determine when FLV video stops playing naturally?

Posted: Wed Oct 08, 2008 9:11 am
by Softanics
Thank you for your question.

key88sf wrote:Is there a way to be notified when playback of an FLV file ends because the end of the video is reached?

I tried FPCN_ONREADYSTATECHANGE, but that is called with state == 4 almost immediate when the video begins playing. I need to know when the end of the video has been reached normally.


Only if a FLV player supports this.

The player I've sent you should support it. Handle FPCN_FLASHCALLW to receive notifications. Handle notification onVideoStatus, the following status is available:
NetConnection.Connect.Success
NetStream.Play.Start
NetStream.Play.StreamNotFound
NetStream.Play.Stop
NetStream.Buffer.Empty
NetStream.Buffer.Full

You need NetStream.Play.Stop.

Thank you.

Posted: Wed Oct 08, 2008 4:29 pm
by key88sf
Cool, that works :)

I have tried using the JW FLV Player (http://www.jeroenwijering.com/?item=JW_FLV_Player) which also works in my code, but I do not receive callbacks from it with FPCN_FLASHCALLW.

Maybe I have to call their function called "addControllerListener(event,function)" ? I'm not sure how to do this properly though...I would need to supply a callback function there. It seems designed more for javascript / html. Any ideas?

Posted: Wed Oct 08, 2008 8:05 pm
by Softanics
key88sf wrote:I have tried using the JW FLV Player (http://www.jeroenwijering.com/?item=JW_FLV_Player) which also works in my code, but I do not receive callbacks from it with FPCN_FLASHCALLW.

Maybe I have to call their function called "addControllerListener(event,function)" ? I'm not sure how to do this properly though...I would need to supply a callback function there. It seems designed more for javascript / html. Any ideas?


I haven't explored the code of this player :) So not sure how to improve it ;)

So your code works well with our new player?

Thank you.

Posted: Wed Oct 08, 2008 11:32 pm
by key88sf
Yes, with the new player it works :)

It would be really nice to have the callbacks and settings of either the new player (or the JW FLV Player) integrated into the C++ code of f-in-box. For example, handling progress, seek, and play notifications would be very valuable :)

The JW FLV Player is extremely popular, and is open source. Should be ideal for integration :) Thanks!