KirovBvulgaru / google-cast-sdk

Automatically exported from code.google.com/p/google-cast-sdk
0 stars 0 forks source link

MediaMetadata doesn't serialize custom fields #144

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The doc of MediaMetadata states that custom keys can be used:

"Keys for common metadata fields are predefined as constants, but the 
application is free to define and use additional fields of its own." 

However it seems that only the KEY_*  values are serialized when this data is 
send to the Chromecast with  RemoteMediaPlayer.load().

Original issue reported on code.google.com by pujos.mi...@gmail.com on 16 Feb 2014 at 2:55

GoogleCodeExporter commented 8 years ago
All the key/value pairs, including the ones that user adds, are serialized and 
sent to the receiver; you can open a debug console on your chromecast and see 
them in the json payloads that come in.

Original comment by anad...@google.com on 16 Feb 2014 at 6:42

GoogleCodeExporter commented 8 years ago
You are rigth, the key/values are sent to the receiver.

But they are not sent back to the sender, for example accessing metadata 
accessed in onMetadataUpdated():

public void onMetadataUpdated() {
  ...
  MediaInfo mediaInfo = mRemoteMediaPlayer.getMediaInfo();
  MediaMetadata metadata = mediaInfo.getMetadadata();
  metadata.get("custom_key"); // always return null
}

I supposed this is expected behavior, but reading the doc I initially thought 
it would be returned back.

Anyway there's getCustomData() that works perfecty for that purpose.

Original comment by pujos.mi...@gmail.com on 16 Feb 2014 at 7:25