I downloaded p5 from the official p5-website and tried to use my webcam. But the VIDEO argument is not recognized by my IDE and therefore what my webcam captures isn’t displayed at the website. I tried it in VS-Code an Webstorm but in both IDE’s it didn’t work. I couldn’t find any helpful tips on the internet so please help me. 🙂 and merry Christmas to everbody 🙂
let video;
function setup() {
createCanvas(640, 520);
video = createCapture(VIDEO);
video.hide();
}
function draw() {
background(0);
// put drawing code here
}
HTML
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>p5.js example</title>
<style>
body {
padding: 0;
margin: 0;
background-color: #1b1b1b;
}
</style>
<script src="../p5.min.js"></script>
<script src="https://unpkg.com/ml5@latest/dist/ml5.min.js"></script>
<!-- <script src="../addons/p5.sound.js"></script> -->
<script src="sketch.js"></script>
</head>
<body>
<main>
</main>
</body>
</html>