/pps/applications/mediaplayer

Object to control multimedia playback

Publishers
Any app
Subscribers
Media Player
Note: This type of object is known as a server object, a special PPS object designed for point-to-point communication between a server and one or more clients. For details, see "Server objects" in the QNX Persistent Publish/Subscribe Developer's Guide.

Overview

You can control media playback from PPS objects by using the /pps/applications/mediaplayer object. This will be the entry point for voice control, external physical buttons (e.g., on the steering wheel), or other means to remotely control the mediaplayer.

Request format

Commands sent to the /pps/applications/mediaplayer object are of the form:

req:json:{"id":ID_number, "cmd":"command_string"}

The ID_number is a unique identifier that will be reflected in the response from the PPS service to your request. You can set the ID to any number you wish.

Commands

Note: The multimedia app must be running for these commands to work.

req:json:{"id":1, "cmd":"stop"}

req:json:{"id":1, "cmd":"pause"}

req:json:{"id":1, "cmd":"next"}

req:json:{"id":1, "cmd":"prev"}

req:json:{"id":1, "cmd":"play"}

req:json:{"id":1, "cmd":"play", "data": {"type":"fid", "id":1}}

req:json:{"id":1, "cmd":"play", "data": {"type":"artist", "id":1}}

req:json:{"id":1, "cmd":"play", "data": {"type":"album", "id":1}}

The data-level ID field can be the fid, artist_id, or album_id from the mmlibrary.db database. You can obtain these by using the queries in the MMLibrary class included with the mediaplayer app.

Examples

Stop the currently selected song:

echo 'req:json:{"id":1, "cmd":"stop"}' >> /pps/applications/mediaplayer

Play the next song in the list:

echo 'req:json:{"id":1, "cmd":"next"}' >> /pps/applications/mediaplayer