# Issues with SnapCam installed

**URL:** <https://openvidu.discourse.group/t/issues-with-snapcam-installed/4093>\
**Category:** Issues developing apps\
**Tags:** v2\
**Created:** [July 14, 2022, 1:33pm UTC](https://openvidu.discourse.group/t/issues-with-snapcam-installed/4093 "2022-07-14T13:33:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glen\_Elkins1](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/glen_elkins1/32/1975_2.png) [@Glen\_Elkins1](https://openvidu.discourse.group/u/Glen_Elkins1)\
**Post date:** [July 14, 2022, 1:33pm UTC](https://openvidu.discourse.group/t/issues-with-snapcam-installed/4093/1 "2022-07-14T13:33:09Z")

</div>

I have a random issue if snapcam is installed, the browser decides sometimes to publish using the snapchat camera.

Is there way to stop it ever using it?

I’m just creating the publisher like normal:

```auto
this.OVPublisher = this.OV.initPublisher("publisher-video", {
          videoSource: true,
          audioSource: true,
          publishAudio: true,
          publishVideo: true,
          frameRate: 30,
          resolution: '1280x720'
        });

```

At this point though access hasn’t been granted to get media devices, once access has been allowed in the browser i can then filter out the media devices and switch the track?

Is there not a more efficient way? The browser doesn’t ask for permission to access the devices until initPublisher is called, and before then i can’t use getDevices()

The snapcam is so unreliable it breaks things entirely most of the time or just get a yellow screen.

---

<div class="post-metadata">

**Author:** ![pabloFuente](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/pablofuente/32/2536_2.png) [@pabloFuente](https://openvidu.discourse.group/u/pabloFuente)\
**Post date:** [July 15, 2022, 8:47am UTC](https://openvidu.discourse.group/t/issues-with-snapcam-installed/4093/2 "2022-07-15T08:47:07Z")

</div>

OpenVidu.getDevices method is just a simple wrapper around Web API method [MediaDevices.enumerateDevices() - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/enumerateDevices).

This method won’t return a proper result unless the web already has permissions to capture audio/video. So there is no shortcut at this point. Instead of using OpenVidu.initPublisher (which will initialize a Publisher object and setup the video element), you can use instead [OpenVidu.getUserMedia](https://docs.openvidu.io/en/2.22.0/api/openvidu-browser/classes/OpenVidu.html#getUserMedia). That method will trigger the permissions dialog the same way. You can then dispose the generated MediaStream and now call the getDevices method to finally get a Publisher object with the desire device.
