# Understanding webRTC

# webRTC and P2P communication


webRTC 로고

webRTC is an abbreviation of Web Real-Time Communications and means real-time communication using the web.
webRTC uses P2P communication, which is a network in which clients communicate with each other without a central server.
Therefore, it is necessary to find out the public network address of the personal computer and exchange data.
In an actual use environment, some computers have various security devices such as firewalls, so it may not be possible to connect between clients.
So we will use the TURN server to connect to each other.
So what is a TURN server?

# TURN Server

TURN 서버

TURN is an abbreviation for Traversal Using Relays around NAT.
Because direct communication between clients is difficult due to the above points,
the client sends data to the TURN Server, and then the TURN Server sends data to other clients.
In this way, each client communicates data via the TURN server.

# Learn more about webRTC

webRTC uses P2P communication and webRTC API.
vchatCloud uses an object called MediaStream of the webRTC API, which has real-time data streams such as cameras and microphones.
So you can watch live video simply by setting MediaStream in srcObject attribute of video tag.

If you want to check more details, please refer to MDN webRTC API (opens new window).

# vchatCloud video chat service

With vchatCloud, complex coding is reduced and simplified to use.
It notifies the user's media source addition or removal event in the video chat room,
and whenever there is a change in the user's camera, audio state, or media source,
the channel object of vchatCloud notifies you through the event.
Therefore, the desired function can be implemented simply, and it can be customized according to the user.
If you use the download type instead, you can change it according to the characteristics of the part you are using.

There are two ways to use vchatCloud's video chat, a code copy type (iframe method) and a download type.
If you use the code copy type, you can use it conveniently without coding knowledge, but it cannot be changed according to the user's characteristics.

Details on how to use it can be found in the next chapter.

Copyright 2022. E7Works Inc. & JOYTUNE Corp. All Rights Reserved.