1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<!DOCTYPE html> <html> <body /> <script> const video = document.createElement('video'); async function start() { const canvas = document.createElement('canvas'); canvas.getContext('2d').fillRect(0, 0, canvas.width, canvas.height); video.srcObject = canvas.captureStream(); await video.play(); await video.requestPictureInPicture(); return true; } </script> </html>