Opening the Movie Player Instance

Each Movie Player instance can load and play one movie file. To load multiple movies and display them simultaneously on screen, you must open a Movie Player instance for each movie file.

Although the Movie Player can support a total of eight instances system-wide, displaying multiple movies can result in poor color mapping for movies running in inactive windows. For best results, display only one movie at a time, or limit the number of colors in the movie palettes.

Call the mmpOpen function to open a single Movie Player instance. The mmpOpen function can also assign a playback window, or stage window, to the Movie Player. The stage window can be any overlapped or pop-up window. The mmpOpen function has the following syntax:

MMPID mmpOpen(hWndStage, wOptions)

When you open the Movie Player instance, you can specify a handle to a window in the hWndStage parameter of the mmpOpen function. This becomes the stage window for the Movie Player instance. The mmpSetStage function provides another way to supply a stage-window handle for a Movie Player instance. For more information on the mmpSetStage function, see “Managing the Stage Window,” later in this chapter.

The wOptions parameter is not used. Set this parameter to NULL.

The mmpOpen function returns a movie ID of type MMPID. This movie ID identifies the Movie Player instance. Most Movie Player functions require this movie ID. The function returns NULL if it fails to start the Movie Player instance.

Note:

To obtain error information after receiving a NULL movie ID from mmpOpen, immediately call the mmpError function with a NULL movie ID. If another Movie Player command is run before the application calls mmpError, the error result will be incorrect.

To play more than one movie at the same time, you must call mmpOpen for each movie you want to play, saving the movie IDs returned by each call.