Reputation: 650
What I am trying to do is to create a simple virtual classroom project like Adobe connect, but obviously simpler, using Flutter
and NodeJS
, and I need the following options:
As I searched so far I found that it seems WebRTC
works for video/voice streaming and also screen sharing as well.
Also most of the livechat projects using Socket.IO
.
My main question here is to know can I use only WebRTC
for both real-time video/voice streaming and also live chat as well? Is it a good idea or it's better to combine Socket.IO
and WebRTC
together?
Furthermore I want to know can I use each of those libraries for File-Sharing purposes?
Upvotes: 0
Views: 6211
Reputation: 381
For real-time video streaming wit WebRTC you need this elements:
As you see in this case you can use Socket.io but only for Emit Signals and ICECandidate.
Upvotes: 0
Reputation: 12405
Using WebRTC requires signaling server and signaling is often implemented using websocket, check this mdn article Signaling and video calling
And with websocket you can implement livechat too, so it is not an either or situation but both quite often.
Upvotes: 1
Reputation: 778
WebRTC gives you lower latency and a lot of functionality for conferencing out of the box. So for video/audio calls and screen sharing this is definitely a better choice.
Also, there's an option to use p2p communication which reduces latency even more and saves you resources on the server-side. Though if you intend to support many participants it looks less beneficial - you will need to maintain n-1
connections for each user if you have n
users in total.
For live chat, whiteboard and file sharing there would be no big difference in terms of performance. Things to consider:
can I use only WebRTC for both real-time video/voice streaming and also live chat as well
Yes you can, there's a RTCDataChannel interface for exchanging arbitrary data. It can be used for live chat / whiteboard / file transfer.
As a good example, there's an opensource project peercalls, that implements chat and file transfer via WebRTC through the same connection that is used for conferencing.
Websockets can be used for file transfer as well, check out this library.
Upvotes: 6