# Proof-of-concept: Web based Jamulus client

Posted at https://github.com/jamulussoftware/jamulus/discussions/2039(opens new window).

# Video

First, here’s a demo:


# Quick facts

# How it works

There are 3 main components:

  1. Jamulus server.

  2. WebRTC-UDP gateway.

    • Source code: https://github.com/dtinth/rtcjam
    • It should be run on the same server as the Jamulus server. It does nothing more than providing browser access to Jamulus server over a different transport layer.
    • Since it will run on a publicly-accessible server, there will be no need to use STUN/TURN solutions.
    • Once a WebRTC connection is established, all data will be forwarded to localhost:22124 (and vice versa).
  3. Web-based Jamulus client.

# Limitations of the POC

  • Right now it can only receive audio, as the encoder has not been implemented yet. The PoC is hardcoded to send silent Opus frames to the server.
  • The PoC is hardcoded to use Stereo High Quality mode with 16 frames of jitter buffer. Client name is hardcoded to WebJam.
  • Memory and CPU usage is very inefficient — a lot of clones and byte-by-byte operations in JavaScript. Safari on my iPad Pro (2015) crashes (page is forced to reload) after 1 minute of usage 😂. But I believe this can be improved by putting more things in WebAssembly, e.g. Jamulus protocol handler, jitter buffer, etc. There is a tutorial on using WebAssembly with AudioWorklet on Google Developers(opens new window)
  • The gateway server currently has no security mechanism at all; it accepts and forwards incoming UDP packets from any host (not just the target server).

Note: I have no intention to develop this any further. All this is just to satisfy my curiosity. However, I think it can be a good starting point to expand Jamulus to the web platform if anyone wants to pursue this goal.