Morten Lied Johansen wrote:
> Duncan Webb wrote:
>> Morten Lied Johansen wrote:
>>> Does anyone know how(/if) freevo detects that playback of a video-item
>>> has completed successfully?
>>
>> When the child application exits.
> 
> That can't be all, as freevo is able to tell the difference between
> playing to completion, and pressing stop on the remote midway. When you
> stop midway, freevo is even able to tell where you stopped, and resume
> playback from the same place in the movie.
> 
> I only want to run my command when it has played to completion, and
> played successfully (no errors).

No...

When you press stop the remote sends an event to freevo and freevo sends
a command to the stdin of the application to stop. With mplayer the
position of the stop can be determined by parsing stdout, this is
written to a file, when the player finished then there is no file
written and so no resume menu item. When resuming playback freevo reads
this file and tells the application where to start from.

When playback completes there are no events but the subprocess has
finished which freevo can detect.

BTW xine-ui doesn't exit so freevo does not return until the stop event
is received.

There is a play_end event that freevo uses when the stop or the player
exits.

>>> The reason I'm asking is that I wish to run a specific command based on
>>> the filename, if the user has watched the entire video.
>>>
>>> I was thinking I could either do it as a wrapper around mplayer, or as a
>>> plugin for freevo (depending on which is less complicated).
>>
>> There is a VIDEO_POST_PLAY option in local_conf.py that you can use.
>> This was designed for home automation to dim lights at the start and
>> restore them at the end.
> 
> I'll look into this one, thanks.

HTH
Duncan


------------------------------------------------------------------------------
_______________________________________________
Freevo-users mailing list
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to