Video call
The documentation applies to: v0.8.0
Features list¶
At the moment, LET Portal only provides one-one video call. We don't have a plan for group call or meeting room. We are very appriciate if anyone can help us to build a draft version based on our source code.
Technical Detail¶
Different with chat function based on SignalR web socket, video call is more complicated and it isn't easy to understand and deploy. So that we take this section for explaining How to develop it.
WebRTC¶
WebRTC is a real-time communication for the web, it is an open-source and supported by many big technology companies. By default, it is built-in on most of browsers such as Firefox, Chrome, Safari. Therefore, LET Portal builds video call function based on WebRTC and combine with SignalR for authentication.
LET Portal flow¶
Let's take a look on the negotication flow
Rest of the flow is exchanging info via SignalR in the middle. SignalR, in this flow, takes a role as Authentication Provider and Connection Router for device-call-device.
- Validate JWT Token
- Send
connectionId
of caller and callee to another - Provide
STUN server
info which has been stored in the server-side - Maintain call state and prevent another incoming call from others
- Notify another when anyone drops a call
WebRTC P2P flow¶
After both users received STUN server
, they can create P2P connection and negotiate. We prefer to read this article for great explanation about WebRTC flow
STUN vs TUN server¶
The key different between STUN
and TURN
server is STUN
allows the media will travel directly between two devices (P2P) and TURN
acts as proxy to transfer media between two devices.
But what exact situation to use TURN
rather than STUN
, which seems to be better? The answer is it depends on your Network and Deployment model.
For example, if you have a plan to deploy whole LET Portal in private network, you don't want to be public this system. So that you want to create or hire one TURN
server because STUN
can't detect your devices because of Firewall.
If you want to create your own TURN server
, you can try this NodeJs server. Unfounately, .NET Core isn't providing any open-source TURN server
.
Deployment Note¶
If you know clearly about WebRT, STUN
and TURN
, so you can choose your deployment model when you want to bring Video Call works. We just take some important notes below:
- Is LET Portal deployed in Private Network, and all devices use private network as well? Yes, choose
TURN
otherwiseSTUN
- IS LET Portal deployed in the internet and all devices use private network, Firewall prevents
NAT
client? Yes, chooseTURN
otherwiseSTUN
- Where can I change
STUN
orTURN
server? You can change it on Chat's appsettings.json, sectionVideoCallOptions
- Where can find
STUN
servers in the internet? You can read this list
Public and Private
In term of network, public is a network which can be reached over the internet. Otherwise, private is a LAN network which can't be reached over the internet. In fact, you should choose TURN
server if your devices can't be detected by NAT
because Firewall prevents NAT
clients.