Here is what I'm doing:
While doing the presentation I have access to the Display I'm casting to:
MediaRouter.RouteInfo route = mMediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);
return route != null ? route.getPresentationDisplay() : null;
Any ideas on how to achive this functionality?
UPDATE:
For those who are interested on this, this is how I did it (Thanks to Ali Naddaf response):
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2)
public void disconnect(){
MediaRouter mMediaRouter = (MediaRouter) getSystemService(Context.MEDIA_ROUTER_SERVICE);
mMediaRouter.selectRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO, mMediaRouter.getDefaultRoute());
}
For the ones like me who came looking for the answer using v3 Cast SDK:
mSessionManager.endCurrentSession(true);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With