sequence diagram for typical webrtc use cases (like text, video, audio ) - webrtc

I hope my question is legit... I am asking this question because after 1 week reading many blogs, playing with many sample apps, and the official API, I am still very confused, and where to start the coding...
Overall, in term of system architecture between browers <-> web servers <-> Signaling servers, etc.. I got it clearly since there are tons of diagrams out there. But I cannot get myself confidence with the coding, all those classes and methods and events... such as RTCPeerConnection Interface , RTCDataChannel, signalingState , etc...
A sequence diagram for "Alice text/video call Bob" would be very helpful for the coding. If N/A I will make one myself and share in answer section

http://www.w3.org/TR/webrtc/
See the section: 10.4 Call Flow Browser to Browser
It is a complete workflow diagram, including all the webRTC internals topics, like PeerConnections, media description, offer, answers, etc.

This slide might help:
http://www.slideshare.net/alexpiwi5/overviewpeerconnectionlifetime
you have on each side of the central row the sequence of the JS API you need to call.

Related

What are the WebRTC samples at https://webrtc.github.io/samples/ supposed to do?

I am trying to work with the WebRTC samples from https://webrtc.github.io/samples/.
IIUC, these should be quite up to date and original minimal samples that will help to understand the technology.
So I am looking for example at https://webrtc.github.io/samples/src/content/peerconnection/pc1/
which is supposed to be Peer Connection Demo.
Despite this is supposed to be Peer connection demo, all it does is to show me my own camera on one machine. Even if I start it on two machines, I see my own camera picture on each one.
If I read the code, I can find hints that this is supposed to make a connection between two machines, yet I fail to understand how. Nowhere on the site it is asking for a peer name, room name or anything which would identify the other party to call.
Am I missing anything here.
I know there are plenty of other WebRTC conference solutions out there on the web for demo purposes, but they all are so much more complex. I am looking for a simple 1:1 demo with source which will allow be to embrace the concept.
Look at the companion project apprtc or steps 7 and 8 of the WebRTC codelab
Having a "peer" requires an enormous amount of effort such as running a signaling server. The samples project only aims to demonstrate how to use APIs and does avoid the signaling topic by calling the API functions on another object in the same page.
I changed the demo code myself on: http://wx.qibu.net.cn/home/demo, using signalR for websocket. you can run it between different PC
The demo code should be separate and use stun and turn servers if necessary

How to test communicator (video, sound, microphone) implemented by using WebRTC

On my current job, we are developing an application that uses WebRTC technology.
And we want to test the work of our application with 30 users in real time -- a conference call with video, sound, and microphone (and everything must work). We know that we can do it by real users (real users connected to our application).
Question is: How to test our requirement if we don't have such a number of real persons? Maybe exists some tool for that.
Thanks.
You'll need a Selenium Grid.
And you'll need to build the automation part on your own on top of it.
Alternatively, you can check out https://testrtc.com -- it enables automating 100's of browsers and more with a focus on WebRTC based services.
I am the co-founder, so take this with a grain of salt
That said, I am not aware of any other commercial tool or otherwise that makes this as simple and straightforward
You have two peer-reviewed IEEE scientific articles that were written on WebRTC testing state of the art this year. They both list and compare several solutions including but not limited to testRTC cited in the other answer.
On July 2017, "WebRTC Testing: Challenges and Practical Solutions" was published in an IEEE venue by the Kurento / Twilio team, and lead by the Spanish researchers that did not join Twilio but went on to start ElasTest, a millions-Euros, EU-funded project that looks very promising but is still in alpha stage.
http://ieeexplore.ieee.org/document/7992926/.
On September 2017, "Real-time communication testing evolution with WebRTC 1.0" was published in Principles, systems and Applications of IP Telecommunication by the CoSMo team behind the original Temasys infrastructure, the symphony solution, and the new Google Testing Engine (KITE). It is a full paper about the state of the art Before google decided to go for KITE, and include a thorough review of all possible testing layers, and existing solutions. There are many solutions to do what you want today. If you need an on-premise solution, and/or test mobile browser, and/or test native apps, IoT, ... AFAIK testRTC.com will not help you, however good for other aspects.
http://ieeexplore.ieee.org/document/8169751/.
You might want to read both articles, and citation therein before you make your choice.
Disclaimer: I am the original author of that last publication.

Does ORTC and/or Edge support DataChannel?

