Home » Javascript » Please Help: Uncaught (in promise) DOMException: Error processing ICE candidate

Please Help: Uncaught (in promise) DOMException: Error processing ICE candidate

Posted by: admin October 29, 2018 Leave a comment

Questions:

I got this error when I tried to add sendMessage and sendFile:

Uncaught (in promise) DOMException: Error processing ICE candidate

before added the video call no problem.

Here my code:
package.json

{
  "name": "webrtc-medical-app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "coffee-script": "^1.12.7",
    "connect": "^3.6.6",
    "ejs": "^2.6.1",
    "express": "^4.16.3",
    "express.io": "^1.1.13"
  }
}

server.js

var express = require('express.io');
var app = express();
app.http().io();
var PORT = 3000;
console.log('server started on port ' + PORT);

app.use(express.static(__dirname + '/public'));

app.get('/', function (req, res) {
    res.render('index.ejs');
})

app.listen(process.env.PORT || PORT);

// signal route
app.io.route('signal', function (req) {
    req.io.join(req.data);
    req.io.join('files');
    app.io.room(req.data).broadcast('signal', {
        user_type: req.data.user_type,
        user_name: req.data.user_name,
        user_data: req.data.user_data,
        command: req.data.command
    })
})

webrtc.js
https://pastebin.com/6QTbNkjB

Thank you for helping me, I’m sorry for my English is very bad.

Answers: