Search code examples
androidchromecastgoogle-cast

Resuming video on phone after disconnecting from chromecast in CastVideos-android


I'm currently playing with the great sample application CastVideos-android, but can't get it to resume video playback on phone after disconnecting from Cast device.

I see this functionality prepared in LocalPlayerActivity.java with comment

this will be the case only if we are coming from the CastControllerActivity by disconnecting from a device

but it's never called (mShouldStartPlayback is always false).

Is there a simple way how to get it working? I'd be thankful for any pointers on where to start.

Thank you in advance!


Solution

  • That feature is not there in that sample due to the structure of the app. For example, you are casting Movie A, then you go back and start browsing and click on Movie B to go to the detail page for that movie. Now Movie A is casting and you are looking at Movie B's detail page. If you disconnect at that time, should it replace the Video B with the Movie A and resume that? That won't be the best user experience. Due to the way the app is structured, that is not implemented.