2

Is there any way to Cast the entire android screen as is to Chromecast using the cast API? I do not want to implement a custom receiver, just mirror the tablet/device screen to the TV by pressing a button on my app.

nette
  • 565
  • 2
  • 7
  • 23

1 Answers1

0

You would need to use the RemoteDisplay APIs and basically build a local view on the phone (which doesn't need to be visible on the phone, but it can be if you want to) and use the abovementioned APIs to present that on the TV. For that, you don't need to use any custom receiver, RemoteDisplay documentation explains that too. Note that this only shows your view (which is part of your app) on the TV screen; you cannot programmatically mirror the phone's screen on TV outside of your own app (and the designated view).

Ali Naddaf
  • 16,629
  • 2
  • 18
  • 27
  • Is there no way to get the chromecast route info and cast directly to it through the selectRoute function? We have some information from the chromecast device i.e. RouteInfo{ name=Chromecast7690, description=Chromecast, status=null, category=RouteCategory{ name=null types=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO groupable=false },supportedTypes=ROUTE_TYPE_LIVE_AUDIO ROUTE_TYPE_LIVE_VIDEO ROUTE_TYPE_REMOTE_DISPLAY , – nette Jul 12 '16 at 05:32
  • presentationDisplay=Display id 18: DisplayInfo{"Chromecast7690", uniqueId "virtual:com.google.android.gms,10056,Chromecast7690,0", app 1280 x 720, real 1280 x 720, largest app 1280 x 720, smallest app 1280 x 720, 60.0 fps, supportedRefreshRates [60.0], rotation 0, density 213 (213.0 x 213.0) dpi, layerStack 18, appVsyncOff 0, presDeadline 16666666, type VIRTUAL, state ON, owner com.google.android.gms (uid 10056), FLAG_SECURE, FLAG_PRESENTATION}, DisplayMetrics{density=1.3312501, width=1280, height=720, scaledDensity=1.3312501, xdpi=213.0, ydpi=213.0}, isValid=true } – nette Jul 12 '16 at 05:33
  • Not sure what you mean, if you want to mirror your "app" on chromecast, the APIs that I mentioned earlier is the only way you can do it. – Ali Naddaf Jul 12 '16 at 17:23