Playing video within stacks on Linux
Warren Samples
warren at warrensweb.us
Fri Dec 13 21:37:47 EST 2013
On 12/13/2013 07:54 PM, Alejandro Tejada wrote:
> Warren Samples wrote
>> Video playback is a mess under Linux.
>> We are eagerly awaiting the new
>> multimedia object!
>> [snip]
>
> Hi Warren,
>
> What is your experience using shell commands
> to control a video player?
>
> This works from the message box:
>
> shell("mplayer -ontop -noborder -geometry 50%:50% myvideo.mp4")
>
> but I have not found a way to pause, stop, move forward or backward,
> change volume, etc, after the movie have started playing.
> It´s necessary to wait until the movie plays completely to issue
> another shell command... :(
>
> Notice that you could use vlc in the same way, and vlc already
> shows all controls inside the video windows, but LiveCode does not
> respond to any command until VLC is closed (not simply stopped).
>
> Does exists some way to control with precision these video players
> (using shell or other method) within LiveCode?
>
> Al
>
>
You can run mplayer in slave mode and control it with LiveCode writing
to the FIFO.
http://www.mplayerhq.hu/DOCS/tech/slave.txt
Because shell() is blocking, you probably want to use an independent
process to open mplayer using -slave. I once spent some time exploring
this. You have to take precautions to make sure you don't leave a bunch
of mplayer instances open when you're done. I couldn't get embed to work
to attach mplayer to a LiveCode window, but this didn't appear to be a
LiveCode issue per se since it was very fickle about attaching to other
application windows as well.
If you don't mind having mplayer open in an independent window, this may
be a good option.
Warren
More information about the use-livecode
mailing list