5

I recently added the ability to (chrome) cast a radio stream (audio/aac) from my Android radio app. The initial casting works as expected; the stream begins playing on the selected chromecast device and the MediaMetadata I provided is displayed in the Cast Dialog and, if casting to a TV or monitor, on the screen via the receiver app.

When I initially cast the stream I provide the MediaMetadata of the currently playing track. Within my Android app I have a service that can notify me when the track has changed and sends out an updated metadata. The issue I'm having is that I'm struggling to find a way to notify the Chromecast device of this update so that the TV will update the track metadata, show the right title/artist & artwork. The only partial, hacky way I've found of doing it so far is by calling RemoteMediaClient.load again with the same stream info and the updated MediaMetadata. This approach is not acceptable as it causes the stream to reload, temporarily halting the playing. I do not see any methods in the RemoteMediaClient that allow for simply updating the MediaMetadata.

The only other post I can find on here that somewhat relates to this is this one, however this now 4 years old and refers to an older version of the SDK that has since been deprecated.

I'm pretty sure the functionality I desire is possible as I've seen this behaviour in other radio apps that include the Chromecast feature.

dr_sulli
  • 893
  • 10
  • 21

0 Answers0