+1
Résolu

XiiaLive metadata, stream stats, and playback status intents

Jona (Lead Developer) il y a 10 ans mis à jour il y a 9 ans 0

XiiaLive will be making the following intents available starting with release v3.0.1.1.  The main goal of these new intents is to match what popular music players are using. Example, Amazon MP3 app, Google Music, Last.fm to name a few.


Please note that these actions are sent out with a category defining the release type of XiiaLive. That is if it is free, paid or beta. You can simply have all those categories defined on your broadcast receiver.


------------------------------------------------------

Action:

com.vblast.xiialive.metachanged


Info

Broadcast sent every time metadata has changed.


Category:

com.vblast.xiialive.category.PRO, com.vblast.xiialive.category.FREE, com.vblast.xiialive.category.BETA


Extras:

active, preparing, streaming, playing, duration, position, url, mime, track, artist, album, genre, website, bitrate, channels, samplerate


------------------------------------------------------

Action:

com.vblast.xiialive.playstatechanged


Info

Broadcast sent every time playback state changes.


Category:

com.vblast.xiialive.category.PRO, com.vblast.xiialive.category.FREE, com.vblast.xiialive.category.BETA


Extras:

active, preparing, streaming, playing, duration, position, url, mime, track, artist, album, genre, website, bitrate, channels, samplerate


------------------------------------------------------

Action: 

com.vblast.xiialive.playbackcomplete


Info

Broadcast sent when playback is done/complete no longer playing.


Category:

com.vblast.xiialive.category.PRO, com.vblast.xiialive.category.FREE, com.vblast.xiialive.category.BETA


Extras:

active, preparing, streaming, playing, duration, position, url, mime, track, artist, album, genre, website, bitrate, channels, samplerate


------------------------------------------------------

Action: 

com.vblast.xiialive.playbackstats


Info

Broadcast sent every 5 sec with playback stats.


Category:

com.vblast.xiialive.category.PRO, com.vblast.xiialive.category.FREE, com.vblast.xiialive.category.BETA


Extras:

baudrate [int (kbps)], downloaded [long (bytes)], lifetime_downloaded [long (bytes)], lifetime_playback [long (ms)]


------------------------------------------------------

Action: 

com.vblast.xiialive.requestupdate


Info: 

Intent action to request updates.


Category:

com.vblast.xiialive.category.PRO, com.vblast.xiialive.category.FREE, com.vblast.xiialive.category.BETA


Extras:

destination [Parcelable Intent where the request will be sent to], request_actions [String[] array of intent actions for requests]



Solution

Solution
Résolu
How to request updates:
// the destination where our request update<br>// should be sent to...<br>Intent destination = new Intent(context, MyBroadcastReceiver.class);<br>Intent intent = new Intent("com.vblast.xiialive.requestupdate");<br>intent.addCategory("com.vblast.xiialive.category.PRO");<br>intent.addCategory("com.vblast.xiialive.category.FREE");<br>intent.addCategory("com.vblast.xiialive.category.BETA");<br>intent.putExtra("destination", destination);<br>intent.putExtra("request_actions", new String[] {<br>"com.vblast.xiialive.metachanged",  "com.vblast.xiialive.playbackstats"});<br>context.sendBroadcast(intent);



Solution
Résolu
How to request updates:
// the destination where our request update<br>// should be sent to...<br>Intent destination = new Intent(context, MyBroadcastReceiver.class);<br>Intent intent = new Intent("com.vblast.xiialive.requestupdate");<br>intent.addCategory("com.vblast.xiialive.category.PRO");<br>intent.addCategory("com.vblast.xiialive.category.FREE");<br>intent.addCategory("com.vblast.xiialive.category.BETA");<br>intent.putExtra("destination", destination);<br>intent.putExtra("request_actions", new String[] {<br>"com.vblast.xiialive.metachanged",  "com.vblast.xiialive.playbackstats"});<br>context.sendBroadcast(intent);