Nilesh Wagh
Nilesh Wagh

Reputation: 940

How to implementation of WebRTC peer-to-peer Audio conference in mesh topology using RTCMultiConnection

I want to implement peer-to-peer audio conference using WebRTC. I have tried RTCMultiConnection.js to implement the same, but Facing some issues to play it outside network(outside NAT). I have tried to setup STUN and TURN as well, but issue remain same. Getting error as "ICE connectivity is failed. Reconnecting peer connection."

STUN and TURN configuration as below:

function initRTCMultiConnection(userid) {
var connection = new RTCMultiConnection();
connection.body = document.getElementById('videos-container');
connection.channel = connection.sessionid = connection.userid = userid || connection.userid;
connection.sdpConstraints.mandatory = {
    OfferToReceiveAudio: false,
    OfferToReceiveVideo: true
};

var iceServers = [];

iceServers.push({
    url: 'stun:stun.l.google.com:19302'
});

iceServers.push({
    url: 'stun:stun.anyfirewall.com:3478'
});

iceServers.push({
    url: 'turn:turn.anyfirewall.com:443?transport=tcp',
    credential: 'webrtc',
    username: 'webrtc'
});

connection.iceServers = iceServers;

I am using updated demo of WebRTC-Scalable-Broadcast.

Please suggest me on solution on it.

Is there any alternative API/library available to to establish peer-to-peer audio conference using WebRTC?

Upvotes: 0

Views: 556

Answers (1)

Tsahi Levent-Levi
Tsahi Levent-Levi

Reputation: 2386

Never ever use a third party TURN server. STUN may be fine, but once you put your own TURN server (or pay for a managed service of one) - it gives you the STUN part for free.

So start by deploying your own STUN and TURN server.

Upvotes: 1

Related Questions