canvas-video

1.0.4 • Public • Published

canvas-video

stable

draws video in canvas element using requestAnimationFrame

Usage

NPM

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 requestAnimationFrame
  • pause: cancelAnimationFrame
  • resize: apply css styles (width, height) of <video> element to <canvas>

License

MIT, see LICENSE.md for details.

Readme

Keywords

none

Package Sidebar

Install

npm i canvas-video

Weekly Downloads

0

Version

1.0.4

License

MIT

Last publish

Collaborators

  • bbriel