Implementation of the Media Sampler MIDlet

Figure 83: Media Sampler MIDlet’s design

The Media Sampler MIDlet consists of the following classes:

The MediaList main view is created and displayed by the MediaSamplerMIDlet class. A reference of MediaSamplerMIDlet is passed to all LCDUI components of the application (MediaList, AudioCanvas, VideoSourceSelector, and so on). The reference is used for getting the display and for displaying an alert when an error occurs. MediaList creates and displays the classes AudioCanvas, VideoSourceSelector, SupportForm, and DRMPlayer.

PlayerPool is a class that handles audio player pooling and playing. DRMPlayer’s task is to play DRM-protected audio files.

The MediaFactory class provides media-specific information such as available sound and video medias, their MIME types and file paths in an application package (JAR). MediaFactory reads resource-specific file path properties from the application descriptor (JAD). Data information returned from MediaFactory is encapsulated in the Media class.

UI classes in the viewer package display the UI or route to another display.