0

I'm building a video chat website and i got stuck on the video steaming. The Local video is working but i can't get the peer to peer connection between them. I've checked out some examples on the web but those are not where i'm looking for. because they only work when you have a local stream.

I've a page for this chat so no rooms are necessary the user needs to connect immediately but only with text chat and users who share their webcam. 16 users can share their webcam and 'unlimited' users can join the page and see those 16 users and chat in text. the text chat goes via socket.io on a node.js server.

is it possible to realize this and if it is can someone please help me out on this or give me a useful example

Edit 1: My code so far

rtc.connect('ws://127.0.0.1:3000');

function joinVideo(){
    console.log('test');
    rtc.createStream({"video": true, "audio":false}, function(stream){
        // get local stream for manipulation
        rtc.attachStream(stream, 'local');
    });
}

rtc.on('add remote stream', function(stream){
    // show the remote video
    rtc.attachStream(stream, 'remote');
});

Thanks anyway, Stefan

  • Please describe in more detail what you are trying to accomplish. Are you trying to establish a direct peer-to-peer connection where you can stream video from one client directly to another (without going through an intermediary server)? – jfriend00 Mar 01 '15 at 02:15
  • i want a direct communication between browser and browser. i've looked into WebRTC. but i can't setup what i need. if someone has a good tutorial or step by step guide i think i can make it work – Stefan Fransen Mar 01 '15 at 14:18
  • now i have tried easywebrtc and it kind of works. i join the page 2 times a one with video one without. and that works. but when i start the stream on the other page the other video stopped working. post the code i've now under Edit1 in the main post – Stefan Fransen Mar 01 '15 at 15:49

1 Answers1

1

If you are trying to set up video chat between peers, check out Icecomm (http://icecomm.io/). It is a wrapper for WebRTC and you'll be able to exchange streams for your multi-person conferencing app in less than a dozen lines of code.

Alex Zai
  • 119
  • 2
  • 4