Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture webcam video with createCapture() but not found #22

Closed
oukunan opened this issue Apr 2, 2018 · 5 comments
Closed

Capture webcam video with createCapture() but not found #22

oukunan opened this issue Apr 2, 2018 · 5 comments

Comments

@oukunan
Copy link

oukunan commented Apr 2, 2018

I tried to capture video with my webcam but react-p5-wrapper not found function createCaptrue(). Or I miss something?

@toroduque
Copy link

toroduque commented Jul 26, 2018

Try importing the p5.dom.js library. This worked for me:

import "react-p5-wrapper/node_modules/p5/lib/addons/p5.dom";

export default function sketch(p5) {

  p5.setup = function() {
        // Create a video element
        video = p5.createCapture(p5.VIDEO);
   }

@oukunan
Copy link
Author

oukunan commented Aug 11, 2018

@toroduque that's work!. thanks.

@and-who and-who closed this as completed May 28, 2019
@rickithadi
Copy link

getting a module not found error for p5.dom .Checking node_modules also shows that the file isnt there. Could you post a gist or a link to your repo please

@and-who
Copy link
Contributor

and-who commented Jun 12, 2019

p5 is now a peerDependency, so it should be in your node_modules Folder.
So you should do something like import "p5/lib/addons/p5.dom";

@rickithadi
Copy link

wow that works. Worth noting that the import is not in the sketch.js file but the component. thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants