MAVA Multimedia Suite

Startseite
Über die MAVA Multimedia Suite
Systemanforderungen
Installation von Java
MMP: MAVA Multimedia Player
MMEd: MAVA Multimedia Editor
Erweiterungen für MMP und MMEd
Erweiterungen für MMP und MMEd von Dritten
Lizenzbestimmungen
Dokumentation
Artikel
MMP Demo Applet
Weitere MMP Dokumente
Aktuelle Entwicklung

Last change: 04.06.2004 (jh)

Integrating Mava Presentations in Custom Applications

Presentations created with the Mava Multimedia Suite can be integrated in your Java application. If you are in need of presenting a synchronized composition of different media, e.g. pictures and sound, you can specify this in a declarative manner in the Mava Multimedia Suite and later integrate the composition in your application. This short article introduces the API that is provided for integrating Mava Presentations in your custom application.

Basically, it is required to start the presentation system, i.e. the so-called mava engine, acquire a visual component and add this component to the GUI of the application. Afterwards, the presentation can be started.

Here are some sample lines of code that show how easy this is.

// create a new MavaEngine, which is responsible for the play-out of a document
mavaEngine = new MavaEngine();

// set security restrictions; it is up to the custom application to ensure the required degree of security

// LOAD_FROM_LOCAL_FILE_SYSTEM means that extensions are loaded only from the local file system
mavaEngine.getExtensionManager().setLoadExtensionsFrom(ExtensionManager.LOAD_FROM_LOCAL_FILE_SYSTEM);

// start MavaEngine thread
mavaEngine.start();

// load a document from a URL, that is provided as a String parameter
mavaEngine.loadDocument("file:...");

// initialize MavaEngine
boolean initOK = mavaEngine.initEngine();

if (initOK) {

// assuming that we are in a JFrame for example
// we can add a component to the JFrame
this.getContentPane().add(mavaEngine.getVisualComponent());

// start the engine to display the document
mavaEngine.startEngine();

// show frame with presentation
this.setVisible(true);
}

The program code for the MMP applet and the MMP Viewer, which can be started from MMEd, are based on the sample code shown above.

If you want to know when the presentation is finished you can register a listener to the mava engine. That looks as follows.

mavaEngine.addEndOfDocumentListener(this);

Your class has to implement the endOfDocument method of the EndOfDocumentListener interface. In this method, the JFrame can be closed.

In the next release of the Mava Multimedia Suite you can even get results from the presentation back to your application.

So if you need synchronized presentations in your application why not use the Mava Multimedia Suite to author these sequences instead of programming them by hand?