I'm trying to integrate the android cast v3 into my app and can't make it work.
I did exactly what written in this google document: https://developers.google.com/cast/docs/android_sender_integrate (until the header: "Configure device discovery")
And the dialog that opened when I click on the MediaRouteButton can't find any device while the "youtube" app success to find my android-tv device.
what did I missed?
// the code of the CastOptionsProvider:
class CastOptionsProvider implements OptionsProvider {
@Override
public CastOptions getCastOptions(Context appContext) {
return new CastOptions.Builder().setReceiverApplicationId(
CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID).build();
}
@Override
public List<SessionProvider> getAdditionalSessionProviders(Context context) {
return null;
}
}
// the code in the custom view:
mMediaRouteButton = (MediaRouteButton)findViewById(R.id.media_route_button);
CastButtonFactory.setUpMediaRouteButton(getContext(), mMediaRouteButton);
mCastContext = CastContext.getSharedInstance(getContext());
and in the manifest (inside the application tag):
<meta-data
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.bla-company-bla.core.cast.CastOptionsProvider"/>