I'm trying to use react-p5-wrapper
and use createCapture()
for video capture but got errors:
TypeError: Cannot read property 'push' of undefined
Here is my code. What should I do?
import p5 from "p5";
import "p5/lib/addons/p5.dom";
export default function sketch(p) {
p.setup = function() {
p5.prototype.createCapture();
p.createCanvas(400, 300, p.WEBGL);
};
p.draw = function() {
p.background(100);
p.stroke("rgb(0,255,0)");
p.strokeWeight(4);
p.line(-400, -50, 0, 400, -50);
p.stroke(200);
};
}