Finding definitive information on ORTC seems difficult, and finding examples even more so. I need to send strings between iframes and was looking into using WebRTC but in order to support Windows Edge I have been looking into ORTC. I wanted to see if anyone had successfully used some sort of data channel with ORTC in Windows Edge. I thought ORTC was specifically for Edge but it seems to define a data channel but Edge does not implement it.
The information I have come across leads me to believe that ORTC cannot do data channels, despite the fact it is listed in their API.
RTCDataChannel defined in the API, section 11.3 http://publications.ortc.org/2016/20161202/)
The RTCDataChannel interface represents a bi-directional data channel between two peers.
But at https://learn.microsoft.com/en-us/microsoft-edge/dev-guide/realtime-communication/object-rtc-api I found:
Since Microsoft Edge does not implement the data channel, the RTCDataChannel and RTCSctpTransport objects are not supported.
and
Microsoft Edge currently does not support any of the DataChannel functionality currently defined in the ORTC spec.
Please offer additional resources I can research in order to have a definitive answer. Also helpful would be any resources stating whether Windows Edge will in the future be supporting this.
According to their roadmap, ORTC Data channels are "Under consideration".
Roadmap Priority: Low — We are still evaluating this technology. There
may be significant spec stabilization, foundational work, or
additional community input required before we can begin development.
But the real question is:
Why do you need webRTC in the first place?
You said that you need to send strings between iframes.
Are the iframes loaded on the same page?
If the answer is yes, you don't need webRTC at all. Take a look at the postMessage API instead.

How does "Follow Chess" stream live chess games?

The app is available at https://play.google.com/store/apps/details?id=com.pereira.live - this is a very popular app, but I"m not sure how the app gets live scores. I've searched all over the internet but cannot find any API that streams this
Well, first of all it, it might not be a public API. Quite possible that Fallow Chess agreed with chess24.com for cooperative work and the API is protected. The things you can do:
You can sniff your Android network traffic and see where the requests are going. Still if it is not public API, you can't use it.
The other thing you/they can do (which regarding to some terms and laws might be illegal !!) with a web crawler to fetch/process the data from the site and send it to the app. Firebase is a great technology for such cases.
The implementation is very simple... If there is a way that they can fetch data from external sources, they'll do it. Otherwise, they'll do the moves manually. Follow Chess is managed by a small team of Indian developers. They can just sit and relay the moves during the games.
PS: Follow Chess is not very popular, in particular when you compare it with what chess24 can offer.

In what forms do APIs come in, and how to write them?

APIs are getting more and more popular and are used by developers to ease the process of developing applications to multiple platforms AND allow them to give other developers the ability to integrate their application's functionality into their own applications.
I've used APIs countless times before, but I'm now at the stage of developing my own applications. And as a developer who strives to create multi-platform applications - I need to use an API.
I'm going to use the RESTful approach as it's recommended the most.
After reading and looking for some background information, I came across: REST API Tutorial (which is really good site!), I learned that APIs basically receive HTTP requests, and return data in JSON/XML format.
However, there were 2 questions left unanswered to me:
In what form do APIs come in? Are APIs actually files? a set of commands......?
How do I actually write APIs? I'm talking about the server-side, data-handling code, and not the application/language-specific code (for sending out HTTP requests etc...)
It'd be great if someone could help me and answer the questions above as I have zero experience with APIs.
Any help is appreciated - much thanks!!
Just a quick from-the-gut answer: They are whatever you want them to be!
Off the top of my head, I would define an API as requiring two main elements:
Some documentation which makes it quite clear how to use the logic your systems prvides
Some way to call those systems. That may be as simple as a web-site that accepts POST-messages, and checks them for certain variables and values in order to perform specific tasks.
In short, it should be entirely up to you. Just make sure you provide simple, clear and acurate documentation.
UPDATE, as an asnwer to the comment below:
That is how I interpret it, and it would seem that Wikipedia is more or less in agreement with me. PHP would be a perfect example: You could for instance create a PHP-file which processes a POST, and instead of outputting html, outputs XML with the resulting data needed. Then a third party app could POST to your PHP application, and receive and process the resulting XML.
Apis come as a response to a http request. It is a plain text response that u can use encoded via json or xml as you described.
There are a plenty of frameworks to help you develop and API.
In Ruby u can use grape or rais-api or even rails itself.
There is a lot more available, but this are the ones im most used to use.