Group voice and video calls with MatrixRTC and LiveKit
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Test (windows-latest) (push) Canceled after 0s
CI / Storage tests on PostgreSQL (push) Canceled after 0s
CI / Complement (federation off) (push) Canceled after 0s
CI / golangci-lint (push) Canceled after 0s
CI / Smoke test the binary (push) Canceled after 0s
CI / Admin panel (push) Canceled after 0s
CI / Web client (push) Canceled after 0s
CI / Test (ubuntu-latest) (push) Canceled after 0s
CI / Test (windows-latest) (push) Canceled after 0s
CI / Storage tests on PostgreSQL (push) Canceled after 0s
CI / Complement (federation off) (push) Canceled after 0s
CI / golangci-lint (push) Canceled after 0s
CI / Smoke test the binary (push) Canceled after 0s
CI / Admin panel (push) Canceled after 0s
CI / Web client (push) Canceled after 0s
Every call in the web client now goes through MatrixRTC with a LiveKit
SFU, the model Element Call and Element X use; the legacy 1:1 m.call.*
calls are gone. In a room of two the other person is rung and can answer
or decline; in a bigger room a banner offers to join the call. Calls show
a grid of participant tiles with mute, camera, screen sharing and leave,
and media is end-to-end encrypted in encrypted rooms.
Server:
- MSC4140 delayed events (send/state with a delay, plus the
delayed_events list/restart/cancel/send API), stored and scheduled, so
a member whose client drops off is taken out of the call.
- POST /user/{userId}/openid/request_token, which lk-jwt-service uses to
hand out LiveKit tokens.
- org.matrix.msc4143.rtc_foci in /.well-known/matrix/client, configured
under client_api.rtc.
- Room presets let members send call membership state.
- Migration 0014 for both SQL dialects.
Deploy: LiveKit and lk-jwt-service in compose (calls.yml) and the helm
chart. Docs: docs/calls.md, configuration and deployment.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
325431a5be
commit
76dfc98a86
49 files changed
+3849
-432
No files matched your search
@@ -0,0 +1,51 @@
|
||||
package clientapi
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/dariuszjaniak/warp/server/internal/httputil"
|
||||
"github.com/dariuszjaniak/warp/server/internal/userapi"
|
||||
)
|
||||
|
||||
// rtcTransportsPath is MSC4143's endpoint for the group call backends a
|
||||
// client may use: the same list /.well-known/matrix/client carries as
|
||||
// org.matrix.msc4143.rtc_foci, behind authentication and without needing
|
||||
// the discovery document.
|
||||
const rtcTransportsPath = "/_matrix/client/unstable/org.matrix.msc4143/rtc/transports"
|
||||
|
||||
// RTCTransport is one group call backend: a LiveKit SFU, named by the JWT
|
||||
// service that hands out tokens for it.
|
||||
type RTCTransport struct {
|
||||
Type string `json:"type"`
|
||||
LiveKitServiceURL string `json:"livekit_service_url"`
|
||||
}
|
||||
|
||||
// RTCTransports lists the configured group call backends, or nil for none.
|
||||
func RTCTransports(liveKitServiceURL string) []RTCTransport {
|
||||
if liveKitServiceURL == "" {
|
||||
return nil
|
||||
}
|
||||
return []RTCTransport{{Type: "livekit", LiveKitServiceURL: strings.TrimRight(liveKitServiceURL, "/")}}
|
||||
}
|
||||
|
||||
type rtcTransportsResponse struct {
|
||||
Transports []RTCTransport `json:"rtc_transports"`
|
||||
}
|
||||
|
||||
// registerRTCRoutes adds the MSC4143 endpoint, if a backend is configured.
|
||||
// Without one it is left unregistered: the 404 is how a client learns there
|
||||
// is none.
|
||||
func (c *ClientAPI) registerRTCRoutes(r *httputil.Router) {
|
||||
if len(c.rtcTransports) == 0 {
|
||||
return
|
||||
}
|
||||
c.authed(r, "GET "+rtcTransportsPath, c.limitDefault, c.handleRTCTransports)
|
||||
}
|
||||
|
||||
// handleRTCTransports implements
|
||||
// GET /_matrix/client/unstable/org.matrix.msc4143/rtc/transports.
|
||||
func (c *ClientAPI) handleRTCTransports(w http.ResponseWriter, _ *http.Request, _ userapi.Authenticated) error {
|
||||
httputil.WriteJSON(w, http.StatusOK, rtcTransportsResponse{Transports: c.rtcTransports})
|
||||
return nil
|
||||
}
|
||||
Reference in new issue
Block a user