Library (or something) for opening DOMElements in Picture-in-Picture.
Find a file
Victor Westerlund c39ef4b57d
Create README.md
2022-08-04 17:37:43 +02:00
.gitignore Initial commit 2022-08-03 15:11:42 +02:00
LICENSE Initial commit 2022-08-03 15:11:42 +02:00
PipCanvas.mjs fix: wait for media and cross-origin error 2022-08-04 02:42:23 +02:00
README.md Create README.md 2022-08-04 17:37:43 +02:00

pip-canvas

Open DOM elements in Picture-in-Picture with the help of <canvas>, <video> and JavaScript. This is a librabry/API sorta, kinda thing.

Early Access

Only HTMLImageElement is supported at this time, but I intend to add more elements later. As well as support for URL and URL strings.

Get started

  1. Clone this repo
git clone https://github.com/VictorWesterlund/pip-canvas.git
  1. Import as ESM into your project
import { PipCanvas } from "./pip-canvas/PipCanvas.mjs"
  1. Initialize PipCanvas() with an HTMLImageElement
const pip = new PipCanvas(HTMLImageElement);
pip.open();