These are chat archives for andyet/SimpleWebRTC

18th
Dec 2017
prprnv
@prprnv
Dec 18 2017 12:31
anyone there
I had created the video chat application in webrtc and using signalr it was working fine if i connect to the person in same network but when i am trying to connect to the person who is in different network is unable to display the partner video everything is working fine call is going accepting just video is not showing of the partner can anyone help me out of this i made in .net below url is of the website where i had hosted that
LuckyCyborg
@LuckyCyborg
Dec 18 2017 12:54
You need also STUN/TURN servers, not only the signaling one.
More precisely: at least a TURN server, to relay your media between users.
prprnv
@prprnv
Dec 18 2017 14:12
here is my connection.js code can u tell me what changes i have to make in this
var _signaler,
_connections = {},
_iceServers = [
{
'urls': 'stun:127.0.0.1:3478'
},
{
'urls': 'turn:192.158.29.39:3478?transport=udp',
'credential': 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
'username': '28224511:1379330808'
},
{
'urls': 'turn:192.158.29.39:3478?transport=tcp',
'credential': 'JZEOEt2V3Qb0y27GRntt2u2PAYA=',
'username': '28224511:1379330808'
}
], // stun.l.google.com - Firefox does not support DNS names.
    /* Callbacks */
    _onReadyForStreamCallback = function () { console.log('UNIMPLEMENTED: _onReadyForStreamCallback'); },
    _onStreamAddedCallback = function () { console.log('UNIMPLEMENTED: _onStreamAddedCallback'); },
    _onStreamRemovedCallback = function () { console.log('UNIMPLEMENTED: _onStreamRemovedCallback'); },

    // Initialize the ConnectionManager with a signaler and callbacks to handle events
    _initialize = function (signaler, onReadyForStream, onStreamAdded, onStreamRemoved) {
        _signaler = signaler;

        _onReadyForStreamCallback = onReadyForStream || _onReadyForStreamCallback;
        _onStreamAddedCallback = onStreamAdded || _onStreamAddedCallback;
        _onStreamRemovedCallback = onStreamRemoved || _onStreamRemovedCallback;
    },

    // Create a new WebRTC Peer Connection with the given partner
    _createConnection = function (partnerClientId) {
        console.log('WebRTC: creating connection...');

        // Create a new PeerConnection
        var connection = new RTCPeerConnection({ iceServers: _iceServers });

        // ICE Candidate Callback
        connection.onicecandidate = function (event) {
            if (event.candidate) {
                // Found a new candidate
                console.log('WebRTC: new ICE candidate');
                _signaler.sendSignal(JSON.stringify({ "candidate": event.candidate }), partnerClientId);
            } else {
                // Null candidate means we are done collecting candidates.
                console.log('WebRTC: ICE candidate gathering complete');
            }
        };