Is it possible to detect if there are any Chromecast devices on the current WiFi network. I've seen that there's a Cast SDK but I couldn't find anything about searching for devices. Having never worked with this SDK before, it is possible that I may have overlooked it.
Select Devices in the top-right corner. Select the 3-dot menu for the Chromecast itself. Select Settings. Near the top, you'll see the name of your Chromecast, and just below you'll see which Wi-Fi network it's connected to.
It's more likely that you're seeing a notification that somebody is streaming something over Chromecast on your wifi network. It's harmless, they can't see anything on your phone. How do I get access to another phone's content from mine, when they are signed into my Wi-Fi?
You can make your Chromecast private by switching off Guest Mode. Use the Google Home App to toggle Guest Mode off by clicking on Account, Devices, then Guest Mode.
Chromecast devices are discoverable using avahi with the type _googlecast._tcp
$ avahi-browse -r _googlecast._tcp
+ eth0 IPv4 Living Room _googlecast._tcp local
= eth0 IPv4 Living Room _googlecast._tcp local
hostname = [Living\032Room.local]
address = [192.168.1.100]
port = [8009]
txt = ["st=0" "fn=Living Room" "ca=5" "ic=/setup/icon.png" "md=Chromecast" "ve=02" "id=c832a30b81ab84a706c82745438fcd64"]
You can perform discovery without using the cast button; you need to use media router from v7 support library (which needs the v7 appcompat support as well) and then get an instance of the media router from your code, define a selector (which is basically a filter to possibly narrow down the devices that you are interested in) and then add a callback to start discovery. As devices are discovered (asynchronously), your callbacks will be called. Take a look at this sample project, specially this class which does exactly what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With