3 ms·
WebRTC doesn't do everything for you; it's really just responsible for tying together ICE with media streams. Signaling is up to you to figure out. For instance
by bkanber 6y ago
WebRTC doesn't do everything for you; it's really just responsible for tying together ICE with media streams. Signaling is up to you to figure out. For instance, multiple clients in one room: this is part of the signaling layer and is not WebRTC's responsibility (I built this into zonko.chat if you want to see how it works though).
Closing and restarting connections is signaling layer stuff, ie your responsibility.
Echo cancellation is really supposed to be application layer and up to you as well, but I think this will probably shift to be the browser's/WebRTC's/getUserMedia's responsibility at some point.
Re. TURN: ICE is the process that works out whether a specific client needs to relay through a TURN server. The question is: do you need to implement a TURN server? The answer is: yes, you need a TURN server. If you built a P2P app that you want to work for all users, you will always need a TURN server. You can run coturn on the same box that you serve your app from. Most likely a side project will never hit the scale requiring more than a $5 digitalocean box for TURN.
And yes, it should not be a surprise that products are time consuming to build :) WebRTC is plumbing; you probably were expecting something more like Jitsi.
- mebeam 6y agoFYI, echo cancel actually does work ( chrome definitely ), just make sure you specify the audio constraint so that it has a sample rate of 16khz ( aec does not work on the default 44/48khz modes )
- bkanber 6y agoGood suggestion, I will have to try that out!
- algesten 6y ago> Echo cancellation is really supposed to be application layer and up to you as well, but I think this will probably shift to be the browser's/WebRTC's/getUserMedia's responsibility at some point. Echo cancellation typically can't be application layer. The APIs I've seen (Android, iOS, WebRTC), require low level latency and works best as close to hardware as possible. { echoCancellation: true } as a track constraint in getUserMedia works.
- bkanber 6y agoI've never actually gotten { echoCancellation: true } to work for me, but your sibling comment does have a suggestion I need to try out! Echo cancellation is a pretty lightweight DSP/FIR task. Whether you do it close to the hardware (? I suspect this is not actually the case with getUserMedia though -- it is still an audio stream algorithm) or in the application layer, echo cancellation requires the same amount of added latency. But in any case, I did say I suspected echo cancellation would shift to getUserMedia. It's not fully there yet, but it will be.