westonsoftware / vue-webrtc

WebRTC video component for Vue.js
MIT License
365 stars 127 forks source link

Sample only works on localhost, not on "my-local-ip" #42

Closed mpena2099 closed 3 years ago

mpena2099 commented 3 years ago

Hi!

Steps: $ git clone https://github.com/westonsoftware/vue-webrtc $ cd vue-webrtc/sample/ $ yarn install $ yarn serve

http://localhost:8080/ -> shows webcam image

http://192.168.0.43:8080/ -> only shows the Vue logo and, on webconsole: "Uncaught TypeError: navigator.getUserMedia is not a function"

Thanks! Mauricio

westonsoftware commented 3 years ago

Try https and see if that works

mpena2099 commented 3 years ago

Try https and see if that works

No effect. I see "ERR_SSL_PROTOCOL_ERROR" on browser.

But as seen in https://forum.vuejs.org/t/vue-cli-serve-with-https/39359/4, I created this file below in /sample directory and now it worked! It even allowed the selection of camera and microphone.

vue.config.js

module.exports = {
  devServer: {
    https: true
  }
}

Captura de tela de 2021-01-27 16-11-43

mpena2099 commented 3 years ago

Just $ yarn serve --https works too.