How to implement group calls: integrate Jitsi or something

This is a proposal on how to implement Add support of Call 📞 in Group.

Why

There are many “group call” applications, so it’s basically a solved problem. All we need is to integrate such a solution, instead of inventing our own. We have GitHub - deltachat/calls-webapp: P2P videocalls via WebRTC for integration into Delta Chat · GitHub, which used to be used by Delta Chat all platforms (now used only by desktop and deltatouch), then android and ios migrated to their own native implementation, totaling a thousand lines or two.
And implementing group calls on top is a whole different beast.
And then we’re gonna be getting feature requests for screen sharing, switching sound devices, toggling noise suppression, etc etc.
I mean just look at the size of the Jitsi repo. It has more commits than Delta Chat Core.

How

As I recently discovered, Element Web (which is also Element Desktop) has a Jitsi integration.
FYI Jitsi has a native Android and iOS apps.

There is also this repo GitHub - element-hq/element-call: Group calls powered by Matrix · GitHub which is actively developed.

I have not figured out if they use an existing implementation on Android and iOS or if they’re simply implementing the same protocol.

I know that integrating big project is usually a pain, but at least on Desktop I don’t imagine it being too painful, since we know that Jitsi runs in a browser fine, and DC desktop is an Electron app.
All we need is to implement signaling.

A good first step would be talking to the Element people and asking them about their experience with Jitsi, and about their element-call repo.

I think the project used to use Jitsi and then moved toward a more “native” solution. See how TURN is included in chatmail now GitHub - chatmail/chatmail-turn: TURN server for chatmail relays · GitHub

Are you talking about Delta Chat? It used to use Jitsi (and similar services) but not in an integrated way, i.e. it would simply generate links to a Jitsi web instance. See What happened to Video Chat?.

Yeah, and they moved to more of a native style integration with chatmail. Use webrtc directly.

You’re suggesting they go back to relying on Jitsi again?

Not “back”, but integrate Jitsi’s code which will use WebRTC directly.

Jitsi Meet server even a whole XMPP server inside. For group calls you only need an SFU on the server side, e.g. Jitsi Videobridge, not the whole Jitsi Meet server.

Jitsi integration in Element likely has no E2EE. Jitsi has some experimental E2EE implementation, but is it enabled in Element?

If you are fine with no E2EE, but want screen sharing and other features, then sending a Jitsi Meet link into the group in good enough.

Otherwise need to setup SFU and build the client side part into the apps. Or do P2P group calls, they are good enough for small groups, e.g. 2-4 people call.

My vision so far is that we don’t need SFU (full mesh is probably fine), and don’t need to have a server that is specific to our “calls” integration, i.e. server-side don’t introduce anything besides what we already have, i.e. TURN.

Interesting. TBH I haven’t investigated the architecture of Jitsi, and in this context I use Jitsi as just “an existing mature app that works on WebRTC and supports group calls”.
E2EE IMO is a must-have.
So it might turn out that Jitsi is actually not super suitable for my idea.
But the idea is: use an existing implementation.

this feature request is not related to group calls.

i’ve heard that for one-to-one-calls a lot as well (and i would also like that personally)

apart from that i am sceptical that “jitsi or similar” fits well to what ppl want to have for “messenger style calls”, having usually a much simpler UI. element is not necessarily a good example, it wants to be more a replacements for discourse, slack etc. but maybe there is also an “existing implementation” or library that we can use or adapt to our needs. let’s see and reconsider when it actually comes to implementing group calls. currently we’re still busy getting things for one-to-one-calls stable :slight_smile:

I pretty much only use DC for a couple groups (family mostly). So ironically I don’t have much need for one on one calls, only group calls!

In some sense, if you design for group calls, don’t you get one on one for free?