draws video in canvas element using requestAnimationFrame
npm install canvas-video --save
import CanvasVideo from 'canvas-video'
const canvas = new CanvasVideo({
video: document.querySelector('video'),
canvas: document.querySelector('canvas')
})
canvas.resize()
canvas.play()
fps
play
: start drawing video in canvas using requestAnimationFramepause
: cancelAnimationFrameresize
: apply css styles (width, height) of<video>
element to<canvas>
MIT, see LICENSE.md for details.