# Webcam is not working on my mac pro

**URL:** https://discourse.processing.org/t/webcam-is-not-working-on-my-mac-pro/22705
**Category:** Coding Questions
**Created:** [July 18, 2020, 12:08pm UTC](https://discourse.processing.org/t/webcam-is-not-working-on-my-mac-pro/22705 "2020-07-18T12:08:18Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yejincolor](https://avatars.discourse-cdn.com/v4/letter/y/b5a626/32.png) [@yejincolor](https://discourse.processing.org/u/yejincolor)
#### Post date: [July 18, 2020, 12:08pm UTC](https://discourse.processing.org/t/webcam-is-not-working-on-my-mac-pro/22705/1 "2020-07-18T12:08:18Z")

</div>

In p5js editor, I wanted to test the example called “capture” to turn on my webcam on my mac pro. The code must be correct since I used the example that already existed, but the camera is not turning on and I do not know why. It works in the web editor in p5.js, but not on the editor on my computer.

the console says,

{  
“constraintName”: “”,  
“message”: “”,  
“name”: “InvalidStateError”  
}

```auto

```

let capture;  
function setup() {  
createCanvas(390, 240);  
capture = createCapture(VIDEO);  
capture.size(320, 240);  
[//capture.hide](https://capture.hide)();  
}

function draw() {  
background(255);  
image(capture, 0, 0, 320, 240);  
filter(INVERT);  
}

```auto

```

---

<div class="post-metadata">

### Author: ![Ackados](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/ackados/32/8282_2.png) [@Ackados](https://discourse.processing.org/u/Ackados)
#### Post date: [July 19, 2020, 12:04am UTC](https://discourse.processing.org/t/webcam-is-not-working-on-my-mac-pro/22705/2 "2020-07-19T00:04:23Z")

</div>

Does your website allow the camera to be used?

---

<div class="post-metadata">

### Author: ![yejincolor](https://avatars.discourse-cdn.com/v4/letter/y/b5a626/32.png) [@yejincolor](https://discourse.processing.org/u/yejincolor)
#### Post date: [July 19, 2020, 12:52am UTC](https://discourse.processing.org/t/webcam-is-not-working-on-my-mac-pro/22705/3 "2020-07-19T00:52:53Z")

</div>

Yes, the webcam works fine with the web editor!
