2

I'm tring to create a library for phonegap that give me control about remote control client. All phonegap side plus structure of new class is made but i don't know how change metadata.

I've made this function:

public void setMetadata() {
    RemoteControlClient.MetadataEditor editor = remoteControlClient.editMetadata(true)
                .putString(MediaMetadataRetriever.METADATA_KEY_ALBUM, "CIAO");
}

but i'm sure that i've missed something like a register function.

Someone can give me an help?

Thanks!

Claudio Ɯǝıs Mulas
  • 1,116
  • 3
  • 15
  • 24

1 Answers1

0

For registering

// register a remote client ===========================================
final Intent mediaButtonIntent = new Intent(Intent.ACTION_MEDIA_BUTTON);
mediaButtonIntent.setComponent(RemoteControlReceiver);
final PendingIntent mediaPendingIntent = PendingIntent.getBroadcast(                    getApplicationContext(), 0, mediaButtonIntent, 0);

// create and register the remote control client
myRemoteControlClient = new RemoteControlClient(mediaPendingIntent);
audioManager.registerRemoteControlClient(myRemoteControlClient);

And dont forget to apply the editor after you made your changes.

editor.apply();
AndroidDev
  • 5,193
  • 5
  • 37
  • 68