canvas-video
v1.0.4
Published
draws video in canvas element using requestAnimationFrame
Downloads
4
Readme
canvas-video
draws video in canvas element using requestAnimationFrame
Usage
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()
options
fps
methods
play
: start drawing video in canvas using requestAnimationFramepause
: cancelAnimationFrameresize
: apply css styles (width, height) of<video>
element to<canvas>
License
MIT, see LICENSE.md for details.