0

I am attempting to add Google Cast functionality to my audio apps. I have created a simple test app to figure it out. I have the cast button working, but currently, it is only displaying my TV's Chromecast and not the Nest Mini I also have on the network. I know this device is available on the network because it shows up as a cast option in YouTube Music. From reading the documentation on audio only devices, the only extra step I saw was to check the box next to "Supports casting to audio only devices" in my apps settings on Google Cast SDK Developer Console and to make sure I have the id set in my options provider. Here is my options provider:

class CastOptionsProvider: OptionsProvider {
override fun getCastOptions(context: Context): CastOptions {
    return CastOptions.Builder()
        .setReceiverApplicationId(context.getString(R.string.app_id))
        .build()
}

override fun getAdditionalSessionProviders(context: Context): MutableList<SessionProvider> {
    return mutableListOf()
}

It is defined in the manifest like this:

<meta-data
        android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
        android:value="com.example.casttest.CastOptionsProvider"/>

I am using the ID for my app from the Google Cast SDK site.

Joel Page
  • 642
  • 3
  • 17

1 Answers1

0

It looks like it just needed some time for the "Supports casting to audio only devices" to take effect. It took about 12 hour for it to start working.

Joel Page
  • 642
  • 3
  • 17