0

I develop an application that presents content to an external display using Presentation. Now I want to mirror that to the phone screen or let say Twilio. One solution is to capture views from within the app.

For example. Is there a way to set a listener on DisplayManager external displays and start recording when it's presenting? Like we do with ADB adb shell screenrecord --display-id [DisplayID] /sdcard/example.mp4

Can we trigger this programmatically and catch each frame?

Note: We use TextureView

Qamar
  • 4,959
  • 1
  • 30
  • 49
  • 2
    [This](https://github.com/commonsguy/cwac-layouts#usage-mirroing) is rather old, but it may give you some ideas. – CommonsWare Aug 17 '21 at 14:01
  • @CommonsWare Thanks for sharing this. I look into `MirroringFrameLayout` You wrote very good logic. We are using `TextureView` so I can't use that as it is. Just got an idea. I think I can get a bitmap from `TextureView.getBitmap` and draw on the top with every draw call. – Qamar Aug 24 '21 at 09:40
  • @CommonsWare mTextureView.isAvailable() returned false from inside MirroringFrameLayout – Qamar Aug 25 '21 at 12:18
  • 1
    @CommonsWare I put the TextureView out of MirroringFrameLayout and now passing to mirroringFrameLayout.setTextureView(textureView), then textureView.getBitmap(bmp); before super.draw(bmpBackedCanvas); working like a charm! thanks – Qamar Aug 26 '21 at 06:50

0 Answers0