This is a learning project, which shows a using picture-in-picture functionality. To start just push "Start" button and select an application window, which do you want to see inside the little window.
The project is available at the link below: https://tol8901.github.io/picture-in-picture/.
Initial window:
Sharing the app in the little window: