Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I programmatically disconnect from a selected route?

I'm using a MediaRouteButton to connect to a ChromeCast device. Once a user is connected they can click on the MediaRouteButton to disconnect, but I would like to place another specific disconnect button in the UI. I've been searching for a way to programmatically disconnect from the selected route, but I can't seem to find anything.

like image 404
ActiveApathy Avatar asked Jan 27 '26 03:01

ActiveApathy


1 Answers

If you are using the MediaRouteHelper, you don't have access to the piece that you are looking for. You can extend MediaRouter and do all the discovery related stuff yourself and then you'll have access to what you want. That said, I strongly recommend not to provide a second mechanism for deselection of a route; we strongly urge developers to use the standard way that we have built. People may not yet be fully familiar with this relatively new approach to select a device and cast content to them but as more and more apps use that, it will become very familiar. Since popular Google apps also use that (e.g. YouTube or Play Movie or Play Music), then a lot of people will learn about that quickly.

like image 69
Ali Naddaf Avatar answered Jan 28 '26 18:01

Ali Naddaf