I am working on adding Chromecast support to my app.
I have gone through : https://codelabs.developers.google.com/codelabs/cast-videos-android/#0
Link for app from code lab : https://github.com/googlecodelabs/cast-videos-android/archive/master.zip
I'm able to cast videos using sample app, but in same app if I set the Receiver Application ID to DEFAULT_MEDIA_RECEIVER_APPLICATION_ID then I'm getting error 15 in SessionManagerListener callback.
@Override
public void onSessionStartFailed(CastSession session, int error) {
//error =15
}
Following is CastOptionsProvider from code lab (read code comment):
public class CastOptionsProvider implements OptionsProvider {
@Override
public CastOptions getCastOptions(Context context) {
return new CastOptions.Builder()
.setReceiverApplicationId(context.getString(R.string.app_id)) // Here,I'm trying to use DEFAULT_MEDIA_RECEIVER_APPLICATION_ID = "CC1AD845"
.build();
}
@Override
public List<SessionProvider> getAdditionalSessionProviders(Context context) {
return null;
}
}
I know that error 15 means session timeout. I'm not able to get any working example with DEFAULT_MEDIA_RECEIVER_APPLICATION_ID.
Thanks in advance.
I have also referred the thread , Android Sender App getting timeout when trying to connect to Chromecast