All Projects → baptistebriel → canvas-video

baptistebriel / canvas-video

Licence: MIT license
draws video in canvas element using requestAnimationFrame

Programming Languages

javascript
184084 projects - #8 most used programming language

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].