Search code examples
javaandroidchromecast

Show cast menu while casting media (without CastCompanionLibrary)


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!


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.