Skip to content

video.get() not working #1656

@sofiagarcia

Description

@sofiagarcia
var video, button;
var snapshots = [];

function setup() {
  createCanvas(800, 240);
  background(51);
  video = createCapture(VIDEO);
  video.size(320, 240);


  button = createButton('Snap!');
  button.mousePressed(takeSnap);

}

function takeSnap() {
  loadPixels();
  snapshots.push(video.get());

}

When I run the sketch, I receive this error:

p5.js:12462 Uncaught TypeError: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': 
The provided value is not of type '(HTMLImageElement or HTMLVideoElement or 
HTMLCanvasElement or ImageBitmap)'(…)

Currently running on
p5.js v0.5.4 October 01, 2016

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions