1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17

content / test / data / media / picture_in_picture / canvas-in-pip.html [blame]

<!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>