I've been trying to implement chromecast to my android app. Even after following the documentation i am not able to establish a connection.
SessionManagerListener<CastSession> mSessionManagerListener = new SessionManagerListener<CastSession>() {
@Override
public void onSessionStarting(CastSession castSession) {
for (ChromeCastSubscriber castListener : getSubscribers()) {
castListener.onCastConnecting();
}
}
@Override
public void onSessionStartFailed(CastSession castSession, int i) {
// Failed
}
};
It starts the connection and goes to Failed method. I am not able to establish a connection here, Any Help? I am on same network on both, Tv and Mobile.
I am getting Error code as "2472" which is not mentioned in the Error code list https://developers.google.com/android/reference/com/google/android/gms/cast/CastStatusCodes
Kindly guide me ahead.