Question

I'm trying to show some information about the currently casted media inside the cast menu like this. The example apps provided by Google are using the CastCompanionLibrary, which won't be available in my project.

There isn't any hint in the Development Guide, so I really hope that there is anybody out there who knows how to do this.

Thanks in advance!

Was it helpful?

Solution

You need to write your own MediaRouteDialogFactory which needs your MediaRouteControllerDialogFragment which needs your MediaRouteControllerDialog.

Then use it via [Cast Icon] or [action bar menu item].setDialogFactory(yourMediaRouteDialogFactory).

Best to take a look at the Video Sample App.

OTHER TIPS

Is the question about how to get info, or you are also asking about how to show a custom dialog when a cast icon is clicked on *while casting)? As for information, the image you referred to currently shows (a) some metadata about the media that is playing there (icon, title, ..) and (b) the playback status (paused/playing). These info are available from RemoteMediaPlayer.getMediaInfo() and getMediaStatus(). You should also register the dialog to listen to updates to media status and metadata so when the dialog is open, it can reflect the changes.

CCL is just a wrapper around the SDK apis so you can look at its code to see how it is using the SDK apis to accomplish these tasks.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top