Skip to content
jQuery plugin for playing/stopping a webcam in a canvas with image capture
JavaScript HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit Feb 8, 2018
LICENSE Initial commit Feb 8, 2018 Update Feb 8, 2018
package-lock.json removed http-server Feb 8, 2018
package.json Update example Feb 8, 2018
video2image.js Initial commit Feb 8, 2018


jQuery plugin for viewing/playing/stopping a webcam with image capture

This plugin requires jQuery

Video capture may not work in all browsers

Do not try to run locally, browser permissions require running with web server only

Package Manager

This plugin can be downloaded using npm

npm install jquery-video2image


selector should be a <canvas> element you have added to the page.

<canvas id="photocanvas" width="320" height="240"></canvas>



Initialize with options

  width : 320,
  height : 240,
  autoplay : true,
  onsuccess : function () {},
  onerror: function () {}

Find out if your browser supports this

Returns true or false

var isSupported = $(selector).video2image('isSupported');

To get a PNG DataURL from the canvas

Returns an image/png in base64

var dataurl = $(selector).video2image('capture');

To Stop the video


To start/restart the video


You can’t perform that action at this time.