Is there any way to programmatically call the Cast Screen function in Android?
I do not want to develop a sender app, just want to start casting the screen extactly as in the Settings -> Display -> Cast Screen without going through those selections.
Disconnecting can be done prorammatically with the following code:
public void disconnect() {
MediaRouter mMediaRouter = (MediaRouter) getApplicationContext()
.getSystemService(Context.MEDIA_ROUTER_SERVICE);
mMediaRouter.selectRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO,
mMediaRouter.getDefaultRoute());
}
I need similar code to start casting.