WebRTC for communicating

#1

Hello,

I’m the chief developer and CEO of Helper.World. I had the idea of a messenger that uses e-mails.
Hey, you had the same idea.

Now, I have the idea of integrating WebRTC into Delta.Chat like I did with Helper.World. We use WebRTC not only for video and audio, but for text messages, too. So my intension is to open a WebRTC channel by exchanging the ICE packages over e-mail. If this is done, chat will be much faster. And delta.chat will be able to support audio/video as well.

Tell me, what you think and I’ll try to contribute.

Greetings,
Heiko.

2 Likes
#2

Hello Heiko,

While WebRTC allows full blown communication features as real time video/audio it has one weak place: one have to use some STUN/ICE server, so devices can exchanges with IPs to be able to find each other and this would create dependency on this server.

Who will run this STUN server and take financial responsibility to pay for it?

#3

We use the stun servers of tilio (tilio.com). Stun server need only low bandwidth and low traffic. We do not use turn server, because than the traffic will be higher.

We have nearly no traffic on the stun server of tilio. We have an own stun server, too. I’ld sponsor a stun server for delta.chat. If traffic would be high so that tilio will close the free access and maybe our server is too small, then the webrtc feature would turn of until end of month.

Audio / video will work, too. And that’s no extra traffic for the stun server (it could be for a turn server, but I’ld prefer not to use one for financial issues).

I’ld see the WebRTC feature as addon. It’s nice, if it works and not necessary, if it doesn’t work.

#4

We could use open stun servers, too: https://gist.github.com/zziuni/3741933
Maybe this has to be discussed, because the stun server will know who is talking with whom, but not more.

We use the tilio list and our stun server right now. You can ask different stun servers on the same time and fetch the first result. So a list with open stun servers shouldn’t be a problem.

You can ask different stun servers each time, so that not one server knows all connections.

#5

hi Heiko,

welcome aboard :slight_smile:

in fact, we’re also thinking about webrtc in various ways, how they can be used and shared in a decentral way, and, of course, audio and video calls and file sharing. routing messages over this channel also sounds interesting, indeed.

currently, there is just no webrtc in delta chat at all, so every progress and contributions on this is welcome :slight_smile:

at least for the ui, the signal-messenger (also open source) might be a good start at least for android.

best,
björn

3 Likes
#6

Hello Heiko, agree with bjoern, sounds interesting and welcome :slight_smile: Our tentative ide was to allow configuring a WebRTC server for a Delta Chat app and to introduce UX to “share” (post) a webrtc config with chat partners so that they can also “use” it. Once configured one could perform WebRTC audio/video calls with chat partners even if the other side does not have webrtc configured. One could also setup a call with regular e-mail users (say someone using webmail), which would simply arrive as a webrtc link. If you want to start on this we could see if you could join one of our dev gatherings that we regularly do in Freiburg.

The topic of routing messages over WebRTC instead of e-mail i’d leave for later. There are several open questions (multi-device, device-to-device sync, …) and it’d be a somewhat major refactoring on the deltachat-core side which is also currently changing quite a bit in other ways.

cheers holger

2 Likes
#7

Hello Holger,

I’ll try to have a look on your code on weekend to see, if can contribute on the code.
Is see the WebRTC channel as an additional channel. So if it’s open, messages will be send with WebRTC and e-mail and the client shows the message it first gets. That’s how we do it on Helper.World. There must be an unique id for the messages so that now message is shown double.

Starting a WebRTC connection is no big deal for a web application. You just have to create an ICE per client (stun server) and send the ICE to the partner (as delta.chat message) and the rest is done by the webrtc library.

So. I’ll try to understand the current delta.chat code and see if I can do something about it.

Greetings,
Heiko.

#8

Are you using something like the jitsi Meet SDK in you app? It says the TURN server can be configured.

Here is some debian discussion about running a (decentral) TURN server behind a NAT https://salsa.debian.org/freedombox-team/plinth/issues/685

#9

And it will ruin two important unique features: everybody with an email can take part in conversation, all messages are in your email folder.

#10

If we would do it we would only do it opportunistically anyway to increase message delivery speed. So it wouldn’t affect that feature. So no worries :wink:

#11

If all received messages ends up in DeltaChat folder, than it’s cool! )

#12

That’s my idea.

2 Likes
#13

I was just trying Delta Chat yesterday and wondering about a WebRTC video call button, too. Right now, I can type something like https://meet.jit.si/WHATEVER, send that, and everyone on the email list will be able to join a WebRTC video call by clicking that link as long as their browser supports WebRTC or they proceed to install the Jitsi Meet app when prompted on iOS and Android.
Why not make a button that does that? A preference could allow the user to enter any Jitsi server. Another preference could allow supporting other types of WebRTC servers. The button could:

  1. Create a random Jitsi conference room link or allow the user to type their own. (Maybe random by default to make it easier?)
  2. Send the link to all recipients
  3. Auto-deep-link into the Jitsi Meet app so you’ll join the video conference room right away.

Is there any advantage to integrating video calling within the Delta chat app versus deep linking to a separate dedicated app like Jitsi Meet? I suppose it would mean one less app to download, but having it separate means you can switch video call providers more easily.

3 Likes
#15

For a first and quick start, I’ld prefer your idea.

The advantage of an own WebRTC channel would be, to transfer the whole chat over this channel as well. And you could do this without audio/video as well.

1 Like