Architecture

Media Player and other applications can send requests to mm-player to browse and play media. The mm-player service uses plugins to explore filesystems, retrieve media metadata, and manage playback on different device types.

Figure 1. Architecture of mm-player

Media Player and other HMI apps can use a WebWorks extension (car.mediaplayer) to talk to mm-player. This extension translates JavaScript function calls into calls to the C functions in the mm-player client library (mmplayerclient). You can write other HTML5 applications that use this same extension to send media requests to mm-player. Or, you can write applications in C that directly call the mm-player API.

The client library forwards the function calls to the mm-player server, which implements the media browsing and playback engine. To learn which media devices are accessible for browsing and playback, the mm-player server reads the status object published through PPS by the multimedia detector service, mm-detect. This status object (/pps/services/mm-detect/status) lists the devices currently attached to the system. The mm-player server subscribes to this object and receives updates whenever its contents change, which happens when a device is added or removed. This way, mm-player always has an up-to-date list of available media sources.

When it receives a request to browse or play content on a particular media source, mm-player selects the Media Player Plugin (MPP) designed for the media source's device type (e.g., iPod, Bluetooth, DLNA). Plugins abstract the details of communicating with media sources and make mm-player extensible for supporting new device types (see "Media Player Plugins" for more information).

MPPs use lower-level components, such as device drivers and other OS services, to browse the filesystems of media sources, retrieve track metadata, and process playback commands. For playback, MPPs use both the supporting components and the mm-renderer service to manage media streams between media sources and output hardware (e.g., speakers).

To perform any playback operation, mm-player must have an active track sequence (or tracksession), which tells it which media file to play next. MPPs manage their own tracksessions.

Note: In this release, mm-player doesn't support video playback (only audio). To play videos, your applications must use the HTML5 video features.