We have been working on a proposal to expose a Picture in Picture API. The repository is https://github.com/mounirlamouri/picture-in-picture and the explainer can be found at https://github.com/mounirlamouri/picture-in-picture/blob/master/explainer.md
This effort started because there are more system APIs for Picture in Picture (Windows, macOS, iOS, Android) and support in browsers (Opera, Safari, Firefox, Samsung). Safari already has a proprietary API for this feature. We believe we should standardise a Web API for this in order to have interoperable behaviour and bring this feature to the Web.