I am creating an UWP/WinRT app where you can record e.g. a presentation or some operations on your screen, draw on it and so on. I've added a feature where the user can record himself, using his camera device. So you have an additional simple box, with a preview of yourself, that is recorded into the final video. You can resize and move it.
This was working quite nice, but I've got a request that the user should have the possibility to insert multiple camera captures.
On that point I want to say that my standard Camera Capture was written on the basis of the Microsoft sample that is avaiable here
When I tried to add multiple MediaCaptures and CaptureElements everytime the previous ones have stopped previewing.
So I thought I'd create a static CameraCaptureManager
that would have a static MediaCapture and CaptureElement, but when I tried add this CaptureElement to multiple UIElements I got the standard error:
Element is already the child of another element.
So I tried to have only a static MediaCapture and create for each box a new CaptureElement with the same source:
var capture = new CaptureElement();
capture.Source = CameraCaptureManager.MediaCapture;
Children.Add(capture);
But it also didn't work. Looks like a MediaCapture can only be the source of one CaptureElement. I've got this error:
The request is invalid in the current state.
Sorry for not pasting much code, but I already have so much I wouldn't know where to start because it'sa quite big project. But the main part, camera capture, is based on the Microsoft sample. I've found samples on GitHub where two (front + back) cameras where used, but I couldn't find any with the same camera is used multiple times on screen. Hope you have samples or have an idea how to do this? Or prove it's impossible (like on Android) :) Thank you