Picture in picture web api with Javascript
When you watch Youtube, there is a miniplayer in the right corner which is same as picture in picture function. I think this is very useful for mordern people's life,who can do multiple thing at the same time,such as browsering website while watching some videos or doing notes when having class on one screen. The video screen can be dragged anywhere you want and resize to any size you want. Efficient tool. When searching picture in picture,there is a chrome extension choice.Here is the customize version for developer. CODE SEPERATE BELOW: HTML video tag is the container for video display with the button to trigger. CSS font from Google font as you choice. First,make sure all the stuff in the center of the body,just for displaying. Giving button some animations,like box-shadow and background. JAVASCRIPT Get the DOM with ID. First, the broswer needs to fetch the screen with Screen Capture API. captureStream = await navigator . mediaDevices . getDisplayMedia ( displayMedi...