XiiaLive Open APIs for Android

XiiaLive provides a few ways to control playback and also receive playback and metadata information. 

Control Service Intents

The control service intents are sent using startService. If the user has installed XiiaLive and XiiaLive Pro the intents will be simply received by XiiaLive Pro only.



Intent App version Description
com.vblast.xiialive.intent.action.
PLAYBACK_RESUME
FREE/PRO Resumes last played. If already playing nothing happens.
com.vblast.xiialive.intent.action.
PLAYBACK_PAUSE
FREE/PRO Pauses playback. If already paused nothing happens.
com.vblast.xiialive.intent.action.
PLAYBACK_TOGGLE
FREE/PRO Toggles playback. If playing it will stop playback. If not playing it will resume playback.
com.vblast.xiialive.intent.action.
PLAYBACK_STOP
FREE/PRO Stops playback. If not playing nothing happens.
com.vblast.xiialive.intent.action.
PLAYLIST_PREV
PRO Starts playing the previous playlist item.
com.vblast.xiialive.intent.action.
PLAYLIST_NEXT
PRO Starts playing the next playlist item.
com.vblast.xiialive.intent.action.
FAVORITE_PREV
PRO Starts playing the next favorite station from the users favorites list.
com.vblast.xiialive.intent.action.
FAVORITE_NEXT
PRO Starts playing the prev favorite station from the users favorites lists.

Metadata Broadcast Intents

We have tried to mimic as much as we could the standard Android music player and various other popular music players intents and extras with playback and metadata information to make it hopefully easy to use.



Intent Description
com.vblast.xiialive.metachanged
Broadcast sent when metadata has changed.
com.vblast.xiialive.playstatechanged
Playback status changed.
com.vblast.xiialive.playbackcomplete
Playback has ended.

Note, if you want to know from what app, XiiaLive or XiiaLive Pro, the broadcast intent came from check the category field if it is  com.vblast.xiialive.category.FREE or com.vblast.xiialive.category.PRO.

Metadata Broadcast Extras

The follow are sent with the metadata broadcast intents.

Extra Type Description
active
boolean An active state means the media player manager is still actively managing playlist, connection issues and potential errors for retries.
preparing boolean
Initial playback request is in preparing state. Preparing state means playlist is being setup and media information is being probed.

playing boolean
If actual audio is playing. During connecting, buffering or pause state playing is false.
uri
string Currently playing URI.
mime string Currently playing MIME.
track string Track name of the song.
artist string Song artist.
album string Media album or station name.
genre string Media genre
bitrate int Media bitrate.
channels int Media channel count. 1=mono, 2=stereo
samplerate int Media sample rate.






Ця стаття допомогла 6 людям. Чи допомогла вам ця стаття?