Re: How to play movies in MPEG format

Scott Raney ((no email))
Fri, 28 Apr 1995 14:15:05 -0600 (MDT)

>
> We'd like to play MPEG format movies within our Metacard application on
> both the Sun Solaris and HP. The FAQ mentioned the various MPEG player
> such as the Berkeley MPEG player and it also mentioned that Metacard
> has properties and commands that allow starting and stopping these
> players plus playing the movie into a Metacard window. I was wondering
> how to implement these functions in my application. I was under the
> impression that these MPEG players have their own GUI for playing the movies
> so how would we play them into a Metacard window ?

Last I saw these packages don't really have GUI, they just support
rawkeyboard/mouse events to control them. They do, however, open
their own windows. If this is acceptable, you can run them directly
using the MetaCard shell() function or the "open process" command.

If you need them to play directly into a MetaCard window, you'll have
to edit the source code for the player such that it doesn't open a
window, but uses a window ID passed on the command line instead. Pass
the player the "windowId" property of the stack when you start it up.

If you need to support starting and stopping the player by clicking on
MetaCard buttons, you'll need to add a function to the player so that
it can get its commands by reading from its stdin which MetaCard can
write using the "write to process" command.

You could also use the "kill" command to send a signal to the process
that would tell it what to do. This might be somewhat easier since
the player wouldn't have to poll its stdin. Just be careful when
handling the signal that you don't do any X calls as Xlib is not
signal-safe.

> Han Nguyen
> NRaD

-- 
***********************************************************************
* Scott Raney  303-447-3936            Remember: the better you look, *
* raney@metacard.com                   the more you'll see -- Lidia   *
***********************************************************************