not working webRTC with public ip joining ;-;

Issue

when i am coding ( on ios ipad system version : 15 ) webRTC ( with socket-io ), in my server-side ( node.js + socket-io ) is not working. if join in localhost, it’s ok. but if join in like 192.168.10.15:8080, then it doesn’t work.

How to fix????

my server code:

var app = require(“express”)()
var server = require(“http”).createServer(app)
var io = new require(“socket-io”)(server)

app.get(“/“, (req, res) => {
    res.sendFile(__dirname + “/index.html”)
})

server.listen(8080)

in my index.html :

<!Doctype html>
<html>
    <head>
       <meta charset=“utf-8”>
       <script src=“./socket-io.min.js”></script>
    </head>
    <body>
       <video autoplay></video>
       <script>
           var socket = io()
           navigator.mediaDevices.getUserMedia({video: true})
              .then((stream) => {
                  document.querySelector(“video”).srcObject = stream
              })
       </script>
    </body>
</html>

but when i tried to open the web-inspector, then it gives me an error : navigator.mediaDevices.getUserMedia is not an function

how to fix?

Solution

it may be ios problem or wi-fi problem…

Answered By – user19248178

Answer Checked By – Cary Denson (AngularFixing Admin)

Leave a Reply

Your email address will not be published.