rabbit_rabbit
rabbit_rabbit13mo ago

In browser video chat client & server

Hello! How might people go about architecting an in-browser video chat client & server, specifically wanting to stream the client's camera feed to a server I'm hosting. On the client side it seems I can use https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia to get the camera and audio streams. How do I go about piping those streams to the server in a performant way? Unless I'm totally off base, there isn't an in-browser API to send arbitrary UDP packets https://gafferongames.com/post/why_cant_i_send_udp_packets_from_a_browser/, so are websockets the best option here? On the server side are there good libraries to receive packets with video & audio data and relay them onto another client? If it helps, other specs are that this will be deployed in a low-bandwidth setting (Zimbabwe specifically). Expectations around video quality will be low, so even going to 144p super grainy video is ok. Frankly, if we could reliably capture audio data, that's most important. Thanks so much in advance!
MediaDevices: getUserMedia() method - Web APIs | MDN
The MediaDevices.getUserMedia() method prompts the user for permission to use a media input which produces a MediaStream with tracks containing the requested types of media.
1 Reply
𝕒𝕣𝕤𝕙
𝕒𝕣𝕤𝕙13mo ago
you should look into webrtc the user sends video directly to the user on the other side the server only helps setting up the connection between them