VinceG/vue-web-cam

Webcam don't work in production environment

ddv1212 opened this issue · 3 comments

Hey,

I copy and paste the demo code and in my development everything works fine. Sometimes the available webcam are not listed but after refreshing the page the problem is gone.

Now I deployed my app with nginx on a raspberry pi in my local network. The problem is that when I load the page with the webcam content that the video stream is not shown. In the area where the webcam should appear is recognized as video (right click shows play etc.)

What can be the problem here?

Best regards!

I think the example is not complete.
Try:

<template>
        <vue-web-cam @cameras="onCameras($event)" :deviceId="deviceId" />
</template>

<script>
import VueWebCam from "vue-web-cam";
export default {
  data: function() {
    return {
      deviceId: null
    };
  },
  components: {
    VueWebCam
  },
  methods: {
    onCameras: function(cameras) {
      if (cameras.length === 1) {
        this.deviceId = cameras[0].deviceId;
      }
    }
  }
};
</script>
<style></style>

Hey, I tried your minimized code but the result is the same :( Not even the browser asks for webcam access. I can't figure out why :/

I solved my problem. The most (maybe all) brwosers dont allow to call getUserMedia without SSL.
I created an self signed certificate and deployed it and now it works. The Problem was not on the Webcam Source!

Thank you anyway @mmouterde