0

I'm quite new in using Google Cast API. I want to create a simple application where is one button to mirror the whole screen to receiver device. I want also to mirror everything outside the app(when the app is going to background). I founded examples with casting remote text and cubes and it's clear for me

I want to cast whole screen/window in and outside of application like with GoogleHomeApp. In PresentationService file I'm trying to do something like this:

Window getWindow(Activity myActivityReference) {
   return myActivityReference.getWindow(); 
}

@Override
protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  Window window = getWindow((Activity) getApplication());
  setContentView(window.getDecorView());
}

PS. There are also other apps which use chromecast to mirroring like Screen Stream Mirroring Free. I'm really trying hard find out how to do this with my app. Please help me.

Thanks in advance!

Przemekeke
  • 81
  • 10
  • Possible duplicate of [Screen mirrorring using chrome cast example code or tutorial](https://stackoverflow.com/questions/41499247/screen-mirrorring-using-chrome-cast-example-code-or-tutorial) – Morrison Chang Sep 11 '17 at 16:57
  • Yes I know about remote display API but the example is with presentation with cubes. My question is how to create presentation for screen mirroring? – Przemekeke Sep 12 '17 at 09:57
  • Did you read the answer and the comments from the Google developer? If that response doesn't answer your question, edit your post to explain how it doesn't. – Morrison Chang Sep 12 '17 at 11:16
  • Hi, i am implementing iOS cast SDk to share my app screen , no video to play in my app. Which API/codes you used for screen share of your app ? So that i can try for similar API in iOS. It would be great help. – Jamshed Alam Jan 21 '21 at 10:23

1 Answers1

1

Developers can only use the Cast Remote Display API for mirroring their own apps content.

System level mirroring can only be initiated by the user with the system level options.

Leon Nicholls
  • 4,623
  • 2
  • 16
  • 17
  • I am going to implement cast iOS SDK , my purpose is to share my app screen (can be single screen or multiple , may be like user navigates to the screens and i will share those) to a TV or supported screen. Can i do it rather playing and sharing video through SDK ? Specially i want mirroring my app screen/s/view only. Please, help me with the workaround. – Jamshed Alam Jan 20 '21 at 06:11
  • Hey @Leon, as the remote display API is deprecated which was used to support app screen mirroring, what other option does a developer now have to support screen mirroring? – hardik9850 Sep 27 '22 at 11:16