Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Conversation.js (AndroidRTC) not working between chrome to firefox #1

Open
jigarrdesai opened this issue Nov 5, 2014 · 3 comments
Open

Comments

@jigarrdesai
Copy link

Hello,

I open this demo in google chrome and second user in firefox. I successfully chat between two user but when i click video it open only localstream remote stream not open.

kindly provide the reply what will be the issue

tx

@muaz-khan
Copy link
Owner

Actually renegotiation isn't yet supported in Firefox. When you add i.e. enable a stream, it (Conversation.js) performs renegotiation among peers.

Solution is: RTCMultiConnection should recreate peers instead of recreating offers/answers.

This issue will be fixed soon (in RTCMultiConnection). Conversation.js will be auto-fixed, because it runs top over latest RTCMultiConnection.js file.

@jigarrdesai
Copy link
Author

How we can get online user list using conversion.js

@muaz-khan
Copy link
Owner

Socket.io server side code:

var listOfUsers = {};
io.sockets.on('connection', function(socket) {
    socket.on('new-user', function(user) {
        listOfUsers[user.userid] = user;
    });

    socket.on('get-user', function(userid) {
        socket.emit('user', listOfUsers[userid]);
    });

    socket.on('get-list-of-users', function(userid) {
        socket.emit('list-of-users', listOfUsers);
    });

    socket.on('message', function(data) {
        socket.broadcast.emit('message', data);
    });
});

Socket.io browser side code:

var socket = io.connect();

socket.emit('new-user', {
    userid: 'someone',
    email: '[email protected]'
});

btnGetUserInfo.onclick = function() {
    socket.emit('get-user', 'target-userid');
};
socket.on('user', function(user) {
    alert('userinfo: ' + user.userid);
});

btnGetListOfUsers.onclick = function() {
    socket.emit('get-list-of-users', 'target-userid');
};
socket.on('list-of-users', function(listOfUsesr) {
    for (var user in listOfUsers) {
        user = listOfUsers[user];
        console.log(user.userid, user.email);
    }
});

// initializing constructor
var signaler = new Signaler();

// whatever sent from conversation.js
signaler.on('message', function(message) {
    // here, you received message from conversation.js
    // pass/emit message to node.js
    socket.emit('message', message);
});

// your socket.io listener that subscribes
// for all messages broadcasted from Node.js
socket.on('message', function(message) {
    // here, you received a message from node.js server
    // pass message to conversation.js
    signaler.emit('message', message);
});

// connect user to signaler
signaler.connect(user);

Otherwise, you can try "Search-Users" demo.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants