mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-20 20:49:20 +00:00
Compare commits
2 Commits
valere/pla
...
robin/in-c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
564349c96f | ||
|
|
8bf81defd4 |
17
.github/workflows/blocked.yaml
vendored
17
.github/workflows/blocked.yaml
vendored
@@ -1,17 +0,0 @@
|
||||
name: Prevent blocked
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, labeled, unlabeled]
|
||||
jobs:
|
||||
prevent-blocked:
|
||||
name: Prevent blocked
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: read
|
||||
steps:
|
||||
- name: Add notice
|
||||
uses: actions/github-script@v7
|
||||
if: contains(github.event.pull_request.labels.*.name, 'X-Blocked')
|
||||
with:
|
||||
script: |
|
||||
core.setFailed("PR has been labeled with X-Blocked; it cannot be merged.");
|
||||
10
.github/workflows/build-and-publish-docker.yaml
vendored
10
.github/workflows/build-and-publish-docker.yaml
vendored
@@ -26,11 +26,11 @@ jobs:
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- name: 📥 Download artifact
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
run-id: ${{ inputs.artifact_run_id }}
|
||||
name: build-output-full
|
||||
name: build-output
|
||||
path: dist
|
||||
|
||||
- name: Log in to container registry
|
||||
@@ -42,16 +42,16 @@ jobs:
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804 # v5.7.0
|
||||
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
tags: ${{ inputs.docker_tags}}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
||||
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
|
||||
uses: docker/build-push-action@b32b51a8eda65d6793cd0494a773d4f6bcef32dc # v6.11.0
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
26
.github/workflows/build-element-call.yaml
vendored
26
.github/workflows/build-element-call.yaml
vendored
@@ -5,10 +5,6 @@ on:
|
||||
vite_app_version:
|
||||
required: true
|
||||
type: string
|
||||
package:
|
||||
type: string # This would ideally be a `choice` type, but that isn't supported yet
|
||||
description: The package type to be built. Must be one of 'full' or 'embedded'
|
||||
required: true
|
||||
secrets:
|
||||
SENTRY_ORG:
|
||||
required: true
|
||||
@@ -29,26 +25,14 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- name: Yarn cache
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
|
||||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
|
||||
with:
|
||||
cache: "yarn"
|
||||
node-version-file: ".node-version"
|
||||
- name: Install dependencies
|
||||
run: "yarn install --frozen-lockfile"
|
||||
- name: Build full version
|
||||
if: ${{ inputs.package == 'full' }}
|
||||
run: "yarn run build:full"
|
||||
env:
|
||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
||||
SENTRY_URL: ${{ secrets.SENTRY_URL }}
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
VITE_APP_VERSION: ${{ inputs.vite_app_version }}
|
||||
NODE_OPTIONS: "--max-old-space-size=4096"
|
||||
- name: Build embedded
|
||||
if: ${{ inputs.package == 'embedded' }}
|
||||
run: "yarn run build:embedded"
|
||||
- name: Build
|
||||
run: "yarn run build"
|
||||
env:
|
||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
||||
@@ -58,9 +42,9 @@ jobs:
|
||||
VITE_APP_VERSION: ${{ inputs.vite_app_version }}
|
||||
NODE_OPTIONS: "--max-old-space-size=4096"
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4
|
||||
with:
|
||||
name: build-output-${{ inputs.package }}
|
||||
name: build-output
|
||||
path: dist
|
||||
# We'll only use this in a triggered job, then we're done with it
|
||||
retention-days: 1
|
||||
|
||||
22
.github/workflows/build.yaml
vendored
22
.github/workflows/build.yaml
vendored
@@ -16,11 +16,9 @@ on:
|
||||
- ".github/CODEOWNERS"
|
||||
- "docs/**"
|
||||
jobs:
|
||||
build_full_element_call:
|
||||
# Use the full package vite build
|
||||
build_element_call:
|
||||
uses: ./.github/workflows/build-element-call.yaml
|
||||
with:
|
||||
package: full
|
||||
vite_app_version: ${{ github.event.release.tag_name || github.sha }}
|
||||
secrets:
|
||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||
@@ -31,11 +29,11 @@ jobs:
|
||||
deploy_develop:
|
||||
# Deploy livekit branch to call.element.dev after build completes
|
||||
if: github.ref == 'refs/heads/livekit'
|
||||
needs: build_full_element_call
|
||||
needs: build_element_call
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Deploy to call.element.dev
|
||||
uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.DEVELOP_DEPLOYMENT_TOKEN }}
|
||||
script: |
|
||||
@@ -52,7 +50,7 @@ jobs:
|
||||
docker_for_develop:
|
||||
# Build docker and publish docker for livekit branch after build completes
|
||||
if: github.ref == 'refs/heads/livekit'
|
||||
needs: build_full_element_call
|
||||
needs: build_element_call
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
@@ -63,15 +61,3 @@ jobs:
|
||||
type=sha,format=short,event=branch
|
||||
type=raw,value=latest-ci
|
||||
type=raw,value=latest-ci_{{date 'X' }}
|
||||
build_embedded_element_call:
|
||||
# Use the embedded package vite build
|
||||
uses: ./.github/workflows/build-element-call.yaml
|
||||
with:
|
||||
package: embedded
|
||||
vite_app_version: ${{ github.event.release.tag_name || github.sha }}
|
||||
secrets:
|
||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
||||
SENTRY_URL: ${{ secrets.SENTRY_URL }}
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
4
.github/workflows/deploy-to-netlify.yaml
vendored
4
.github/workflows/deploy-to-netlify.yaml
vendored
@@ -46,11 +46,11 @@ jobs:
|
||||
Exercise caution. Use test accounts.
|
||||
|
||||
- name: 📥 Download artifact
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
|
||||
with:
|
||||
github-token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||
run-id: ${{ inputs.artifact_run_id }}
|
||||
name: build-output-full
|
||||
name: build-output
|
||||
path: webapp
|
||||
|
||||
- name: Add redirects file
|
||||
|
||||
2
.github/workflows/lint.yaml
vendored
2
.github/workflows/lint.yaml
vendored
@@ -9,7 +9,7 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- name: Yarn cache
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
|
||||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
|
||||
with:
|
||||
cache: "yarn"
|
||||
node-version-file: ".node-version"
|
||||
|
||||
33
.github/workflows/playwright.yml
vendored
33
.github/workflows/playwright.yml
vendored
@@ -1,33 +0,0 @@
|
||||
name: Playwright Tests
|
||||
on:
|
||||
pull_request: {}
|
||||
push:
|
||||
branches: [livekit, full-mesh]
|
||||
jobs:
|
||||
test:
|
||||
timeout-minutes: 10
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
cache: "yarn"
|
||||
node-version-file: ".node-version"
|
||||
- name: Install dependencies
|
||||
run: yarn install --frozen-lockfile
|
||||
- name: Install Playwright Browsers
|
||||
run: yarn playwright install --with-deps
|
||||
- name: Run backend components
|
||||
run: |
|
||||
docker compose -f dev-backend-docker-compose.yml up -d
|
||||
docker ps
|
||||
- name: Copy config file
|
||||
run: cp config/config.devenv.json public/config.json
|
||||
- name: Run Playwright tests
|
||||
run: yarn playwright test
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: ${{ !cancelled() }}
|
||||
with:
|
||||
name: playwright-report
|
||||
path: playwright-report/
|
||||
retention-days: 3
|
||||
7
.github/workflows/publish.yaml
vendored
7
.github/workflows/publish.yaml
vendored
@@ -13,7 +13,6 @@ jobs:
|
||||
if: ${{ github.event_name == 'release' }}
|
||||
uses: ./.github/workflows/build-element-call.yaml
|
||||
with:
|
||||
package: full
|
||||
vite_app_version: ${{ github.event.release.tag_name || github.sha }}
|
||||
secrets:
|
||||
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
||||
@@ -35,11 +34,11 @@ jobs:
|
||||
id: current-time
|
||||
run: echo "unix_time=$(date +'%s')" >> $GITHUB_OUTPUT
|
||||
- name: 📥 Download artifact
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4
|
||||
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
run-id: ${{ github.event.workflow_run.id || github.run_id }}
|
||||
name: build-output-full
|
||||
name: build-output
|
||||
path: dist
|
||||
- name: Create Tarball
|
||||
env:
|
||||
@@ -47,7 +46,7 @@ jobs:
|
||||
run: |
|
||||
tar --numeric-owner --transform "s/dist/element-call-${TARBALL_VERSION}/" -cvzf element-call-${TARBALL_VERSION}.tar.gz dist
|
||||
- name: Upload
|
||||
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
|
||||
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
with:
|
||||
|
||||
4
.github/workflows/test.yaml
vendored
4
.github/workflows/test.yaml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
- name: Yarn cache
|
||||
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
|
||||
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
|
||||
with:
|
||||
cache: "yarn"
|
||||
node-version-file: ".node-version"
|
||||
@@ -20,7 +20,7 @@ jobs:
|
||||
- name: Vitest
|
||||
run: "yarn run test:coverage"
|
||||
- name: Upload to codecov
|
||||
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # v5
|
||||
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
with:
|
||||
|
||||
4
.github/workflows/translations-download.yaml
vendored
4
.github/workflows/translations-download.yaml
vendored
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
|
||||
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4
|
||||
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
|
||||
with:
|
||||
cache: "yarn"
|
||||
node-version-file: ".node-version"
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
|
||||
- name: Create Pull Request
|
||||
id: cpr
|
||||
uses: peter-evans/create-pull-request@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # v7.0.7
|
||||
uses: peter-evans/create-pull-request@67ccf781d68cd99b580ae25a5c18a1cc84ffff1f # v7.0.6
|
||||
with:
|
||||
token: ${{ secrets.ELEMENT_BOT_TOKEN }}
|
||||
branch: actions/localazy-download
|
||||
|
||||
7
.gitignore
vendored
7
.gitignore
vendored
@@ -4,15 +4,8 @@ node_modules
|
||||
dist
|
||||
dist-ssr
|
||||
*.local
|
||||
*.bkp
|
||||
.idea/
|
||||
public/config.json
|
||||
backend/synapse_tmp/*
|
||||
/coverage
|
||||
yarn-error.log
|
||||
|
||||
# Playwright
|
||||
/test-results/
|
||||
/playwright-report/
|
||||
/blob-report/
|
||||
/playwright/.cache/
|
||||
|
||||
330
README.md
330
README.md
@@ -2,101 +2,127 @@
|
||||
|
||||
[](https://matrix.to/#/#webrtc:matrix.org)
|
||||
[](https://localazy.com/p/element-call)
|
||||
[](LICENSE-AGPL-3.0)
|
||||
|
||||
[🎬 Live Demo 🎬](https://call.element.io)
|
||||
Group calls with WebRTC that leverage [Matrix](https://matrix.org) and an
|
||||
open-source WebRTC toolkit from [LiveKit](https://livekit.io/).
|
||||
|
||||
The world's first 🌐 decentralized and 🤝 federated video conferencing solution
|
||||
powered by **the Matrix protocol**.
|
||||
|
||||
## 📌 Overview
|
||||
|
||||
**Element Call** is a native Matrix video conferencing application developed by
|
||||
[Element](https://element.io/), designed for **secure**, **scalable**,
|
||||
**privacy-respecting**, and **decentralized** video and voice calls over the
|
||||
Matrix protocol. Built on **MatrixRTC**
|
||||
([MSC4143](https://github.com/matrix-org/matrix-spec-proposals/pull/4143)), it
|
||||
utilizes
|
||||
**[MSC4195](https://github.com/hughns/matrix-spec-proposals/blob/hughns/matrixrtc-livekit/proposals/4195-matrixrtc-livekit.md)**
|
||||
with **[LiveKit](https://livekit.io/)** as its backend.
|
||||
For prior version of the Element Call that relied solely on full-mesh logic,
|
||||
check [`full-mesh`](https://github.com/element-hq/element-call/tree/full-mesh)
|
||||
branch.
|
||||
|
||||

|
||||
|
||||
You can find the latest development version continuously deployed to
|
||||
To try it out, visit our hosted version at
|
||||
[call.element.io](https://call.element.io). You can also find the latest
|
||||
development version continuously deployed to
|
||||
[call.element.dev](https://call.element.dev/).
|
||||
|
||||
> [!NOTE]
|
||||
> For prior version of the Element Call that relied solely on full-mesh logic,
|
||||
> check [`full-mesh`](https://github.com/element-hq/element-call/tree/full-mesh)
|
||||
> branch.
|
||||
## Host it yourself
|
||||
|
||||
## ✨ Key Features
|
||||
Until prebuilt tarballs are available, you'll need to build Element Call from
|
||||
source. First, clone and install the package:
|
||||
|
||||
✅ **Decentralized & Federated** – No central authority; works across Matrix
|
||||
homeservers.
|
||||
✅ **End-to-End Encrypted** – Secure and private calls.
|
||||
✅ **Standalone & Widget Mode** – Use as an independent app or embed in Matrix
|
||||
clients.
|
||||
✅ **WebRTC-based** – No additional software required.
|
||||
✅ **Scalable with LiveKit** – Supports large meetings via SFU
|
||||
([MSC4195: MatrixRTC using LiveKit backend](https://github.com/hughns/matrix-spec-proposals/blob/hughns/matrixrtc-livekit/proposals/4195-matrixrtc-livekit.md)).
|
||||
✅ **Raise Hand** – Participants can signal when they want to speak, helping to
|
||||
organize the flow of the meeting.
|
||||
✅ **Emoji Reactions** – Users can react with emojis 👍️ 🎉 👏 🤘, adding
|
||||
engagement and interactivity to the conversation.
|
||||
```
|
||||
git clone https://github.com/element-hq/element-call.git
|
||||
cd element-call
|
||||
yarn
|
||||
yarn build
|
||||
```
|
||||
|
||||
## 🚀 Deployment Options
|
||||
If all went well, you can now find the build output under `dist` as a series of
|
||||
static files. These can be hosted using any web server that can be configured
|
||||
with custom routes (see below).
|
||||
|
||||
Element Call can be packaged in two ways:
|
||||
You may also wish to add a configuration file (Element Call uses the domain it's
|
||||
hosted on as a Homeserver URL by default, but you can change this in the config
|
||||
file). This goes in `public/config.json` - you can use the sample as a starting
|
||||
point:
|
||||
|
||||
**Full Package** – Supports both **Standalone** and **Widget** mode. Hosted as
|
||||
a static web page and accessed via a URL when used as a widget.
|
||||
```
|
||||
cp config/config.sample.json public/config.json
|
||||
# edit public/config.json
|
||||
```
|
||||
|
||||
**Embedded Package** – 🚧 **Coming [Soon](https://github.com/element-hq/element-call/issues/2994):** Designed for **Widget mode** only. Bundled with a
|
||||
messenger app for seamless integration. This is the recommended method for
|
||||
embedding Element Call into a messenger app.
|
||||
Because Element Call uses client-side routing, your server must be able to route
|
||||
any requests to non-existing paths back to `/index.html`. For example, in Nginx
|
||||
you can achieve this with the `try_files` directive:
|
||||
|
||||
### Standalone mode
|
||||
```
|
||||
server {
|
||||
...
|
||||
location / {
|
||||
...
|
||||
try_files $uri /$uri /index.html;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||

|
||||
By default, the app expects you to have a Matrix homeserver (such as
|
||||
[Synapse](https://element-hq.github.io/synapse/latest/setup/installation.html))
|
||||
installed locally and running on port 8008. If you wish to use a homeserver on a
|
||||
different URL or one that is hosted on a different server, you can add a config
|
||||
file as above, and include the homeserver URL that you'd like to use.
|
||||
|
||||
In Standalone mode Element Call operates as an independent, full-featured video
|
||||
conferencing web application, allowing users to join or host calls without
|
||||
requiring a separate Matrix client.
|
||||
Element Call requires a homeserver with registration enabled without any 3pid or
|
||||
token requirements, if you want it to be used by unregistered users.
|
||||
Furthermore, it is not recommended to use it with an existing homeserver where
|
||||
user accounts have joined normal rooms, as it may not be able to handle those
|
||||
yet and it may behave unreliably.
|
||||
|
||||
### Widget mode embedded in Messenger Apps
|
||||
Therefore, to use a self-hosted homeserver, this is recommended to be a new
|
||||
server where any user account created has not joined any normal rooms anywhere
|
||||
in the Matrix federated network. The homeserver used can be setup to disable
|
||||
federation, so as to prevent spam registrations (if you keep registrations open)
|
||||
and to ensure Element Call continues to work in case any user decides to log in
|
||||
to their Element Call account using the standard Element app and joins normal
|
||||
rooms that Element Call cannot handle.
|
||||
|
||||

|
||||
## Configuration
|
||||
|
||||
Element Call can be embedded as a widget inside apps like
|
||||
[**Element Web**](https://github.com/element-hq/element-web) or **Element X
|
||||
([iOS](https://github.com/element-hq/element-x-ios),
|
||||
[Android](https://github.com/element-hq/element-x-android))**, bringing
|
||||
**MatrixRTC** capabilities to messenger apps for seamless decentralized video
|
||||
and voice calls within Matrix rooms.
|
||||
There are currently two different config files. `.env` holds variables that are
|
||||
used at build time, while `public/config.json` holds variables that are used at
|
||||
runtime. Documentation and default values for `public/config.json` can be found
|
||||
in [ConfigOptions.ts](src/config/ConfigOptions.ts).
|
||||
|
||||
> [!IMPORTANT]
|
||||
> Embedded packaging is recommended for Element Call in widget mode!
|
||||
If you're using [Synapse](https://github.com/element-hq/synapse/), you'll need
|
||||
to additionally add the following to `homeserver.yaml` or Element Call won't
|
||||
work:
|
||||
|
||||
## 🛠️ Self-Hosting
|
||||
```
|
||||
experimental_features:
|
||||
# MSC3266: Room summary API. Used for knocking over federation
|
||||
msc3266_enabled: true
|
||||
# MSC4222 needed for syncv2 state_after. This allow clients to
|
||||
# correctly track the state of the room.
|
||||
msc4222_enabled: true
|
||||
|
||||
For operating and deploying Element Call on your own server, refer to the
|
||||
[**Self-Hosting Guide**](./docs/self-hosting.md).
|
||||
# The maximum allowed duration by which sent events can be delayed, as
|
||||
# per MSC4140.
|
||||
max_event_delay_duration: 24h
|
||||
|
||||
## 🧭 MatrixRTC Backend Discovery and Selection
|
||||
rc_message:
|
||||
# This needs to match at least the heart-beat frequency plus a bit of headroom
|
||||
# Currently the heart-beat is every 5 seconds which translates into a rate of 0.2s
|
||||
per_second: 0.5
|
||||
burst_count: 30
|
||||
```
|
||||
|
||||
For proper Element Call operation each site deployment needs a MatrixRTC backend
|
||||
setup as outlined in the [Self-Hosting](#self-hosting). A typical federated site
|
||||
deployment for three different sites A, B and C is depicted below.
|
||||
MSC3266 allows to request a room summary of rooms you are not joined. The
|
||||
summary contains the room join rules. We need that to decide if the user gets
|
||||
prompted with the option to knock ("Request to join call"), a cannot join error or the
|
||||
join view.
|
||||
|
||||

|
||||
MSC4222 allow clients to opt-in to a change of the sync v2 API that allows them
|
||||
to correctly track the state of the room. This is required by Element Call to
|
||||
track room state reliably.
|
||||
|
||||
### Backend Discovery
|
||||
Element Call requires a Livekit SFU alongside a [Livekit JWT
|
||||
service](https://github.com/element-hq/lk-jwt-service) to work. The url to the
|
||||
Livekit JWT service can either be configured in the config of Element Call
|
||||
(fallback/legacy configuration) or be configured by your homeserver via the
|
||||
`.well-known/matrix/client`. This is the recommended method.
|
||||
|
||||
MatrixRTC backend (according to
|
||||
[MSC4143](https://github.com/matrix-org/matrix-spec-proposals/pull/4143))
|
||||
is announced by the homeserver's `.well-known/matrix/client` file and discovered
|
||||
via the `org.matrix.msc4143.rtc_foci` key, e.g.:
|
||||
The configuration is a list of Foci configs:
|
||||
|
||||
```json
|
||||
"org.matrix.msc4143.rtc_foci": [
|
||||
@@ -104,65 +130,60 @@ via the `org.matrix.msc4143.rtc_foci` key, e.g.:
|
||||
"type": "livekit",
|
||||
"livekit_service_url": "https://someurl.com"
|
||||
},
|
||||
{
|
||||
"type": "livekit",
|
||||
"livekit_service_url": "https://livekit2.com"
|
||||
},
|
||||
{
|
||||
"type": "another_foci",
|
||||
"props_for_another_foci": "val"
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
where the format for MatrixRTC using LiveKit backend is defined in
|
||||
[MSC4195](https://github.com/hughns/matrix-spec-proposals/blob/hughns/matrixrtc-livekit/proposals/4195-matrixrtc-livekit.md).
|
||||
In the example above Matrix clients do discover a focus of type `livekit` which
|
||||
points them to a Matrix LiveKit JWT Auth Service via `livekit_service_url`.
|
||||
|
||||
### Backend Selection
|
||||
|
||||
- Each call participant proposes their discovered MatrixRTC backend from
|
||||
`org.matrix.msc4143.rtc_foci` in their `org.matrix.msc3401.call.member` state event.
|
||||
- For **LiveKit** MatrixRTC backend
|
||||
([MSC4195](https://github.com/hughns/matrix-spec-proposals/blob/hughns/matrixrtc-livekit/proposals/4195-matrixrtc-livekit.md)),
|
||||
the **first participant who joined the call** defines via the `foci_preferred`
|
||||
key in their `org.matrix.msc3401.call.member` which actual MatrixRTC backend
|
||||
will be used for this call.
|
||||
- During the actual call join flow, the **LiveKit JWT Auth Service** provides
|
||||
the client with the **LiveKit SFU WebSocket URL** and an **access JWT token**
|
||||
in order to exchange media via WebRTC.
|
||||
|
||||
The example below illustrates how backend selection works across **Matrix
|
||||
federation**, using the setup from sites A, B, and C. It demonstrates backend
|
||||
selection for **Matrix rooms 123 and 456**, which include users from different
|
||||
homeservers.
|
||||

|
||||
|
||||
## 🌍 Translation
|
||||
## Translation
|
||||
|
||||
If you'd like to help translate Element Call, head over to
|
||||
[Localazy](https://localazy.com/p/element-call). You're also encouraged to join
|
||||
the [Element Translators](https://matrix.to/#/#translators:element.io) space to
|
||||
discuss and coordinate translation efforts.
|
||||
|
||||
## 🛠️ Development
|
||||
## Development
|
||||
|
||||
### Frontend
|
||||
|
||||
To get started clone and set up this project:
|
||||
Element Call is built against
|
||||
[matrix-js-sdk](https://github.com/matrix-org/matrix-js-sdk/pull/2553). To get
|
||||
started, clone, install, and link the package:
|
||||
|
||||
```sh
|
||||
```
|
||||
git clone https://github.com/matrix-org/matrix-js-sdk.git
|
||||
cd matrix-js-sdk
|
||||
yarn
|
||||
yarn link
|
||||
```
|
||||
|
||||
Next, we can set up this project:
|
||||
|
||||
```
|
||||
git clone https://github.com/element-hq/element-call.git
|
||||
cd element-call
|
||||
yarn
|
||||
yarn link matrix-js-sdk
|
||||
```
|
||||
|
||||
To use it, create a local config by, e.g.,
|
||||
`cp ./config/config.devenv.json ./public/config.json` and adapt it if necessary.
|
||||
The `config.devenv.json` config should work with the backend development
|
||||
environment as outlined in the next section out of box.
|
||||
To use it, create a local config by, e.g., `cp ./config/config.devenv.json
|
||||
./public/config.json` and adapt it if necessary. The `config.devenv.json` config
|
||||
should work with the backend development environment as outlined in the next
|
||||
section out of box.
|
||||
|
||||
> [!NOTE]
|
||||
> Be aware, that this `config.devenv.json` is exposing a deprecated fallback
|
||||
> LiveKit config key. If the homeserver advertises SFU backend via
|
||||
> `.well-known/matrix/client` this has precedence.
|
||||
(Be aware, that this `config.devenv.json` is exposing a deprecated fallback
|
||||
LiveKit config key. If the homeserver advertises SFU backend via
|
||||
`.well-known/matrix/client` this has precedence.)
|
||||
|
||||
You're now ready to launch the development server:
|
||||
|
||||
```sh
|
||||
```
|
||||
yarn dev
|
||||
```
|
||||
|
||||
@@ -171,82 +192,24 @@ yarn dev
|
||||
A docker compose file `dev-backend-docker-compose.yml` is provided to start the
|
||||
whole stack of components which is required for a local development environment:
|
||||
|
||||
- Minimum Synapse Setup (servername: `synapse.localhost`)
|
||||
- Minimum Synapse Setup (servername: synapse.localhost)
|
||||
- LiveKit JWT Service (Note requires Federation API and hence a TLS reverse proxy)
|
||||
- Minimum TLS reverse proxy (servername: `synapse.localhost`) Note certificates
|
||||
- Minimum TLS reverse proxy (servername: synapse.localhost) Note certificates
|
||||
are valid for at least 10 years from now
|
||||
- Minimum LiveKit SFU Setup using dev defaults for config
|
||||
- Redis db for completeness
|
||||
- Redis db for completness
|
||||
|
||||
These use a test 'secret' published in this repository, so this must be used
|
||||
only for local development and **_never be exposed to the public Internet._**
|
||||
|
||||
Run backend components:
|
||||
|
||||
```sh
|
||||
```
|
||||
yarn backend
|
||||
# or for podman-compose
|
||||
# podman-compose -f dev-backend-docker-compose.yml up
|
||||
```
|
||||
|
||||
### Playwright tests
|
||||
|
||||
Our Playwright tests run automatically as part of our CI along with our other tests,
|
||||
on every pull request.
|
||||
|
||||
You may need to follow instructions to set up your development environment for running
|
||||
Playwright by following <https://playwright.dev/docs/browsers#install-browsers> and
|
||||
<https://playwright.dev/docs/browsers#install-system-dependencies>.
|
||||
|
||||
However the Playwright tests are run, an element-call instance must be running on
|
||||
https://localhost:3000 (this is configured in `playwright.config.ts`) - this is what will
|
||||
be tested.
|
||||
|
||||
The local backend environment should be running for the test to work:
|
||||
`yarn backend`
|
||||
|
||||
There are a few different ways to run the tests yourself. The simplest is to run:
|
||||
|
||||
```shell
|
||||
yarn run test:playwright
|
||||
```
|
||||
|
||||
This will run the Playwright tests once, non-interactively.
|
||||
|
||||
There is a more user-friendly way to run the tests in interactive mode:
|
||||
|
||||
```shell
|
||||
yarn run test:playwright:open
|
||||
```
|
||||
|
||||
The easiest way to develop new test is to use the codegen feature of Playwright:
|
||||
|
||||
```shell
|
||||
npx playwright codegen
|
||||
```
|
||||
|
||||
This will record your action and write the test code for you. Use the tool bar to test visibility, text content,
|
||||
clicking.
|
||||
|
||||
##### Investigate a failed test from the CI
|
||||
|
||||
In the failed action page, click on the failed job, then scroll down to the `upload-artifact` step.
|
||||
You will find a link to download the zip report, as per:
|
||||
|
||||
```
|
||||
Artifact playwright-report has been successfully uploaded! Final size is 1360358 bytes. Artifact ID is 2746265841
|
||||
Artifact download URL: https://github.com/element-hq/element-call/actions/runs/13837660687/artifacts/2746265841
|
||||
```
|
||||
|
||||
Unzip the report then use this command to open the report in your browser:
|
||||
|
||||
```shell
|
||||
npx playwright show-report ~/Downloads/playwright-report/
|
||||
```
|
||||
|
||||
Under the failed test there is a small icon looking like "3 columns" (next to test name file name),
|
||||
click on it to see the live screenshots/console output.
|
||||
|
||||
### Test Coverage
|
||||
|
||||
<img src="https://codecov.io/github/element-hq/element-call/graphs/tree.svg?token=O6CFVKK6I1"></img>
|
||||
@@ -255,11 +218,9 @@ click on it to see the live screenshots/console output.
|
||||
|
||||
To add a new translation key you can do these steps:
|
||||
|
||||
1. Add the new key entry to the code where the new key is used:
|
||||
`t("some_new_key")`
|
||||
1. Add the new key entry to the code where the new key is used: `t("some_new_key")`
|
||||
1. Run `yarn i18n` to extract the new key and update the translation files. This
|
||||
will add a skeleton entry to the `locales/en/app.json` file:
|
||||
|
||||
```jsonc
|
||||
{
|
||||
...
|
||||
@@ -267,39 +228,30 @@ To add a new translation key you can do these steps:
|
||||
...
|
||||
}
|
||||
```
|
||||
1. Update the skeleton entry in the `locales/en/app.json` file with
|
||||
the English translation:
|
||||
|
||||
1. Update the skeleton entry in the `locales/en/app.json` file with the English
|
||||
translation:
|
||||
|
||||
```jsonc
|
||||
```jsonc
|
||||
{
|
||||
...
|
||||
"some_new_key": "Some new key",
|
||||
...
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
## 📖 Documentation
|
||||
## Documentation
|
||||
|
||||
Usage and other technical details about the project can be found here:
|
||||
|
||||
[**Docs**](./docs/README.md)
|
||||
|
||||
## 📝 Copyright & License
|
||||
## Copyright & License
|
||||
|
||||
Copyright 2021-2025 New Vector Ltd
|
||||
|
||||
This software is dual-licensed by New Vector Ltd (Element). It can be used
|
||||
either:
|
||||
This software is dual-licensed by New Vector Ltd (Element). It can be used either:
|
||||
|
||||
(1) for free under the terms of the GNU Affero General Public License (as
|
||||
published by the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version); OR
|
||||
(1) for free under the terms of the GNU Affero General Public License (as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version); OR
|
||||
|
||||
(2) under the terms of a paid-for Element Commercial License agreement between
|
||||
you and Element (the terms of which may vary depending on what you and Element
|
||||
have agreed to). Unless required by applicable law or agreed to in writing,
|
||||
software distributed under the Licenses is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
Licenses for the specific language governing permissions and limitations under
|
||||
the Licenses.
|
||||
(2) under the terms of a paid-for Element Commercial License agreement between you and Element (the terms of which may vary depending on what you and Element have agreed to).
|
||||
Unless required by applicable law or agreed to in writing, software distributed under the Licenses is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licenses for the specific language governing permissions and limitations under the Licenses.
|
||||
|
||||
@@ -41,23 +41,10 @@ max_event_delay_duration: 24h
|
||||
# - burst_count: number of requests a client can send before being throttled.
|
||||
|
||||
rc_message:
|
||||
per_second: 10000
|
||||
burst_count: 10000
|
||||
|
||||
rc_login:
|
||||
address:
|
||||
per_second: 10000
|
||||
burst_count: 10000
|
||||
account:
|
||||
per_second: 10000
|
||||
burst_count: 10000
|
||||
failed_attempts:
|
||||
per_second: 10000
|
||||
burst_count: 10000
|
||||
|
||||
rc_registration:
|
||||
per_second: 10000
|
||||
burst_count: 10000
|
||||
# This needs to match at least the heart-beat frequency plus a bit of headroom
|
||||
# Currently the heart-beat is every 5 seconds which translates into a rate of 0.2s
|
||||
per_second: 0.5
|
||||
burst_count: 30
|
||||
|
||||
# Required for Element Call in Single Page Mode due to on-the-fly user registration
|
||||
enable_registration: true
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
{
|
||||
"default_server_config": {
|
||||
"m.homeserver": {
|
||||
"base_url": "https://mydomain.com",
|
||||
"server_name": "mydomain.com"
|
||||
"base_url": "http://synapse.localhost:8008",
|
||||
"server_name": "synapse.localhost"
|
||||
}
|
||||
},
|
||||
"livekit": {
|
||||
"livekit_service_url": "https://livekit-jwt.mydomain.com"
|
||||
},
|
||||
"features": {
|
||||
"feature_use_device_session_member_events": true
|
||||
},
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 86 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 49 KiB |
@@ -5,4 +5,3 @@ This folder contains documentation for Element Call setup and usage.
|
||||
- [Embedded vs standalone mode](./embedded-standalone.md)
|
||||
- [Url format and parameters](./url-params.md)
|
||||
- [Global JS controls](./controls.md)
|
||||
- [Self-Hosting](./self-hosting.md)
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 15 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 909 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 868 KiB |
@@ -2,7 +2,7 @@
|
||||
|
||||
Element call is developed using the js-sdk with matroska mode. This means the app can run either as a standalone app directly connected to a homeserver providing login interfaces or it can be used as a widget.
|
||||
|
||||
As a widget the app only uses the core calling (MatrixRTC) parts. The rest (authentication, sending events, getting room state updates about calls) is done by the hosting client.
|
||||
As a widget the app only uses the core calling (matrixRTC) parts. The rest (authentication, sending events, getting room state updates about calls) is done by the hosting client.
|
||||
Element Call and the hosting client are connected via the widget api.
|
||||
|
||||
Element call detects that it is run as a widget if a widgetId is defined in the url parameters. If `widgetId` is present element call will try to connect to the client via the widget postMessage api using the parameters provided in [Url Format and parameters
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
# Self-Hosting Element Call
|
||||
|
||||
## Prerequisites
|
||||
|
||||
> [!IMPORTANT]
|
||||
> This section covers the requirements for deploying a **Matrix site**
|
||||
> compatible with MatrixRTC, the foundation of Element Call. These requirements
|
||||
> apply to both Standalone as well as Widget mode operation of Element Call.
|
||||
|
||||
### A Matrix Homeserver
|
||||
|
||||
The following [MSCs](https://github.com/matrix-org/matrix-spec-proposals) are
|
||||
required for Element Call to work properly:
|
||||
|
||||
- **[MSC3266](https://github.com/deepbluev7/matrix-doc/blob/room-summaries/proposals/3266-room-summary.md):
|
||||
Room Summary API**: In Standalone mode Element Call is able to join rooms
|
||||
over federation using knocking. In this context MSC3266 is required as it
|
||||
allows to request a room summary of rooms you are not joined. The summary
|
||||
contains the room join rules. We need that information to decide if the user
|
||||
gets prompted with the option to knock ("Request to join call"), a "cannot
|
||||
join error" or "the join view".
|
||||
|
||||
- **[MSC4140](https://github.com/matrix-org/matrix-spec-proposals/blob/toger5/expiring-events-keep-alive/proposals/4140-delayed-events-futures.md)
|
||||
Delayed Events**: Delayed events are required for proper call participation
|
||||
signalling. If disabled it is very likely that you end up with stuck calls in
|
||||
Matrix rooms.
|
||||
|
||||
- **[MSC4222](https://github.com/matrix-org/matrix-spec-proposals/blob/erikj/sync_v2_state_after/proposals/4222-sync-v2-state-after.md)
|
||||
Adding `state_after` to sync v2**: Allow clients to opt-in to a change of the
|
||||
sync v2 API that allows them to correctly track the state of the room. This is
|
||||
required by Element Call to track room state reliably.
|
||||
|
||||
If you're using [Synapse](https://github.com/element-hq/synapse/) as your homeserver, you'll need
|
||||
to additionally add the following config items to `homeserver.yaml` to comply with Element Call:
|
||||
|
||||
```yaml
|
||||
experimental_features:
|
||||
# MSC3266: Room summary API. Used for knocking over federation
|
||||
msc3266_enabled: true
|
||||
# MSC4222 needed for syncv2 state_after. This allow clients to
|
||||
# correctly track the state of the room.
|
||||
msc4222_enabled: true
|
||||
|
||||
# The maximum allowed duration by which sent events can be delayed, as
|
||||
# per MSC4140.
|
||||
max_event_delay_duration: 24h
|
||||
|
||||
rc_message:
|
||||
# This needs to match at least the heart-beat frequency plus a bit of headroom
|
||||
# Currently the heart-beat is every 5 seconds which translates into a rate of 0.2s
|
||||
per_second: 0.5
|
||||
burst_count: 30
|
||||
```
|
||||
|
||||
### MatrixRTC Backend
|
||||
|
||||
In order to **guarantee smooth operation** of Element Call MatrixRTC backend is
|
||||
required for each site deployment.
|
||||
|
||||

|
||||
|
||||
As depicted above, Element Call requires a
|
||||
[Livekit SFU](https://github.com/livekit/livekit) alongside a
|
||||
[Matrix Livekit JWT auth service](https://github.com/element-hq/lk-jwt-service)
|
||||
to implement
|
||||
[MSC4195: MatrixRTC using LiveKit backend](https://github.com/hughns/matrix-spec-proposals/blob/hughns/matrixrtc-livekit/proposals/4195-matrixrtc-livekit.md).
|
||||
|
||||
> [!IMPORTANT]
|
||||
> As defined in
|
||||
> [MSC4143](https://github.com/matrix-org/matrix-spec-proposals/pull/4143)
|
||||
> MatrixRTC backend must be announced to the client via your **homeserver's
|
||||
> `.well-known/matrix/client`**. The configuration is a list of Foci configs:
|
||||
|
||||
```json
|
||||
"org.matrix.msc4143.rtc_foci": [
|
||||
{
|
||||
"type": "livekit",
|
||||
"livekit_service_url": "https://someurl.com"
|
||||
},
|
||||
{
|
||||
"type": "livekit",
|
||||
"livekit_service_url": "https://livekit2.com"
|
||||
},
|
||||
{
|
||||
"type": "another_foci",
|
||||
"props_for_another_foci": "val"
|
||||
},
|
||||
]
|
||||
```
|
||||
|
||||
## Building Element Call
|
||||
|
||||
> [!NOTE]
|
||||
> This step is only required if you want to deploy Element Call in Standalone
|
||||
> mode.
|
||||
|
||||
Until prebuilt tarballs are available, you'll need to build Element Call from
|
||||
source. First, clone and install the package:
|
||||
|
||||
```sh
|
||||
git clone https://github.com/element-hq/element-call.git
|
||||
cd element-call
|
||||
yarn
|
||||
yarn build
|
||||
```
|
||||
|
||||
If all went well, you can now find the build output under `dist` as a series of
|
||||
static files. These can be hosted using any web server that can be configured
|
||||
with custom routes (see below).
|
||||
|
||||
You also need to add a configuration file which goes in `public/config.json` -
|
||||
you can use the sample as a starting point:
|
||||
|
||||
```sh
|
||||
cp config/config.sample.json public/config.json
|
||||
# edit public/config.json
|
||||
```
|
||||
|
||||
The sample needs editing to contain the homeserver that you are using.
|
||||
|
||||
Because Element Call uses client-side routing, your server must be able to route
|
||||
any requests to non-existing paths back to `/index.html`. For example, in Nginx
|
||||
you can achieve this with the `try_files` directive:
|
||||
|
||||
```jsonc
|
||||
server {
|
||||
...
|
||||
location / {
|
||||
...
|
||||
try_files $uri /$uri /index.html;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
There are currently two different config files. `.env` holds variables that are
|
||||
used at build time, while `public/config.json` holds variables that are used at
|
||||
runtime. Documentation and default values for `public/config.json` can be found
|
||||
in [ConfigOptions.ts](src/config/ConfigOptions.ts).
|
||||
|
||||
> [!CAUTION]
|
||||
> Please note configuring MatrixRTC backend via `config.json` of
|
||||
> Element Call is only available for developing and debug purposes. Relying on
|
||||
> it might break Element Call going forward!
|
||||
|
||||
## A Note on Standalone Mode of Element Call
|
||||
|
||||
Element Call in Standalone mode requires a homeserver with registration enabled
|
||||
without any 3pid or token requirements, if you want it to be used by
|
||||
unregistered users. Furthermore, it is not recommended to use it with an
|
||||
existing homeserver where user accounts have joined normal rooms, as it may not
|
||||
be able to handle those yet and it may behave unreliably.
|
||||
|
||||
Therefore, to use a self-hosted homeserver, this is recommended to be a new
|
||||
server where any user account created has not joined any normal rooms anywhere
|
||||
in the Matrix federated network. The homeserver used can be setup to disable
|
||||
federation, so as to prevent spam registrations (if you keep registrations open)
|
||||
and to ensure Element Call continues to work in case any user decides to log in
|
||||
to their Element Call account using the standard Element app and joins normal
|
||||
rooms that Element Call cannot handle.
|
||||
@@ -32,16 +32,14 @@ There are two formats for Element Call urls.
|
||||
|
||||
## Parameters
|
||||
|
||||
### Common Parameters
|
||||
|
||||
These parameters are relevant to both widget and standalone modes:
|
||||
|
||||
| Name | Values | Required for widget | Required for SPA | Description |
|
||||
| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `allowIceFallback` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Allows use of fallback STUN servers for ICE if the user's homeserver doesn’t provide any. |
|
||||
| `analyticsID` | Posthog analytics ID | No | No | Available only with user's consent for sharing telemetry in Element Web. |
|
||||
| `appPrompt` | `true` or `false` | No, defaults to `true` | No, defaults to `true` | Prompts the user to launch the native mobile app upon entering a room, applicable only on Android and iOS, and must be enabled in config. |
|
||||
| `baseUrl` | | Yes | Not applicable | The base URL of the homeserver to use for media lookups. |
|
||||
| `confineToRoom` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Keeps the user confined to the current call/room. |
|
||||
| `deviceId` | Matrix device ID | Yes | Not applicable | The Matrix device ID for the widget host. |
|
||||
| `displayName` | | No | No | Display name used for auto-registration. |
|
||||
| `enableE2EE` (deprecated) | `true` or `false` | No, defaults to `true` | No, defaults to `true` | Legacy flag to enable end-to-end encryption, not used in the `livekit` branch. |
|
||||
| `fontScale` | A decimal number such as `0.9` | No, defaults to `1.0` | No, defaults to `1.0` | Factor by which to scale the interface's font size. |
|
||||
@@ -51,24 +49,15 @@ These parameters are relevant to both widget and standalone modes:
|
||||
| `homeserver` | | Not applicable | No | Homeserver for registering a new (guest) user, configures non-default guest user server when creating a spa link. |
|
||||
| `intent` | `start_call` or `join_existing` | No, defaults to `start_call` | No, defaults to `start_call` | The intent of the user with respect to the call. e.g. if they clicked a Start Call button, this would be `start_call`. If it was a Join Call button, it would be `join_existing`. |
|
||||
| `lang` | [BCP 47](https://www.rfc-editor.org/info/bcp47) code | No | No | The language the app should use. |
|
||||
| `parentUrl` | | Yes | Not applicable | The url used to send widget action postMessages. This should be the domain of the client or the webview the widget is hosted in. (in case the widget is not in an Iframe but in a dedicated webview we send the postMessages same WebView the widget lives in. Filtering is done in the widget so it ignores the messages it receives from itself) |
|
||||
| `password` | | No | No | E2EE password when using a shared secret. (For individual sender keys in embedded mode this is not required.) |
|
||||
| `perParticipantE2EE` | `true` or `false` | No, defaults to `false` | No, defaults to `false` | Enables per participant encryption with Keys exchanged over encrypted matrix room messages. |
|
||||
| `preload` | `true` or `false` | No, defaults to `false` | Not applicable | Pauses app before joining a call until an `io.element.join` widget action is seen, allowing preloading. |
|
||||
| `returnToLobby` | `true` or `false` | No, defaults to `false` | Not applicable | Displays the lobby in widget mode after leaving a call; shows a blank page if set to `false`. Useful for video rooms. |
|
||||
| `roomId` | [Matrix Room ID](https://spec.matrix.org/v1.12/appendices/#room-ids) | Yes | No | Anything about what room we're pointed to should be from useRoomIdentifier which parses the path and resolves alias with respect to the default server name, however roomId is an exception as we need the room ID in embedded widget mode, and not the room alias (or even the via params because we are not trying to join it). This is also not validated, where it is in `useRoomIdentifier()`. |
|
||||
| `showControls` | `true` or `false` | No, defaults to `true` | No, defaults to `true` | Displays controls like mute, screen-share, invite, and hangup buttons during a call. |
|
||||
| `skipLobby` (deprecated: use `intent` instead) | `true` or `false` | No. If `intent` is explicitly `start_call` then defaults to `true`. Otherwise defaults to `false` | No, defaults to `false` | Skips the lobby to join a call directly, can be combined with preload in widget. When `true` the audio and video inputs will be muted by default. (This means there currently is no way to start without muted video if one wants to skip the lobby. Also not in widget mode.) |
|
||||
| `theme` | One of: `light`, `dark`, `light-high-contrast`, `dark-high-contrast` | No, defaults to `dark` | No, defaults to `dark` | UI theme to use. |
|
||||
| `userId` | [Matrix User Identifier](https://spec.matrix.org/v1.12/appendices/#user-identifiers) | Yes | Not applicable | The Matrix user ID. |
|
||||
| `viaServers` | Comma separated list of [Matrix Server Names](https://spec.matrix.org/v1.12/appendices/#server-name) | Not applicable | No | Homeserver for joining a room, non-empty value required for rooms not on the user’s default homeserver. |
|
||||
|
||||
### Widget-only parameters
|
||||
|
||||
These parameters are only available in widget mode.
|
||||
|
||||
| Name | Values | Required | Description |
|
||||
| --------------- | ----------------------------------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `baseUrl` | | Yes | The base URL of the homeserver to use for media lookups. |
|
||||
| `deviceId` | Matrix device ID | Yes | The Matrix device ID for the widget host. |
|
||||
| `parentUrl` | | Yes | The url used to send widget action postMessages. This should be the domain of the client or the webview the widget is hosted in. (in case the widget is not in an Iframe but in a dedicated webview we send the postMessages same WebView the widget lives in. Filtering is done in the widget so it ignores the messages it receives from itself) |
|
||||
| `preload` | `true` or `false` | No, defaults to `false` | Pauses app before joining a call until an `io.element.join` widget action is seen, allowing preloading. |
|
||||
| `returnToLobby` | `true` or `false` | No, defaults to `false` | Displays the lobby in widget mode after leaving a call; shows a blank page if set to `false`. Useful for video rooms. |
|
||||
| `userId` | [Matrix User Identifier](https://spec.matrix.org/v1.12/appendices/#user-identifiers) | Yes | The Matrix user ID. |
|
||||
| `widgetId` | [MSC2774](https://github.com/matrix-org/matrix-spec-proposals/pull/2774) format widget ID | Yes | The id used by the widget. The presence of this parameter implies that element call will not connect to a homeserver directly and instead tries to establish postMessage communication via the `parentUrl`. |
|
||||
| `widgetId` | [MSC2774](https://github.com/matrix-org/matrix-spec-proposals/pull/2774) format widget ID | Yes | Not applicable | The id used by the widget. The presence of this parameter implies that element call will not connect to a homeserver directly and instead tries to establish postMessage communication via the `parentUrl`. |
|
||||
|
||||
45
index.html
45
index.html
@@ -1,45 +0,0 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
|
||||
<% if (packageType === "full") { %>
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.png" />
|
||||
<link rel="preload" href="/config.json" as="fetch" />
|
||||
<% } %>
|
||||
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0"
|
||||
/>
|
||||
<title><%- brand %></title>
|
||||
<script>
|
||||
window.global = window;
|
||||
</script>
|
||||
|
||||
<% if (packageType === "full") { %>
|
||||
<!-- Open graph meta tags -->
|
||||
|
||||
<meta property="og:title" content="<%- brand %>" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="You're invited to join a call on <%- brand %>"
|
||||
/>
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:image" content="favicon.png" />
|
||||
|
||||
<meta name="twitter:card" content="summary_large_image" />
|
||||
<meta name="twitter:title" content="<%- brand %>" />
|
||||
<meta
|
||||
name="twitter:description"
|
||||
content="You're invited to join a call on <%- brand %>"
|
||||
/>
|
||||
<meta name="twitter:image" content="favicon.png" />
|
||||
<% } %>
|
||||
</head>
|
||||
|
||||
<!-- The default class is: .no-theme {display: none}. It will be overwritten once the app is loaded. -->
|
||||
<body class="no-theme">
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
3
knip.ts
3
knip.ts
@@ -1,9 +1,6 @@
|
||||
import { KnipConfig } from "knip";
|
||||
|
||||
export default {
|
||||
vite: {
|
||||
config: ["vite.config.js", "vite-embedded.config.js"],
|
||||
},
|
||||
entry: ["src/main.tsx", "i18next-parser.config.ts"],
|
||||
ignoreBinaries: [
|
||||
// This is deprecated, so Knip doesn't actually recognize it as a globally
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
"common": {
|
||||
"audio": "Звук",
|
||||
"avatar": "Аватар",
|
||||
"camera": "Камера",
|
||||
"display_name": "Име/псевдоним",
|
||||
"home": "Начало",
|
||||
"loading": "Зареждане…",
|
||||
"microphone": "Микрофон",
|
||||
"password": "Парола",
|
||||
"profile": "Профил",
|
||||
"settings": "Настройки",
|
||||
@@ -59,7 +61,8 @@
|
||||
"settings": {
|
||||
"developer_tab_title": "Разработчик",
|
||||
"feedback_tab_h4": "Изпрати обратна връзка",
|
||||
"feedback_tab_send_logs_label": "Включи debug логове"
|
||||
"feedback_tab_send_logs_label": "Включи debug логове",
|
||||
"speaker_device_selection_label": "Говорител"
|
||||
},
|
||||
"unauthenticated_view_body": "Все още не сте регистрирани? <2>Създайте акаунт</2>",
|
||||
"unauthenticated_view_login_button": "Влезте в акаунта си",
|
||||
|
||||
@@ -17,14 +17,20 @@
|
||||
"not_now_button": "Teď ne, vrátit se na domovskou obrazovku"
|
||||
},
|
||||
"common": {
|
||||
"camera": "Kamera",
|
||||
"display_name": "Zobrazované jméno",
|
||||
"home": "Domov",
|
||||
"loading": "Načítání…",
|
||||
"microphone": "Mikrofon",
|
||||
"password": "Heslo",
|
||||
"profile": "Profil",
|
||||
"settings": "Nastavení",
|
||||
"username": "Uživatelské jméno"
|
||||
},
|
||||
"error": {
|
||||
"generic_description": "Odeslání ladících záznamů nám pomůže diagnostikovat problém."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Oops, něco se pokazilo.</0>",
|
||||
"header_label": "Domov Element Call",
|
||||
"join_existing_call_modal": {
|
||||
"join_button": "Ano, připojit se",
|
||||
@@ -58,7 +64,8 @@
|
||||
"settings": {
|
||||
"developer_tab_title": "Vývojář",
|
||||
"feedback_tab_h4": "Dát feedback",
|
||||
"feedback_tab_send_logs_label": "Zahrnout ladící záznamy"
|
||||
"feedback_tab_send_logs_label": "Zahrnout ladící záznamy",
|
||||
"speaker_device_selection_label": "Reproduktor"
|
||||
},
|
||||
"unauthenticated_view_body": "Nejste registrovaní? <2>Vytvořit účet</2>",
|
||||
"unauthenticated_view_login_button": "Přihlásit se ke svému účtu",
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
"text": "Bereit, beizutreten?",
|
||||
"title": "App auswählen"
|
||||
},
|
||||
"application_opened_another_tab": "Diese Anwendung wurde in einem anderen Tab geöffnet.",
|
||||
"browser_media_e2ee_unsupported": "Dein Webbrowser unterstützt keine Medien-Ende-zu-Ende-Verschlüsselung. Unterstützte Browser sind Chrome, Safari, Firefox >=117",
|
||||
"browser_media_e2ee_unsupported_heading": "Inkompatibler Browser",
|
||||
"call_ended_view": {
|
||||
"create_account_button": "Konto erstellen",
|
||||
"create_account_prompt": "<0>Warum vergibst du nicht abschließend ein Passwort, um dein Konto zu erhalten?</0><1>Du kannst deinen Namen behalten und ein Profilbild für zukünftige Anrufe festlegen.</1>",
|
||||
@@ -44,10 +47,13 @@
|
||||
"audio": "Audio",
|
||||
"avatar": "Profilbild",
|
||||
"back": "Zurück",
|
||||
"camera": "Kamera",
|
||||
"display_name": "Anzeigename",
|
||||
"encrypted": "Verschlüsselt",
|
||||
"error": "Fehler",
|
||||
"home": "Startseite",
|
||||
"loading": "Lade …",
|
||||
"microphone": "Mikrofon",
|
||||
"next": "Weiter",
|
||||
"options": "Optionen",
|
||||
"password": "Passwort",
|
||||
@@ -56,49 +62,34 @@
|
||||
"reaction": "Reaktion",
|
||||
"reactions": "Reaktionen",
|
||||
"settings": "Einstellungen",
|
||||
"something_went_wrong": "Etwas ist schief gelaufen",
|
||||
"unencrypted": "Nicht verschlüsselt",
|
||||
"username": "Benutzername",
|
||||
"video": "Video"
|
||||
},
|
||||
"developer_mode": {
|
||||
"crypto_version": "Krypto-Version: {{version}}",
|
||||
"debug_tile_layout_label": "Kachel-Layout debuggen",
|
||||
"device_id": "Geräte-ID: {{id}}",
|
||||
"duplicate_tiles_label": "Anzahl zusätzlicher Kachelkopien pro Teilnehmer",
|
||||
"hostname": "Hostname: {{hostname}}",
|
||||
"livekit_server_info": "LiveKit-Server Informationen",
|
||||
"livekit_sfu": "LiveKit SFU: {{url}}",
|
||||
"matrix_id": "Matrix-ID: {{id}}",
|
||||
"show_connection_stats": "Verbindungsstatistiken anzeigen",
|
||||
"show_non_member_tiles": "Kacheln für Nicht-Mitgliedermedien anzeigen",
|
||||
"use_new_membership_manager": "Neuen MembershipManager verwenden"
|
||||
"matrix_id": "Matrix-ID: {{id}}"
|
||||
},
|
||||
"disconnected_banner": "Die Verbindung zum Server wurde getrennt.",
|
||||
"error": {
|
||||
"call_is_not_supported": "Anrufe werden nicht unterstützt",
|
||||
"call_not_found": "Anruf nicht gefunden",
|
||||
"call_not_found_description": "<0>Dieser Link scheint zu keinem bestehenden Anruf zu gehören. Vergewissern Sie sich, dass Sie den richtigen Link haben, oder <1> erstellen Sie einen neuen</1>. </0>",
|
||||
"connection_lost": "Verbindung verloren",
|
||||
"connection_lost_description": "Ihre Verbindung zum Anruf wurde unterbrochen.",
|
||||
"e2ee_unsupported": "Inkompatibler Browser",
|
||||
"e2ee_unsupported_description": "Ihr Webbrowser unterstützt keine verschlüsselten Anrufe. Zu den unterstützten Browsern gehören Chrome, Safari und Firefox 117+.",
|
||||
"generic": "Etwas ist schief gelaufen",
|
||||
"generic_description": "Durch das Senden von Debugprotokollen können wir das Problem leichter eingrenzen.",
|
||||
"insufficient_capacity": "Unzureichende Kapazität",
|
||||
"insufficient_capacity_description": "Der Server hat seine maximale Kapazität erreicht, daher ist ein Beitritt zum Anruf derzeit nicht möglich. Bitte später erneut versuchen oder den Serveradministrator kontaktieren, falls das Problem weiterhin besteht.",
|
||||
"matrix_rtc_focus_missing": "Der Server ist nicht für die Verwendung mit {{brand}} konfiguriert. Bitte den Serveradministrator kontaktieren (Domain: {{domain}}, Fehlercode: {{ errorCode }}).",
|
||||
"open_elsewhere": "In einem anderen Tab geöffnet",
|
||||
"open_elsewhere_description": "{{brand}} wurde in einem anderen Tab geöffnet. Wenn das nicht richtig klingt, versuchen Sie, die Seite neu zu laden.",
|
||||
"unexpected_ec_error": "Ein unerwarteter Fehler ist aufgetreten (<0>Fehlercode: </0> <1>{{ errorCode }}</1>). Bitte den Serveradministrator kontaktieren."
|
||||
"connection_lost_description": "Deine Verbindung wurde getrennt",
|
||||
"generic_description": "Übermittelte Problemberichte helfen uns, Fehler zu beheben."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Hoppla, etwas ist schiefgelaufen.</0>",
|
||||
"group_call_loader": {
|
||||
"banned_body": "Du wurdest aus dem Raum verbannt.",
|
||||
"banned_heading": "Verbannt",
|
||||
"call_ended_body": "Du wurdest aus dem Anruf entfernt.",
|
||||
"call_ended_heading": "Anruf beendet",
|
||||
"failed_heading": "Beitreten fehlgeschlagen",
|
||||
"failed_text": "Anruf nicht gefunden oder Beitritt nicht erlaubt",
|
||||
"knock_reject_body": "Die Teilnahmeanfrage wurde abgelehnt.",
|
||||
"knock_reject_heading": "Zugriff verweigert",
|
||||
"reason": "Grund: {{reason}}"
|
||||
"reason": "Grund"
|
||||
},
|
||||
"hangup_button_label": "Anruf beenden",
|
||||
"header_label": "Element Call-Startseite",
|
||||
@@ -158,20 +149,10 @@
|
||||
"screenshare_button_label": "Bildschirm teilen",
|
||||
"settings": {
|
||||
"audio_tab": {
|
||||
"effect_volume_description": "Lautstärke anpassen, mit der Reaktionen und Handmeldungen abgespielt werden.",
|
||||
"effect_volume_description": "Lautstärke anpassen, mit der Reaktionen und Handmeldungen abgespielt werden",
|
||||
"effect_volume_label": "Lautstärke der Soundeffekte"
|
||||
},
|
||||
"developer_tab_title": "Entwickler",
|
||||
"devices": {
|
||||
"camera": "Kamera",
|
||||
"camera_numbered": "Kamera {{n}}",
|
||||
"default": "Standard",
|
||||
"default_named": "Standard<2> ({{name}} )</2>",
|
||||
"microphone": "Mikrofon",
|
||||
"microphone_numbered": "Mikrofon{{n}}",
|
||||
"speaker": "Lautsprecher",
|
||||
"speaker_numbered": "Lautsprecher{{n}}"
|
||||
},
|
||||
"feedback_tab_body": "Falls du auf Probleme stößt oder einfach nur eine Rückmeldung geben möchtest, sende uns bitte eine kurze Beschreibung.",
|
||||
"feedback_tab_description_label": "Deine Rückmeldung",
|
||||
"feedback_tab_h4": "Rückmeldung geben",
|
||||
@@ -180,16 +161,12 @@
|
||||
"feedback_tab_title": "Rückmeldung",
|
||||
"opt_in_description": "<0></0><1></1>Du kannst deine Zustimmung durch Abwählen dieses Kästchens zurückziehen. Falls du dich aktuell in einem Anruf befindest, wird diese Einstellung nach dem Ende des Anrufs wirksam.",
|
||||
"preferences_tab": {
|
||||
"developer_mode_label": "Entwickler-Modus",
|
||||
"developer_mode_label_description": "Aktivieren Sie den Entwicklermodus und zeigen Sie die Registerkarte mit den Entwicklereinstellungen an.",
|
||||
"introduction": "Hier können zusätzliche Optionen für individuelle Anforderungen eingestellt werden.",
|
||||
"reactions_play_sound_description": "Spielen Sie einen Soundeffekt ab, wenn jemand eine Reaktion auf einen Anruf sendet.",
|
||||
"reactions_play_sound_description": "Einen Soundeffekt abspielen, wenn jemand eine Reaktion sendet",
|
||||
"reactions_play_sound_label": "Reaktionstöne abspielen",
|
||||
"reactions_show_description": "Zeige eine Animation, wenn jemand eine Reaktion sendet.",
|
||||
"reactions_show_label": "Reaktionen anzeigen",
|
||||
"show_hand_raised_timer_description": "Einen Timer zur Handmeldung anzeigen",
|
||||
"show_hand_raised_timer_label": "Dauer der Handmeldung anzeigen"
|
||||
}
|
||||
"reactions_show_label": "Reaktionen anzeigen"
|
||||
},
|
||||
"speaker_device_selection_label": "Lautsprecher"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} Stern",
|
||||
"star_rating_input_label_other": "{{count}} Sterne",
|
||||
@@ -206,7 +183,6 @@
|
||||
"version": "{{productName}} Version: {{version}}",
|
||||
"video_tile": {
|
||||
"always_show": "Immer anzeigen",
|
||||
"camera_starting": "Video wird geladen...",
|
||||
"change_fit_contain": "An Fenster anpassen",
|
||||
"collapse": "Minimieren",
|
||||
"expand": "Erweitern",
|
||||
|
||||
@@ -24,15 +24,21 @@
|
||||
},
|
||||
"common": {
|
||||
"audio": "Ήχος",
|
||||
"camera": "Κάμερα",
|
||||
"display_name": "Εμφανιζόμενο όνομα",
|
||||
"home": "Αρχική",
|
||||
"loading": "Φόρτωση…",
|
||||
"microphone": "Μικρόφωνο",
|
||||
"password": "Κωδικός",
|
||||
"profile": "Προφίλ",
|
||||
"settings": "Ρυθμίσεις",
|
||||
"username": "Όνομα χρήστη",
|
||||
"video": "Βίντεο"
|
||||
},
|
||||
"error": {
|
||||
"generic_description": "Η υποβολή αρχείων καταγραφής σφαλμάτων θα μας βοηθήσει να εντοπίσουμε το πρόβλημα."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Ωχ, κάτι πήγε στραβά.</0>",
|
||||
"header_label": "Element Κεντρική Οθόνη Κλήσεων",
|
||||
"join_existing_call_modal": {
|
||||
"join_button": "Ναι, συμμετοχή στην κλήση",
|
||||
@@ -70,7 +76,8 @@
|
||||
"feedback_tab_send_logs_label": "Να συμπεριληφθούν αρχεία καταγραφής",
|
||||
"feedback_tab_thank_you": "Ευχαριστούμε, λάβαμε τα σχόλιά σας!",
|
||||
"feedback_tab_title": "Ανατροφοδότηση",
|
||||
"opt_in_description": "<0></0><1></1>Μπορείτε να ανακαλέσετε τη συγκατάθεσή σας αποεπιλέγοντας αυτό το πλαίσιο. Εάν βρίσκεστε σε κλήση, η ρύθμιση αυτή θα τεθεί σε ισχύ στο τέλος της."
|
||||
"opt_in_description": "<0></0><1></1>Μπορείτε να ανακαλέσετε τη συγκατάθεσή σας αποεπιλέγοντας αυτό το πλαίσιο. Εάν βρίσκεστε σε κλήση, η ρύθμιση αυτή θα τεθεί σε ισχύ στο τέλος της.",
|
||||
"speaker_device_selection_label": "Ηχείο"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} αστέρι",
|
||||
"star_rating_input_label_other": "{{count}} αστέρια",
|
||||
|
||||
@@ -70,12 +70,10 @@
|
||||
"livekit_sfu": "LiveKit SFU: {{url}}",
|
||||
"matrix_id": "Matrix ID: {{id}}",
|
||||
"show_connection_stats": "Show connection statistics",
|
||||
"show_non_member_tiles": "Show tiles for non-member media",
|
||||
"use_new_membership_manager": "Use the new implementation of the call MembershipManager"
|
||||
"show_non_member_tiles": "Show tiles for non-member media"
|
||||
},
|
||||
"disconnected_banner": "Connectivity to the server has been lost.",
|
||||
"error": {
|
||||
"call_is_not_supported": "Call is not supported",
|
||||
"call_not_found": "Call not found",
|
||||
"call_not_found_description": "<0>That link doesn't appear to belong to any existing call. Check that you have the right link, or <1>create a new one</1>.</0>",
|
||||
"connection_lost": "Connection lost",
|
||||
@@ -84,12 +82,8 @@
|
||||
"e2ee_unsupported_description": "Your web browser does not support encrypted calls. Supported browsers include Chrome, Safari, and Firefox 117+.",
|
||||
"generic": "Something went wrong",
|
||||
"generic_description": "Submitting debug logs will help us track down the problem.",
|
||||
"insufficient_capacity": "Insufficient capacity",
|
||||
"insufficient_capacity_description": "The server has reached its maximum capacity and you cannot join the call at this time. Try again later, or contact your server admin if the problem persists.",
|
||||
"matrix_rtc_focus_missing": "The server is not configured to work with {{brand}}. Please contact your server admin (Domain: {{domain}}, Error Code: {{ errorCode }}).",
|
||||
"open_elsewhere": "Opened in another tab",
|
||||
"open_elsewhere_description": "{{brand}} has been opened in another tab. If that doesn't sound right, try reloading the page.",
|
||||
"unexpected_ec_error": "An unexpected error occurred (<0>Error Code:</0> <1>{{ errorCode }}</1>). Please contact your server admin."
|
||||
"open_elsewhere_description": "{{brand}} has been opened in another tab. If that doesn't sound right, try reloading the page."
|
||||
},
|
||||
"group_call_loader": {
|
||||
"banned_body": "You have been banned from the room.",
|
||||
|
||||
@@ -22,14 +22,20 @@
|
||||
"survey_prompt": "¿Cómo ha ido?"
|
||||
},
|
||||
"common": {
|
||||
"camera": "Cámara",
|
||||
"display_name": "Nombre a mostrar",
|
||||
"home": "Inicio",
|
||||
"loading": "Cargando…",
|
||||
"microphone": "Micrófono",
|
||||
"password": "Contraseña",
|
||||
"profile": "Perfil",
|
||||
"settings": "Ajustes",
|
||||
"username": "Nombre de usuario"
|
||||
},
|
||||
"error": {
|
||||
"generic_description": "Subir los registros de depuración nos ayudará a encontrar el problema."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Ups, algo ha salido mal.</0>",
|
||||
"header_label": "Inicio de Element Call",
|
||||
"join_existing_call_modal": {
|
||||
"join_button": "Si, unirse a la llamada",
|
||||
@@ -70,7 +76,8 @@
|
||||
"feedback_tab_send_logs_label": "Incluir registros de depuración",
|
||||
"feedback_tab_thank_you": "¡Gracias, hemos recibido tus comentarios!",
|
||||
"feedback_tab_title": "Danos tu opinión",
|
||||
"opt_in_description": "<0></0><1></1>Puedes retirar tu consentimiento desmarcando esta casilla. Si estás en una llamada, este ajuste se aplicará al final de esta."
|
||||
"opt_in_description": "<0></0><1></1>Puedes retirar tu consentimiento desmarcando esta casilla. Si estás en una llamada, este ajuste se aplicará al final de esta.",
|
||||
"speaker_device_selection_label": "Altavoz"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} estrella",
|
||||
"star_rating_input_label_other": "{{count}} estrellas",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"text": "Oled valmis liituma?",
|
||||
"title": "Vali rakendus"
|
||||
},
|
||||
"browser_media_e2ee_unsupported": "Sinu veebibrauser ei toeta meedia läbivat krüptimist. Toetatud brauserid on Chrome, Chromium, Safari ja Firefox >=117",
|
||||
"call_ended_view": {
|
||||
"create_account_button": "Loo konto",
|
||||
"create_account_prompt": "<0>Kas soovid salasõna seadistada ja sellega oma kasutajakonto alles jätta?</0><1>Nii saad säilitada oma nime ja määrata profiilipildi, mida saad kasutada tulevastes kõnedes</1>",
|
||||
@@ -35,10 +36,12 @@
|
||||
"common": {
|
||||
"audio": "Heli",
|
||||
"avatar": "Tunnuspilt",
|
||||
"camera": "Kaamera",
|
||||
"display_name": "Kuvatav nimi",
|
||||
"encrypted": "Krüptitud",
|
||||
"home": "Avavaatesse",
|
||||
"loading": "Laadimine …",
|
||||
"microphone": "Mikrofon",
|
||||
"password": "Salasõna",
|
||||
"profile": "Profiil",
|
||||
"settings": "Seadistused",
|
||||
@@ -46,6 +49,11 @@
|
||||
"username": "Kasutajanimi"
|
||||
},
|
||||
"disconnected_banner": "Võrguühendus serveriga on katkenud.",
|
||||
"error": {
|
||||
"connection_lost_description": "Sinu ühendus kõnega katkes",
|
||||
"generic_description": "Kui saadad meile vealogid, siis on lihtsam vea põhjust otsida."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Ohoo, midagi on nüüd katki.</0>",
|
||||
"hangup_button_label": "Lõpeta kõne",
|
||||
"header_participants_label": "Osalejad",
|
||||
"invite_modal": {
|
||||
@@ -98,7 +106,8 @@
|
||||
"feedback_tab_send_logs_label": "Lisa veatuvastuslogid",
|
||||
"feedback_tab_thank_you": "Tänud, me oleme sinu tagasiside kätte saanud!",
|
||||
"feedback_tab_title": "Tagasiside",
|
||||
"opt_in_description": "<0></0><1></1>Sa võid selle valiku eelmaldamisega alati oma nõusoleku tagasi võtta. Kui sul parasjagu on kõne pooleli, siis seadistuste muudatus jõustub pärast kõne lõppu."
|
||||
"opt_in_description": "<0></0><1></1>Sa võid selle valiku eelmaldamisega alati oma nõusoleku tagasi võtta. Kui sul parasjagu on kõne pooleli, siis seadistuste muudatus jõustub pärast kõne lõppu.",
|
||||
"speaker_device_selection_label": "Kõlar"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} tärni",
|
||||
"star_rating_input_label_other": "{{count}} tärni",
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
"common": {
|
||||
"audio": "صدا",
|
||||
"avatar": "آواتار",
|
||||
"camera": "دوربین",
|
||||
"display_name": "نام نمایشی",
|
||||
"home": "خانه",
|
||||
"loading": "بارگزاری…",
|
||||
"microphone": "میکروفون",
|
||||
"password": "رمز عبور",
|
||||
"profile": "پروفایل",
|
||||
"settings": "تنظیمات",
|
||||
@@ -61,7 +63,8 @@
|
||||
"settings": {
|
||||
"developer_tab_title": "توسعه دهنده",
|
||||
"feedback_tab_h4": "بازخورد ارائه دهید",
|
||||
"feedback_tab_send_logs_label": "شامل لاگهای عیبیابی"
|
||||
"feedback_tab_send_logs_label": "شامل لاگهای عیبیابی",
|
||||
"speaker_device_selection_label": "بلندگو"
|
||||
},
|
||||
"unauthenticated_view_body": "هنوز ثبتنام نکردهاید؟ <2>ساخت حساب کاربری</2>",
|
||||
"unauthenticated_view_login_button": "به حساب کاربری خود وارد شوید",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"text": "Prêt à rejoindre ?",
|
||||
"title": "Choisissez l’application"
|
||||
},
|
||||
"browser_media_e2ee_unsupported": "Votre navigateur web ne prend pas en charge le chiffrement de bout-en-bout des médias. Les navigateurs pris en charge sont Chrome, Safari, Firefox >= 117",
|
||||
"call_ended_view": {
|
||||
"create_account_button": "Créer un compte",
|
||||
"create_account_prompt": "<0>Pourquoi ne pas créer un mot de passe pour conserver votre compte ?</0><1>Vous pourrez garder votre nom et définir un avatar pour vos futurs appels</1>",
|
||||
@@ -33,6 +34,7 @@
|
||||
},
|
||||
"call_name": "Nom de l’appel",
|
||||
"common": {
|
||||
"camera": "Caméra",
|
||||
"display_name": "Nom d’affichage",
|
||||
"encrypted": "Chiffré",
|
||||
"home": "Accueil",
|
||||
@@ -45,6 +47,11 @@
|
||||
"video": "Vidéo"
|
||||
},
|
||||
"disconnected_banner": "La connexion avec le serveur a été perdue.",
|
||||
"error": {
|
||||
"connection_lost_description": "Vous avez été déconnecté de l’appel",
|
||||
"generic_description": "Soumettre les journaux de débogage nous aidera à déterminer le problème."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Oups, quelque chose s’est mal passé.</0>",
|
||||
"hangup_button_label": "Terminer l’appel",
|
||||
"header_label": "Accueil Element Call",
|
||||
"invite_modal": {
|
||||
@@ -97,7 +104,8 @@
|
||||
"feedback_tab_send_logs_label": "Inclure les journaux de débogage",
|
||||
"feedback_tab_thank_you": "Merci, nous avons reçu vos commentaires !",
|
||||
"feedback_tab_title": "Commentaires",
|
||||
"opt_in_description": "<0></0><1></1>Vous pouvez retirer votre consentement en décochant cette case. Si vous êtes actuellement en communication, ce paramètre prendra effet à la fin de l’appel."
|
||||
"opt_in_description": "<0></0><1></1>Vous pouvez retirer votre consentement en décochant cette case. Si vous êtes actuellement en communication, ce paramètre prendra effet à la fin de l’appel.",
|
||||
"speaker_device_selection_label": "Intervenant"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} favori",
|
||||
"star_rating_input_label_other": "{{count}} favoris",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"text": "Siap untuk bergabung?",
|
||||
"title": "Pilih plikasi"
|
||||
},
|
||||
"browser_media_e2ee_unsupported": "Peramban web Anda tidak mendukung enkripsi media ujung ke ujung. Peramban yang didukung adalah Chrome, Safari, dan Firefox >=117",
|
||||
"call_ended_view": {
|
||||
"create_account_button": "Buat akun",
|
||||
"create_account_prompt": "<0>Kenapa tidak selesaikan dengan mengatur sebuah kata sandi untuk menjaga akun Anda?</0><1>Anda akan dapat tetap menggunakan nama Anda dan atur sebuah avatar untuk digunakan dalam panggilan di masa mendatang</1>",
|
||||
@@ -33,10 +34,12 @@
|
||||
},
|
||||
"call_name": "Nama panggilan",
|
||||
"common": {
|
||||
"camera": "Kamera",
|
||||
"display_name": "Nama tampilan",
|
||||
"encrypted": "Terenkripsi",
|
||||
"home": "Beranda",
|
||||
"loading": "Memuat…",
|
||||
"microphone": "Mikrofon",
|
||||
"password": "Kata sandi",
|
||||
"profile": "Profil",
|
||||
"settings": "Pengaturan",
|
||||
@@ -44,6 +47,11 @@
|
||||
"username": "Nama pengguna"
|
||||
},
|
||||
"disconnected_banner": "Koneksi ke server telah hilang.",
|
||||
"error": {
|
||||
"connection_lost_description": "Anda terputus dari panggilan",
|
||||
"generic_description": "Mengirim catatan pengawakutuan akan membantu kami melacak masalahnya."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Aduh, ada yang salah.</0>",
|
||||
"hangup_button_label": "Akhiri panggilan",
|
||||
"header_label": "Beranda Element Call",
|
||||
"header_participants_label": "Peserta",
|
||||
@@ -97,7 +105,8 @@
|
||||
"feedback_tab_send_logs_label": "Termasuk catatan pengawakutuan",
|
||||
"feedback_tab_thank_you": "Terima kasih, kami telah menerima masukan Anda!",
|
||||
"feedback_tab_title": "Masukan",
|
||||
"opt_in_description": "<0></0><1></1>Anda dapat mengurungkan kembali izin dengan mencentang kotak ini. Jika Anda saat ini dalam panggilan, pengaturan ini akan diterapkan di akhir panggilan."
|
||||
"opt_in_description": "<0></0><1></1>Anda dapat mengurungkan kembali izin dengan mencentang kotak ini. Jika Anda saat ini dalam panggilan, pengaturan ini akan diterapkan di akhir panggilan.",
|
||||
"speaker_device_selection_label": "Pembicara"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} bintang",
|
||||
"star_rating_input_label_other": "{{count}} bintang",
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
"text": "Tutto pronto per entrare?",
|
||||
"title": "Seleziona app"
|
||||
},
|
||||
"browser_media_e2ee_unsupported": "Il tuo browser non supporta la crittografia end-to-end dei media. I browser supportati sono Chrome, Safari, Firefox >=117",
|
||||
"call_ended_view": {
|
||||
"create_account_button": "Crea profilo",
|
||||
"create_account_prompt": "<0>Ti va di terminare impostando una password per mantenere il profilo?</0><1>Potrai mantenere il tuo nome e impostare un avatar da usare in chiamate future</1>",
|
||||
@@ -32,16 +33,23 @@
|
||||
},
|
||||
"call_name": "Nome della chiamata",
|
||||
"common": {
|
||||
"camera": "Fotocamera",
|
||||
"display_name": "Il tuo nome",
|
||||
"encrypted": "Cifrata",
|
||||
"home": "Pagina iniziale",
|
||||
"loading": "Caricamento…",
|
||||
"microphone": "Microfono",
|
||||
"profile": "Profilo",
|
||||
"settings": "Impostazioni",
|
||||
"unencrypted": "Non cifrata",
|
||||
"username": "Nome utente"
|
||||
},
|
||||
"disconnected_banner": "La connessione al server è stata persa.",
|
||||
"error": {
|
||||
"connection_lost_description": "Sei stato disconnesso dalla chiamata",
|
||||
"generic_description": "L'invio di registri di debug ci aiuterà ad individuare il problema."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Ops, qualcosa è andato storto.</0>",
|
||||
"hangup_button_label": "Termina chiamata",
|
||||
"header_label": "Inizio di Element Call",
|
||||
"header_participants_label": "Partecipanti",
|
||||
@@ -94,7 +102,8 @@
|
||||
"feedback_tab_h4": "Invia commento",
|
||||
"feedback_tab_send_logs_label": "Includi registri di debug",
|
||||
"feedback_tab_thank_you": "Grazie, abbiamo ricevuto il tuo commento!",
|
||||
"opt_in_description": "<0></0><1></1>Puoi revocare il consenso deselezionando questa casella. Se attualmente sei in una chiamata, avrà effetto al termine di essa."
|
||||
"opt_in_description": "<0></0><1></1>Puoi revocare il consenso deselezionando questa casella. Se attualmente sei in una chiamata, avrà effetto al termine di essa.",
|
||||
"speaker_device_selection_label": "Altoparlante"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} stelle",
|
||||
"star_rating_input_label_other": "{{count}} stelle",
|
||||
|
||||
@@ -17,15 +17,20 @@
|
||||
"common": {
|
||||
"audio": "音声",
|
||||
"avatar": "アバター",
|
||||
"camera": "カメラ",
|
||||
"display_name": "表示名",
|
||||
"home": "ホーム",
|
||||
"loading": "読み込んでいます…",
|
||||
"microphone": "マイク",
|
||||
"password": "パスワード",
|
||||
"profile": "プロフィール",
|
||||
"settings": "設定",
|
||||
"username": "ユーザー名",
|
||||
"video": "ビデオ"
|
||||
},
|
||||
"error": {
|
||||
"generic_description": "何かがうまく行きませんでした。"
|
||||
},
|
||||
"header_label": "Element Call ホーム",
|
||||
"join_existing_call_modal": {
|
||||
"join_button": "はい、通話に参加",
|
||||
@@ -56,7 +61,8 @@
|
||||
"settings": {
|
||||
"developer_tab_title": "開発者",
|
||||
"feedback_tab_h4": "フィードバックを送信",
|
||||
"feedback_tab_send_logs_label": "デバッグログを含める"
|
||||
"feedback_tab_send_logs_label": "デバッグログを含める",
|
||||
"speaker_device_selection_label": "スピーカー"
|
||||
},
|
||||
"unauthenticated_view_body": "アカウントがありませんか? <2>アカウントを作成</2>",
|
||||
"unauthenticated_view_login_button": "アカウントにログイン",
|
||||
|
||||
@@ -26,15 +26,22 @@
|
||||
"common": {
|
||||
"audio": "Skaņa",
|
||||
"avatar": "Attēls",
|
||||
"camera": "Kamera",
|
||||
"display_name": "Attēlojamais vārds",
|
||||
"home": "Sākums",
|
||||
"loading": "Lādējas…",
|
||||
"microphone": "Mikrofons",
|
||||
"password": "Parole",
|
||||
"profile": "Profils",
|
||||
"settings": "Iestatījumi",
|
||||
"username": "Lietotājvārds"
|
||||
},
|
||||
"disconnected_banner": "Ir zaudēts savienojums ar serveri.",
|
||||
"error": {
|
||||
"connection_lost_description": "Tu tiki atvienots no zvana",
|
||||
"generic_description": "Atkļūdošanas žurnāla ierakstu iesūtīšana palīdzēs mums atklāt nepilnību."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Ak vai, kaut kas nogāja greizi!</0>",
|
||||
"header_label": "Element Call sākums",
|
||||
"join_existing_call_modal": {
|
||||
"join_button": "Jā, pievienoties zvanam",
|
||||
@@ -77,7 +84,8 @@
|
||||
"feedback_tab_send_logs_label": "Iekļaut atkļūdošanas žurnāla ierakstus",
|
||||
"feedback_tab_thank_you": "Paldies, mēs saņēmām atsauksmi!",
|
||||
"feedback_tab_title": "Atsauksmes",
|
||||
"opt_in_description": "<0></0><1></1>Savu piekrišanu var atsaukt ar atzīmes noņemšanu no šīs rūtiņas. Ja pašreiz atrodies zvanā, šis iestatījums stāsies spēkā zvana beigās."
|
||||
"opt_in_description": "<0></0><1></1>Savu piekrišanu var atsaukt ar atzīmes noņemšanu no šīs rūtiņas. Ja pašreiz atrodies zvanā, šis iestatījums stāsies spēkā zvana beigās.",
|
||||
"speaker_device_selection_label": "Runātājs"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} zvaigzne",
|
||||
"star_rating_input_label_other": "{{count}} zvaigznes",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"text": "Gotowy, by dołączyć?",
|
||||
"title": "Wybierz aplikację"
|
||||
},
|
||||
"browser_media_e2ee_unsupported": "Twoja przeglądarka nie wspiera szyfrowania end-to-end. Wspierane przeglądarki to Chrome, Safari, Firefox >=117",
|
||||
"call_ended_view": {
|
||||
"create_account_button": "Utwórz konto",
|
||||
"create_account_prompt": "<0>Może zechcesz ustawić hasło, aby zachować swoje konto?</0><1>Będziesz w stanie utrzymać swoją nazwę i ustawić awatar do wyświetlania podczas połączeń w przyszłości</1>",
|
||||
@@ -35,10 +36,12 @@
|
||||
"common": {
|
||||
"audio": "Dźwięk",
|
||||
"avatar": "Awatar",
|
||||
"camera": "Kamera",
|
||||
"display_name": "Nazwa wyświetlana",
|
||||
"encrypted": "Szyfrowane",
|
||||
"home": "Strona domowa",
|
||||
"loading": "Ładowanie…",
|
||||
"microphone": "Mikrofon",
|
||||
"password": "Hasło",
|
||||
"profile": "Profil",
|
||||
"settings": "Ustawienia",
|
||||
@@ -47,6 +50,11 @@
|
||||
"video": "Wideo"
|
||||
},
|
||||
"disconnected_banner": "Utracono połączenie z serwerem.",
|
||||
"error": {
|
||||
"connection_lost_description": "Rozłączono Cię z połączenia",
|
||||
"generic_description": "Wysłanie dzienników debuggowania pomoże nam ustalić przyczynę problemu."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Ojej, coś poszło nie tak.</0>",
|
||||
"hangup_button_label": "Zakończ połączenie",
|
||||
"header_label": "Strona główna Element Call",
|
||||
"header_participants_label": "Uczestnicy",
|
||||
@@ -100,7 +108,8 @@
|
||||
"feedback_tab_send_logs_label": "Dołącz dzienniki debugowania",
|
||||
"feedback_tab_thank_you": "Dziękujemy, otrzymaliśmy Twoją opinię!",
|
||||
"feedback_tab_title": "Opinia użytkownika",
|
||||
"opt_in_description": "<0></0><1></1>Możesz wycofać swoją zgodę poprzez odznaczenie tego pola. Jeśli już jesteś w trakcie rozmowy, opcja zostanie zastosowana po jej zakończeniu."
|
||||
"opt_in_description": "<0></0><1></1>Możesz wycofać swoją zgodę poprzez odznaczenie tego pola. Jeśli już jesteś w trakcie rozmowy, opcja zostanie zastosowana po jej zakończeniu.",
|
||||
"speaker_device_selection_label": "Głośnik"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} gwiazdki",
|
||||
"star_rating_input_label_other": "{{count}} gwiazdki",
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
"text": "Sunteți gata să vă alăturați?",
|
||||
"title": "Selectați aplicația"
|
||||
},
|
||||
"application_opened_another_tab": "Această aplicație a fost deschisă într-o altă filă.",
|
||||
"browser_media_e2ee_unsupported": "Browserul dvs. web nu acceptă criptarea media end-to-end. Browserele acceptate sunt Chrome, Safari, Firefox > = 117",
|
||||
"browser_media_e2ee_unsupported_heading": "Browser incompatibil",
|
||||
"call_ended_view": {
|
||||
"create_account_button": "Creează cont",
|
||||
"create_account_prompt": "<0>De ce să nu terminați prin configurarea unei parole pentru a vă păstra contul? </0><1>Veți putea să vă păstrați numele și să setați un avatar pentru a fi utilizat la apelurile viitoare </1>",
|
||||
@@ -44,10 +47,13 @@
|
||||
"audio": "Audio",
|
||||
"avatar": "avatar",
|
||||
"back": "Înapoi",
|
||||
"camera": "Aparat foto",
|
||||
"display_name": "Nume afișat",
|
||||
"encrypted": "Criptat",
|
||||
"error": "Eroare",
|
||||
"home": "Acasa",
|
||||
"loading": "Se încarcă...",
|
||||
"microphone": "Microfon",
|
||||
"next": "Urmator\n",
|
||||
"options": "Opțiuni",
|
||||
"password": "Parolă",
|
||||
@@ -56,6 +62,7 @@
|
||||
"reaction": "Reacție",
|
||||
"reactions": "Reacții",
|
||||
"settings": "Settings",
|
||||
"something_went_wrong": "Ceva nu a mers bine",
|
||||
"unencrypted": "Nu este criptat",
|
||||
"username": "Nume utilizator",
|
||||
"video": "Videoclip"
|
||||
@@ -68,11 +75,18 @@
|
||||
"matrix_id": "ID-ul matricei: {{id}}"
|
||||
},
|
||||
"disconnected_banner": "Conectivitatea la server a fost pierdută.",
|
||||
"error": {
|
||||
"connection_lost_description": "Ai fost deconectat de la apel",
|
||||
"generic_description": "Trimiterea jurnalelor de depanare ne va ajuta să urmărim problema."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Hopa, ceva nu a mers bine. </0>",
|
||||
"group_call_loader": {
|
||||
"banned_body": "Ai fost interzis să ieși din cameră.",
|
||||
"banned_heading": "Interzis",
|
||||
"call_ended_body": "Ați fost eliminat din apel.",
|
||||
"call_ended_heading": "Apel încheiat",
|
||||
"failed_heading": "Nu s-a putut alătura",
|
||||
"failed_text": "Apelul nu a fost găsit sau nu este accesibil.",
|
||||
"knock_reject_body": "Cererea dvs. de a vă alătura a fost respinsă.",
|
||||
"knock_reject_heading": "Acces refuzat",
|
||||
"reason": "Motivul"
|
||||
@@ -149,7 +163,8 @@
|
||||
"reactions_play_sound_label": "Redați sunete de reacție",
|
||||
"reactions_show_description": "Afișați o animație atunci când cineva trimite o reacție.",
|
||||
"reactions_show_label": "Afișați reacțiile"
|
||||
}
|
||||
},
|
||||
"speaker_device_selection_label": "vorbitor"
|
||||
},
|
||||
"start_new_call": "Începe un nou apel",
|
||||
"start_video_button_label": "Începeți videoclipul",
|
||||
|
||||
@@ -25,15 +25,21 @@
|
||||
"common": {
|
||||
"audio": "Аудио",
|
||||
"avatar": "Аватар",
|
||||
"camera": "Камера",
|
||||
"display_name": "Видимое имя",
|
||||
"home": "Начало",
|
||||
"loading": "Загрузка…",
|
||||
"microphone": "Микрофон",
|
||||
"password": "Пароль",
|
||||
"profile": "Профиль",
|
||||
"settings": "Настройки",
|
||||
"username": "Имя пользователя",
|
||||
"video": "Видео"
|
||||
},
|
||||
"error": {
|
||||
"generic_description": "Отправка журналов поможет нам найти и устранить проблему."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Упс, что-то пошло не так.</0>",
|
||||
"header_label": "Главная Element Call",
|
||||
"join_existing_call_modal": {
|
||||
"join_button": "Да, присоединиться",
|
||||
@@ -72,7 +78,8 @@
|
||||
"feedback_tab_send_logs_label": "Приложить журнал отладки",
|
||||
"feedback_tab_thank_you": "Спасибо. Мы получили ваш отзыв!",
|
||||
"feedback_tab_title": "Отзыв",
|
||||
"opt_in_description": "<0></0><1></1>Вы можете отозвать согласие, сняв этот флажок. Если вы в данный момент находитесь в разговоре, эта настройка вступит в силу по окончании разговора."
|
||||
"opt_in_description": "<0></0><1></1>Вы можете отозвать согласие, сняв этот флажок. Если вы в данный момент находитесь в разговоре, эта настройка вступит в силу по окончании разговора.",
|
||||
"speaker_device_selection_label": "Динамик"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} отмечен",
|
||||
"star_rating_input_label_other": "{{count}} отмеченных",
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"text": "Ste pripravení sa pridať?",
|
||||
"title": "Vybrať aplikáciu"
|
||||
},
|
||||
"browser_media_e2ee_unsupported": "Váš webový prehliadač nepodporuje end-to-end šifrovanie médií. Podporované prehliadače sú Chrome, Safari, Firefox >=117",
|
||||
"call_ended_view": {
|
||||
"create_account_button": "Vytvoriť účet",
|
||||
"create_account_prompt": "<0>Prečo neskončiť nastavením hesla, aby ste si zachovali svoj účet? </0><1>Budete si môcť ponechať svoje meno a nastaviť obrázok, ktorý sa bude používať pri budúcich hovoroch</1>",
|
||||
@@ -34,10 +35,12 @@
|
||||
"call_name": "Názov hovoru",
|
||||
"common": {
|
||||
"avatar": "Obrázok",
|
||||
"camera": "Kamera",
|
||||
"display_name": "Zobrazované meno",
|
||||
"encrypted": "Šifrované",
|
||||
"home": "Domov",
|
||||
"loading": "Načítanie…",
|
||||
"microphone": "Mikrofón",
|
||||
"password": "Heslo",
|
||||
"profile": "Profil",
|
||||
"settings": "Nastavenia",
|
||||
@@ -45,6 +48,11 @@
|
||||
"username": "Meno používateľa"
|
||||
},
|
||||
"disconnected_banner": "Spojenie so serverom sa stratilo.",
|
||||
"error": {
|
||||
"connection_lost_description": "Boli ste odpojení z hovoru",
|
||||
"generic_description": "Odoslanie záznamov ladenia nám pomôže nájsť problém."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Hups, niečo sa pokazilo.</0>",
|
||||
"hangup_button_label": "Ukončiť hovor",
|
||||
"header_label": "Domov Element Call",
|
||||
"header_participants_label": "Účastníci",
|
||||
@@ -98,7 +106,8 @@
|
||||
"feedback_tab_send_logs_label": "Zahrnúť záznamy o ladení",
|
||||
"feedback_tab_thank_you": "Ďakujeme, dostali sme vašu spätnú väzbu!",
|
||||
"feedback_tab_title": "Spätná väzba",
|
||||
"opt_in_description": "<0></0><1></1>Súhlas môžete odvolať zrušením označenia tohto políčka. Ak práve prebieha hovor, toto nastavenie nadobudne platnosť po skončení hovoru."
|
||||
"opt_in_description": "<0></0><1></1>Súhlas môžete odvolať zrušením označenia tohto políčka. Ak práve prebieha hovor, toto nastavenie nadobudne platnosť po skončení hovoru.",
|
||||
"speaker_device_selection_label": "Reproduktor"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} hviezdička",
|
||||
"star_rating_input_label_other": "{{count}} hviezdičiek",
|
||||
|
||||
@@ -15,9 +15,11 @@
|
||||
},
|
||||
"common": {
|
||||
"audio": "Ses",
|
||||
"camera": "Kamera",
|
||||
"display_name": "Ekran adı",
|
||||
"home": "Ev",
|
||||
"loading": "Yükleniyor…",
|
||||
"microphone": "Mikrofon",
|
||||
"password": "Parola",
|
||||
"settings": "Ayarlar"
|
||||
},
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
"text": "Готові приєднатися?",
|
||||
"title": "Вибрати застосунок"
|
||||
},
|
||||
"browser_media_e2ee_unsupported": "Ваш браузер не підтримує наскрізне шифрування мультимедійних даних. Підтримувані браузери: Chrome, Safari, Firefox >=117",
|
||||
"call_ended_view": {
|
||||
"create_account_button": "Створити обліковий запис",
|
||||
"create_account_prompt": "<0>Чому б не завершити, налаштувавши пароль для збереження свого облікового запису?</0><1>Ви зможете зберегти своє ім'я та встановити аватарку для подальшого користування під час майбутніх викликів</1>",
|
||||
@@ -35,10 +36,12 @@
|
||||
"common": {
|
||||
"audio": "Звук",
|
||||
"avatar": "Аватар",
|
||||
"camera": "Камера",
|
||||
"display_name": "Псевдонім",
|
||||
"encrypted": "Зашифровано",
|
||||
"home": "Домівка",
|
||||
"loading": "Завантаження…",
|
||||
"microphone": "Мікрофон",
|
||||
"password": "Пароль",
|
||||
"profile": "Профіль",
|
||||
"settings": "Налаштування",
|
||||
@@ -47,6 +50,11 @@
|
||||
"video": "Відео"
|
||||
},
|
||||
"disconnected_banner": "Втрачено зв'язок з сервером.",
|
||||
"error": {
|
||||
"connection_lost_description": "Вас від'єднано від виклику",
|
||||
"generic_description": "Надсилання журналів налагодження допоможе нам виявити проблему."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Йой, щось пішло не за планом.</0>",
|
||||
"hangup_button_label": "Завершити виклик",
|
||||
"header_label": "Домівка Element Call",
|
||||
"header_participants_label": "Учасники",
|
||||
@@ -100,7 +108,8 @@
|
||||
"feedback_tab_send_logs_label": "Долучити журнали налагодження",
|
||||
"feedback_tab_thank_you": "Дякуємо, ми отримали ваш відгук!",
|
||||
"feedback_tab_title": "Відгук",
|
||||
"opt_in_description": "<0></0><1></1>Ви можете відкликати згоду, прибравши цей прапорець. Якщо ви зараз розмовляєте, це налаштування застосується після завершення виклику."
|
||||
"opt_in_description": "<0></0><1></1>Ви можете відкликати згоду, прибравши цей прапорець. Якщо ви зараз розмовляєте, це налаштування застосується після завершення виклику.",
|
||||
"speaker_device_selection_label": "Динамік"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} зірок",
|
||||
"star_rating_input_label_other": "{{count}} зірок",
|
||||
|
||||
@@ -17,14 +17,20 @@
|
||||
"common": {
|
||||
"audio": "Âm thanh",
|
||||
"avatar": "Ảnh đại diện",
|
||||
"camera": "Máy quay",
|
||||
"display_name": "Tên hiển thị",
|
||||
"loading": "Đang tải…",
|
||||
"microphone": "Micrô",
|
||||
"password": "Mật khẩu",
|
||||
"profile": "Hồ sơ",
|
||||
"settings": "Cài đặt",
|
||||
"username": "Tên người dùng",
|
||||
"video": "Truyền hình"
|
||||
},
|
||||
"error": {
|
||||
"generic_description": "Gửi nhật ký gỡ lỗi sẽ giúp chúng tôi theo dõi vấn đề."
|
||||
},
|
||||
"full_screen_view_h1": "<0>Ối, có cái gì đó sai.</0>",
|
||||
"join_existing_call_modal": {
|
||||
"join_button": "Vâng, tham gia cuộc gọi",
|
||||
"text": "Cuộc gọi đã tồn tại, bạn có muốn tham gia không?",
|
||||
@@ -56,7 +62,8 @@
|
||||
"feedback_tab_h4": "Gửi phản hồi",
|
||||
"feedback_tab_send_logs_label": "Kèm theo nhật ký gỡ lỗi",
|
||||
"feedback_tab_thank_you": "Cảm ơn, chúng tôi đã nhận được phản hồi!",
|
||||
"feedback_tab_title": "Phản hồi"
|
||||
"feedback_tab_title": "Phản hồi",
|
||||
"speaker_device_selection_label": "Loa"
|
||||
},
|
||||
"submitting": "Đang gửi…",
|
||||
"unauthenticated_view_body": "Chưa đăng ký? <2>Tạo tài khoản</2>",
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
"text": "准备好加入了吗?",
|
||||
"title": "选择应用程序"
|
||||
},
|
||||
"browser_media_e2ee_unsupported": "您的浏览器不支持媒体端对端加密。支持的浏览器有 Chrome、Safari、Firefox >=117",
|
||||
"call_ended_view": {
|
||||
"body": "通话已中断",
|
||||
"create_account_button": "创建账户",
|
||||
"create_account_prompt": "<0>为何不设置密码来保留你的账户?</0><1>保留昵称并设置头像,以便在未来的通话中使用。</1>",
|
||||
"feedback_done": "<0>感谢反馈!</0>",
|
||||
@@ -33,10 +35,12 @@
|
||||
"common": {
|
||||
"audio": "音频",
|
||||
"avatar": "头像",
|
||||
"camera": "摄像头",
|
||||
"display_name": "显示名称",
|
||||
"encrypted": "已加密",
|
||||
"home": "主页",
|
||||
"loading": "加载中……",
|
||||
"microphone": "麦克风",
|
||||
"password": "密码",
|
||||
"profile": "个人信息",
|
||||
"settings": "设置",
|
||||
@@ -45,6 +49,8 @@
|
||||
"video": "视频"
|
||||
},
|
||||
"disconnected_banner": "与服务器的连接中断。",
|
||||
"full_screen_view_description": "<0>提交日志以帮助我们修复问题。</0>",
|
||||
"full_screen_view_h1": "<0>哎哟,出问题了。</0>",
|
||||
"hangup_button_label": "通话结束",
|
||||
"header_label": "Element Call主页",
|
||||
"join_existing_call_modal": {
|
||||
@@ -93,7 +99,8 @@
|
||||
"feedback_tab_send_logs_label": "包含调试日志",
|
||||
"feedback_tab_thank_you": "谢谢,我们收到了反馈!",
|
||||
"feedback_tab_title": "反馈",
|
||||
"opt_in_description": "<0></0><1></1>您可以取消选中复选框来撤回同意。如果正在通话中,此设置将在通话结束时生效。"
|
||||
"opt_in_description": "<0></0><1></1>您可以取消选中复选框来撤回同意。如果正在通话中,此设置将在通话结束时生效。",
|
||||
"speaker_device_selection_label": "发言人"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} 个星",
|
||||
"star_rating_input_label_other": "{{count}} 个星",
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
"text": "準備好加入了?",
|
||||
"title": "選取應用程式"
|
||||
},
|
||||
"browser_media_e2ee_unsupported": "您的網路瀏覽器不支援媒體端到端加密。支援的瀏覽器包含了 Chrome、Safari、Firefox >=117",
|
||||
"call_ended_view": {
|
||||
"body": "您已從通話斷線",
|
||||
"create_account_button": "建立帳號",
|
||||
"create_account_prompt": "<0>何不設定密碼以保留此帳號?</0><1>您可以保留暱稱並設定頭像,以便未來通話時使用</1>",
|
||||
"feedback_done": "<0>感謝您的回饋!</0>",
|
||||
@@ -35,10 +37,12 @@
|
||||
"common": {
|
||||
"audio": "語音",
|
||||
"avatar": "大頭照",
|
||||
"camera": "相機",
|
||||
"display_name": "顯示名稱",
|
||||
"encrypted": "已加密",
|
||||
"home": "首頁",
|
||||
"loading": "載入中…",
|
||||
"microphone": "麥克風",
|
||||
"password": "密碼",
|
||||
"profile": "個人檔案",
|
||||
"settings": "設定",
|
||||
@@ -47,6 +51,8 @@
|
||||
"video": "視訊"
|
||||
},
|
||||
"disconnected_banner": "到伺服器的連線已遺失。",
|
||||
"full_screen_view_description": "<0>送出除錯紀錄,可幫助我們修正問題。</0>",
|
||||
"full_screen_view_h1": "<0>喔喔,有些地方怪怪的。</0>",
|
||||
"hangup_button_label": "結束通話",
|
||||
"header_label": "Element Call 首頁",
|
||||
"header_participants_label": "參與者",
|
||||
@@ -100,7 +106,8 @@
|
||||
"feedback_tab_send_logs_label": "包含除錯紀錄",
|
||||
"feedback_tab_thank_you": "感謝,我們已經收到您的回饋了!",
|
||||
"feedback_tab_title": "回饋",
|
||||
"opt_in_description": "<0></0><1></1>您可以透過取消核取此方塊來撤回同意。若您目前正在通話中,此設定將在通話結束時生效。"
|
||||
"opt_in_description": "<0></0><1></1>您可以透過取消核取此方塊來撤回同意。若您目前正在通話中,此設定將在通話結束時生效。",
|
||||
"speaker_device_selection_label": "發言者"
|
||||
},
|
||||
"star_rating_input_label_one": "{{count}} 個星星",
|
||||
"star_rating_input_label_other": "{{count}} 個星星",
|
||||
|
||||
19
package.json
19
package.json
@@ -3,12 +3,8 @@
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "yarn dev:full",
|
||||
"dev:full": "vite",
|
||||
"dev:embedded": "vite --config vite-embedded.config.js",
|
||||
"build": "yarn build:full",
|
||||
"build:full": "NODE_OPTIONS=--max-old-space-size=16384 vite build",
|
||||
"build:embedded": "yarn build:full --config vite-embedded.config.js",
|
||||
"dev": "vite",
|
||||
"build": "NODE_OPTIONS=--max-old-space-size=16384 vite build",
|
||||
"serve": "vite preview",
|
||||
"prettier:check": "prettier -c .",
|
||||
"prettier:format": "prettier -w .",
|
||||
@@ -21,9 +17,7 @@
|
||||
"i18n:check": "i18next --fail-on-warnings --fail-on-update",
|
||||
"test": "vitest",
|
||||
"test:coverage": "vitest --coverage",
|
||||
"backend": "docker-compose -f dev-backend-docker-compose.yml up",
|
||||
"test:playwright": "playwright test",
|
||||
"test:playwright:open": "yarn test:playwright --ui"
|
||||
"backend": "docker-compose -f dev-backend-docker-compose.yml up"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.16.5",
|
||||
@@ -45,7 +39,6 @@
|
||||
"@opentelemetry/sdk-trace-base": "^1.25.1",
|
||||
"@opentelemetry/sdk-trace-web": "^1.9.1",
|
||||
"@opentelemetry/semantic-conventions": "^1.25.1",
|
||||
"@playwright/test": "^1.51.0",
|
||||
"@radix-ui/react-dialog": "^1.0.4",
|
||||
"@radix-ui/react-slider": "^1.1.2",
|
||||
"@radix-ui/react-visually-hidden": "^1.0.3",
|
||||
@@ -98,7 +91,7 @@
|
||||
"livekit-client": "^2.5.7",
|
||||
"lodash-es": "^4.17.21",
|
||||
"loglevel": "^1.9.1",
|
||||
"matrix-js-sdk": "github:matrix-org/matrix-js-sdk#8395919f0fd1af7cab1e793d736f2cdf18ef7686",
|
||||
"matrix-js-sdk": "^36.1.0",
|
||||
"matrix-widget-api": "1.11.0",
|
||||
"normalize.css": "^8.0.1",
|
||||
"observable-hooks": "^4.2.3",
|
||||
@@ -121,14 +114,12 @@
|
||||
"unique-names-generator": "^4.6.0",
|
||||
"vaul": "^1.0.0",
|
||||
"vite": "^6.0.0",
|
||||
"vite-plugin-generate-file": "^0.2.0",
|
||||
"vite-plugin-html": "^3.2.2",
|
||||
"vite-plugin-html-template": "^1.1.0",
|
||||
"vite-plugin-svgr": "^4.0.0",
|
||||
"vitest": "^3.0.0",
|
||||
"vitest-axe": "^1.0.0-pre.3"
|
||||
},
|
||||
"resolutions": {
|
||||
"@livekit/components-core/rxjs": "^7.8.1",
|
||||
"matrix-widget-api": "1.11.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { defineConfig, devices } from "@playwright/test";
|
||||
|
||||
/**
|
||||
* See https://playwright.dev/docs/test-configuration.
|
||||
*/
|
||||
export default defineConfig({
|
||||
testDir: "./playwright",
|
||||
/* Run tests in files in parallel */
|
||||
fullyParallel: true,
|
||||
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||
forbidOnly: !!process.env.CI,
|
||||
/* Retry on CI only */
|
||||
retries: process.env.CI ? 2 : 0,
|
||||
/* Opt out of parallel tests on CI. */
|
||||
workers: process.env.CI ? 1 : undefined,
|
||||
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||
reporter: "html",
|
||||
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||
use: {
|
||||
/* Base URL to use in actions like `await page.goto('/')`. */
|
||||
baseURL: "https://localhost:3000",
|
||||
|
||||
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||
trace: "on-first-retry",
|
||||
},
|
||||
/* Configure projects for major browsers */
|
||||
projects: [
|
||||
{
|
||||
name: "chromium",
|
||||
use: {
|
||||
...devices["Desktop Chrome"],
|
||||
permissions: [
|
||||
"clipboard-write",
|
||||
"clipboard-read",
|
||||
"microphone",
|
||||
"camera",
|
||||
],
|
||||
ignoreHTTPSErrors: true,
|
||||
launchOptions: {
|
||||
args: [
|
||||
"--use-fake-ui-for-media-stream",
|
||||
"--use-fake-device-for-media-stream",
|
||||
"--mute-audio",
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
name: "firefox",
|
||||
use: {
|
||||
...devices["Desktop Firefox"],
|
||||
ignoreHTTPSErrors: true,
|
||||
launchOptions: {
|
||||
firefoxUserPrefs: {
|
||||
"permissions.default.microphone": 1,
|
||||
"permissions.default.camera": 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// No safari for now, until I find a solution to fix `Not allowed to request resource` due to calling
|
||||
// clear http to the homeserver
|
||||
],
|
||||
|
||||
/* Run your local dev server before starting the tests */
|
||||
webServer: {
|
||||
command: "yarn dev",
|
||||
url: "https://localhost:3000",
|
||||
reuseExistingServer: !process.env.CI,
|
||||
ignoreHTTPSErrors: true,
|
||||
},
|
||||
});
|
||||
@@ -1,131 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("Sign up a new account, then login, then logout", async ({ browser }) => {
|
||||
const userId = `test_user-id_${Date.now()}`;
|
||||
|
||||
const newUserContext = await browser.newContext();
|
||||
const newUserPage = await newUserContext.newPage();
|
||||
await newUserPage.goto("/");
|
||||
|
||||
await expect(newUserPage.getByTestId("home_register")).toBeVisible();
|
||||
await newUserPage.getByTestId("home_register").click();
|
||||
|
||||
await newUserPage.getByTestId("register_username").click();
|
||||
await newUserPage.getByTestId("register_username").fill(userId);
|
||||
|
||||
await newUserPage.getByTestId("register_password").click();
|
||||
await newUserPage.getByTestId("register_password").fill("password1!");
|
||||
await newUserPage.getByTestId("register_confirm_password").click();
|
||||
await newUserPage.getByTestId("register_confirm_password").fill("password1!");
|
||||
await newUserPage.getByTestId("register_register").click();
|
||||
|
||||
await expect(
|
||||
newUserPage.getByRole("heading", { name: "Start new call" }),
|
||||
).toBeVisible();
|
||||
|
||||
// Now use a new page to login this account
|
||||
const returningUserContext = await browser.newContext();
|
||||
const returningUserPage = await returningUserContext.newPage();
|
||||
await returningUserPage.goto("/");
|
||||
|
||||
await expect(returningUserPage.getByTestId("home_login")).toBeVisible();
|
||||
await returningUserPage.getByTestId("home_login").click();
|
||||
await returningUserPage.getByTestId("login_username").click();
|
||||
await returningUserPage.getByTestId("login_username").fill(userId);
|
||||
await returningUserPage.getByTestId("login_password").click();
|
||||
await returningUserPage.getByTestId("login_password").fill("password1!");
|
||||
await returningUserPage.getByTestId("login_login").click();
|
||||
|
||||
await expect(
|
||||
returningUserPage.getByRole("heading", { name: "Start new call" }),
|
||||
).toBeVisible();
|
||||
|
||||
// logout
|
||||
await returningUserPage.getByTestId("usermenu_open").click();
|
||||
await returningUserPage.locator('[data-test-id="usermenu_logout"]').click();
|
||||
|
||||
await expect(
|
||||
returningUserPage.getByRole("link", { name: "Log In" }),
|
||||
).toBeVisible();
|
||||
await expect(returningUserPage.getByTestId("home_login")).toBeVisible();
|
||||
});
|
||||
|
||||
test("As a guest, create a call, share link and other join", async ({
|
||||
browser,
|
||||
}) => {
|
||||
// Use reduce motion to disable animations that are making the tests a bit flaky
|
||||
const creatorContext = await browser.newContext({ reducedMotion: "reduce" });
|
||||
const creatorPage = await creatorContext.newPage();
|
||||
|
||||
await creatorPage.goto("/");
|
||||
|
||||
// ========
|
||||
// ARRANGE: The first user creates a call as guest, join it, then click the invite button to copy the invite link
|
||||
// ========
|
||||
await creatorPage.getByTestId("home_callName").click();
|
||||
await creatorPage.getByTestId("home_callName").fill("Welcome");
|
||||
await creatorPage.getByTestId("home_displayName").click();
|
||||
await creatorPage.getByTestId("home_displayName").fill("Inviter");
|
||||
await creatorPage.getByTestId("home_go").click();
|
||||
await expect(creatorPage.locator("video")).toBeVisible();
|
||||
|
||||
// join
|
||||
await creatorPage.getByTestId("lobby_joinCall").click();
|
||||
// Spotlight mode to make checking the test visually clearer
|
||||
await creatorPage.getByRole("radio", { name: "Spotlight" }).check();
|
||||
|
||||
// Get the invite link
|
||||
await creatorPage.getByRole("button", { name: "Invite" }).click();
|
||||
await expect(
|
||||
creatorPage.getByRole("heading", { name: "Invite to this call" }),
|
||||
).toBeVisible();
|
||||
await expect(creatorPage.getByRole("img", { name: "QR Code" })).toBeVisible();
|
||||
await expect(creatorPage.getByTestId("modal_inviteLink")).toBeVisible();
|
||||
await expect(creatorPage.getByTestId("modal_inviteLink")).toBeVisible();
|
||||
await creatorPage.getByTestId("modal_inviteLink").click();
|
||||
|
||||
let inviteLink = (await creatorPage.evaluate(
|
||||
"navigator.clipboard.readText()",
|
||||
)) as string;
|
||||
expect(inviteLink).toContain("room/#/");
|
||||
|
||||
// ========
|
||||
// ACT: The other user use the invite link to join the call as a guest
|
||||
// ========
|
||||
const guestInviteeContext = await browser.newContext({
|
||||
reducedMotion: "reduce",
|
||||
});
|
||||
const guestPage = await guestInviteeContext.newPage();
|
||||
|
||||
await guestPage.goto(inviteLink);
|
||||
await guestPage.getByTestId("joincall_displayName").fill("Invitee");
|
||||
await expect(guestPage.getByTestId("joincall_joincall")).toBeVisible();
|
||||
await guestPage.getByTestId("joincall_joincall").click();
|
||||
await guestPage.getByTestId("lobby_joinCall").click();
|
||||
await guestPage.getByRole("radio", { name: "Spotlight" }).check();
|
||||
|
||||
// ========
|
||||
// ASSERT: check that there are two members in the call
|
||||
// ========
|
||||
|
||||
// There should be two participants now
|
||||
await expect(
|
||||
guestPage.getByTestId("roomHeader_participants_count"),
|
||||
).toContainText("2");
|
||||
expect(await guestPage.getByTestId("videoTile").count()).toBe(2);
|
||||
|
||||
// Same in creator page
|
||||
await expect(
|
||||
creatorPage.getByTestId("roomHeader_participants_count"),
|
||||
).toContainText("2");
|
||||
expect(await creatorPage.getByTestId("videoTile").count()).toBe(2);
|
||||
|
||||
// XXX check the display names on the video tiles
|
||||
});
|
||||
@@ -1,55 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test("Start a new call then leave and show the feedback screen", async ({
|
||||
page,
|
||||
}) => {
|
||||
await page.goto("/");
|
||||
|
||||
await page.getByTestId("home_callName").click();
|
||||
await page.getByTestId("home_callName").fill("HelloCall");
|
||||
await page.getByTestId("home_displayName").click();
|
||||
await page.getByTestId("home_displayName").fill("John Doe");
|
||||
await page.getByTestId("home_go").click();
|
||||
|
||||
await expect(page.locator("video")).toBeVisible();
|
||||
await expect(page.getByTestId("lobby_joinCall")).toBeVisible();
|
||||
|
||||
// Check the button toolbar
|
||||
// await expect(page.getByRole('button', { name: 'Mute microphone' })).toBeVisible();
|
||||
// await expect(page.getByRole('button', { name: 'Stop video' })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "Settings" })).toBeVisible();
|
||||
await expect(page.getByRole("button", { name: "End call" })).toBeVisible();
|
||||
|
||||
// Join the call
|
||||
await page.getByTestId("lobby_joinCall").click();
|
||||
|
||||
// Ensure that the call is connected
|
||||
await page
|
||||
.locator("div")
|
||||
.filter({ hasText: /^HelloCall$/ })
|
||||
.click();
|
||||
// Check the number of participants
|
||||
await expect(page.locator("div").filter({ hasText: /^1$/ })).toBeVisible();
|
||||
// The tooltip with the name should be visible
|
||||
await expect(page.getByTestId("name_tag")).toContainText("John Doe");
|
||||
|
||||
// leave the call
|
||||
await page.getByTestId("incall_leave").click();
|
||||
await expect(page.getByRole("heading")).toContainText(
|
||||
"John Doe, your call has ended. How did it go?",
|
||||
);
|
||||
await expect(page.getByRole("main")).toContainText(
|
||||
"Why not finish by setting up a password to keep your account?",
|
||||
);
|
||||
|
||||
await expect(
|
||||
page.getByRole("link", { name: "Not now, return to home screen" }),
|
||||
).toBeVisible();
|
||||
});
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { test, expect } from "@playwright/test";
|
||||
|
||||
test("has title", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
|
||||
await expect(page).toHaveTitle(/Element Call/);
|
||||
});
|
||||
|
||||
test("Landing page", async ({ page }) => {
|
||||
await page.goto("/");
|
||||
|
||||
// There should be a login button in the header
|
||||
await expect(page.getByRole("link", { name: "Log In" })).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.getByRole("heading", { name: "Start new call" }),
|
||||
).toBeVisible();
|
||||
|
||||
await expect(page.getByTestId("home_callName")).toBeVisible();
|
||||
await expect(page.getByTestId("home_displayName")).toBeVisible();
|
||||
|
||||
await expect(page.getByTestId("home_go")).toBeVisible();
|
||||
});
|
||||
21
public/index.html
Normal file
21
public/index.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.png" />
|
||||
<link rel="preload" href="/config.json" as="fetch" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, maximum-scale=1.0"
|
||||
/>
|
||||
<title><%- title %></title>
|
||||
<script>
|
||||
window.global = window;
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<!-- The default class is: .no-theme {display: none}. It will be overwritten once the app is loaded. -->
|
||||
<body class="no-theme">
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
</html>
|
||||
3
src/@types/global.d.ts
vendored
3
src/@types/global.d.ts
vendored
@@ -6,8 +6,6 @@ Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import "matrix-js-sdk/src/@types/global";
|
||||
import { type setLogLevel as setLKLogLevel } from "livekit-client";
|
||||
|
||||
import type { DurationFormat as PolyfillDurationFormat } from "@formatjs/intl-durationformat";
|
||||
import { type Controls } from "../controls";
|
||||
|
||||
@@ -20,7 +18,6 @@ declare global {
|
||||
|
||||
interface Window {
|
||||
controls: Controls;
|
||||
setLKLogLevel: typeof setLKLogLevel;
|
||||
}
|
||||
|
||||
interface HTMLElement {
|
||||
|
||||
@@ -72,11 +72,7 @@ export const App: FC = () => {
|
||||
<Suspense fallback={null}>
|
||||
<ClientProvider>
|
||||
<MediaDevicesProvider>
|
||||
<Sentry.ErrorBoundary
|
||||
fallback={(error) => (
|
||||
<ErrorPage error={error} widget={widget} />
|
||||
)}
|
||||
>
|
||||
<Sentry.ErrorBoundary fallback={ErrorPage}>
|
||||
<DisconnectedBanner />
|
||||
<Routes>
|
||||
<SentryRoute path="/" element={<HomePage />} />
|
||||
|
||||
@@ -351,7 +351,7 @@ export const ClientProvider: FC<Props> = ({ children }) => {
|
||||
}, [initClientState, onSync]);
|
||||
|
||||
if (alreadyOpenedErr) {
|
||||
return <ErrorPage widget={widget} error={alreadyOpenedErr} />;
|
||||
return <ErrorPage error={alreadyOpenedErr} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -12,16 +12,13 @@ import {
|
||||
type FC,
|
||||
type ReactNode,
|
||||
type SVGAttributes,
|
||||
type ReactElement,
|
||||
} from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { RageshakeButton } from "./settings/RageshakeButton";
|
||||
import styles from "./ErrorView.module.css";
|
||||
import { useUrlParams } from "./UrlParams";
|
||||
import { LinkButton } from "./button";
|
||||
import { ElementWidgetActions, type WidgetHelpers } from "./widget.ts";
|
||||
|
||||
interface Props {
|
||||
Icon: ComponentType<SVGAttributes<SVGElement>>;
|
||||
@@ -38,7 +35,6 @@ interface Props {
|
||||
*/
|
||||
fatal?: boolean;
|
||||
children: ReactNode;
|
||||
widget: WidgetHelpers | null;
|
||||
}
|
||||
|
||||
export const ErrorView: FC<Props> = ({
|
||||
@@ -47,7 +43,6 @@ export const ErrorView: FC<Props> = ({
|
||||
rageshake,
|
||||
fatal,
|
||||
children,
|
||||
widget,
|
||||
}) => {
|
||||
const { t } = useTranslation();
|
||||
const { confineToRoom } = useUrlParams();
|
||||
@@ -56,46 +51,6 @@ export const ErrorView: FC<Props> = ({
|
||||
window.location.href = "/";
|
||||
}, []);
|
||||
|
||||
const CloseWidgetButton: FC<{ widget: WidgetHelpers }> = ({
|
||||
widget,
|
||||
}): ReactElement => {
|
||||
// in widget mode we don't want to show the return home button but a close button
|
||||
const closeWidget = (): void => {
|
||||
widget.api.transport
|
||||
.send(ElementWidgetActions.Close, {})
|
||||
.catch((e) => {
|
||||
// What to do here?
|
||||
logger.error("Failed to send close action", e);
|
||||
})
|
||||
.finally(() => {
|
||||
widget.api.transport.stop();
|
||||
});
|
||||
};
|
||||
return (
|
||||
<Button kind="primary" onClick={closeWidget}>
|
||||
{t("action.close")}
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
||||
// Whether the error is considered fatal or pathname is `/` then reload the all app.
|
||||
// If not then navigate to home page.
|
||||
const ReturnToHomeButton = (): ReactElement => {
|
||||
if (fatal || location.pathname === "/") {
|
||||
return (
|
||||
<Button kind="tertiary" className={styles.homeLink} onClick={onReload}>
|
||||
{t("return_home_button")}
|
||||
</Button>
|
||||
);
|
||||
} else {
|
||||
return (
|
||||
<LinkButton kind="tertiary" className={styles.homeLink} to="/">
|
||||
{t("return_home_button")}
|
||||
</LinkButton>
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<div className={styles.error}>
|
||||
<BigIcon className={styles.icon}>
|
||||
@@ -108,11 +63,20 @@ export const ErrorView: FC<Props> = ({
|
||||
{rageshake && (
|
||||
<RageshakeButton description={`***Error View***: ${title}`} />
|
||||
)}
|
||||
{widget ? (
|
||||
<CloseWidgetButton widget={widget} />
|
||||
) : (
|
||||
!confineToRoom && <ReturnToHomeButton />
|
||||
)}
|
||||
{!confineToRoom &&
|
||||
(fatal || location.pathname === "/" ? (
|
||||
<Button
|
||||
kind="tertiary"
|
||||
className={styles.homeLink}
|
||||
onClick={onReload}
|
||||
>
|
||||
{t("return_home_button")}
|
||||
</Button>
|
||||
) : (
|
||||
<LinkButton kind="tertiary" className={styles.homeLink} to="/">
|
||||
{t("return_home_button")}
|
||||
</LinkButton>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -17,7 +17,6 @@ import styles from "./FullScreenView.module.css";
|
||||
import { useUrlParams } from "./UrlParams";
|
||||
import { RichError } from "./RichError";
|
||||
import { ErrorView } from "./ErrorView";
|
||||
import { type WidgetHelpers } from "./widget.ts";
|
||||
|
||||
interface FullScreenViewProps {
|
||||
className?: string;
|
||||
@@ -48,12 +47,11 @@ export const FullScreenView: FC<FullScreenViewProps> = ({
|
||||
|
||||
interface ErrorPageProps {
|
||||
error: Error | unknown;
|
||||
widget: WidgetHelpers | null;
|
||||
}
|
||||
|
||||
// Due to this component being used as the crash fallback for Sentry, which has
|
||||
// weird type requirements, we can't just give this a type of FC<ErrorPageProps>
|
||||
export const ErrorPage = ({ error, widget }: ErrorPageProps): ReactElement => {
|
||||
export const ErrorPage = ({ error }: ErrorPageProps): ReactElement => {
|
||||
const { t } = useTranslation();
|
||||
useEffect(() => {
|
||||
logger.error(error);
|
||||
@@ -65,13 +63,7 @@ export const ErrorPage = ({ error, widget }: ErrorPageProps): ReactElement => {
|
||||
{error instanceof RichError ? (
|
||||
error.richMessage
|
||||
) : (
|
||||
<ErrorView
|
||||
widget={widget}
|
||||
Icon={ErrorIcon}
|
||||
title={t("error.generic")}
|
||||
rageshake
|
||||
fatal
|
||||
>
|
||||
<ErrorView Icon={ErrorIcon} title={t("error.generic")} rageshake fatal>
|
||||
<p>{t("error.generic_description")}</p>
|
||||
</ErrorView>
|
||||
)}
|
||||
|
||||
@@ -161,12 +161,7 @@ export const RoomHeaderInfo: FC<RoomHeaderInfoProps> = ({
|
||||
height={20}
|
||||
aria-label={t("header_participants_label")}
|
||||
/>
|
||||
<Text
|
||||
as="span"
|
||||
size="sm"
|
||||
weight="medium"
|
||||
data-testid="roomHeader_participants_count"
|
||||
>
|
||||
<Text as="span" size="sm" weight="medium">
|
||||
{t("participant_count", { count: participantCount ?? 0 })}
|
||||
</Text>
|
||||
</div>
|
||||
|
||||
@@ -46,7 +46,7 @@ test("the modal can be closed by clicking the close button", async () => {
|
||||
}
|
||||
const user = userEvent.setup();
|
||||
const { queryByRole, getByRole } = render(<ModalFn />);
|
||||
await user.click(getByRole("button", { name: "Close" }));
|
||||
await user.click(getByRole("button", { name: "action.close" }));
|
||||
expect(queryByRole("dialog")).toBeNull();
|
||||
});
|
||||
|
||||
|
||||
@@ -5,12 +5,11 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { type FC, type ReactNode } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { PopOutIcon } from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||
|
||||
import type { FC, ReactNode } from "react";
|
||||
import { ErrorView } from "./ErrorView";
|
||||
import { widget } from "./widget.ts";
|
||||
|
||||
/**
|
||||
* An error consisting of a terse message to be logged to the console and a
|
||||
@@ -32,11 +31,7 @@ const OpenElsewhere: FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
return (
|
||||
<ErrorView
|
||||
widget={widget}
|
||||
Icon={PopOutIcon}
|
||||
title={t("error.open_elsewhere")}
|
||||
>
|
||||
<ErrorView Icon={PopOutIcon} title={t("error.open_elsewhere")}>
|
||||
<p>
|
||||
{t("error.open_elsewhere_description", {
|
||||
brand: import.meta.env.VITE_PRODUCT_NAME || "Element Call",
|
||||
|
||||
@@ -110,8 +110,8 @@ describe("UrlParams", () => {
|
||||
});
|
||||
|
||||
describe("returnToLobby", () => {
|
||||
it("is false in SPA mode", () => {
|
||||
expect(getUrlParams("?returnToLobby=true").returnToLobby).toBe(false);
|
||||
it("is true in SPA mode", () => {
|
||||
expect(getUrlParams("?returnToLobby=false").returnToLobby).toBe(true);
|
||||
});
|
||||
|
||||
it("defaults to false in widget mode", () => {
|
||||
|
||||
@@ -264,9 +264,7 @@ export const getUrlParams = (
|
||||
"skipLobby",
|
||||
isWidget && intent === UserIntent.StartNewCall,
|
||||
),
|
||||
// In SPA mode the user should always exit to the home screen when hanging
|
||||
// up, rather than being sent back to the lobby
|
||||
returnToLobby: isWidget ? parser.getFlagParam("returnToLobby") : false,
|
||||
returnToLobby: isWidget ? parser.getFlagParam("returnToLobby") : true,
|
||||
theme: parser.getParam("theme"),
|
||||
viaServers: !isWidget ? parser.getParam("viaServers") : null,
|
||||
homeserver: !isWidget ? parser.getParam("homeserver") : null,
|
||||
|
||||
@@ -5,7 +5,7 @@ exports[`QrCode > renders 1`] = `
|
||||
class="qrCode bar"
|
||||
>
|
||||
<img
|
||||
alt="QR Code"
|
||||
alt="qr_code"
|
||||
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHQAAAB0CAYAAABUmhYnAAAAAklEQVR4AewaftIAAALBSURBVO3BQW7kQAwEwSxC//9yro88NSBI4/UQjIg/WGMUa5RijVKsUYo1SrFGKdYoxRqlWKMUa5RijVKsUYo1SrFGKdYoxRrl4qEk/CaVkyR0Kl0STlS6JPwmlSeKNUqxRinWKBcvU3lTEk6S8ITKHSpvSsKbijVKsUYp1igXH5aEO1Q+SaVLQqdyRxLuUPmkYo1SrFGKNcrFl1PpknCShE5lkmKNUqxRijXKxZdLQqdyotIloVP5ZsUapVijFGuUiw9T+UuS8CaVv6RYoxRrlGKNcvGyJPwlSehUuiTckYS/rFijFGuUYo0Sf/DFkvAmlW9WrFGKNUqxRrl4KAknKl0SOpWTJJyodEk4UbkjCXeodEk4UXlTsUYp1ijFGuXiIZUuCXck4USlS0KXhE7lk1TelIRO5YlijVKsUYo1ysXLVLok3KHSJaFT6ZLQJaFTOUnCicodSehUTpLwpmKNUqxRijXKxUNJ6FSeSEKn0iXhROUkCZ3Kb0pCp/KmYo1SrFGKNcrFh6mcJKFT6ZJwotIloVPpVLokdCpdEjqVLgmdyh1J6FSeKNYoxRqlWKPEH3yxJHQqJ0noVO5IwolKl4ROpUtCp/JEsUYp1ijFGuXioST8JpU7ktCpnCShUzlROVHpktCpvKlYoxRrlGKNcvEylTcl4USlS8JJEt6UhBOVTqVLQqfyRLFGKdYoxRrl4sOScIfKEyonSehUTpJwh0qXhN9UrFGKNUqxRrn4ckn4JJU7kvA/FWuUYo1SrFEuvpxKl4QTlS4JncodSehU7kjCm4o1SrFGKdYoFx+m8klJOFE5UemScKJyRxI6lU7lTcUapVijFGuUi5cl4X9SOUnCicoTSThJQqfypmKNUqxRijVK/MEao1ijFGuUYo1SrFGKNUqxRinWKMUapVijFGuUYo1SrFGKNUqxRinWKP8AKoQP/lIBoMIAAAAASUVORK5CYII="
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -47,7 +47,7 @@ test("Can open menu", async () => {
|
||||
const { getByLabelText, container } = render(
|
||||
<TestComponent vm={vm} rtcSession={rtcSession} />,
|
||||
);
|
||||
await user.click(getByLabelText("Reactions"));
|
||||
await user.click(getByLabelText("common.reactions"));
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -58,8 +58,8 @@ test("Can raise hand", async () => {
|
||||
const { getByLabelText, container } = render(
|
||||
<TestComponent vm={vm} rtcSession={rtcSession} />,
|
||||
);
|
||||
await user.click(getByLabelText("Reactions"));
|
||||
await user.click(getByLabelText("Raise hand"));
|
||||
await user.click(getByLabelText("common.reactions"));
|
||||
await user.click(getByLabelText("action.raise_hand"));
|
||||
expect(rtcSession.room.client.sendEvent).toHaveBeenCalledWith(
|
||||
rtcSession.room.roomId,
|
||||
"m.reaction",
|
||||
@@ -92,8 +92,8 @@ test("Can lower hand", async () => {
|
||||
const { getByLabelText, container } = render(
|
||||
<TestComponent vm={vm} rtcSession={rtcSession} />,
|
||||
);
|
||||
await user.click(getByLabelText("Reactions"));
|
||||
await user.click(getByLabelText("Raise hand"));
|
||||
await user.click(getByLabelText("common.reactions"));
|
||||
await user.click(getByLabelText("action.raise_hand"));
|
||||
act(() => {
|
||||
handRaisedSubject$.next({
|
||||
[localIdent]: {
|
||||
@@ -103,8 +103,8 @@ test("Can lower hand", async () => {
|
||||
},
|
||||
});
|
||||
});
|
||||
await user.click(getByLabelText("Reactions"));
|
||||
await user.click(getByLabelText("Lower hand"));
|
||||
await user.click(getByLabelText("common.reactions"));
|
||||
await user.click(getByLabelText("action.lower_hand"));
|
||||
expect(rtcSession.room.client.redactEvent).toHaveBeenCalledWith(
|
||||
rtcSession.room.roomId,
|
||||
reactionEventId,
|
||||
@@ -122,7 +122,7 @@ test("Can react with emoji", async () => {
|
||||
const { getByLabelText, getByText } = render(
|
||||
<TestComponent vm={vm} rtcSession={rtcSession} />,
|
||||
);
|
||||
await user.click(getByLabelText("Reactions"));
|
||||
await user.click(getByLabelText("common.reactions"));
|
||||
await user.click(getByText("🐶"));
|
||||
expect(rtcSession.room.client.sendEvent).toHaveBeenCalledWith(
|
||||
rtcSession.room.roomId,
|
||||
@@ -144,8 +144,8 @@ test("Can fully expand emoji picker", async () => {
|
||||
const { getByLabelText, container, getByText } = render(
|
||||
<TestComponent vm={vm} rtcSession={rtcSession} />,
|
||||
);
|
||||
await user.click(getByLabelText("Reactions"));
|
||||
await user.click(getByLabelText("Show more"));
|
||||
await user.click(getByLabelText("common.reactions"));
|
||||
await user.click(getByLabelText("action.show_more"));
|
||||
expect(container).toMatchSnapshot();
|
||||
await user.click(getByText("🦗"));
|
||||
expect(rtcSession.room.client.sendEvent).toHaveBeenCalledWith(
|
||||
@@ -168,8 +168,8 @@ test("Can close reaction dialog", async () => {
|
||||
const { getByLabelText, container } = render(
|
||||
<TestComponent vm={vm} rtcSession={rtcSession} />,
|
||||
);
|
||||
await user.click(getByLabelText("Reactions"));
|
||||
await user.click(getByLabelText("Show more"));
|
||||
await user.click(getByLabelText("Show less"));
|
||||
await user.click(getByLabelText("common.reactions"));
|
||||
await user.click(getByLabelText("action.show_more"));
|
||||
await user.click(getByLabelText("action.show_less"));
|
||||
expect(container).toMatchSnapshot();
|
||||
});
|
||||
|
||||
@@ -13,7 +13,6 @@ import {
|
||||
type ConfigOptions,
|
||||
type ResolvedConfigOptions,
|
||||
} from "./ConfigOptions";
|
||||
import { isFailure } from "../utils/fetch";
|
||||
|
||||
export class Config {
|
||||
private static internalInstance: Config | undefined;
|
||||
@@ -29,20 +28,7 @@ export class Config {
|
||||
const internalInstance = new Config();
|
||||
Config.internalInstance = internalInstance;
|
||||
|
||||
let fetchTarget: string;
|
||||
|
||||
if (
|
||||
window.location.pathname.endsWith("/room/") ||
|
||||
window.location.pathname.endsWith("/room")
|
||||
) {
|
||||
// it looks like we are running in standalone mode so use the config at the root
|
||||
fetchTarget = new URL("/config.json", window.location.href).href;
|
||||
} else {
|
||||
// otherwise we are probably running as a widget so use the config in the same directory
|
||||
fetchTarget = "config.json";
|
||||
}
|
||||
|
||||
Config.internalInstance.initPromise = downloadConfig(fetchTarget).then(
|
||||
Config.internalInstance.initPromise = downloadConfig("/config.json").then(
|
||||
(config) => {
|
||||
internalInstance.config = merge({}, DEFAULT_CONFIG, config);
|
||||
},
|
||||
@@ -84,15 +70,18 @@ export class Config {
|
||||
private initPromise?: Promise<void>;
|
||||
}
|
||||
|
||||
async function downloadConfig(fetchTarget: string): Promise<ConfigOptions> {
|
||||
const response = await fetch(fetchTarget);
|
||||
async function downloadConfig(
|
||||
configJsonFilename: string,
|
||||
): Promise<ConfigOptions> {
|
||||
const url = new URL(configJsonFilename, window.location.href);
|
||||
const res = await fetch(url);
|
||||
|
||||
if (isFailure(response)) {
|
||||
if (!res.ok || res.status === 404 || res.status === 0) {
|
||||
// Lack of a config isn't an error, we should just use the defaults.
|
||||
// Also treat a blank config as no config, assuming the status code is 0, because we don't get 404s from file:
|
||||
// URIs so this is the only way we can not fail if the file doesn't exist when loading from a file:// URI.
|
||||
return DEFAULT_CONFIG;
|
||||
}
|
||||
|
||||
return response.json();
|
||||
return res.json();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ export interface ConfigOptions {
|
||||
/**
|
||||
* A link to the end-user license agreement (EULA)
|
||||
*/
|
||||
eula?: string;
|
||||
eula: string;
|
||||
|
||||
media_devices?: {
|
||||
/**
|
||||
@@ -131,7 +131,6 @@ export interface ResolvedConfigOptions extends ConfigOptions {
|
||||
server_name: string;
|
||||
};
|
||||
};
|
||||
eula: string;
|
||||
media_devices: {
|
||||
enable_audio: boolean;
|
||||
enable_video: boolean;
|
||||
|
||||
@@ -13,7 +13,6 @@ import { ErrorPage, LoadingPage } from "../FullScreenView";
|
||||
import { UnauthenticatedView } from "./UnauthenticatedView";
|
||||
import { RegisteredView } from "./RegisteredView";
|
||||
import { usePageTitle } from "../usePageTitle";
|
||||
import { widget } from "../widget.ts";
|
||||
|
||||
export const HomePage: FC = () => {
|
||||
const { t } = useTranslation();
|
||||
@@ -24,7 +23,7 @@ export const HomePage: FC = () => {
|
||||
if (!clientState) {
|
||||
return <LoadingPage />;
|
||||
} else if (clientState.state === "error") {
|
||||
return <ErrorPage widget={widget} error={clientState.error} />;
|
||||
return <ErrorPage error={clientState.error} />;
|
||||
} else {
|
||||
return clientState.authenticated ? (
|
||||
<RegisteredView client={clientState.authenticated.client} />
|
||||
|
||||
@@ -100,8 +100,7 @@ body[data-platform="android"] {
|
||||
}
|
||||
|
||||
body[data-platform="ios"] {
|
||||
--cpd-font-family-sans:
|
||||
-apple-system, BlinkMacSystemFont, "Inter", sans-serif;
|
||||
--cpd-font-family-sans: -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
|
||||
}
|
||||
|
||||
@layer compound-legacy {
|
||||
|
||||
@@ -28,7 +28,6 @@ import { getUrlParams } from "./UrlParams";
|
||||
import { Config } from "./config/Config";
|
||||
import { ElementCallOpenTelemetry } from "./otel/otel";
|
||||
import { platform } from "./Platform";
|
||||
import { isFailure } from "./utils/fetch";
|
||||
|
||||
// This generates a map of locale names to their URL (based on import.meta.url), which looks like this:
|
||||
// {
|
||||
@@ -80,7 +79,7 @@ const Backend = {
|
||||
},
|
||||
});
|
||||
|
||||
if (isFailure(response)) {
|
||||
if (!response.ok) {
|
||||
throw Error(`Failed to fetch ${url}`);
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,10 @@ test("StarRatingInput is accessible", async () => {
|
||||
);
|
||||
expect(await axe(container)).toHaveNoViolations();
|
||||
// Change the rating to 4 stars
|
||||
await user.click(await screen.findByLabelText("4 stars"));
|
||||
await user.click(
|
||||
(
|
||||
await screen.findAllByRole("radio", { name: "star_rating_input_label" })
|
||||
)[3],
|
||||
);
|
||||
expect(onChange).toBeCalledWith(4);
|
||||
});
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { type FC, useCallback, useState } from "react";
|
||||
import { test, vi } from "vitest";
|
||||
import {
|
||||
ConnectionError,
|
||||
ConnectionErrorReason,
|
||||
type Room,
|
||||
} from "livekit-client";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import { MemoryRouter } from "react-router-dom";
|
||||
|
||||
import { useECConnectionState } from "./useECConnectionState";
|
||||
import { type SFUConfig } from "./openIDSFU";
|
||||
import { GroupCallErrorBoundary } from "../room/GroupCallErrorBoundary.tsx";
|
||||
|
||||
test.each<[string, ConnectionError]>([
|
||||
[
|
||||
"LiveKit",
|
||||
new ConnectionError("", ConnectionErrorReason.InternalError, 503),
|
||||
],
|
||||
[
|
||||
"LiveKit Cloud",
|
||||
new ConnectionError("", ConnectionErrorReason.NotAllowed, 429),
|
||||
],
|
||||
])(
|
||||
"useECConnectionState throws error when %s hits track limit",
|
||||
async (_server, error) => {
|
||||
const mockRoom = {
|
||||
on: () => {},
|
||||
off: () => {},
|
||||
once: () => {},
|
||||
connect: () => {
|
||||
throw error;
|
||||
},
|
||||
localParticipant: {
|
||||
getTrackPublication: () => {},
|
||||
createTracks: () => [],
|
||||
},
|
||||
} as unknown as Room;
|
||||
|
||||
const TestComponent: FC = () => {
|
||||
const [sfuConfig, setSfuConfig] = useState<SFUConfig | undefined>(
|
||||
undefined,
|
||||
);
|
||||
const connect = useCallback(
|
||||
() => setSfuConfig({ url: "URL", jwt: "JWT token" }),
|
||||
[],
|
||||
);
|
||||
useECConnectionState({}, false, mockRoom, sfuConfig);
|
||||
return <button onClick={connect}>Connect</button>;
|
||||
};
|
||||
|
||||
const user = userEvent.setup();
|
||||
render(
|
||||
<MemoryRouter>
|
||||
<GroupCallErrorBoundary recoveryActionHandler={vi.fn()} widget={null}>
|
||||
<TestComponent />
|
||||
</GroupCallErrorBoundary>
|
||||
</MemoryRouter>,
|
||||
);
|
||||
await user.click(screen.getByRole("button", { name: "Connect" }));
|
||||
screen.getByText("Insufficient capacity");
|
||||
},
|
||||
);
|
||||
@@ -7,7 +7,6 @@ Please see LICENSE in the repository root for full details.
|
||||
|
||||
import {
|
||||
type AudioCaptureOptions,
|
||||
ConnectionError,
|
||||
ConnectionState,
|
||||
type LocalTrack,
|
||||
type Room,
|
||||
@@ -20,11 +19,6 @@ import * as Sentry from "@sentry/react";
|
||||
|
||||
import { type SFUConfig, sfuConfigEquals } from "./openIDSFU";
|
||||
import { PosthogAnalytics } from "../analytics/PosthogAnalytics";
|
||||
import {
|
||||
ElementCallError,
|
||||
InsufficientCapacityError,
|
||||
UnknownCallError,
|
||||
} from "../utils/errors.ts";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
@@ -112,8 +106,7 @@ async function doConnect(
|
||||
await connectAndPublish(livekitRoom, sfuConfig, preCreatedAudioTrack, []);
|
||||
} catch (e) {
|
||||
preCreatedAudioTrack?.stop();
|
||||
logger.debug("Stopped precreated audio tracks.");
|
||||
throw e;
|
||||
logger.warn("Stopped precreated audio tracks.", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,22 +129,12 @@ async function connectAndPublish(
|
||||
tracker.cacheConnectStart();
|
||||
livekitRoom.once(RoomEvent.SignalConnected, tracker.cacheWsConnect);
|
||||
|
||||
try {
|
||||
await livekitRoom!.connect(sfuConfig!.url, sfuConfig!.jwt, {
|
||||
// Due to stability issues on Firefox we are testing the effect of different
|
||||
// timeouts, and allow these values to be set through the console
|
||||
peerConnectionTimeout: window.peerConnectionTimeout ?? 45000,
|
||||
websocketTimeout: window.websocketTimeout ?? 45000,
|
||||
});
|
||||
} catch (e) {
|
||||
// LiveKit uses 503 to indicate that the server has hit its track limits
|
||||
// or equivalently, 429 in LiveKit Cloud
|
||||
// For reference, the 503 response is generated at: https://github.com/livekit/livekit/blob/fcb05e97c5a31812ecf0ca6f7efa57c485cea9fb/pkg/service/rtcservice.go#L171
|
||||
|
||||
if (e instanceof ConnectionError && (e.status === 503 || e.status === 429))
|
||||
throw new InsufficientCapacityError();
|
||||
throw e;
|
||||
}
|
||||
await livekitRoom!.connect(sfuConfig!.url, sfuConfig!.jwt, {
|
||||
// Due to stability issues on Firefox we are testing the effect of different
|
||||
// timeouts, and allow these values to be set through the console
|
||||
peerConnectionTimeout: window.peerConnectionTimeout ?? 45000,
|
||||
websocketTimeout: window.websocketTimeout ?? 45000,
|
||||
});
|
||||
|
||||
// remove listener in case the connect promise rejects before `SignalConnected` is emitted.
|
||||
livekitRoom.off(RoomEvent.SignalConnected, tracker.cacheWsConnect);
|
||||
@@ -192,8 +175,6 @@ export function useECConnectionState(
|
||||
|
||||
const [isSwitchingFocus, setSwitchingFocus] = useState(false);
|
||||
const [isInDoConnect, setIsInDoConnect] = useState(false);
|
||||
const [error, setError] = useState<ElementCallError | null>(null);
|
||||
if (error !== null) throw error;
|
||||
|
||||
const onConnStateChanged = useCallback((state: ConnectionState) => {
|
||||
if (state == ConnectionState.Connected) setSwitchingFocus(false);
|
||||
@@ -275,11 +256,7 @@ export function useECConnectionState(
|
||||
initialAudioOptions,
|
||||
)
|
||||
.catch((e) => {
|
||||
if (e instanceof ElementCallError) {
|
||||
setError(e); // Bubble up any error screens to React
|
||||
} else if (e instanceof Error) {
|
||||
setError(new UnknownCallError(e));
|
||||
} else logger.error("Failed to connect to SFU", e);
|
||||
logger.error("Failed to connect to SFU", e);
|
||||
})
|
||||
.finally(() => setIsInDoConnect(false));
|
||||
}
|
||||
|
||||
@@ -24,12 +24,10 @@ import { App } from "./App";
|
||||
import { init as initRageshake } from "./settings/rageshake";
|
||||
import { Initializer } from "./initializer";
|
||||
|
||||
window.setLKLogLevel = setLKLogLevel;
|
||||
|
||||
initRageshake().catch((e) => {
|
||||
logger.error("Failed to initialize rageshake", e);
|
||||
});
|
||||
setLKLogLevel("warn");
|
||||
setLKLogLevel("debug");
|
||||
setLKLogExtension((level, msg, context) => {
|
||||
// we pass a synthetic logger name of "livekit" to the rageshake to make it easier to read
|
||||
global.mx_rage_logger.log(level, "livekit", msg, context);
|
||||
|
||||
@@ -8,7 +8,7 @@ exports[`RaisedHandIndicator > renders a smaller indicator when miniature is spe
|
||||
class="reaction"
|
||||
>
|
||||
<span
|
||||
aria-label="Reaction"
|
||||
aria-label="common.reaction"
|
||||
role="img"
|
||||
>
|
||||
✋
|
||||
@@ -28,7 +28,7 @@ exports[`RaisedHandIndicator > renders an indicator when a hand has been raised
|
||||
class="reaction reactionLarge"
|
||||
>
|
||||
<span
|
||||
aria-label="Reaction"
|
||||
aria-label="common.reaction"
|
||||
role="img"
|
||||
>
|
||||
✋
|
||||
@@ -48,7 +48,7 @@ exports[`RaisedHandIndicator > renders an indicator when a hand has been raised
|
||||
class="reaction reactionLarge"
|
||||
>
|
||||
<span
|
||||
aria-label="Reaction"
|
||||
aria-label="common.reaction"
|
||||
role="img"
|
||||
>
|
||||
✋
|
||||
|
||||
@@ -1,253 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { describe, expect, test, vi } from "vitest";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import {
|
||||
type FC,
|
||||
type ReactElement,
|
||||
type ReactNode,
|
||||
useCallback,
|
||||
useState,
|
||||
} from "react";
|
||||
import { BrowserRouter } from "react-router-dom";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
|
||||
import {
|
||||
type CallErrorRecoveryAction,
|
||||
GroupCallErrorBoundary,
|
||||
} from "./GroupCallErrorBoundary.tsx";
|
||||
import {
|
||||
ConnectionLostError,
|
||||
E2EENotSupportedError,
|
||||
type ElementCallError,
|
||||
InsufficientCapacityError,
|
||||
MatrixRTCFocusMissingError,
|
||||
UnknownCallError,
|
||||
} from "../utils/errors.ts";
|
||||
import { mockConfig } from "../utils/test.ts";
|
||||
import { ElementWidgetActions, type WidgetHelpers } from "../widget.ts";
|
||||
|
||||
test.each([
|
||||
{
|
||||
error: new MatrixRTCFocusMissingError("example.com"),
|
||||
expectedTitle: "Call is not supported",
|
||||
},
|
||||
{
|
||||
error: new ConnectionLostError(),
|
||||
expectedTitle: "Connection lost",
|
||||
expectedDescription: "You were disconnected from the call.",
|
||||
},
|
||||
{
|
||||
error: new E2EENotSupportedError(),
|
||||
expectedTitle: "Incompatible browser",
|
||||
expectedDescription:
|
||||
"Your web browser does not support encrypted calls. Supported browsers include Chrome, Safari, and Firefox 117+.",
|
||||
},
|
||||
{
|
||||
error: new InsufficientCapacityError(),
|
||||
expectedTitle: "Insufficient capacity",
|
||||
expectedDescription:
|
||||
"The server has reached its maximum capacity and you cannot join the call at this time. Try again later, or contact your server admin if the problem persists.",
|
||||
},
|
||||
])(
|
||||
"should report correct error for $expectedTitle",
|
||||
async ({ error, expectedTitle, expectedDescription }) => {
|
||||
const TestComponent = (): ReactNode => {
|
||||
throw error;
|
||||
};
|
||||
|
||||
const onErrorMock = vi.fn();
|
||||
const { asFragment } = render(
|
||||
<BrowserRouter>
|
||||
<GroupCallErrorBoundary
|
||||
onError={onErrorMock}
|
||||
recoveryActionHandler={vi.fn()}
|
||||
widget={null}
|
||||
>
|
||||
<TestComponent />
|
||||
</GroupCallErrorBoundary>
|
||||
</BrowserRouter>,
|
||||
);
|
||||
|
||||
await screen.findByText(expectedTitle);
|
||||
if (expectedDescription) {
|
||||
expect(screen.queryByText(expectedDescription)).toBeInTheDocument();
|
||||
}
|
||||
expect(onErrorMock).toHaveBeenCalledWith(error);
|
||||
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
},
|
||||
);
|
||||
|
||||
test("should render the error page with link back to home", async () => {
|
||||
const error = new MatrixRTCFocusMissingError("example.com");
|
||||
const TestComponent = (): ReactNode => {
|
||||
throw error;
|
||||
};
|
||||
|
||||
const onErrorMock = vi.fn();
|
||||
const { asFragment } = render(
|
||||
<BrowserRouter>
|
||||
<GroupCallErrorBoundary
|
||||
onError={onErrorMock}
|
||||
recoveryActionHandler={vi.fn()}
|
||||
widget={null}
|
||||
>
|
||||
<TestComponent />
|
||||
</GroupCallErrorBoundary>
|
||||
</BrowserRouter>,
|
||||
);
|
||||
|
||||
await screen.findByText("Call is not supported");
|
||||
expect(screen.getByText(/Domain: example\.com/i)).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText(/Error Code: MISSING_MATRIX_RTC_FOCUS/i),
|
||||
).toBeInTheDocument();
|
||||
|
||||
await screen.findByRole("button", { name: "Return to home screen" });
|
||||
|
||||
expect(onErrorMock).toHaveBeenCalledOnce();
|
||||
expect(onErrorMock).toHaveBeenCalledWith(error);
|
||||
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test("ConnectionLostError: Action handling should reset error state", async () => {
|
||||
const user = userEvent.setup();
|
||||
|
||||
const TestComponent: FC<{ fail: boolean }> = ({ fail }): ReactNode => {
|
||||
if (fail) {
|
||||
throw new ConnectionLostError();
|
||||
}
|
||||
return <div>HELLO</div>;
|
||||
};
|
||||
|
||||
const reconnectCallbackSpy = vi.fn();
|
||||
|
||||
const WrapComponent = (): ReactNode => {
|
||||
const [failState, setFailState] = useState(true);
|
||||
const reconnectCallback = useCallback(
|
||||
(action: CallErrorRecoveryAction) => {
|
||||
reconnectCallbackSpy(action);
|
||||
setFailState(false);
|
||||
},
|
||||
[setFailState],
|
||||
);
|
||||
|
||||
return (
|
||||
<BrowserRouter>
|
||||
<GroupCallErrorBoundary
|
||||
recoveryActionHandler={reconnectCallback}
|
||||
widget={null}
|
||||
>
|
||||
<TestComponent fail={failState} />
|
||||
</GroupCallErrorBoundary>
|
||||
</BrowserRouter>
|
||||
);
|
||||
};
|
||||
|
||||
const { asFragment } = render(<WrapComponent />);
|
||||
|
||||
// Should fail first
|
||||
await screen.findByText("Connection lost");
|
||||
await screen.findByRole("button", { name: "Reconnect" });
|
||||
await screen.findByRole("button", { name: "Return to home screen" });
|
||||
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
|
||||
await user.click(screen.getByRole("button", { name: "Reconnect" }));
|
||||
|
||||
// reconnect should have reset the error, thus rendering should be ok
|
||||
await screen.findByText("HELLO");
|
||||
|
||||
expect(reconnectCallbackSpy).toHaveBeenCalledOnce();
|
||||
expect(reconnectCallbackSpy).toHaveBeenCalledWith("reconnect");
|
||||
});
|
||||
|
||||
describe("Rageshake button", () => {
|
||||
function setupTest(testError: ElementCallError): void {
|
||||
mockConfig({
|
||||
rageshake: {
|
||||
submit_url: "https://rageshake.example.com.localhost",
|
||||
},
|
||||
});
|
||||
|
||||
const TestComponent = (): ReactElement => {
|
||||
throw testError;
|
||||
};
|
||||
|
||||
render(
|
||||
<BrowserRouter>
|
||||
<GroupCallErrorBoundary
|
||||
onError={vi.fn()}
|
||||
recoveryActionHandler={vi.fn()}
|
||||
widget={null}
|
||||
>
|
||||
<TestComponent />
|
||||
</GroupCallErrorBoundary>
|
||||
</BrowserRouter>,
|
||||
);
|
||||
}
|
||||
|
||||
test("should show send rageshake button for unknown errors", () => {
|
||||
setupTest(new UnknownCallError(new Error("FOO")));
|
||||
|
||||
expect(
|
||||
screen.queryByRole("button", { name: "Send debug logs" }),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test("should not show send rageshake button for call errors", () => {
|
||||
setupTest(new E2EENotSupportedError());
|
||||
|
||||
expect(
|
||||
screen.queryByRole("button", { name: "Send debug logs" }),
|
||||
).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
|
||||
test("should have a close button in widget mode", async () => {
|
||||
const error = new MatrixRTCFocusMissingError("example.com");
|
||||
const TestComponent = (): ReactNode => {
|
||||
throw error;
|
||||
};
|
||||
|
||||
const mockWidget = {
|
||||
api: {
|
||||
transport: { send: vi.fn().mockResolvedValue(undefined), stop: vi.fn() },
|
||||
},
|
||||
} as unknown as WidgetHelpers;
|
||||
|
||||
const user = userEvent.setup();
|
||||
const onErrorMock = vi.fn();
|
||||
const { asFragment } = render(
|
||||
<BrowserRouter>
|
||||
<GroupCallErrorBoundary
|
||||
widget={mockWidget}
|
||||
onError={onErrorMock}
|
||||
recoveryActionHandler={vi.fn()}
|
||||
>
|
||||
<TestComponent />
|
||||
</GroupCallErrorBoundary>
|
||||
</BrowserRouter>,
|
||||
);
|
||||
|
||||
await screen.findByText("Call is not supported");
|
||||
|
||||
await screen.findByRole("button", { name: "Close" });
|
||||
|
||||
expect(asFragment()).toMatchSnapshot();
|
||||
|
||||
await user.click(screen.getByRole("button", { name: "Close" }));
|
||||
|
||||
expect(mockWidget.api.transport.send).toHaveBeenCalledWith(
|
||||
ElementWidgetActions.Close,
|
||||
expect.anything(),
|
||||
);
|
||||
expect(mockWidget.api.transport.stop).toHaveBeenCalled();
|
||||
});
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { ErrorBoundary, type FallbackRender } from "@sentry/react";
|
||||
import {
|
||||
type ComponentType,
|
||||
type FC,
|
||||
type ReactElement,
|
||||
type ReactNode,
|
||||
type SVGAttributes,
|
||||
useCallback,
|
||||
} from "react";
|
||||
import { Trans, useTranslation } from "react-i18next";
|
||||
import {
|
||||
ErrorIcon,
|
||||
HostIcon,
|
||||
OfflineIcon,
|
||||
WebBrowserIcon,
|
||||
} from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||
|
||||
import {
|
||||
ConnectionLostError,
|
||||
ElementCallError,
|
||||
ErrorCategory,
|
||||
ErrorCode,
|
||||
UnknownCallError,
|
||||
} from "../utils/errors.ts";
|
||||
import { FullScreenView } from "../FullScreenView.tsx";
|
||||
import { ErrorView } from "../ErrorView.tsx";
|
||||
import { type WidgetHelpers } from "../widget.ts";
|
||||
|
||||
export type CallErrorRecoveryAction = "reconnect"; // | "retry" ;
|
||||
|
||||
export type RecoveryActionHandler = (action: CallErrorRecoveryAction) => void;
|
||||
|
||||
interface ErrorPageProps {
|
||||
error: ElementCallError;
|
||||
recoveryActionHandler: RecoveryActionHandler;
|
||||
resetError: () => void;
|
||||
widget: WidgetHelpers | null;
|
||||
}
|
||||
|
||||
const ErrorPage: FC<ErrorPageProps> = ({
|
||||
error,
|
||||
recoveryActionHandler,
|
||||
widget,
|
||||
}: ErrorPageProps): ReactElement => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
let icon: ComponentType<SVGAttributes<SVGElement>>;
|
||||
switch (error.category) {
|
||||
case ErrorCategory.CONFIGURATION_ISSUE:
|
||||
icon = HostIcon;
|
||||
break;
|
||||
case ErrorCategory.NETWORK_CONNECTIVITY:
|
||||
icon = OfflineIcon;
|
||||
break;
|
||||
case ErrorCategory.CLIENT_CONFIGURATION:
|
||||
icon = WebBrowserIcon;
|
||||
break;
|
||||
default:
|
||||
icon = ErrorIcon;
|
||||
}
|
||||
|
||||
const actions: { label: string; onClick: () => void }[] = [];
|
||||
if (error instanceof ConnectionLostError) {
|
||||
actions.push({
|
||||
label: t("call_ended_view.reconnect_button"),
|
||||
onClick: () => recoveryActionHandler("reconnect"),
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<FullScreenView>
|
||||
<ErrorView
|
||||
Icon={icon}
|
||||
title={error.localisedTitle}
|
||||
rageshake={error.code == ErrorCode.UNKNOWN_ERROR}
|
||||
widget={widget}
|
||||
>
|
||||
<p>
|
||||
{error.localisedMessage ?? (
|
||||
<Trans
|
||||
i18nKey="error.unexpected_ec_error"
|
||||
components={[<b />, <code />]}
|
||||
values={{ errorCode: error.code }}
|
||||
/>
|
||||
)}
|
||||
</p>
|
||||
{actions &&
|
||||
actions.map((action, index) => (
|
||||
<button onClick={action.onClick} key={`action${index}`}>
|
||||
{action.label}
|
||||
</button>
|
||||
))}
|
||||
</ErrorView>
|
||||
</FullScreenView>
|
||||
);
|
||||
};
|
||||
|
||||
interface BoundaryProps {
|
||||
children: ReactNode | (() => ReactNode);
|
||||
recoveryActionHandler: RecoveryActionHandler;
|
||||
onError?: (error: unknown) => void;
|
||||
widget: WidgetHelpers | null;
|
||||
}
|
||||
|
||||
export const GroupCallErrorBoundary = ({
|
||||
recoveryActionHandler,
|
||||
onError,
|
||||
children,
|
||||
widget,
|
||||
}: BoundaryProps): ReactElement => {
|
||||
const fallbackRenderer: FallbackRender = useCallback(
|
||||
({ error, resetError }): ReactElement => {
|
||||
const callError =
|
||||
error instanceof ElementCallError
|
||||
? error
|
||||
: new UnknownCallError(error instanceof Error ? error : new Error());
|
||||
return (
|
||||
<ErrorPage
|
||||
widget={widget ?? null}
|
||||
error={callError}
|
||||
resetError={resetError}
|
||||
recoveryActionHandler={(action: CallErrorRecoveryAction) => {
|
||||
resetError();
|
||||
recoveryActionHandler(action);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
},
|
||||
[recoveryActionHandler, widget],
|
||||
);
|
||||
|
||||
return (
|
||||
<ErrorBoundary
|
||||
fallback={fallbackRenderer}
|
||||
onError={(error) => onError?.(error)}
|
||||
children={children}
|
||||
/>
|
||||
);
|
||||
};
|
||||
@@ -199,7 +199,7 @@ test("GroupCallView leaves the session when an error occurs", async () => {
|
||||
const user = userEvent.setup();
|
||||
const { rtcSession } = createGroupCallView(null);
|
||||
await user.click(screen.getByRole("button", { name: "Panic!" }));
|
||||
screen.getByText("Something went wrong");
|
||||
screen.getByText("error.generic");
|
||||
expect(leaveRTCSession).toHaveBeenCalledWith(
|
||||
rtcSession,
|
||||
"error",
|
||||
|
||||
@@ -7,6 +7,7 @@ Please see LICENSE in the repository root for full details.
|
||||
|
||||
import {
|
||||
type FC,
|
||||
type ReactElement,
|
||||
type ReactNode,
|
||||
useCallback,
|
||||
useEffect,
|
||||
@@ -15,16 +16,20 @@ import {
|
||||
} from "react";
|
||||
import { type MatrixClient } from "matrix-js-sdk/src/client";
|
||||
import {
|
||||
Room as LivekitRoom,
|
||||
Room,
|
||||
isE2EESupported as isE2EESupportedBrowser,
|
||||
} from "livekit-client";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
|
||||
import { JoinRule } from "matrix-js-sdk/src/matrix";
|
||||
import {
|
||||
MatrixRTCSessionEvent,
|
||||
type MatrixRTCSession,
|
||||
} from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
|
||||
import { JoinRule, type Room } from "matrix-js-sdk/src/matrix";
|
||||
OfflineIcon,
|
||||
WebBrowserIcon,
|
||||
} from "@vector-im/compound-design-tokens/assets/web/icons";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { ErrorBoundary } from "@sentry/react";
|
||||
import { Button } from "@vector-im/compound-web";
|
||||
|
||||
import type { IWidgetApiRequest } from "matrix-widget-api";
|
||||
import {
|
||||
@@ -32,13 +37,14 @@ import {
|
||||
type JoinCallData,
|
||||
type WidgetHelpers,
|
||||
} from "../widget";
|
||||
import { ErrorPage, FullScreenView } from "../FullScreenView";
|
||||
import { LobbyView } from "./LobbyView";
|
||||
import { type MatrixInfo } from "./VideoPreview";
|
||||
import { CallEndedView } from "./CallEndedView";
|
||||
import { PosthogAnalytics } from "../analytics/PosthogAnalytics";
|
||||
import { useProfile } from "../profile/useProfile";
|
||||
import { findDeviceByName } from "../utils/media";
|
||||
import { ActiveCall } from "./InCallView";
|
||||
import { ActiveCall, ConnectionLostError } from "./InCallView";
|
||||
import { MUTE_PARTICIPANT_COUNT, type MuteStates } from "./MuteStates";
|
||||
import { useMediaDevices } from "../livekit/MediaDevicesContext";
|
||||
import { useMatrixRTCSessionMemberships } from "../useMatrixRTCSessionMemberships";
|
||||
@@ -54,19 +60,7 @@ import { useAudioContext } from "../useAudioContext";
|
||||
import { callEventAudioSounds } from "./CallEventAudioRenderer";
|
||||
import { useLatest } from "../useLatest";
|
||||
import { usePageTitle } from "../usePageTitle";
|
||||
import {
|
||||
E2EENotSupportedError,
|
||||
ElementCallError,
|
||||
ErrorCode,
|
||||
RTCSessionError,
|
||||
UnknownCallError,
|
||||
} from "../utils/errors.ts";
|
||||
import { GroupCallErrorBoundary } from "./GroupCallErrorBoundary.tsx";
|
||||
import {
|
||||
useNewMembershipManagerSetting as useNewMembershipManagerSetting,
|
||||
useSetting,
|
||||
} from "../settings/settings";
|
||||
import { useTypedEventEmitter } from "../useEvents";
|
||||
import { ErrorView } from "../ErrorView";
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
@@ -74,6 +68,11 @@ declare global {
|
||||
}
|
||||
}
|
||||
|
||||
interface GroupCallErrorPageProps {
|
||||
error: Error | unknown;
|
||||
resetError: () => void;
|
||||
}
|
||||
|
||||
interface Props {
|
||||
client: MatrixClient;
|
||||
isPasswordlessUser: boolean;
|
||||
@@ -120,18 +119,6 @@ export const GroupCallView: FC<Props> = ({
|
||||
};
|
||||
}, [rtcSession]);
|
||||
|
||||
useTypedEventEmitter(
|
||||
rtcSession,
|
||||
MatrixRTCSessionEvent.MembershipManagerError,
|
||||
(error) => {
|
||||
setError(
|
||||
new RTCSessionError(
|
||||
ErrorCode.MEMBERSHIP_MANAGER_UNRECOVERABLE,
|
||||
error.message ?? error,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
useEffect(() => {
|
||||
// Sanity check the room object
|
||||
if (client.getRoom(rtcSession.room.roomId) !== rtcSession.room)
|
||||
@@ -140,14 +127,11 @@ export const GroupCallView: FC<Props> = ({
|
||||
);
|
||||
}, [client, rtcSession.room]);
|
||||
|
||||
const room = rtcSession.room as Room;
|
||||
const { displayName, avatarUrl } = useProfile(client);
|
||||
const roomName = useRoomName(room);
|
||||
const roomAvatar = useRoomAvatar(room);
|
||||
const roomName = useRoomName(rtcSession.room);
|
||||
const roomAvatar = useRoomAvatar(rtcSession.room);
|
||||
const { perParticipantE2EE, returnToLobby } = useUrlParams();
|
||||
const e2eeSystem = useRoomEncryptionSystem(room.roomId);
|
||||
const [useNewMembershipManager] = useSetting(useNewMembershipManagerSetting);
|
||||
|
||||
const e2eeSystem = useRoomEncryptionSystem(rtcSession.room.roomId);
|
||||
usePageTitle(roomName);
|
||||
|
||||
const matrixInfo = useMemo((): MatrixInfo => {
|
||||
@@ -155,13 +139,21 @@ export const GroupCallView: FC<Props> = ({
|
||||
userId: client.getUserId()!,
|
||||
displayName: displayName!,
|
||||
avatarUrl: avatarUrl!,
|
||||
roomId: room.roomId,
|
||||
roomId: rtcSession.room.roomId,
|
||||
roomName,
|
||||
roomAlias: room.getCanonicalAlias(),
|
||||
roomAlias: rtcSession.room.getCanonicalAlias(),
|
||||
roomAvatar,
|
||||
e2eeSystem,
|
||||
};
|
||||
}, [client, displayName, avatarUrl, roomName, room, roomAvatar, e2eeSystem]);
|
||||
}, [
|
||||
client,
|
||||
displayName,
|
||||
avatarUrl,
|
||||
rtcSession.room,
|
||||
roomName,
|
||||
roomAvatar,
|
||||
e2eeSystem,
|
||||
]);
|
||||
|
||||
// Count each member only once, regardless of how many devices they use
|
||||
const participantCount = useMemo(
|
||||
@@ -173,31 +165,6 @@ export const GroupCallView: FC<Props> = ({
|
||||
const latestDevices = useLatest(deviceContext);
|
||||
const latestMuteStates = useLatest(muteStates);
|
||||
|
||||
const enterRTCSessionOrError = async (
|
||||
rtcSession: MatrixRTCSession,
|
||||
perParticipantE2EE: boolean,
|
||||
newMembershipManager: boolean,
|
||||
): Promise<void> => {
|
||||
try {
|
||||
await enterRTCSession(
|
||||
rtcSession,
|
||||
perParticipantE2EE,
|
||||
newMembershipManager,
|
||||
);
|
||||
} catch (e) {
|
||||
if (e instanceof ElementCallError) {
|
||||
// e.code === ErrorCode.MISSING_LIVE_KIT_SERVICE_URL)
|
||||
setError(e);
|
||||
} else {
|
||||
logger.error(`Unknown Error while entering RTC session`, e);
|
||||
const error = new UnknownCallError(
|
||||
e instanceof Error ? e : new Error("Unknown error", { cause: e }),
|
||||
);
|
||||
setError(error);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
const defaultDeviceSetup = async ({
|
||||
audioInput,
|
||||
@@ -207,7 +174,7 @@ export const GroupCallView: FC<Props> = ({
|
||||
// permissions and give you device names unless you specify a kind, but
|
||||
// here we want all kinds of devices. This needs a fix in livekit-client
|
||||
// for the following name-matching logic to do anything useful.
|
||||
const devices = await LivekitRoom.getLocalDevices(undefined, true);
|
||||
const devices = await Room.getLocalDevices(undefined, true);
|
||||
|
||||
if (audioInput) {
|
||||
const deviceId = findDeviceByName(audioInput, "audioinput", devices);
|
||||
@@ -247,11 +214,7 @@ export const GroupCallView: FC<Props> = ({
|
||||
await defaultDeviceSetup(
|
||||
ev.detail.data as unknown as JoinCallData,
|
||||
);
|
||||
await enterRTCSessionOrError(
|
||||
rtcSession,
|
||||
perParticipantE2EE,
|
||||
useNewMembershipManager,
|
||||
);
|
||||
await enterRTCSession(rtcSession, perParticipantE2EE);
|
||||
widget.api.transport.reply(ev.detail, {});
|
||||
})().catch((e) => {
|
||||
logger.error("Error joining RTC session", e);
|
||||
@@ -264,21 +227,13 @@ export const GroupCallView: FC<Props> = ({
|
||||
} else {
|
||||
// No lobby and no preload: we enter the rtc session right away
|
||||
(async (): Promise<void> => {
|
||||
await enterRTCSessionOrError(
|
||||
rtcSession,
|
||||
perParticipantE2EE,
|
||||
useNewMembershipManager,
|
||||
);
|
||||
await enterRTCSession(rtcSession, perParticipantE2EE);
|
||||
})().catch((e) => {
|
||||
logger.error("Error joining RTC session", e);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
void enterRTCSessionOrError(
|
||||
rtcSession,
|
||||
perParticipantE2EE,
|
||||
useNewMembershipManager,
|
||||
);
|
||||
void enterRTCSession(rtcSession, perParticipantE2EE);
|
||||
}
|
||||
}
|
||||
}, [
|
||||
@@ -289,11 +244,9 @@ export const GroupCallView: FC<Props> = ({
|
||||
perParticipantE2EE,
|
||||
latestDevices,
|
||||
latestMuteStates,
|
||||
useNewMembershipManager,
|
||||
]);
|
||||
|
||||
const [left, setLeft] = useState(false);
|
||||
const [error, setError] = useState<ElementCallError | null>(null);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const onLeave = useCallback(
|
||||
@@ -307,7 +260,7 @@ export const GroupCallView: FC<Props> = ({
|
||||
// Otherwise the iFrame gets killed before the callEnded event got tracked.
|
||||
const posthogRequest = new Promise((resolve) => {
|
||||
PosthogAnalytics.instance.eventCallEnded.track(
|
||||
room.roomId,
|
||||
rtcSession.room.roomId,
|
||||
rtcSession.memberships.length,
|
||||
sendInstantly,
|
||||
rtcSession,
|
||||
@@ -336,12 +289,11 @@ export const GroupCallView: FC<Props> = ({
|
||||
});
|
||||
},
|
||||
[
|
||||
leaveSoundContext,
|
||||
widget,
|
||||
rtcSession,
|
||||
room.roomId,
|
||||
isPasswordlessUser,
|
||||
confineToRoom,
|
||||
leaveSoundContext,
|
||||
navigate,
|
||||
],
|
||||
);
|
||||
@@ -367,7 +319,7 @@ export const GroupCallView: FC<Props> = ({
|
||||
}
|
||||
}, [widget, isJoined, rtcSession]);
|
||||
|
||||
const joinRule = useJoinRule(room);
|
||||
const joinRule = useJoinRule(rtcSession.room);
|
||||
|
||||
const [shareModalOpen, setInviteModalOpen] = useState(false);
|
||||
const onDismissInviteModal = useCallback(
|
||||
@@ -381,14 +333,59 @@ export const GroupCallView: FC<Props> = ({
|
||||
);
|
||||
const onShareClick = joinRule === JoinRule.Public ? onShareClickFn : null;
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
const errorPage = useMemo(() => {
|
||||
function GroupCallErrorPage({
|
||||
error,
|
||||
resetError,
|
||||
}: GroupCallErrorPageProps): ReactElement {
|
||||
useEffect(() => {
|
||||
if (rtcSession.isJoined()) onLeave("error");
|
||||
}, [error]);
|
||||
|
||||
const onReconnect = useCallback(() => {
|
||||
setLeft(false);
|
||||
resetError();
|
||||
enterRTCSession(rtcSession, perParticipantE2EE).catch((e) => {
|
||||
logger.error("Error re-entering RTC session on reconnect", e);
|
||||
});
|
||||
}, [resetError]);
|
||||
|
||||
return error instanceof ConnectionLostError ? (
|
||||
<FullScreenView>
|
||||
<ErrorView
|
||||
Icon={OfflineIcon}
|
||||
title={t("error.connection_lost")}
|
||||
rageshake
|
||||
>
|
||||
<p>{t("error.connection_lost_description")}</p>
|
||||
<Button onClick={onReconnect}>
|
||||
{t("call_ended_view.reconnect_button")}
|
||||
</Button>
|
||||
</ErrorView>
|
||||
</FullScreenView>
|
||||
) : (
|
||||
<ErrorPage error={error} />
|
||||
);
|
||||
}
|
||||
return GroupCallErrorPage;
|
||||
}, [onLeave, rtcSession, perParticipantE2EE, t]);
|
||||
|
||||
if (!isE2EESupportedBrowser() && e2eeSystem.kind !== E2eeType.NONE) {
|
||||
// If we have a encryption system but the browser does not support it.
|
||||
throw new E2EENotSupportedError();
|
||||
return (
|
||||
<FullScreenView>
|
||||
<ErrorView Icon={WebBrowserIcon} title={t("error.e2ee_unsupported")}>
|
||||
<p>{t("error.e2ee_unsupported_description")}</p>
|
||||
</ErrorView>
|
||||
</FullScreenView>
|
||||
);
|
||||
}
|
||||
|
||||
const shareModal = (
|
||||
<InviteModal
|
||||
room={room}
|
||||
room={rtcSession.room}
|
||||
open={shareModalOpen}
|
||||
onDismiss={onDismissInviteModal}
|
||||
/>
|
||||
@@ -400,13 +397,7 @@ export const GroupCallView: FC<Props> = ({
|
||||
client={client}
|
||||
matrixInfo={matrixInfo}
|
||||
muteStates={muteStates}
|
||||
onEnter={() =>
|
||||
void enterRTCSessionOrError(
|
||||
rtcSession,
|
||||
perParticipantE2EE,
|
||||
useNewMembershipManager,
|
||||
)
|
||||
}
|
||||
onEnter={() => void enterRTCSession(rtcSession, perParticipantE2EE)}
|
||||
confineToRoom={confineToRoom}
|
||||
hideHeader={hideHeader}
|
||||
participantCount={participantCount}
|
||||
@@ -416,14 +407,7 @@ export const GroupCallView: FC<Props> = ({
|
||||
);
|
||||
|
||||
let body: ReactNode;
|
||||
if (error) {
|
||||
// If an ElementCallError was recorded, then create a component that will fail to render and throw
|
||||
// the error. This will then be handled by the ErrorBoundary component.
|
||||
const ErrorComponent = (): ReactNode => {
|
||||
throw error;
|
||||
};
|
||||
body = <ErrorComponent />;
|
||||
} else if (isJoined) {
|
||||
if (isJoined) {
|
||||
body = (
|
||||
<>
|
||||
{shareModal}
|
||||
@@ -470,35 +454,14 @@ export const GroupCallView: FC<Props> = ({
|
||||
}
|
||||
} else if (left && widget !== null) {
|
||||
// Left in widget mode:
|
||||
body = returnToLobby ? lobbyView : null;
|
||||
if (!returnToLobby) {
|
||||
body = null;
|
||||
}
|
||||
} else if (preload || skipLobby) {
|
||||
body = null;
|
||||
} else {
|
||||
body = lobbyView;
|
||||
}
|
||||
|
||||
return (
|
||||
<GroupCallErrorBoundary
|
||||
widget={widget}
|
||||
recoveryActionHandler={(action) => {
|
||||
if (action == "reconnect") {
|
||||
setLeft(false);
|
||||
enterRTCSessionOrError(
|
||||
rtcSession,
|
||||
perParticipantE2EE,
|
||||
useNewMembershipManager,
|
||||
).catch((e) => {
|
||||
logger.error("Error re-entering RTC session", e);
|
||||
});
|
||||
}
|
||||
}}
|
||||
onError={
|
||||
(/**error*/) => {
|
||||
if (rtcSession.isJoined()) onLeave("error");
|
||||
}
|
||||
}
|
||||
>
|
||||
{body}
|
||||
</GroupCallErrorBoundary>
|
||||
);
|
||||
return <ErrorBoundary fallback={errorPage}>{body}</ErrorBoundary>;
|
||||
};
|
||||
|
||||
@@ -97,12 +97,13 @@ import {
|
||||
useSetting,
|
||||
} from "../settings/settings";
|
||||
import { ReactionsReader } from "../reactions/ReactionsReader";
|
||||
import { ConnectionLostError } from "../utils/errors.ts";
|
||||
|
||||
const canScreenshare = "getDisplayMedia" in (navigator.mediaDevices ?? {});
|
||||
|
||||
const maxTapDurationMs = 400;
|
||||
|
||||
export class ConnectionLostError extends Error {}
|
||||
|
||||
export interface ActiveCallProps
|
||||
extends Omit<InCallViewProps, "vm" | "livekitRoom" | "connState"> {
|
||||
e2eeSystem: EncryptionSystem;
|
||||
|
||||
@@ -30,6 +30,6 @@ test("InviteModal is accessible", async () => {
|
||||
);
|
||||
|
||||
expect(await axe(container)).toHaveNoViolations();
|
||||
await user.click(screen.getByRole("button", { name: "Copy link" }));
|
||||
await user.click(screen.getByRole("button", { name: "action.copy_link" }));
|
||||
expect(onDismiss).toBeCalled();
|
||||
});
|
||||
|
||||
@@ -182,7 +182,6 @@ export const RoomPage: FC = () => {
|
||||
<ErrorView
|
||||
Icon={UnknownSolidIcon}
|
||||
title={t("error.call_not_found")}
|
||||
widget={widget}
|
||||
>
|
||||
<Trans i18nKey="error.call_not_found_description">
|
||||
<p>
|
||||
@@ -200,7 +199,6 @@ export const RoomPage: FC = () => {
|
||||
<ErrorView
|
||||
Icon={groupCallState.error.icon}
|
||||
title={groupCallState.error.message}
|
||||
widget={widget}
|
||||
>
|
||||
<p>{groupCallState.error.messageBody}</p>
|
||||
{groupCallState.error.reason && (
|
||||
@@ -214,7 +212,7 @@ export const RoomPage: FC = () => {
|
||||
</FullScreenView>
|
||||
);
|
||||
} else {
|
||||
return <ErrorPage widget={widget} error={groupCallState.error} />;
|
||||
return <ErrorPage error={groupCallState.error} />;
|
||||
}
|
||||
default:
|
||||
return <> </>;
|
||||
@@ -225,7 +223,7 @@ export const RoomPage: FC = () => {
|
||||
if (loading || isRegistering) {
|
||||
content = <LoadingPage />;
|
||||
} else if (error) {
|
||||
content = <ErrorPage widget={widget} error={error} />;
|
||||
content = <ErrorPage error={error} />;
|
||||
} else if (!client) {
|
||||
content = <RoomAuthView />;
|
||||
} else if (!roomIdOrAlias) {
|
||||
|
||||
@@ -66,6 +66,8 @@ describe("VideoPreview", () => {
|
||||
children={<></>}
|
||||
/>,
|
||||
);
|
||||
expect(queryByRole("status")).toHaveTextContent("Video loading...");
|
||||
expect(queryByRole("status")).toHaveTextContent(
|
||||
"video_tile.camera_starting",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,26 +6,19 @@ Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
|
||||
import { expect, onTestFinished, test, vi } from "vitest";
|
||||
import { expect, test, vi } from "vitest";
|
||||
import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery";
|
||||
import EventEmitter from "events";
|
||||
|
||||
import { enterRTCSession, leaveRTCSession } from "../src/rtcSessionHelpers";
|
||||
import { mockConfig } from "./utils/test";
|
||||
import { ElementWidgetActions, widget } from "./widget";
|
||||
import { ErrorCode } from "./utils/errors.ts";
|
||||
|
||||
const getUrlParams = vi.hoisted(() => vi.fn(() => ({})));
|
||||
vi.mock("./UrlParams", () => ({ getUrlParams }));
|
||||
|
||||
const actualWidget = await vi.hoisted(async () => vi.importActual("./widget"));
|
||||
vi.mock("./widget", () => ({
|
||||
...actualWidget,
|
||||
widget: {
|
||||
api: {
|
||||
setAlwaysOnScreen: (): void => {},
|
||||
transport: { send: vi.fn(), reply: vi.fn(), stop: vi.fn() },
|
||||
},
|
||||
api: { transport: { send: vi.fn(), reply: vi.fn(), stop: vi.fn() } },
|
||||
lazyActions: new EventEmitter(),
|
||||
},
|
||||
}));
|
||||
@@ -111,95 +104,36 @@ test("It joins the correct Session", async () => {
|
||||
{
|
||||
manageMediaKeys: false,
|
||||
useLegacyMemberEvents: false,
|
||||
useNewMembershipManager: true,
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
async function testLeaveRTCSession(
|
||||
cause: "user" | "error",
|
||||
expectClose: boolean,
|
||||
): Promise<void> {
|
||||
test("leaveRTCSession closes the widget on a normal hangup", async () => {
|
||||
vi.clearAllMocks();
|
||||
const session = { leaveRoomSession: vi.fn() } as unknown as MatrixRTCSession;
|
||||
await leaveRTCSession(session, cause);
|
||||
await leaveRTCSession(session, "user");
|
||||
expect(session.leaveRoomSession).toHaveBeenCalled();
|
||||
expect(widget!.api.transport.send).toHaveBeenCalledWith(
|
||||
ElementWidgetActions.HangupCall,
|
||||
expect.anything(),
|
||||
);
|
||||
if (expectClose) {
|
||||
expect(widget!.api.transport.send).toHaveBeenCalledWith(
|
||||
ElementWidgetActions.Close,
|
||||
expect.anything(),
|
||||
);
|
||||
expect(widget!.api.transport.stop).toHaveBeenCalled();
|
||||
} else {
|
||||
expect(widget!.api.transport.send).not.toHaveBeenCalledWith(
|
||||
ElementWidgetActions.Close,
|
||||
expect.anything(),
|
||||
);
|
||||
expect(widget!.api.transport.stop).not.toHaveBeenCalled();
|
||||
}
|
||||
}
|
||||
|
||||
test("leaveRTCSession closes the widget on a normal hangup", async () => {
|
||||
await testLeaveRTCSession("user", true);
|
||||
});
|
||||
|
||||
test("leaveRTCSession doesn't close the widget on a fatal error", async () => {
|
||||
await testLeaveRTCSession("error", false);
|
||||
});
|
||||
|
||||
test("leaveRTCSession doesn't close the widget when returning to lobby", async () => {
|
||||
getUrlParams.mockReturnValue({ returnToLobby: true });
|
||||
onTestFinished(() => void getUrlParams.mockReset());
|
||||
await testLeaveRTCSession("user", false);
|
||||
});
|
||||
|
||||
test("It fails with configuration error if no live kit url config is set in fallback", async () => {
|
||||
mockConfig({});
|
||||
vi.spyOn(AutoDiscovery, "getRawClientConfig").mockResolvedValue({});
|
||||
|
||||
const mockedSession = vi.mocked({
|
||||
room: {
|
||||
roomId: "roomId",
|
||||
client: {
|
||||
getDomain: vi.fn().mockReturnValue("example.org"),
|
||||
},
|
||||
},
|
||||
memberships: [],
|
||||
getFocusInUse: vi.fn(),
|
||||
joinRoomSession: vi.fn(),
|
||||
}) as unknown as MatrixRTCSession;
|
||||
|
||||
await expect(enterRTCSession(mockedSession, false)).rejects.toThrowError(
|
||||
expect.objectContaining({ code: ErrorCode.MISSING_MATRIX_RTC_FOCUS }),
|
||||
expect(widget!.api.transport.send).toHaveBeenCalledWith(
|
||||
ElementWidgetActions.Close,
|
||||
expect.anything(),
|
||||
);
|
||||
});
|
||||
|
||||
test("It should not fail with configuration error if homeserver config has livekit url but not fallback", async () => {
|
||||
mockConfig({});
|
||||
vi.spyOn(AutoDiscovery, "getRawClientConfig").mockResolvedValue({
|
||||
"org.matrix.msc4143.rtc_foci": [
|
||||
{
|
||||
type: "livekit",
|
||||
livekit_service_url: "http://my-well-known-service-url.com",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const mockedSession = vi.mocked({
|
||||
room: {
|
||||
roomId: "roomId",
|
||||
client: {
|
||||
getDomain: vi.fn().mockReturnValue("example.org"),
|
||||
},
|
||||
},
|
||||
memberships: [],
|
||||
getFocusInUse: vi.fn(),
|
||||
joinRoomSession: vi.fn(),
|
||||
}) as unknown as MatrixRTCSession;
|
||||
|
||||
await enterRTCSession(mockedSession, false);
|
||||
test("leaveRTCSession doesn't close the widget on a fatal error", async () => {
|
||||
vi.clearAllMocks();
|
||||
const session = { leaveRoomSession: vi.fn() } as unknown as MatrixRTCSession;
|
||||
await leaveRTCSession(session, "error");
|
||||
expect(session.leaveRoomSession).toHaveBeenCalled();
|
||||
expect(widget!.api.transport.send).toHaveBeenCalledWith(
|
||||
ElementWidgetActions.HangupCall,
|
||||
expect.anything(),
|
||||
);
|
||||
expect(widget!.api.transport.send).not.toHaveBeenCalledWith(
|
||||
ElementWidgetActions.Close,
|
||||
expect.anything(),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -8,18 +8,16 @@ Please see LICENSE in the repository root for full details.
|
||||
import { type MatrixRTCSession } from "matrix-js-sdk/src/matrixrtc/MatrixRTCSession";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import {
|
||||
isLivekitFocus,
|
||||
isLivekitFocusConfig,
|
||||
type LivekitFocus,
|
||||
type LivekitFocusActive,
|
||||
isLivekitFocus,
|
||||
isLivekitFocusConfig,
|
||||
} from "matrix-js-sdk/src/matrixrtc/LivekitFocus";
|
||||
import { AutoDiscovery } from "matrix-js-sdk/src/autodiscovery";
|
||||
|
||||
import { PosthogAnalytics } from "./analytics/PosthogAnalytics";
|
||||
import { Config } from "./config/Config";
|
||||
import { ElementWidgetActions, widget, type WidgetHelpers } from "./widget";
|
||||
import { MatrixRTCFocusMissingError } from "./utils/errors.ts";
|
||||
import { getUrlParams } from "./UrlParams.ts";
|
||||
import { ElementWidgetActions, type WidgetHelpers, widget } from "./widget";
|
||||
|
||||
const FOCI_WK_KEY = "org.matrix.msc4143.rtc_foci";
|
||||
|
||||
@@ -82,7 +80,10 @@ async function makePreferredLivekitFoci(
|
||||
}
|
||||
|
||||
if (preferredFoci.length === 0)
|
||||
throw new MatrixRTCFocusMissingError(domain ?? "");
|
||||
throw new Error(
|
||||
`No livekit_service_url is configured so we could not create a focus.
|
||||
Currently we skip computing a focus based on other users in the room.`,
|
||||
);
|
||||
return Promise.resolve(preferredFoci);
|
||||
|
||||
// TODO: we want to do something like this:
|
||||
@@ -97,7 +98,6 @@ async function makePreferredLivekitFoci(
|
||||
export async function enterRTCSession(
|
||||
rtcSession: MatrixRTCSession,
|
||||
encryptMedia: boolean,
|
||||
useNewMembershipManager = true,
|
||||
): Promise<void> {
|
||||
PosthogAnalytics.instance.eventCallEnded.cacheStartCall(new Date());
|
||||
PosthogAnalytics.instance.eventCallStarted.track(rtcSession.room.roomId);
|
||||
@@ -115,7 +115,6 @@ export async function enterRTCSession(
|
||||
await makePreferredLivekitFoci(rtcSession, livekitAlias),
|
||||
makeActiveFocus(),
|
||||
{
|
||||
useNewMembershipManager,
|
||||
manageMediaKeys: encryptMedia,
|
||||
...(useDeviceSessionMemberEvents !== undefined && {
|
||||
useLegacyMemberEvents: !useDeviceSessionMemberEvents,
|
||||
@@ -127,13 +126,6 @@ export async function enterRTCSession(
|
||||
makeKeyDelay: matrixRtcSessionConfig?.key_rotation_on_leave_delay,
|
||||
},
|
||||
);
|
||||
if (widget) {
|
||||
try {
|
||||
await widget.api.transport.send(ElementWidgetActions.JoinCall, {});
|
||||
} catch (e) {
|
||||
logger.error("Failed to send join action", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const widgetPostHangupProcedure = async (
|
||||
@@ -159,7 +151,7 @@ const widgetPostHangupProcedure = async (
|
||||
}
|
||||
// On a normal user hangup we can shut down and close the widget. But if an
|
||||
// error occurs we should keep the widget open until the user reads it.
|
||||
if (cause === "user" && !getUrlParams().returnToLobby) {
|
||||
if (cause === "user") {
|
||||
try {
|
||||
await widget.api.transport.send(ElementWidgetActions.Close, {});
|
||||
} catch (e) {
|
||||
|
||||
@@ -15,7 +15,6 @@ import {
|
||||
debugTileLayout as debugTileLayoutSetting,
|
||||
showNonMemberTiles as showNonMemberTilesSetting,
|
||||
showConnectionStats as showConnectionStatsSetting,
|
||||
useNewMembershipManagerSetting,
|
||||
} from "./settings";
|
||||
import type { MatrixClient } from "matrix-js-sdk/src/client";
|
||||
import type { Room as LivekitRoom } from "livekit-client";
|
||||
@@ -39,10 +38,6 @@ export const DeveloperSettingsTab: FC<Props> = ({ client, livekitRoom }) => {
|
||||
showConnectionStatsSetting,
|
||||
);
|
||||
|
||||
const [useNewMembershipManager, setNewMembershipManager] = useSetting(
|
||||
useNewMembershipManagerSetting,
|
||||
);
|
||||
|
||||
const sfuUrl = useMemo((): URL | null => {
|
||||
if (livekitRoom?.engine.client.ws?.url) {
|
||||
// strip the URL params
|
||||
@@ -139,20 +134,6 @@ export const DeveloperSettingsTab: FC<Props> = ({ client, livekitRoom }) => {
|
||||
)}
|
||||
/>
|
||||
</FieldRow>
|
||||
<FieldRow>
|
||||
<InputField
|
||||
id="useNewMembershipManager"
|
||||
type="checkbox"
|
||||
label={t("developer_mode.use_new_membership_manager")}
|
||||
checked={!!useNewMembershipManager}
|
||||
onChange={useCallback(
|
||||
(event: ChangeEvent<HTMLInputElement>): void => {
|
||||
setNewMembershipManager(event.target.checked);
|
||||
},
|
||||
[setNewMembershipManager],
|
||||
)}
|
||||
/>
|
||||
</FieldRow>
|
||||
{livekitRoom ? (
|
||||
<>
|
||||
<p>
|
||||
|
||||
@@ -113,8 +113,4 @@ export const soundEffectVolumeSetting = new Setting<number>(
|
||||
0.5,
|
||||
);
|
||||
|
||||
export const useNewMembershipManagerSetting = new Setting<boolean>(
|
||||
"new-membership-manager",
|
||||
true,
|
||||
);
|
||||
export const alwaysShowSelf = new Setting<boolean>("always-show-self", true);
|
||||
|
||||
@@ -9,10 +9,10 @@ import { type ComponentProps, useCallback, useEffect, useState } from "react";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
import {
|
||||
ClientEvent,
|
||||
type Crypto,
|
||||
type MatrixClient,
|
||||
type MatrixEvent,
|
||||
} from "matrix-js-sdk/src/matrix";
|
||||
import { type CryptoApi } from "matrix-js-sdk/src/crypto-api";
|
||||
|
||||
import { getLogsForReport } from "./rageshake";
|
||||
import { useClient } from "../ClientContext";
|
||||
@@ -34,7 +34,7 @@ const gzip = async (text: string): Promise<Blob> => {
|
||||
* Collects crypto related information.
|
||||
*/
|
||||
async function collectCryptoInfo(
|
||||
cryptoApi: CryptoApi,
|
||||
cryptoApi: Crypto.CryptoApi,
|
||||
body: FormData,
|
||||
): Promise<void> {
|
||||
body.append("crypto_version", cryptoApi.getVersion());
|
||||
@@ -82,7 +82,7 @@ async function collectCryptoInfo(
|
||||
*/
|
||||
async function collectRecoveryInfo(
|
||||
client: MatrixClient,
|
||||
cryptoApi: CryptoApi,
|
||||
cryptoApi: Crypto.CryptoApi,
|
||||
body: FormData,
|
||||
): Promise<void> {
|
||||
const secretStorage = client.secretStorage;
|
||||
|
||||
@@ -7,8 +7,6 @@ Please see LICENSE in the repository root for full details.
|
||||
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { isFailure } from "./utils/fetch";
|
||||
|
||||
type SoundDefinition = { mp3?: string; ogg: string };
|
||||
|
||||
export type PrefetchedSounds<S extends string> = Promise<
|
||||
@@ -51,7 +49,7 @@ export async function prefetchSounds<S extends string>(
|
||||
const response = await fetch(
|
||||
preferredFormat === "ogg" ? ogg : (mp3 ?? ogg),
|
||||
);
|
||||
if (isFailure(response)) {
|
||||
if (!response.ok) {
|
||||
// If the sound doesn't load, it's not the end of the world. We won't play
|
||||
// the sound when requested, but it's better than failing the whole application.
|
||||
logger.warn(`Could not load sound ${name}, response was not okay`);
|
||||
|
||||
@@ -496,10 +496,6 @@ export class CallViewModel extends ViewModel {
|
||||
}
|
||||
return displaynameMap;
|
||||
}),
|
||||
// It turns out that doing the disambiguation above is rather expensive on Safari (10x slower
|
||||
// than on Chrome/Firefox). This means it is important that we share() the result so that we
|
||||
// don't do this work more times than we need to. This is achieve through the state() operator:
|
||||
this.scope.state(),
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,8 +30,7 @@ borders don't support gradients */
|
||||
}
|
||||
|
||||
.tile.speaking::before {
|
||||
background:
|
||||
linear-gradient(
|
||||
background: linear-gradient(
|
||||
119deg,
|
||||
rgba(13, 92, 189, 0.7) 0%,
|
||||
rgba(13, 189, 168, 0.7) 100%
|
||||
@@ -50,8 +49,7 @@ borders don't support gradients */
|
||||
}
|
||||
|
||||
.tile.handRaised::before {
|
||||
background:
|
||||
linear-gradient(
|
||||
background: linear-gradient(
|
||||
119deg,
|
||||
var(--cpd-color-yellow-1200) 0%,
|
||||
var(--cpd-color-yellow-900) 100%
|
||||
|
||||
@@ -70,14 +70,16 @@ describe("MediaView", () => {
|
||||
<MediaView {...baseProps} video={undefined} localParticipant={true} />,
|
||||
);
|
||||
expect(screen.getByRole("img", { name: "some name" })).toBeVisible();
|
||||
expect(screen.queryAllByText("Waiting for media...").length).toBe(0);
|
||||
expect(screen.queryAllByText("video_tile.waiting_for_media").length).toBe(
|
||||
0,
|
||||
);
|
||||
});
|
||||
it("shows avatar and label for remote user", () => {
|
||||
render(
|
||||
<MediaView {...baseProps} video={undefined} localParticipant={false} />,
|
||||
);
|
||||
expect(screen.getByRole("img", { name: "some name" })).toBeVisible();
|
||||
expect(screen.getByText("Waiting for media...")).toBeVisible();
|
||||
expect(screen.getByText("video_tile.waiting_for_media")).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -96,7 +98,9 @@ describe("MediaView", () => {
|
||||
</TooltipProvider>,
|
||||
);
|
||||
expect(await axe(container)).toHaveNoViolations();
|
||||
expect(screen.getByRole("img", { name: "Not encrypted" })).toBeTruthy();
|
||||
expect(
|
||||
screen.getByRole("img", { name: "common.unencrypted" }),
|
||||
).toBeTruthy();
|
||||
});
|
||||
|
||||
test("is not shown", () => {
|
||||
@@ -106,7 +110,7 @@ describe("MediaView", () => {
|
||||
</TooltipProvider>,
|
||||
);
|
||||
expect(
|
||||
screen.queryAllByRole("img", { name: "Not encrypted" }).length,
|
||||
screen.queryAllByRole("img", { name: "common.unencrypted" }).length,
|
||||
).toBe(0);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -64,12 +64,14 @@ test("SpotlightTile is accessible", async () => {
|
||||
// Bob should be out of the spotlight, and therefore invisible
|
||||
expect(isInaccessible(screen.getByText("Bob"))).toBe(true);
|
||||
// Now navigate to Bob
|
||||
await user.click(screen.getByRole("button", { name: "Next" }));
|
||||
await user.click(screen.getByRole("button", { name: "common.next" }));
|
||||
screen.getByText("Bob");
|
||||
expect(screen.getByRole("img")).not.toBe(aliceAvatar);
|
||||
expect(isInaccessible(screen.getByText("Alice"))).toBe(true);
|
||||
// Can toggle whether the tile is expanded
|
||||
await user.click(screen.getByRole("button", { name: "Expand" }));
|
||||
await user.click(
|
||||
screen.getByRole("button", { name: "video_tile.expand" }),
|
||||
);
|
||||
expect(toggleExpanded).toHaveBeenCalled();
|
||||
},
|
||||
);
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { afterEach, beforeAll, describe, expect, test, vi } from "vitest";
|
||||
|
||||
import { shouldDisambiguate } from "./displayname";
|
||||
import { alice } from "./test-fixtures";
|
||||
import { mockMatrixRoom } from "./test";
|
||||
|
||||
// Ideally these tests would be in ./displayname.test.ts but I can't figure out how to
|
||||
// just spy on the removeHiddenChars() function without impacting the other tests.
|
||||
// So, these tests are in this separate test file.
|
||||
vi.mock("matrix-js-sdk/src/utils");
|
||||
|
||||
describe("shouldDisambiguate", () => {
|
||||
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
||||
let jsUtils: typeof import("matrix-js-sdk/src/utils");
|
||||
|
||||
beforeAll(async () => {
|
||||
jsUtils = await import("matrix-js-sdk/src/utils");
|
||||
vi.spyOn(jsUtils, "removeHiddenChars").mockImplementation((str) => str);
|
||||
});
|
||||
afterEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
test("should only call removeHiddenChars once for a single displayname", () => {
|
||||
const room = mockMatrixRoom({});
|
||||
shouldDisambiguate(alice, [], room);
|
||||
expect(jsUtils.removeHiddenChars).toHaveBeenCalledTimes(1);
|
||||
for (let i = 0; i < 10; i++) {
|
||||
shouldDisambiguate(alice, [], room);
|
||||
}
|
||||
expect(jsUtils.removeHiddenChars).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
@@ -7,36 +7,12 @@ Please see LICENSE in the repository root for full details.
|
||||
|
||||
import {
|
||||
removeDirectionOverrideChars,
|
||||
removeHiddenChars as removeHiddenCharsUncached,
|
||||
removeHiddenChars,
|
||||
} from "matrix-js-sdk/src/utils";
|
||||
|
||||
import type { Room } from "matrix-js-sdk/src/matrix";
|
||||
import type { CallMembership } from "matrix-js-sdk/src/matrixrtc";
|
||||
|
||||
// Calling removeHiddenChars() can be slow on Safari, so we cache the results.
|
||||
// To illustrate a simple benchmark:
|
||||
// Chrome: 10,000 calls took 2.599ms
|
||||
// Safari: 10,000 calls took 242ms
|
||||
// See: https://github.com/element-hq/element-call/issues/3065
|
||||
|
||||
const removeHiddenCharsCache = new Map<string, string>();
|
||||
|
||||
/**
|
||||
* Calls removeHiddenCharsUncached and caches the result
|
||||
*/
|
||||
function removeHiddenChars(str: string): string {
|
||||
if (removeHiddenCharsCache.has(str)) {
|
||||
return removeHiddenCharsCache.get(str)!;
|
||||
}
|
||||
const result = removeHiddenCharsUncached(str);
|
||||
// this is naive but should be good enough for our purposes
|
||||
if (removeHiddenCharsCache.size > 500) {
|
||||
removeHiddenCharsCache.clear();
|
||||
}
|
||||
removeHiddenCharsCache.set(str, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
// Borrowed from https://github.com/matrix-org/matrix-js-sdk/blob/f10deb5ef2e8f061ff005af0476034382ea128ca/src/models/room-member.ts#L409
|
||||
export function shouldDisambiguate(
|
||||
member: { rawDisplayName?: string; userId: string },
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { t } from "i18next";
|
||||
|
||||
export enum ErrorCode {
|
||||
/**
|
||||
* Configuration problem due to no MatrixRTC backend/SFU is exposed via .well-known and no fallback configured.
|
||||
*/
|
||||
MISSING_MATRIX_RTC_FOCUS = "MISSING_MATRIX_RTC_FOCUS",
|
||||
CONNECTION_LOST_ERROR = "CONNECTION_LOST_ERROR",
|
||||
MEMBERSHIP_MANAGER_UNRECOVERABLE = "MEMBERSHIP_MANAGER_UNRECOVERABLE",
|
||||
/** LiveKit indicates that the server has hit its track limits */
|
||||
INSUFFICIENT_CAPACITY_ERROR = "INSUFFICIENT_CAPACITY_ERROR",
|
||||
E2EE_NOT_SUPPORTED = "E2EE_NOT_SUPPORTED",
|
||||
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
||||
}
|
||||
|
||||
export enum ErrorCategory {
|
||||
/** Calling is not supported, server misconfigured (JWT service missing, no MSC support ...)*/
|
||||
CONFIGURATION_ISSUE = "CONFIGURATION_ISSUE",
|
||||
NETWORK_CONNECTIVITY = "NETWORK_CONNECTIVITY",
|
||||
RTC_SESSION_FAILURE = "RTC_SESSION_FAILURE",
|
||||
CLIENT_CONFIGURATION = "CLIENT_CONFIGURATION",
|
||||
UNKNOWN = "UNKNOWN",
|
||||
// SYSTEM_FAILURE / FEDERATION_FAILURE ..
|
||||
}
|
||||
|
||||
/**
|
||||
* Structure for errors that occur when using ElementCall.
|
||||
*/
|
||||
export class ElementCallError extends Error {
|
||||
public code: ErrorCode;
|
||||
public category: ErrorCategory;
|
||||
public localisedMessage?: string;
|
||||
public localisedTitle: string;
|
||||
|
||||
protected constructor(
|
||||
localisedTitle: string,
|
||||
code: ErrorCode,
|
||||
category: ErrorCategory,
|
||||
localisedMessage: string,
|
||||
cause?: Error,
|
||||
) {
|
||||
super(localisedTitle, { cause });
|
||||
this.localisedTitle = localisedTitle;
|
||||
this.localisedMessage = localisedMessage;
|
||||
this.category = category;
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
|
||||
export class MatrixRTCFocusMissingError extends ElementCallError {
|
||||
public domain: string;
|
||||
|
||||
public constructor(domain: string) {
|
||||
super(
|
||||
t("error.call_is_not_supported"),
|
||||
ErrorCode.MISSING_MATRIX_RTC_FOCUS,
|
||||
ErrorCategory.CONFIGURATION_ISSUE,
|
||||
t("error.matrix_rtc_focus_missing", {
|
||||
domain,
|
||||
brand: import.meta.env.VITE_PRODUCT_NAME || "Element Call",
|
||||
errorCode: ErrorCode.MISSING_MATRIX_RTC_FOCUS,
|
||||
}),
|
||||
);
|
||||
this.domain = domain;
|
||||
}
|
||||
}
|
||||
|
||||
export class ConnectionLostError extends ElementCallError {
|
||||
public constructor() {
|
||||
super(
|
||||
t("error.connection_lost"),
|
||||
ErrorCode.CONNECTION_LOST_ERROR,
|
||||
ErrorCategory.NETWORK_CONNECTIVITY,
|
||||
t("error.connection_lost_description"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class RTCSessionError extends ElementCallError {
|
||||
public constructor(code: ErrorCode, message: string) {
|
||||
super("RTCSession Error", code, ErrorCategory.RTC_SESSION_FAILURE, message);
|
||||
}
|
||||
}
|
||||
|
||||
export class E2EENotSupportedError extends ElementCallError {
|
||||
public constructor() {
|
||||
super(
|
||||
t("error.e2ee_unsupported"),
|
||||
ErrorCode.E2EE_NOT_SUPPORTED,
|
||||
ErrorCategory.CLIENT_CONFIGURATION,
|
||||
t("error.e2ee_unsupported_description"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class UnknownCallError extends ElementCallError {
|
||||
public constructor(error: Error) {
|
||||
super(
|
||||
t("error.generic"),
|
||||
ErrorCode.UNKNOWN_ERROR,
|
||||
ErrorCategory.UNKNOWN,
|
||||
error.message,
|
||||
// Properly set it as a cause for a better reporting on sentry
|
||||
error,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class InsufficientCapacityError extends ElementCallError {
|
||||
public constructor() {
|
||||
super(
|
||||
t("error.insufficient_capacity"),
|
||||
ErrorCode.INSUFFICIENT_CAPACITY_ERROR,
|
||||
ErrorCategory.UNKNOWN,
|
||||
t("error.insufficient_capacity_description"),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { expect, describe, it } from "vitest";
|
||||
|
||||
import { isFailure } from "./fetch";
|
||||
|
||||
describe("isFailure", () => {
|
||||
it("returns false for a successful response", () => {
|
||||
expect(isFailure({ ok: true, url: "https://foo.com" } as Response)).toBe(
|
||||
false,
|
||||
);
|
||||
});
|
||||
|
||||
it("returns true for a failed response", () => {
|
||||
expect(isFailure({ ok: false, url: "https://foo.com" } as Response)).toBe(
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
it("returns false for a file:// URL with status 0", () => {
|
||||
expect(
|
||||
isFailure({ ok: false, url: "file://foo", status: 0 } as Response),
|
||||
).toBe(false);
|
||||
});
|
||||
});
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
Copyright 2025 New Vector Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Check if a fetch response is a failure in a way that works with file:// URLs
|
||||
* @param response the response to check
|
||||
* @returns true if the response is a failure, false otherwise
|
||||
*/
|
||||
export function isFailure(response: Response): boolean {
|
||||
// if response says it's okay, then it's not a failure
|
||||
if (response.ok) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// fetch will return status === 0 for a success on a file:// URL, so we special case it
|
||||
if (response.url.startsWith("file:") && response.status === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -69,7 +69,7 @@ async function waitForSync(client: MatrixClient): Promise<void> {
|
||||
* otherwise rust crypto will throw since it is not ready to initialize a new session.
|
||||
* If another client is running make sure `.logout()` is called before executing this function.
|
||||
* @param clientOptions Object of options passed through to the client
|
||||
* @param restore If the rust crypto should be reset before the client initialization or
|
||||
* @param restore If the rust crypto should be reset before the cient initialization or
|
||||
* if the initialization should try to restore the crypto state from the indexDB.
|
||||
* @returns The MatrixClient instance
|
||||
*/
|
||||
@@ -160,6 +160,7 @@ export async function initClient(
|
||||
);
|
||||
}
|
||||
|
||||
client.setGlobalErrorOnUnknownDevices(false);
|
||||
// Once startClient is called, syncs are run asynchronously.
|
||||
// Also, sync completion is communicated only via events.
|
||||
// So, apply the event listener *before* starting the client.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user