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
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.
Related
I am trying to build a screen sharing app using electron js, webRTC , socket io and express.
Can please explain to me :
how can i send the MediaStream taken from the getDisplayMedia to the server through socket io … I have read articles about that and they explained that it is not possible to send it through websocket however we should use webRTCpeerConnection because the stream is live … Can you tell me more about this and i wonder if i can send video and audio tracks one by one throught web sockets if possible or if you have a solution for that using websocket instead of RTCpeerconnection .
Sorry for the long message, i will appreciate your help <3
I want to build an internet radio station using nodejs. My architecture needs to be like the following, there is one producer who records live audio, this live audio data needs to be sent to the server. On the server-side, I need to save the live streams of audio data in some audio format(for future playback) and also simultaneously stream the live audio to multiple clients. Can somebody please point me towards some implementations or library available to achieve this? I have read several posts and stackoverflow answers but couldn't find anything related to my need.
Is webRTC needed? I don't want clients to get peer to peer connection as I also want to save the live audio on the server. Please any help would be appreciated.
I'm trying to figure out how a chat app with lots of "rooms" would be implemented with nodejs and socket.io.
I know there are plenty of tutorials around for 1 room chats that run on 1 port, but my question is how would I transform something like that to support multiple chat rooms?
Would it require a different port per room? If so how would I get the server to sniff out open ports for this?.. or is there a better approach?
The target clients are native mobile sdks like iOS and android, so how would I get the server to open a room for a GET request?
Please excuse my noobness, I'm really trying to learn.
I have to point you to ActionHeroJS, namely the built-in chat server. This is accomplished with a single websocket port on the server, where each connection and each room is stored inside Redis. When a message is broadcast to a room, only those connections in that room get the message.
I might encourage you to try out the framework as an alternative to starting from scratch, but definitely look at the concepts as a way to manage a chat system at scale, beyond single-room-tutorials.
I am using WebRTC to make a audio, video and chat application. How on the server side we can check if the peer is still connected.
Actually, I want to check before making audio/video call that the other user end is still connected. I am able to maintain Presence (i.e online/offline) when user logs in or logs out of the application.
Suppose, the network connection drops or got disconnected, I am not able to get any information on the server side. If I can get, then I can communicate to rest of the peers connected.
So, need help how to get the information if the peer is still connected or not. I am using Nodejs and WebRTC in my application.
Socket.IO has a concept of 'rooms' that makes it very handy for building WebRTC signaling servers, and a disconnect event fired when a user disconnects. You can also set up a custom event to be emited when, for example, a user stops a video stream or leaves a page.
You might want to take a look at the codelab at bitbucket.org/webrtc/codelab, which uses Socket.IO for signaling. (Apologies, once again, for shameless self promotion!)
You would need to implement your own logic to do that.
Since you already have the client registering presence you could:
maintain a persistent connection via websockets
implement a polling/keep alive algorithm between your clients and server
I was going through some article and found that chat Clients are mostly p2p. If Google Talk is a p2p client then how is it able to save our chat in Gmail ?
The simple answer is that the audio is streamed from browser to browser without any server in between using the Jingle protocol.
So things like text chat and audio chat is peer-to-peer whereas all other functionality is provided by Google servers.
he chat it self uses Jabber (XMPP), but conversation logs are automatically saved to a Chats area in the user's Gmail account. This means that chats involve three parties (your computer, your mates computer and Googles Gmail server cluster)