Most of Java Media Control APIs are asynchronous. The Java Media Control applications are typically event driven. So it is important to understand Java Media Control API’s event model.

There are three entities in the event model, as illustrated in the diagram. MediaEvents are sent by MediaEventNotifier to registered MediaEventListeners. A MediaEventNotifier can have multiple MediaEventListeners.

The following table lists the types MediaEventNotifier in Java Media Control API and the type of MediaEvent each one generates. Italic name indicates the MediaEventNotifier is a MediaObject. Bold name indicates the MediaEventNotifier is a Resource.

Types of MediaEventNotifier Types of MediaEvent
MediaMixer MixerEvent
Player PlayerEvent
Recorder RecorderEvent
SdpPortManager SdpPortManagerEvent
SignalDetector SignalDetectorEvent
SignalGenerator SignalGeneratorEvent
VideoRenderer VideoRendererEvet
VxmlDialog VxmlDialogEvent

In Java Media Control API, the event model is strong type. MediaEventListener is a Java Generic interface. Typically the implementation narrows down to a particular event type.

A successful event indicates the operation that triggers the event succeeded. Otherwise, MediaErr can be retrieved from the event. Each event has a EventType to indicate the nature of the event.

The events from a Resource are ResourceEvents. Each ResourceEvent has a Qualifier to provide additional context about the event. ResourceEvent also has a Trigger to indicate how this event is triggered.

In  the future blogs, I will talk more about each type of MediaEventNotifier, its operations, and corresponding EventType, Qualifier, and Trigger.

Originally from Voxeo Blogs