Initially WebRTC technology was designed for establishing direct connections between web browsers, like it is shown onthe picture below.
The signaling server here is not a part of WebRTC engine, but it is required to initiate the connection and resolve firewall bypassing issues.
We adopted this scheme for MPlatform and MFromats SDK and created the MWebRTC object. It can act as a WebRTC streaming or receiving client. Check this article to get the idea how to use MWebRTC object: [http://docs.medialooks.com/a962d7/ How to get started with WebRTC] .
Here is how it works:
As you see you need to have a signaling server and HTML pages except of MPlatform or MFormats based application to play around with WebRTC.
We have 2 ways to deal with signaling server and test pages:
- The easy one
Go for it if you want to test the WebRTC logic and don't want to spend time for deploying signaling server and HTML pages.
Use our demo signaling server.
It is available here: https://rtc.medialooks.com:8889
It is set by default for all MPlatform and MFormats objects, so if you've just installed the SDK and using our sample applications, there is no need to do anything else.
- The expert one
Go for it if you want to use your own signaling server and deploy HTML pages on your own web server.
Step 1: Run your own signaling server.
Signaling server source code is available in installation package:
- MPlatorm SDK: "C:\Program Files (x86)\Medialooks\MPlatform SDK\Samples WebRTC\SIGNALING SERVER"
- MFormats SDK: "C:\Program Files (x86)\Medialooks\MFormats SDK\Samples WebRTC\SIGNALING SERVER"
We use [https://github.com/andyet/signalmaster Signalmaster], a Node.js-based signaling server, with some minor modifications. It helps to establish a peer connection between the MWebRTC object and the browser or another MWebRTC object.
To run your own server you need to:
- Install Node.js engine: https://nodejs.org/en/download
- Open a command prompt and navigate to the folder with signaling server (e.g "C:\Program Files (x86)\Medialooks\MPlatform SDK\Samples WebRTC\SIGNALING SERVER").
- Run "npm install" (Windows user might previously want to install Visual Studio 2013/2015 to avoid missing dependencies during this step).
- Generate test self-signed SSL certificate (cert.pem, key.pem) to allow secure communication with your signaling server and put it in "C:\Program Files (x86)\Medialooks\MPlatform SDK\Samples WebRTC\SIGNALING SERVER\config\sslcerts" folder. Windows users can do it by using OpenSSL like described [https://msol.io/blog/tech/create-a-self-signe.../ here].
- Run following in command line :
Set NODE_ENV=production
6.start the signaling server
node server.js
Once you're done with signaling server setup, don't forget to specify signaling server IP in your applications, by default after SDK installation all MWebRTC object will using https://rtc.medialooks.com:8889
[HKEY_CURRENT_USER\SOFTWARE\Medialooks\WebRTC]
signaling_server = https://rtc.medialooks.com:8889
All local WebRTC objects will use this signaling server address by default.