Thank you for using the iConfRTC SDK
The iConfRTC SDK is a .NET SDK that allows you to easily create video chat enabled applications or integrate video chat capabilities into existing desktop ( and soon mobile ) applications, using WebRTC.
Getting started
The easiest way to get started is to access the demo applications that already use the iConfRTC SDK, these are located on github.
A Windows Forms application
https://github.com/avspeed/webrtc-Windows-Forms-Test
A WPF application
https://github.com/avspeed/wecbrtc-WPFDemo
Both demo applications ( just like the iConfRTC SDK ) were created using Visual Studio 2017
WebRTC dictates that in order to communicate, a mechanism is needed to coordinate communication and to send control messages, a process known as signaling.
The iConfRTC SDK can use both socket.io and signalR for signaling.
The demo application connect to a hosted nodejs socket.io based server running on a Windows Server VM. Please note that our signaling server can be used for demo purposes but for production purposes, you should host your own signaling server.
The socket.io signaling server used by the demo applications can be found on github
https://github.com/avspeed/RTCSignaling.io
When you setup your own server, point the SignalingUrl property to the RTCControl to the new server. For example for the socket.io server
rtcControl.SignalingUrl = @"192.3.24.139:8080/";
Connecting users
Connecting users is a fairly simple process.
In order to be in a video/audio call with someone, you both need to be in the same "Meeting"
A user joins a meeting using a meeting ID and a user name. If the meeting does not exist, it will be created. If the meeting does exist, the user will join the meeting.
Once you enter the meeting, if any one else joins, you can see/hear the other person and the other person can see/hear you.
//Important! Initialize the WebRTC Engine
RTC.Init()
//setup the signaling
rtcControl.SignalingURL = @"xxx.xxx.xxx:8080/";
rtcControl.JoinMeeting("your_unique_meeting_id", "patientname");
Upon successfully Joining the meeting, an event will be triggered
rtcControl_UserJoinedMeeting(object sender, UserArgs e)
{
//the new peer session available event is fired
//a peer joins your meeting or when you join the meeting
ProcessParticipants(e.Participants);
}
private void ProcessParticipants(List<MeetingParticipants> participants)
{
//when a user joins a meeting we receive a list of meeting participants ( including yourself )
//we go through the list , create viewers (RTCControls) for each participant and call ViewSession,
//passing along the participant's sessionId
foreach (var participant in participants)
{
if (participant.Session != iconfRTC.MySession) //you are already seeing yourself :)
{
bool sessionExists = currParticipants.Any(p => p.Session == participant.Session);
if (!sessionExists)
{
//here we basically create anew instance of the RTCControl
//and in this case add a panel to a panel viewer to host that new instance
var viewer = new RTCControl
{
SignalingType = SignalingTypes.Socketio,
SignalingUrl = rtcControl.SignalingUrl,
Dock = DockStyle.Fill
};
var pnlViewerParent = new Panel
{
Tag = participant.Session,
Width = 480,
Height = 360
};
pnlViewerParent.Controls.Add(viewer);
pnlViewerParent.Visible = true;
pnlLayout.Controls.Add(pnlViewerParent);
currParticipants.Add(new CurrentParticipants { Session = participant.Session, UserName = participant.UserName, PanelLayout = pnlViewerParent, RTCControl = viewer });
//only call webrtc functions when WebRTC is ready!!
viewer.RTCInitialized += ((a =>
{
//you can add additional ice servers if you'd like
// viewer.AddIceServer(url: "numb.viagenie.ca", userName: "support@avspeed.com", password: "avspeedwebrtc", clearFirst: false, type: "turn");
//viewer.AddIceServer("stun.voiparound.com");
//webrtc is ready, connect to signaling
viewer.ViewSession(participant.Session);
}));
}
}
}
}