Media players (mediaplayer.h)

Functions for media playing.

This file defines the Media Player service, which provides functions for the playing of media files.

Media players connect to Now Playing service to co-operatively work with other media players in the system, acquiring the right to play content, and giving up the right if the user directs another media player to start playing content.

If your media player app is interrupted by a higher priority player (for example, a phone call or voice control), the Now Playing service instructs your app to pause. In most cases, once the interrupting media player releases control (for example, the phone call ends), the Now Playing service sends a play command to your app. The one exception is when the output device switches from private (for example, headphones) to public (for example, speaker) while the high priority player is active. In these cases, music is supposed to automatically pause when the switch occurs.

If a higher priority media player starts and the Now Playing services pauses your app, the user can still hit the play button on the screen. Your app can monitor the Now Playing status object to see the priority of the currently active player. If the priority is higher than 'low', your app should not attempt to play, as doing so will result in the Now Playing service sending an error response.

If your media player app is interrupted by a media player of the same priority, your app will receive a MEDIAPLAYER_REVOKE event. Your app must stop playback at this point and free up multimedia resources. It is your media player's responsibility to re-acquire the right to play content after receiving this event.

Media players also can provide metadata to the system and receive commands from media controllers.

BlackBerry 10.0.0

Last modified: 2014-01-30

Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus