Voice calls and audio rooms in a web app: how they work
A voice call is a WebRTC call with a microphone and no camera. An audio room is a group call where a few speak and the rest listen. What each needs, measured.
Blog
What we are building into WordPlus Cloud, and how to get the most out of realtime on your site.
A voice call is a WebRTC call with a microphone and no camera. An audio room is a group call where a few speak and the rest listen. What each needs, measured.
Node.js has no RTCPeerConnection of its own. It serves WebRTC as the signaling server, or joins a call through an npm package. Tested code for both.
Python takes part in WebRTC in two ways: as the server that connects browsers, or as a peer of its own with aiortc. Tested code for both, and when each fits.
A video call in JavaScript is getUserMedia, RTCPeerConnection and a signaling channel. Working code for two browsers, and what a real app adds to it.
Free STUN servers are easy to find, free TURN servers are not. What each kind of free relay gives, its catch, how to run coturn and how to test any of them.
Every live streaming API shows a player. Ten questions that tell them apart: how far behind live viewers are, what the bill counts, who may watch, the chat.
Every video call API lists HD and screen sharing. Ten questions that tell them apart: does every call connect, what the bill counts, who sees the media.
Feature lists look alike. Ten questions that tell chat APIs apart: where messages are kept, what the bill counts, who can read them, what a reconnect loses.
PHP answers a request and ends, so a websocket in PHP needs a server script that never stops. What running one takes, and how to send live events without it.
A websocket server in Node.js is fifteen lines with ws. What a second process or server changes, what running several takes, and how to send events without one.
The ports a WebRTC video call uses: the page, STUN, TURN over UDP, TCP and TLS, and the media itself, with what a firewall must allow and how to test a network.
Why a WebSocket connection fails and how to find out: test the address, read the close code, check the handshake, and fix proxies, origins and timeouts.
Why a WebRTC call fails to connect and how to find the cause: blocked UDP, symmetric NAT, a missing or broken TURN server, and what to log on each side.
Test your microphone in one click, then fix what stops it: a blocked site, your system's settings, a muted input, the wrong device or a Bluetooth headset.
Test your camera in one click, then fix what stops it: a blocked site, your system's settings, another app holding it, a black picture or the wrong device.
How to test a TURN server step by step: check that it answers on each port, accepts your credentials and really relays data, with errors 401 and 701 explained.
How websockets work in Python, why Django and Flask on WSGI cannot hold them, what running your own takes, and how to send live updates from a view instead.
How to estimate what group video calls cost: participant minutes, how size and length multiply them, video and audio, connections, and a worked month.
How web push works, why a WordPress site struggles to send it alone, and how to reach members on computers, iPhones and Android phones with the site closed.
What a live online community in Next.js needs, from channels with photos to voice rooms and live events, each part built in a real club, with code and a demo.
What a private video consultation needs, from booking and a waiting room to a visit encrypted end to end, built in a real Next.js site, with code and a demo.
What buyer and seller chat in a Next.js marketplace needs, from who may read a conversation to photos and offers, each part built in a real marketplace.
What video meetings in a Next.js app need, from who may join to the host's controls, each part built in a real team intranet, with its code and a live demo.
What live streaming in a Next.js app needs, from going live to viewers on stage, each part built in a real live classes site, with its code and a live demo.
Why calls between people far apart lag, and how relays and media servers in several regions keep each person close to a server, in one call.
Why FastAPI websockets break with more than one worker, what shared pub/sub and sticky sessions take, and how to send live updates without a websocket server.
What a video call in a Next.js app needs, from ringing to relays and who may call whom, each part built in a real dating site, with its code and a live demo.
Why a Next.js app on serverless hosting cannot keep a websocket open, what polling, streams and a server of your own cost, and how to add realtime without one.
How realtime and video call services count what they bill, what a chat of 1,000 users online adds up to under each model, and what to check in any price list.
Laravel broadcasting needs a websocket server beside your app. What running one takes, and how to keep your events and Echo while a cloud holds the connections.
Why a WordPress host cannot keep websocket connections open, what polling and a websocket server of your own cost, and how a realtime cloud does it instead.
What a signaling server does, why mesh calls stop at a few people, and how SFU media servers carry group video calls, end to end encryption included.
What STUN and TURN servers do for a WebRTC video call, what running your own TURN server takes, and what to do when even a relay cannot connect a call.
WordPlus Cloud now speaks the Pusher Channels protocol: plugins built for Pusher connect with our hosts and the keys of your site, on your subscription.
WebSockets, 1-to-1 calls, group calls and live streaming from one cloud, for every plugin on your WordPress site and for your own apps.