PlayMMedia

The PlayMMedia function plays an Adobe Flash application file (.swf), an AVI file, or a sound file (MIDI or WAVE).

Tip:If you are using PlayMMedia to display an Flash file or an AVI file, the installation must display a background window. For more information, see Displaying a Background Window in InstallScript and InstallScript MSI Installations.

InstallShield has support for displaying a Flash file as a billboard for your installation without displaying a background window. To learn more, see Billboard Styles and File Types for InstallScript and InstallScript MSI Projects.

Syntax

PlayMMedia (nType, szFileName, nOperation, nReserved);

Parameters

PlayMMedia Parameters

Parameter

Description

nType

Specify the type of file that you want your installation to play. Pass one of the following predefined constants in this parameter:

MMEDIA_AVI—The file is an AVI file.
MMEDIA_MIDI—The file is of MIDI sound format.
MMEDIA_SWF—The file is an Adobe Flash application file (.swf).
MMEDIA_WAVE—The file is of WAVE sound format.

szFileName

Specify the fully qualified name of the file to be played.

nOperation

Specify the play mode. Pass any of the following predefined constants in this parameter:

MMEDIA_PLAYSYNCH—Play synchronously.
MMEDIA_PLAYASYNCH—Play asynchronously. This constant can be combined with MMEDIA_PLAYCONTINUOUS by using the OR operator (|).
MMEDIA_PLAYCONTINUOUS—Play in a continuous loop. This value cannot be used when playing a sound/AVI file in synchronous mode. It can be used only with files being played in asynchronous mode. Combine it with MMEDIA_PLAYASYNCH by using the OR operator (|).
MMEDIA_STOP—Stop playing.

Note:A Flash file plays only once asynchronously, regardless of whether any MMEDIA_PLAY* constants are passed in nOperation.

nReserved

Pass the number zero in this parameter. No other value is allowed.

Return Values

PlayMMedia Return Values

Return Value

Description

0

The function successfully played the file.

< 0

The function was unable to play the file.

One example of when this occurs is if you specified a Flash file for PlayMMedia but the Flash Player is not present on the target system.

Additional Information

If you are using a Flash file or an AVI file, you can use SizeWindow and PlaceWindow to control the size and placement of the background window that displays the Flash or AVI file.