Search code examples
androidchromecastgoogle-cast

Connection animation on mediaroutebutton CastCompanionLibrary


The MediaRouteButton never animates. It is weird in my opnion that the design checklist features the CastVideos example that uses the cast companion library. But this library never shows the connection animation. How do i make the mediarouterbutton behave as following

- User selects chromecast --> button shows the alternating waves
- Connected to chromecast --> button still shows waves
- OnApplicationConnected --> button shows connected state.

Is this possible. Can you guide me in the right direction where to find this in the cast companion library?


Solution

  • You are reading the design checklist correctly. Animation of the cast button happens while the phone application is trying to connect to the CastApi service. When that happens, cast button shows a solid image. Whether receiver application has been launched, is fully launched or is not launched at all is irrelevant. So "while connecting" means while it is connecting to the CastApi and not receiver.