Skip to content

draws video in canvas element using requestAnimationFrame

License

Notifications You must be signed in to change notification settings

baptistebriel/canvas-video

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

draws video in canvas element using requestAnimationFrame

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published