From ce31297837a52972000a2dee5e9da868c81c7c1c Mon Sep 17 00:00:00 2001 From: alexlapa Date: Sun, 16 Dec 2018 20:49:44 -0600 Subject: [PATCH 01/24] init --- docs/rfc/0002-webrc-client-api.md | 230 ++++++++++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 docs/rfc/0002-webrc-client-api.md diff --git a/docs/rfc/0002-webrc-client-api.md b/docs/rfc/0002-webrc-client-api.md new file mode 100644 index 000000000..2f730a8c8 --- /dev/null +++ b/docs/rfc/0002-webrc-client-api.md @@ -0,0 +1,230 @@ +- Feature Name: `client_webrtc_signalling_api` +- Start Date: 2018-12-13 +- RFC PR: (leave this empty) +- Tracking Issue: (leave this empty) + + + + +## Summary +[summary]: #summary + +Formalize communication protocol between client(browser, mobile apps) and media server regarding WebRTC connection management. + +## Motivation +[motivation]: #motivation + +WebRTC allows P2P data exchange, but WebRTC as a protocol comes without signaling. At a minimum signalling protocol must provide ways to exchange Session Description +data(SDP offer/answer) and ICE Candidates. But if you think about signalling protocol in terms of interaction with media server things are becoming more complicated. +You will need to express ways to: +1. Provide STUN/TURN servers. +2. Exchange some low-level media metadata(resolution, codecs, media types). +3. Allow more sophisticated track management(updating video resolution on preview/fullscreen switches, passing multiple video tracks with different settings). +4. Pass some user metadata to hook business logic on. +5. Build more complex connection graphs. +6. Dynamically cancel/begin media publishing/receiving. +7. Passing erros, connection stats messages. +8. Cover both P2P mesh and SFU scenarios. + +The protocol must be versatile enough to cover all possible use-cases. + +## Guide-level explanation +[guide-level-explanation]: #guide-level-explanation + +### What is `WebRTC Client API`? + +It is a part of `Client API` responsible for WebRTC connection management. You can find `Client API` on approximate architecture design. + +``` + .------------Server-----------. + : .-------------------. : + .--------------------------------------------+-----o Control Service : : + : : '--------o----------' : + : : | : + : : Control Api : +.--------Client-----------+------------------------. : | : +: .--------------------. : .--------------------. : .-Client-API--. : .-----------o------------. : +: : User Application o-' : Medea Web Client o-+--' '-+--o Medea Media Server : : +: : :----: o-+--. .-+--o : : +: '--------------------' '--------------------' : '----Media----' : '------------------------' : +'---------------------------------------------------' '-----------------------------' + +``` + +So, how it works from `Medea Media Server` point of view: +1. `Control Service` configures media room via `Control API`. +2. `Medea Media Server` provides all necessary information (urls+credentials) for all room members. +3. `User Application` passes credentials and other necessary stuff (like `