Compare commits

...
Author SHA1 Message Date
MoepchiandClaude Opus 5.5 9878b1caf3 Master password: say it's asked again every session when turning it on
The README now points to the master password instead of only saying
everything is stored unencrypted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 10:55:04 +00:00
MoepchiandClaude Opus 5.5 36f510b28e README: new desktop screenshot in a narrower aspect ratio
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 10:45:36 +00:00
MoepchiandClaude Opus 5.5 faef5c7d19 README: rename phone screenshot so GitHub's image cache picks up the new one
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 10:35:59 +00:00
MoepchiandClaude Opus 5.5 ecf0285f1c README: new phone screenshot showing the mobile layout
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 10:33:01 +00:00
MoepchiandClaude Opus 5.5 b11a7a73b8 Mobile: keep the mobile layout under Nova, Pulse and IDE themes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 10:12:04 +00:00
MoepchiandClaude Opus 5.5 b5e2ce3f7e Mobile: hamburger menu opens as a left drawer sized to its entries
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 10:01:51 +00:00
MoepchiandClaude Opus 5.5 e5cda8301d Mobile: back chevron vertically centred with its label
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 09:57:50 +00:00
MoepchiandClaude Opus 5.5 708ad72e59 Mobile: dialogs as bottom sheets / full-screen pages
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 09:51:22 +00:00
MoepchiandClaude Opus 5.5 85fa73c7d6 Hamburger menu: picking an entry closes the whole panel
It stayed open on top of the dialog the entry had just opened.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 09:44:16 +00:00
MoepchiandClaude Opus 5.5 8a3e1c230e Mobile: open submenu fills the screen with a sticky back row
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 09:38:09 +00:00
MoepchiandClaude Opus 5.5 b50dc338df Mobile: hamburger menu drills into one submenu with a back row
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 09:34:56 +00:00
MoepchiandClaude Opus 5.5 b40ada8cff Mobile options: no outline on the last-picked section
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 09:30:38 +00:00
MoepchiandClaude Opus 5.5 fa2c68b622 Mobile: options as full-screen list -> page with back button
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 09:30:30 +00:00
MoepchiandClaude Opus 5.5 54046d51fe Mobile: active tab highlight wraps icon and label
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 09:23:51 +00:00
MoepchiandClaude Opus 5.5 9364a7d48a Mobile: readable accent buttons, calmer disconnected state, no demo toggle on phones
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 09:21:33 +00:00
MoepchiandClaude Opus 5.5 dab1a7637e Demo mobile preview: keep floating buttons inside the phone frame
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-09 09:19:15 +00:00
MoepchiandClaude Opus 5.5 a4da3409bc Mobile: own touch layout with bottom voice bar and tabs
Below 700px (or with the demo's mobile toggle) the client switches to its own
shell instead of squeezing the desktop layout: header with the menu behind a
hamburger, one full-height panel at a time (channels / chat / info), big
mic / sound / leave buttons and a tab bar at the bottom. Touch targets are at
least 44px, the chat input is 16px so iOS doesn't zoom. Desktop is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-08 21:14:33 +00:00
MoepchiandClaude Opus 5.5 da985ef7d1 README: add table of contents
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-08 21:00:52 +00:00
MoepchiandClaude Opus 5.5 806de52382 i18n: drop Weblate, take translations via pull request
Weblate stayed pinned to the pre-transfer repo URL and stopped syncing.
The in-app links now point to a new README section explaining how to
fix or add a language with a PR or by sending the file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-08 20:50:03 +00:00
MoepchiandClaude Opus 5.5 d299343835 stream: add webcam as a stream source
The stream dialog gets a source choice: screen/window via the browser
picker, or the camera via getUserMedia, announced to TS6 as type=1
(CAMERA). Camera streams send no audio track, since that would be the
microphone a second time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-11-05 11:28:51 +00:00
MoepchiandClaude Opus 5.5 10ae24a99f i18n: add Russian translation (beta)
Russia is the third-largest country in the connection stats and had no
translation yet. Machine-assisted, so marked (Beta) until a native
speaker has reviewed it, like Persian.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
2026-10-26 22:00:36 +00:00
15 changed files with 2210 additions and 58 deletions

No files matched your search

+29 -3
View File
@@ -31,6 +31,23 @@
---
## 📑 Contents
- [Preview](#-preview)
- [Quick Start](#-quick-start)
- [Features](#-features)
- [Tech Stack](#-tech-stack)
- [Browser Support](#-browser-support)
- [Installation](#-installation)
- [Docker (recommended)](#-docker-recommended)
- [Account sync](#account-sync)
- [Environment variables](#environment-variables)
- [Auto-Connect Links](#-auto-connect-links)
- [Translating](#translating)
- [Credits](#credits)
- [In Memory of Akimo](#-in-memory-of-akimo)
- [Legal / Disclaimer](#legal--disclaimer)
## 📸 Preview
<table>
@@ -39,8 +56,8 @@
<th>Mobile</th>
</tr>
<tr>
<td width="72%"><img src="docs/screenshots/webspeak_current.png" width="100%" alt="WebSpeak3 desktop client connected to a TeamSpeak server"></td>
<td width="28%" align="center"><img src="docs/screenshots/webspeak_mobile.png" width="260" alt="WebSpeak3 mobile client connected to a TeamSpeak server"></td>
<td width="72%"><img src="docs/screenshots/webspeak_desktop.png" width="100%" alt="WebSpeak3 desktop client connected to a TeamSpeak server"></td>
<td width="28%" align="center"><img src="docs/screenshots/webspeak_mobile_phone.png" width="260" alt="WebSpeak3 mobile client connected to a TeamSpeak server"></td>
</tr>
</table>
@@ -239,7 +256,7 @@ All optional; add them under `environment:` in your compose override next to `PO
> **Trust model:** the gateway speaks the TeamSpeak protocol on the user's behalf, so whoever runs it necessarily handles their identity key, server/channel passwords and privilege keys (they're kept out of process listings, but the operator can still see them). Only use gateways you trust, and serve them over HTTPS/WSS (`TLS_CERT`/`TLS_KEY` or a TLS-terminating proxy) - plain HTTP exposes all of that on the wire. File uploads are limited to 24 MiB, downloads to 25 MiB.
> **Stored in the browser:** identities (including their private keys), favorites with any passwords you typed into them, and settings live in the browser's `localStorage`, unencrypted - the same way the native client keeps them in its settings files. Anyone with access to your browser profile can read them; leave favorite password fields empty on shared machines and export identities you care about. Server banners load directly from the host the server admin configured; turn them off under Options → Application if you don't want that host to see your IP.
> **Stored in the browser:** identities (including their private keys), favorites with any passwords you typed into them, and settings live in the browser's `localStorage`, unencrypted by default - the same way the native client keeps them in its settings files. Anyone with access to your browser profile can read them. To encrypt identities and saved passwords, set a master password under Options → Security; it's then asked for once per session (every reload or new tab), and without it that data can't be recovered, so export identities you care about first. Server banners load directly from the host the server admin configured; turn them off under Options → Application if you don't want that host to see your IP.
<details>
<summary><b>🛠️ Manual installation (without Docker)</b></summary>
@@ -365,6 +382,15 @@ A share link (above) always takes priority over the baked-in default when both a
Either way: on your own hosted instance, the mandatory first-visit Terms of Use is shown and accepted before anything auto-connects; and if the connection fails, the connect dialog opens prefilled so the visitor can fix it and retry by hand.
<a id="translating"></a>
## 🌍 Translating
The UI texts live in flat JSON files in [`web/src/locales/`](web/src/locales/), one per language, with `en.json` as the reference. Untranslated keys fall back to English.
- **Fix or complete a language:** edit its file and open a pull request.
- **Add a new language:** copy `en.json` to `<code>.json` (for example `it.json`), translate the values and open a pull request. Leave the keys and placeholders like `{count}` as they are. I'll wire the language into the selector.
- **No GitHub account?** Send the file via the in-app feedback form or to feedback@webspeak3.de.
## Credits
The vast majority of this project's code was written by [Claude Code](https://claude.com/claude-code) (Anthropic's Claude), working iteratively with the repo owner one feature at a time.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 421 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

+891
View File
@@ -43,6 +43,9 @@
.ts-app.ts-force-mobile {
max-width: 390px;
margin: 0 auto;
/* Makes position:fixed children (FABs, dialogs) stick to this phone frame
instead of the browser window. */
transform: translateZ(0);
box-shadow:
0 0 0 1px rgba(0, 0, 0, 0.4),
0 0 40px rgba(0, 0, 0, 0.5);
@@ -4999,3 +5002,891 @@ input.ts-identities-uid {
.ts-app .gts-connection-tab-close:hover {
opacity: 1;
}
/* ---------------------------------------------------------------------------
Mobile shell (.ts-mobile is set from JS below 700px or via the demo toggle).
Own layout instead of the squeezed desktop one: slim header with the menu
behind ☰, one full-height panel at a time (channels / chat / info), big
voice controls and tabs at the bottom. Touch targets are >= 44px.
--------------------------------------------------------------------------- */
.ts-app.ts-mobile {
height: 100dvh;
font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--m-radius: 14px;
}
.ts-app.ts-mobile > .ts-toolbar,
.ts-app.ts-mobile > .ts-log,
.ts-app.ts-mobile .ts-resize-handle-vertical,
.ts-app.ts-mobile .ts-resize-handle-horizontal {
display: none !important;
}
/* Header */
.ts-app.ts-mobile > .ts-menubar {
position: relative;
min-height: 56px;
padding: 0 8px 0 4px;
gap: 6px;
flex-wrap: nowrap;
justify-content: flex-start;
font-size: 15px;
}
.ts-app.ts-mobile > .ts-menubar .ts-nova-menu-dropdown {
position: static;
order: 0;
}
.ts-app.ts-mobile .ts-nova-menu-toggle {
width: 44px;
height: 44px;
font-size: 22px;
border-radius: 12px;
border: none;
background: transparent;
}
.ts-app.ts-mobile .ts-mobile-title {
display: flex;
flex-direction: column;
min-width: 0;
flex: 1;
line-height: 1.2;
}
.ts-app.ts-mobile .ts-mobile-title-name {
font-size: 17px;
font-weight: 650;
color: var(--text);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ts-app.ts-mobile .ts-mobile-title-status {
font-size: 12px;
color: var(--text-muted);
display: flex;
align-items: center;
gap: 5px;
}
.ts-app.ts-mobile .ts-mobile-title-status::before {
content: "";
width: 7px;
height: 7px;
border-radius: 50%;
background: var(--text-muted);
}
.ts-app.ts-mobile .ts-mobile-title-status-on::before {
background: #3ba55d;
}
/* The ☰ panel becomes a full-width sheet with inline (accordion) submenus. */
.ts-app.ts-mobile .ts-menubar-items.ts-nova-menu-panel.ts-nova-menu-panel-open {
left: 8px;
right: 8px;
top: calc(100% + 4px);
margin: 0;
padding: 8px;
max-height: calc(100dvh - 140px);
overflow-y: auto;
border-radius: var(--m-radius);
box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.ts-app.ts-mobile .ts-menubar-items.ts-nova-menu-panel-open .ts-menubar-item,
.ts-app.ts-mobile .ts-menubar-items.ts-nova-menu-panel-open .ts-menubar-item-active {
min-height: 48px;
padding: 0 14px;
font-size: 16px;
font-weight: 600;
color: var(--text);
text-align: left;
border-radius: 10px;
}
.ts-app.ts-mobile .ts-menubar-items.ts-nova-menu-panel-open .ts-menu {
position: static;
margin: 0 0 6px 10px;
width: auto;
min-width: 0;
max-height: none;
border: none;
border-left: 2px solid var(--border-soft);
border-radius: 0;
box-shadow: none;
background: transparent;
}
.ts-app.ts-mobile .ts-menu-item {
min-height: 44px;
font-size: 15px;
}
/* Body: one panel at a time */
.ts-app.ts-mobile .ts-body {
flex: 1;
min-height: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
.ts-app.ts-mobile .ts-upper {
height: auto !important;
flex: 1;
min-height: 0;
flex-direction: column;
}
.ts-app.ts-mobile .ts-tree-panel,
.ts-app.ts-mobile .ts-side-panel {
width: 100% !important;
max-height: none;
flex: 1;
min-height: 0;
overflow-y: auto;
border: none;
}
.ts-app.ts-mobile .ts-chat-panel {
flex: 1;
min-height: 0;
}
.ts-app.ts-mobile-tab-tree .ts-side-panel,
.ts-app.ts-mobile-tab-tree .ts-chat-panel,
.ts-app.ts-mobile-tab-info .ts-tree-panel,
.ts-app.ts-mobile-tab-info .ts-chat-panel,
.ts-app.ts-mobile-tab-chat .ts-upper {
display: none !important;
}
/* Tree: big, rounded rows */
.ts-app.ts-mobile .ts-tree-panel {
padding: 6px 8px 12px;
font-size: 15px;
}
.ts-app.ts-mobile .ts-tree-panel .ts-row {
min-height: 44px;
line-height: 1.3;
padding-top: 0;
padding-bottom: 0;
padding-right: 10px;
gap: 8px;
border-radius: 10px;
}
.ts-app.ts-mobile .ts-tree-panel .ts-server-row {
font-weight: 650;
}
.ts-app.ts-mobile .ts-tree-search {
min-height: 42px;
margin: 6px 0;
padding: 0 14px;
font-size: 16px;
border-radius: 12px;
}
.ts-app.ts-mobile .ts-side-panel {
padding: 8px 12px;
font-size: 15px;
}
/* Chat */
.ts-app.ts-mobile .ts-chat-messages {
font-size: 15px;
padding: 8px 12px;
}
.ts-app.ts-mobile .ts-chat-tabs {
overflow-x: auto;
gap: 6px;
padding: 6px 8px;
}
.ts-app.ts-mobile .ts-chat-tab {
min-height: 36px;
padding: 0 14px;
border-radius: 999px;
font-size: 14px;
white-space: nowrap;
}
.ts-app.ts-mobile .ts-chat-input-row {
padding: 8px;
gap: 8px;
align-items: flex-end;
}
.ts-app.ts-mobile .ts-chat-input-row textarea {
min-height: 44px;
font-size: 16px; /* < 16px makes iOS zoom into the field */
padding: 10px 14px;
border-radius: 22px;
}
.ts-app.ts-mobile .ts-chat-input-row button {
min-height: 44px;
padding: 0 18px;
font-size: 15px;
font-weight: 600;
border: none;
border-radius: 22px;
background: var(--accent);
color: var(--bg);
}
/* Bottom: voice bar + tabs */
.ts-mobile-bottom {
flex-shrink: 0;
background: var(--bg-toolbar-1);
border-top: 1px solid var(--border-soft);
padding-bottom: env(safe-area-inset-bottom);
}
.ts-mobile-voicebar {
display: flex;
gap: 8px;
padding: 8px 10px 4px;
}
.ts-mobile-voice-btn {
flex: 1;
min-width: 0;
min-height: 56px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 4px;
border: none;
border-radius: var(--m-radius, 14px);
background: var(--input-bg);
color: var(--text);
cursor: pointer;
touch-action: manipulation;
-webkit-user-select: none;
user-select: none;
}
.ts-mobile-voice-label {
font-size: 11px;
color: var(--text-muted);
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.ts-mobile-voice-on {
background: #3ba55d;
color: #fff;
}
.ts-mobile-voice-off {
background: #b3403a;
color: #fff;
}
.ts-mobile-voice-on .ts-mobile-voice-label,
.ts-mobile-voice-off .ts-mobile-voice-label,
.ts-mobile-voice-hangup .ts-mobile-voice-label {
color: #fff;
}
.ts-mobile-voice-hangup {
flex: 0 0 72px;
background: #d6403d;
color: #fff;
}
.ts-mobile-ptt {
flex: 2;
}
.ts-mobile-connect-btn {
flex: 1;
min-height: 52px;
border: none;
border-radius: var(--m-radius, 14px);
background: var(--accent);
color: var(--bg);
font-size: 16px;
font-weight: 650;
}
.ts-mobile-tabs {
display: flex;
}
.ts-mobile-tab {
flex: 1;
min-height: 52px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
border: none;
background: transparent;
color: var(--text-muted);
font-size: 11px;
font-weight: 600;
position: relative;
touch-action: manipulation;
margin: 4px 18px;
border-radius: 16px;
}
.ts-mobile-icon {
width: 24px;
height: 24px;
flex-shrink: 0;
}
.ts-mobile-tab-active {
color: var(--accent);
}
.ts-mobile-tab-active {
background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.ts-mobile-tab-unread::after {
content: "";
position: absolute;
top: 8px;
left: calc(50% + 10px);
width: 8px;
height: 8px;
border-radius: 50%;
background: #d6403d;
}
/* Floating buttons sit above the bottom bars instead of on top of them. */
.ts-app.ts-mobile .ts-donate-fab {
bottom: calc(150px + env(safe-area-inset-bottom));
right: 12px;
}
.ts-app.ts-mobile .ts-feedback-fab-wrap {
bottom: calc(150px + env(safe-area-inset-bottom));
right: 12px;
}
.ts-app.ts-mobile .ts-feedback-fab-wrap-stacked {
bottom: calc(200px + env(safe-area-inset-bottom));
}
.ts-mobile-tab > * {
position: relative;
}
/* In the chat tab the floating buttons would cover the send button. */
.ts-app.ts-mobile-tab-chat .ts-donate-fab,
.ts-app.ts-mobile-tab-chat .ts-feedback-fab-wrap {
display: none;
}
.ts-app.ts-mobile .ts-chat-tabs {
order: -1;
border-bottom: 1px solid var(--border-soft);
}
/* Disconnected: the header already says so, keep the panel calm and centered. */
.ts-app.ts-mobile .ts-tree-panel > .ts-tree-empty:only-child {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
font-style: normal;
font-size: 16px;
color: var(--text-muted);
}
/* --- Mobile: settings dialogs as full-screen pages ------------------------ */
.ts-options-back {
display: none;
}
.ts-app.ts-mobile .ts-options-dialog {
position: fixed;
inset: 0;
width: 100% !important;
max-height: none;
height: 100dvh;
border: none;
border-radius: 0;
display: flex;
flex-direction: column;
overflow: hidden;
}
.ts-app.ts-mobile .ts-options-dialog .ts-dialog-titlebar {
min-height: 56px;
padding: 0 4px 0 16px;
font-size: 17px;
flex-shrink: 0;
}
.ts-app.ts-mobile .ts-options-dialog .ts-dialog-titlebar > button:last-child {
width: 44px;
height: 44px;
font-size: 20px;
}
.ts-app.ts-mobile .ts-options-dialog .ts-options-body {
flex: 1;
min-height: 0;
overflow-y: auto;
flex-direction: column;
}
.ts-app.ts-mobile .ts-options-dialog .ts-dialog-buttons {
display: none;
}
/* Section list */
.ts-app.ts-mobile .ts-options-dialog-nav .ts-options-sidebar {
flex-direction: column;
flex-wrap: nowrap;
width: 100%;
padding: 8px 12px calc(16px + env(safe-area-inset-bottom));
border: none;
gap: 2px;
}
.ts-app.ts-mobile .ts-options-dialog-nav .ts-options-sidebar-item {
min-height: 52px;
padding: 0 12px;
gap: 14px;
font-size: 16px;
border-radius: 12px;
background: none;
border: none;
outline: none;
font-weight: 500;
}
.ts-app.ts-mobile .ts-options-dialog-nav .ts-options-sidebar-item::after {
content: "›";
margin-left: auto;
font-size: 22px;
color: var(--text-muted);
}
.ts-app.ts-mobile .ts-options-dialog-nav .ts-options-sidebar-icon {
width: 34px;
height: 34px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
background: var(--input-bg);
font-size: 18px;
}
.ts-app.ts-mobile .ts-options-dialog-nav:not(.ts-options-detail) .ts-options-content,
.ts-app.ts-mobile .ts-options-dialog-nav.ts-options-detail .ts-options-sidebar,
.ts-app.ts-mobile .ts-options-dialog-nav.ts-options-detail .ts-options-title {
display: none;
}
.ts-app.ts-mobile .ts-options-detail .ts-options-back {
display: flex;
align-items: center;
gap: 8px;
min-height: 44px;
padding: 0 8px 0 0;
font-size: 17px;
font-weight: 600;
color: var(--text);
}
.ts-app.ts-mobile .ts-options-back span {
font-size: 0;
}
/* Other dialogs sharing this layout (server edit): tabs as a scrolling pill row */
.ts-app.ts-mobile .ts-options-dialog:not(.ts-options-dialog-nav) .ts-options-sidebar {
flex-direction: row;
flex-wrap: nowrap;
overflow-x: auto;
width: 100%;
gap: 6px;
padding: 8px 12px;
flex-shrink: 0;
}
.ts-app.ts-mobile .ts-options-dialog:not(.ts-options-dialog-nav) .ts-options-sidebar-item {
min-height: 38px;
padding: 0 14px;
border-radius: 999px;
white-space: nowrap;
font-size: 14px;
}
.ts-app.ts-mobile .ts-options-dialog:not(.ts-options-dialog-nav) .ts-dialog-buttons {
display: flex;
}
/* Page content: touch-sized controls */
.ts-app.ts-mobile .ts-options-dialog .ts-options-content {
padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
font-size: 15px;
}
.ts-app.ts-mobile .ts-options-dialog .ts-options-content select,
.ts-app.ts-mobile .ts-options-dialog .ts-options-content input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
.ts-app.ts-mobile .ts-options-dialog .ts-options-content textarea {
min-height: 44px;
font-size: 16px;
border-radius: 10px;
padding: 0 12px;
}
.ts-app.ts-mobile .ts-options-dialog .ts-options-content button {
min-height: 44px;
border-radius: 10px;
padding: 0 14px;
}
.ts-app.ts-mobile .ts-options-dialog .ts-options-content input[type="checkbox"],
.ts-app.ts-mobile .ts-options-dialog .ts-options-content input[type="radio"] {
width: 20px;
height: 20px;
flex-shrink: 0;
}
.ts-app.ts-mobile .ts-options-dialog .ts-options-content fieldset {
border-radius: 12px;
}
.ts-app.ts-mobile .ts-options-dialog .ts-options-content label {
min-height: 36px;
}
/* --- Mobile: ☰ menu as drill-down (tap "Extras" -> only its items) ------- */
.ts-app.ts-mobile .ts-menubar-items.ts-nova-menu-panel.ts-nova-menu-panel-open {
z-index: 600;
}
.ts-app.ts-mobile:has(.ts-nova-menu-panel-open) .ts-donate-fab,
.ts-app.ts-mobile:has(.ts-nova-menu-panel-open) .ts-feedback-fab-wrap {
display: none;
}
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menubar-dropdown > .ts-menubar-item {
display: flex;
align-items: center;
}
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menubar-dropdown > .ts-menubar-item::after {
content: "›";
margin-left: auto;
font-size: 22px;
font-weight: 400;
color: var(--text-muted);
}
/* One submenu open: hide its siblings, its trigger becomes the back row. */
.ts-app.ts-mobile .ts-nova-menu-panel-open:has(> .ts-menubar-dropdown > .ts-menu) > .ts-menubar-dropdown:not(:has(> .ts-menu)) {
display: none;
}
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menubar-dropdown:has(> .ts-menu) > .ts-menubar-item {
font-size: 17px;
border-bottom: 1px solid var(--border-soft);
border-radius: 10px 10px 0 0;
margin-bottom: 6px;
}
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menubar-dropdown:has(> .ts-menu) > .ts-menubar-item::before {
content: "";
margin-right: 12px;
}
/* Back chevron drawn with borders: a glyph sits on the baseline and looks low. */
.ts-app.ts-mobile .ts-options-back span,
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menubar-dropdown:has(> .ts-menu) > .ts-menubar-item::before {
display: inline-block;
flex: none;
width: 10px;
height: 10px;
margin-left: 6px;
border-left: 2.5px solid var(--accent);
border-bottom: 2.5px solid var(--accent);
transform: rotate(45deg);
}
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menubar-dropdown:has(> .ts-menu) > .ts-menubar-item::after {
content: none;
}
.ts-app.ts-mobile .ts-menubar-items.ts-nova-menu-panel-open .ts-menu {
margin: 0;
padding: 0;
border-left: none;
}
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menu-item {
min-height: 50px;
padding: 0 10px;
gap: 14px;
border-radius: 12px;
}
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menu-item-icon {
width: 34px;
height: 34px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 10px;
background: var(--input-bg);
font-size: 17px;
flex-shrink: 0;
overflow: hidden;
}
/* Keyboard shortcuts mean nothing on a phone. */
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menu-item-shortcut {
display: none;
}
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menu-separator {
margin: 6px 10px;
opacity: 0.6;
}
/* An open submenu takes the whole screen, its back row acts as the title bar. */
.ts-app.ts-mobile .ts-menubar-items.ts-nova-menu-panel.ts-nova-menu-panel-open:has(> .ts-menubar-dropdown > .ts-menu) {
position: fixed;
inset: 0;
max-height: none;
margin: 0;
padding: 0 8px calc(16px + env(safe-area-inset-bottom));
border: none;
border-radius: 0;
box-shadow: none;
}
.ts-app.ts-mobile .ts-nova-menu-panel-open .ts-menubar-dropdown:has(> .ts-menu) > .ts-menubar-item {
position: sticky;
top: 0;
z-index: 1;
min-height: 56px;
margin: 0 -8px 6px;
padding: env(safe-area-inset-top) 16px 0 12px;
border-radius: 0;
background: var(--bg-toolbar-1);
}
/* --- Mobile: all other dialogs ------------------------------------------- */
/* Small prompts slide up as a bottom sheet; list/admin dialogs fill the
screen. :where() keeps this below the options-dialog rules above. */
.ts-app.ts-mobile .ts-dialog-backdrop {
align-items: flex-end;
}
.ts-app.ts-mobile :where(.ts-dialog) {
width: 100% !important;
min-width: 0 !important;
max-width: none !important;
max-height: 100dvh;
box-sizing: border-box;
display: flex;
flex-direction: column;
overflow-y: auto;
overscroll-behavior: contain;
border: none;
border-radius: 20px 20px 0 0;
padding-bottom: env(safe-area-inset-bottom);
font-size: 15px;
}
.ts-app.ts-mobile :where(
.ts-client-log-dialog, .ts-server-protocol-log-dialog, .ts-ban-list-dialog,
.ts-complain-list-dialog, .ts-offline-messages-dialog, .ts-collected-urls-dialog,
.ts-contacts-dialog, .ts-identities-dialog, .ts-favorites-dialog,
.ts-file-browser-dialog, .ts-transfers-window, .ts-perms-editor-dialog,
.ts-permission-overview-dialog, .ts-whisper-lists-dialog,
.ts-whisper-history-dialog, .ts-server-icons-dialog, .ts-group-assign-dialog,
.ts-tos-dialog, .ts-connection-info-dialog, .ts-feedback-dialog, .ts-about-dialog
) {
height: 100dvh;
border-radius: 0;
}
.ts-app.ts-mobile :where(.ts-dialog) > .ts-dialog-titlebar {
position: sticky;
top: 0;
z-index: 2;
min-height: 56px;
padding: 0 4px 0 16px;
font-size: 17px;
background: var(--bg-toolbar-1);
flex-shrink: 0;
}
.ts-app.ts-mobile :where(.ts-dialog) > .ts-dialog-titlebar button {
width: 44px;
height: 44px;
font-size: 20px;
}
.ts-app.ts-mobile :where(.ts-dialog) > .ts-dialog-buttons {
position: sticky;
bottom: 0;
z-index: 2;
margin-top: auto;
flex-wrap: wrap;
gap: 8px;
padding: 10px 12px;
background: var(--bg-toolbar-1);
}
/* The scrolling list inside a full-screen dialog takes the free height. */
.ts-app.ts-mobile :where(.ts-dialog) > :not(.ts-dialog-titlebar):not(.ts-dialog-buttons) {
min-width: 0;
}
.ts-app.ts-mobile :where(.ts-dialog) table {
display: block;
overflow-x: auto;
max-width: 100%;
}
.ts-app.ts-mobile :where(.ts-dialog) button {
min-height: 44px;
padding: 0 16px;
border-radius: 10px;
font-size: 15px;
}
.ts-app.ts-mobile :where(.ts-dialog) :where(select, textarea,
input:not([type="checkbox"]):not([type="radio"]):not([type="range"])) {
min-height: 44px;
font-size: 16px;
border-radius: 10px;
padding-left: 12px;
padding-right: 12px;
box-sizing: border-box;
max-width: 100%;
}
.ts-app.ts-mobile :where(.ts-dialog) :where(input[type="checkbox"], input[type="radio"]) {
width: 20px;
height: 20px;
flex-shrink: 0;
}
.ts-app.ts-mobile :where(.ts-dialog) .ts-dialog-field {
font-size: 13px;
}
/* Mobile: buttons share each wrapped row evenly; log-level filters as a chip row. */
.ts-app.ts-mobile :where(.ts-dialog) > .ts-dialog-buttons > div {
display: flex;
flex-wrap: wrap;
flex: 1 1 100%;
gap: 8px;
}
.ts-app.ts-mobile :where(.ts-dialog) > .ts-dialog-buttons button {
flex: 1 1 auto;
}
.ts-app.ts-mobile :where(.ts-dialog) .ts-dialog-row {
align-items: stretch;
}
.ts-app.ts-mobile .ts-log-level-row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
gap: 6px 14px;
}
.ts-app.ts-mobile .ts-log-level-row > .ts-dialog-checkbox {
display: inline-flex;
align-items: center;
gap: 6px;
margin: 0;
}
/* --- Mobile: ☰ top level as a left drawer, as wide as its longest entry ---- */
.ts-app.ts-mobile .ts-menubar-items.ts-nova-menu-panel.ts-nova-menu-panel-open:not(:has(> .ts-menubar-dropdown > .ts-menu)) {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: auto;
width: max-content;
max-width: 85%;
max-height: none;
margin: 0;
padding: calc(12px + env(safe-area-inset-top)) 8px calc(12px + env(safe-area-inset-bottom));
border: none;
border-radius: 0 20px 20px 0;
box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45), 8px 0 24px rgba(0, 0, 0, 0.3);
animation: ts-mobile-drawer-in 0.2s ease-out;
}
.ts-app.ts-mobile .ts-nova-menu-panel-open:not(:has(> .ts-menubar-dropdown > .ts-menu)) .ts-menubar-dropdown > .ts-menubar-item {
gap: 28px;
}
@keyframes ts-mobile-drawer-in {
from { transform: translateX(-100%); }
}
/* --- Mobile × design themes: themes keep colours/fonts, the mobile layout wins */
/* Nova/Pulse reorder the app's flex children; pin the mobile bar + ticker last. */
.ts-app.ts-mobile > .ts-mobile-bottom {
order: 10;
}
.ts-app.ts-mobile > .ts-news-ticker {
order: 11;
}
/* Nova/Pulse send buttons are icon-only; keep them round instead of the text pill. */
.ts-app.ts-mobile:is(.ts-design-nova, .ts-design-pulse) .ts-chat-input-row button {
width: 44px;
min-width: 44px;
padding: 0;
font-size: 0;
border-radius: 50%;
}
/* IDE: undo its floating hamburger and three-column grid. */
.ts-app.ts-mobile.ts-design-ide > .ts-menubar {
height: auto;
padding: 0 12px;
border-bottom: 1px solid var(--border-soft);
}
.ts-app.ts-mobile.ts-design-ide > .ts-menubar .ts-nova-menu-dropdown {
position: static;
order: 0;
}
.ts-app.ts-mobile.ts-design-ide > .ts-body {
display: flex;
}
.ts-app.ts-mobile.ts-design-ide .ts-upper {
display: flex;
}
.ts-app.ts-mobile.ts-design-ide .ts-tree-panel {
max-height: none;
}
+174 -18
View File
@@ -2588,17 +2588,18 @@ function SegmentedChoice<T extends string | number>({
}
function StreamSettingsDialog({
defaultName,
ownName,
onStart,
onCancel,
}: {
defaultName: string;
ownName: string;
onStart: (options: StreamPublishOptions) => void;
onCancel: () => void;
}) {
const t = useT();
const backdrop = useBackdropDismiss(onCancel);
const [preset, setPreset] = useState<string | null>("720");
const [source, setSource] = useState<"display" | "camera">("display");
const [audio, setAudio] = useState(true);
const [accessibility, setAccessibility] = useState<number>(StreamAccess.PUBLIC);
const [advanced, setAdvanced] = useState(false);
@@ -2644,6 +2645,18 @@ function StreamSettingsDialog({
<p className="ts-alpha-note">{t("publish.alphaNote")}</p>
<h4 className="ts-stream-settings-section">{t("publish.dialog.basic")}</h4>
<div className="ts-stream-settings-row">
<span>{t("publish.kind")}</span>
<SegmentedChoice
value={source}
onChange={setSource}
options={[
{ value: "display", label: `🖥️ ${t("publish.kind.display")}` },
{ value: "camera", label: `📷 ${t("publish.camera")}` },
]}
/>
</div>
<div className="ts-stream-settings-row">
<span>{t("publish.preset")}</span>
<SegmentedChoice
@@ -2659,8 +2672,16 @@ function StreamSettingsDialog({
<div className="ts-stream-settings-row">
<span>{t("publish.audio")}</span>
<label className="ts-stream-settings-toggle">
<input type="checkbox" checked={audio} onChange={(e) => setAudio(e.target.checked)} />
<label
className="ts-stream-settings-toggle"
title={source === "camera" ? t("publish.audio.cameraHint") : undefined}
>
<input
type="checkbox"
checked={audio && source === "display"}
disabled={source === "camera"}
onChange={(e) => setAudio(e.target.checked)}
/>
<span />
</label>
</div>
@@ -2731,7 +2752,7 @@ function StreamSettingsDialog({
<SegmentedChoice
value={audioBitrateKbps}
onChange={custom(setAudioBitrateKbps)}
disabled={!audio}
disabled={!audio || source === "camera"}
options={AUDIO_BITRATE_CHOICES.map((v) => ({ value: v, label: String(v) }))}
/>
</div>
@@ -2787,8 +2808,9 @@ function StreamSettingsDialog({
className="ts-stream-settings-go"
onClick={() =>
onStart({
name: defaultName,
audio,
name: `${ownName} - ${t(source === "camera" ? "publish.camera" : "publish.screen")}`,
source,
audio: audio && source === "display",
accessibility,
mode,
viewerLimit,
@@ -3128,6 +3150,27 @@ function NewsTicker() {
);
}
/** Line icons for the mobile shell (24px grid, stroke = currentColor). */
const MOBILE_ICONS = {
mic: "M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3zM5 11a7 7 0 0 0 14 0M12 18v3",
micOff: "M3 3l18 18M9 9v3a3 3 0 0 0 5.1 2.1M15 9.3V6a3 3 0 0 0-5.7-1.3M5 11a7 7 0 0 0 11.9 4.9M19 11a7 7 0 0 1-.6 2.8M12 18v3",
sound: "M11 5L6 9H3v6h3l5 4zM15.5 8.5a5 5 0 0 1 0 7M18.5 5.5a9 9 0 0 1 0 13",
soundOff: "M11 5L6 9H3v6h3l5 4zM22 9l-6 6M16 9l6 6",
leave: "M3.6 13.4c4.6-4.5 12.2-4.5 16.8 0l-2.3 2.3-3-1.3v-2.1a11 11 0 0 0-6.2 0v2.1l-3 1.3z",
talk: "M12 3a3 3 0 0 0-3 3v6a3 3 0 0 0 6 0V6a3 3 0 0 0-3-3zM5 11a7 7 0 0 0 14 0M12 18v3M2 8v4M22 8v4",
tree: "M4 5h16M8 10h12M8 15h12M4 5v15M4 10h4M4 15h4M8 20h12M4 20h4",
chat: "M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z",
info: "M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 11v6M12 7.5v.5",
} as const;
function MobileIcon({ name }: { name: keyof typeof MOBILE_ICONS }) {
return (
<svg className="ts-mobile-icon" viewBox="0 0 24 24" aria-hidden="true" fill="none" stroke="currentColor" strokeWidth={2} strokeLinecap="round" strokeLinejoin="round">
<path d={MOBILE_ICONS[name]} />
</svg>
);
}
function DonateFab() {
const t = useT();
if (!DONATE_URL) return null;
@@ -6448,10 +6491,11 @@ function AnwendungPanel({
<option value="zh-CN">{t("app.language.zh-CN")}</option>
<option value="fa">{t("app.language.fa")}</option>
<option value="cs-CZ">{t("app.language.cs-CZ")}</option>
<option value="ru">{t("app.language.ru")}</option>
</select>
</label>
<p className="ts-options-hint">
<a href="https://hosted.weblate.org/projects/webspeak3/" target="_blank" rel="noreferrer">
<a href="https://github.com/WebSpeak3/webspeak3#translating" target="_blank" rel="noreferrer">
{t("app.language.helpTranslate")}
</a>
</p>
@@ -8418,11 +8462,19 @@ function OptionsDialog({
const t = useT();
const active = OPTIONS_SECTIONS.find((s) => s.id === section) ?? OPTIONS_SECTIONS[0];
const backdrop = useBackdropDismiss(onClose);
// Mobile only (CSS): list of sections first, tapping one shows just that page.
const [mobileDetail, setMobileDetail] = useState(false);
return (
<div className="ts-dialog-backdrop" {...backdrop}>
<div className="ts-dialog ts-options-dialog" onClick={(e) => e.stopPropagation()}>
<div
className={`ts-dialog ts-options-dialog ts-options-dialog-nav${mobileDetail ? " ts-options-detail" : ""}`}
onClick={(e) => e.stopPropagation()}
>
<div className="ts-dialog-titlebar">
<span>{t("options.title")}</span>
<button className="ts-options-back" onClick={() => setMobileDetail(false)}>
<span aria-hidden="true">‹</span> {t(`options.section.${active.id}`)}
</button>
<span className="ts-options-title">{t("options.title")}</span>
<button onClick={onClose} title={t("dialog.close")} aria-label={t("dialog.close")}>
✕
</button>
@@ -8433,7 +8485,10 @@ function OptionsDialog({
<button
key={s.id}
className={`ts-options-sidebar-item${s.id === active.id ? " ts-options-sidebar-item-active" : ""}`}
onClick={() => onSectionChange(s.id)}
onClick={() => {
onSectionChange(s.id);
setMobileDetail(true);
}}
>
<span className="ts-options-sidebar-icon">{s.icon}</span>
<span>{t(`options.section.${s.id}`)}</span>
@@ -8883,6 +8938,17 @@ function AppInner() {
const [banSeconds, setBanSeconds] = useState("0");
const banBackdrop = useBackdropDismiss(() => setBanTarget(null));
const [demoForceMobile, setDemoForceMobile] = useState(false);
// Phones get their own shell (header + big tree + bottom voice bar/tabs)
// instead of the squeezed desktop layout.
const [narrowScreen, setNarrowScreen] = useState(() => window.matchMedia("(max-width: 700px)").matches);
useEffect(() => {
const mq = window.matchMedia("(max-width: 700px)");
const onChange = () => setNarrowScreen(mq.matches);
mq.addEventListener("change", onChange);
return () => mq.removeEventListener("change", onChange);
}, []);
const mobile = narrowScreen || demoForceMobile;
const [mobileTab, setMobileTab] = useState<"tree" | "chat" | "info">("tree");
const [clientContextMenu, setClientContextMenu] = useState<{
x: number;
y: number;
@@ -12545,7 +12611,7 @@ function AppInner() {
: treeClients.length;
const novaSplash = designTheme === "nova" && !connected;
// Nova and IDE collapse the menubar behind a hamburger button.
const compactMenu = designTheme === "nova" || designTheme === "ide";
const compactMenu = designTheme === "nova" || designTheme === "ide" || mobile;
const micLabel = !micOn ? t("toolbar.micEnable") : inputMuted ? t("toolbar.micUnmute") : t("toolbar.micMute");
const streamLabel = DEMO_MODE
? t("publish.demoUnavailable")
@@ -12556,7 +12622,7 @@ function AppInner() {
<div
className={`ts-app ts-theme-${theme}${designThemeClassName(designTheme)}${
activeCustomTheme ? " ts-design-custom" : ""
}${demoForceMobile ? " ts-force-mobile" : ""}${novaSplash ? " ts-nova-splash" : ""}${
}${demoForceMobile ? " ts-force-mobile" : ""}${mobile ? ` ts-mobile ts-mobile-tab-${mobileTab}` : ""}${novaSplash ? " ts-nova-splash" : ""}${
designTheme === "ide" && !idePixelFont ? " ts-ide-plain-font" : ""
}`}
data-custom-theme={activeCustomTheme?.id}
@@ -12568,9 +12634,9 @@ function AppInner() {
<a href="https://github.com/WebSpeak3/webspeak3" target="_blank" rel="noreferrer">
Get WebSpeak3
</a>
<button className="ts-demo-mobile-toggle" onClick={() => setDemoForceMobile((v) => !v)}>
{!narrowScreen && <button className="ts-demo-mobile-toggle" onClick={() => setDemoForceMobile((v) => !v)}>
{demoForceMobile ? "🖥 Desktop view" : "📱 Mobile view"}
</button>
</button>}
</div>
)}
<div className="ts-menubar">
@@ -12589,6 +12655,11 @@ function AppInner() {
className={`ts-menubar-items${compactMenu ? " ts-nova-menu-panel" : ""}${
novaMenuOpen ? " ts-nova-menu-panel-open" : ""
}`}
// Picking an entry closes the whole ☰ panel, not just the submenu -
// otherwise it stays on top of the dialog the entry just opened.
onClick={(e) => {
if (compactMenu && (e.target as HTMLElement).closest(".ts-menu-item")) setNovaMenuOpen(false);
}}
>
<div className="ts-menubar-dropdown" ref={connectionsMenuRef}>
<button
@@ -13092,7 +13163,7 @@ function AppInner() {
</a>
<a
className="ts-menu-item"
href="https://hosted.weblate.org/projects/webspeak3/"
href="https://github.com/WebSpeak3/webspeak3#translating"
target="_blank"
rel="noreferrer"
onClick={() => setHelpMenuOpen(false)}
@@ -13118,6 +13189,14 @@ function AppInner() {
</div>
</div>
</div>
{mobile && designTheme !== "nova" && (
<div className="ts-mobile-title">
<span className="ts-mobile-title-name">{connected ? serverName || host : "WebSpeak3"}</span>
<span className={`ts-mobile-title-status${connected ? " ts-mobile-title-status-on" : ""}`}>
{connected ? ownClient?.name ?? t("design.status.connected") : t("tree.notConnected")}
</span>
</div>
)}
{designTheme === "nova" && (
<div className="ts-nova-topbar-server">
<span className="ts-nova-topbar-logo">W</span>
@@ -13382,7 +13461,7 @@ function AppInner() {
</div>
{sessionTabs.length > 0 ? (
{sessionTabs.length > (mobile ? 1 : 0) ? (
<ConnectionTabs
tabs={sessionTabs}
activeTabId={activeSessionId}
@@ -13975,7 +14054,7 @@ function AppInner() {
{streamSettingsOpen && (
<StreamSettingsDialog
defaultName={`${ownClient?.name ?? "WebSpeak3"} - ${t("publish.screen")}`}
ownName={ownClient?.name ?? "WebSpeak3"}
onStart={handleStartPublishing}
onCancel={() => setStreamSettingsOpen(false)}
/>
@@ -14634,6 +14713,83 @@ function AppInner() {
</div>
</main>
{mobile && (
<div className="ts-mobile-bottom">
{connected ? (
<div className="ts-mobile-voicebar">
{pushToTalk && micOn && (
<button
className={`ts-mobile-voice-btn ts-mobile-ptt${pttPressed ? " ts-mobile-voice-on" : ""}`}
onPointerDown={(e) => {
e.currentTarget.setPointerCapture(e.pointerId);
setPttPressed(true);
}}
onPointerUp={() => setPttPressed(false)}
onPointerCancel={() => setPttPressed(false)}
onContextMenu={(e) => e.preventDefault()}
aria-label={t("toolbar.pushToTalk")}
aria-pressed={pttPressed}
>
<MobileIcon name="talk" />
<span className="ts-mobile-voice-label">{t("mobile.talk")}</span>
</button>
)}
<button
className={`ts-mobile-voice-btn${micOn && !inputMuted ? " ts-mobile-voice-on" : ""}${
micOn && inputMuted ? " ts-mobile-voice-off" : ""
}`}
onClick={handleToggleMic}
aria-label={micLabel}
>
<MobileIcon name={micOn && !inputMuted ? "mic" : "micOff"} />
<span className="ts-mobile-voice-label">{t("mobile.mic")}</span>
</button>
<button
className={`ts-mobile-voice-btn${outputMuted ? " ts-mobile-voice-off" : ""}`}
onClick={handleToggleOutputMuted}
aria-label={outputMuted ? t("toolbar.unmuteSound") : t("toolbar.muteSound")}
>
<MobileIcon name={outputMuted ? "soundOff" : "sound"} />
<span className="ts-mobile-voice-label">{t("mobile.sound")}</span>
</button>
<button className="ts-mobile-voice-btn ts-mobile-voice-hangup" onClick={handleDisconnect} aria-label={t("menu.connections.disconnectCurrent")}>
<MobileIcon name="leave" />
<span className="ts-mobile-voice-label">{t("mobile.leave")}</span>
</button>
</div>
) : (
<div className="ts-mobile-voicebar">
<button className="ts-mobile-connect-btn" onClick={() => setConnectDialogOpen(true)} disabled={connecting}>
{t("menu.connections.connect")}
</button>
</div>
)}
<nav className="ts-mobile-tabs">
{(
[
["tree", t("mobile.tab.channels")],
["chat", t("mobile.tab.chat")],
["info", t("mobile.tab.info")],
] as const
).map(([id, label]) => (
<button
key={id}
className={`ts-mobile-tab${mobileTab === id ? " ts-mobile-tab-active" : ""}${
id === "chat" && (chatUnread.server || chatUnread.channel || Object.values(pmThreads).some((p) => p.unread))
? " ts-mobile-tab-unread"
: ""
}`}
onClick={() => setMobileTab(id)}
aria-current={mobileTab === id ? "page" : undefined}
>
<MobileIcon name={id} />
{label}
</button>
))}
</nav>
</div>
)}
<div className="ts-log">
{log.slice(-50).map((entry, i) => {
let text = entry.text;
+6 -3
View File
@@ -5,8 +5,9 @@ import en from "./locales/en.json";
import zhCN from "./locales/zh-CN.json";
import fa from "./locales/fa.json";
import csCZ from "./locales/cs-CZ.json";
import ru from "./locales/ru.json";
export type Lang = "de" | "en" | "zh-CN" | "fa" | "cs-CZ";
export type Lang = "de" | "en" | "zh-CN" | "fa" | "cs-CZ" | "ru";
const RTL_LANGS = new Set<Lang>(["fa"]);
export type LangPref = "auto" | Lang;
@@ -16,7 +17,7 @@ const LANGUAGE_KEY = "webspeak3:language";
// user-facing string in the app should have an entry in every file - falls
// back to the English string (or the raw key) if a translation is missing,
// so a partial dictionary never blanks out the UI. Plain JSON (not inline
// TS objects) so translation tools like Weblate can read/write these files
// TS objects) so translation tools can read/write these files
// directly.
const translations: Record<Lang, Record<string, string>> = {
de,
@@ -24,6 +25,7 @@ const translations: Record<Lang, Record<string, string>> = {
"zh-CN": zhCN,
fa,
"cs-CZ": csCZ,
ru,
};
function detectSystemLang(): Lang {
@@ -32,6 +34,7 @@ function detectSystemLang(): Lang {
if (normalized.startsWith("zh")) return "zh-CN";
if (normalized.startsWith("fa")) return "fa";
if (normalized.startsWith("cs")) return "cs-CZ";
if (normalized.startsWith("ru")) return "ru";
return normalized.startsWith("de") ? "de" : "en";
}
@@ -41,7 +44,7 @@ export function resolveLang(pref: LangPref): Lang {
export function loadLangPref(): LangPref {
const raw = localStorage.getItem(LANGUAGE_KEY);
return raw === "de" || raw === "en" || raw === "zh-CN" || raw === "fa" || raw === "cs-CZ" || raw === "auto" ? raw : "auto";
return raw === "de" || raw === "en" || raw === "zh-CN" || raw === "fa" || raw === "cs-CZ" || raw === "ru" || raw === "auto" ? raw : "auto";
}
export function saveLangPref(pref: LangPref) {
+17 -5
View File
@@ -19,7 +19,7 @@
"menu.help.about": "O WebSpeak3",
"menu.help.github": "GitHub",
"menu.help.changelog": "Seznam změn",
"menu.help.translate": "Pomozte s překladem (Weblate)",
"menu.help.translate": "Pomozte s překladem (GitHub)",
"menu.extras.identities": "Identity",
"menu.extras.contacts": "Kontakty",
"menu.extras.collectedUrls": "Shromážděné URL",
@@ -407,7 +407,8 @@
"app.language.zh-CN": "简体中文",
"app.language.fa": "فارسی (بتا)",
"app.language.cs-CZ": "Čeština",
"app.language.helpTranslate": "Missing your language or spotted wrong translation? Help out on Weblate →",
"app.language.ru": "Русский (бета)",
"app.language.helpTranslate": "Chybí váš jazyk nebo jste našli chybu v překladu? Takto můžete pomoct →",
"app.serverBanner": "Zobrazovat bannery serveru",
"app.serverBanner.hint": "Banner se načítá přímo z adresy nastavené administrátorem serveru a tento hostitel vidí vaši IP adresu.",
"app.chatImages": "Načítat obrázky v chatu",
@@ -489,10 +490,13 @@
"publish.alphaTitle": "Alfa – nestabilní, může se kdykoli změnit nebo přestat fungovat",
"publish.demoUnavailable": "Streamování není v demu dostupné – vyžaduje skutečný server TeamSpeak 6.",
"publish.alphaNote": "Streamování je ve fázi alfa. Používá nezdokumentovaný protokol Stream/Call služby TeamSpeak 6, takže připojení, kvalita obrazu i práce s diváky mohou selhat nebo se bez upozornění změnit. Není určeno pro produkční použití.",
"publish.start": "Sdílet obrazovku",
"publish.start": "Sdílet obrazovku nebo kameru",
"publish.stop": "Zastavit sdílení",
"publish.title": "Vaše vysílání",
"publish.screen": "Obrazovka",
"publish.camera": "Kamera",
"publish.kind": "Sdílet",
"publish.kind.display": "Obrazovka / okno",
"publish.starting": "Spouštění…",
"publish.viewers": "Sleduje {count} diváků",
"publish.request.allow": "Povolit",
@@ -507,6 +511,7 @@
"publish.preset": "Předvolba",
"publish.preset.presentation": "Prezentace",
"publish.audio": "Snímat zvuk",
"publish.audio.cameraHint": "U kamery jde tvůj zvuk jako obvykle přes mikrofon.",
"publish.privacy": "Soukromí",
"publish.privacy.public": "Veřejné",
"publish.privacy.contacts": "Kontakty",
@@ -930,7 +935,7 @@
"securitySettings.masterNew": "Nové hlavní heslo",
"securitySettings.masterRepeat": "Zopakovat",
"securitySettings.masterMismatch": "Hesla se neshodují.",
"securitySettings.masterNote": "Dobře si ho zapamatujte: bez něj přijdete o identity a uložená hesla.",
"securitySettings.masterNote": "Budete ho muset zadat znovu v každé nové relaci (po obnovení stránky nebo v nové kartě). Dobře si ho zapamatujte: bez něj přijdete o identity a uložená hesla.",
"sync.subtitle": "Tvá data na všech zařízeních",
"sync.intro": "Účet je jen náhodné číslo, volitelně s heslem. Žádný e-mail, žádné jméno. Vše se před nahráním zašifruje na tvém zařízení. Server vidí jen nečitelná data.",
"sync.create.title": "Nový účet",
@@ -994,5 +999,12 @@
"sync.error.pow_required": "Bezpečnostní kontrola selhala, zkus to znovu.",
"sync.error.conflict": "Jiné zařízení mezitím něco změnilo.",
"sync.error.payload_too_large": "Příliš mnoho dat pro synchronizaci (max. 1 MB).",
"sync.error.generic": "Synchronizace selhala."
"sync.error.generic": "Synchronizace selhala.",
"mobile.tab.channels": "Kanály",
"mobile.tab.chat": "Chat",
"mobile.tab.info": "Info",
"mobile.mic": "Mikrofon",
"mobile.sound": "Zvuk",
"mobile.leave": "Odpojit",
"mobile.talk": "Mluvit"
}
+17 -5
View File
@@ -19,7 +19,7 @@
"menu.help.about": "Über WebSpeak3",
"menu.help.github": "GitHub",
"menu.help.changelog": "Changelog",
"menu.help.translate": "Mitübersetzen (Weblate)",
"menu.help.translate": "Mitübersetzen (GitHub)",
"menu.extras.identities": "Identitäten",
"menu.extras.contacts": "Kontakte",
"menu.extras.collectedUrls": "Gesammelte URLs",
@@ -407,7 +407,8 @@
"app.language.zh-CN": "简体中文",
"app.language.fa": "فارسی (بتا)",
"app.language.cs-CZ": "Čeština",
"app.language.helpTranslate": "Fehlt deine Sprache oder eine Übersetzung ist ungenau? Hilf mit auf Weblate →",
"app.language.ru": "Русский (бета)",
"app.language.helpTranslate": "Fehlt deine Sprache oder eine Übersetzung ist ungenau? So hilfst du mit →",
"app.serverBanner": "Server-Banner anzeigen",
"app.serverBanner.hint": "Das Banner lädt direkt von der Adresse, die der Serverbetreiber eingetragen hat. Dieser Host sieht dabei deine IP-Adresse.",
"app.chatImages": "Bilder im Chat laden",
@@ -489,10 +490,13 @@
"publish.alphaTitle": "Alpha – instabil, kann sich jederzeit ändern oder brechen",
"publish.demoUnavailable": "Übertragen ist in der Demo nicht verfügbar – dafür braucht es einen echten TeamSpeak-6-Server.",
"publish.alphaNote": "Streaming ist Alpha. Es spricht TeamSpeak 6s Stream/Call-Protokoll, das nicht dokumentiert ist – Verbindungsaufbau, Bildqualität und Zuschauerverwaltung können fehlschlagen oder sich ohne Vorankündigung ändern. Nicht für produktive Nutzung gedacht.",
"publish.start": "Bildschirm übertragen",
"publish.start": "Bildschirm oder Kamera übertragen",
"publish.stop": "Übertragung beenden",
"publish.title": "Deine Übertragung",
"publish.screen": "Bildschirm",
"publish.camera": "Kamera",
"publish.kind": "Übertragen",
"publish.kind.display": "Bildschirm / Fenster",
"publish.starting": "Wird gestartet…",
"publish.viewers": "{count} Zuschauer",
"publish.request.allow": "Zulassen",
@@ -507,6 +511,7 @@
"publish.preset": "Voreinstellung",
"publish.preset.presentation": "Präsentation",
"publish.audio": "Audio aufnehmen",
"publish.audio.cameraHint": "Bei der Kamera läuft dein Ton wie gewohnt übers Mikrofon.",
"publish.privacy": "Privatsphäre",
"publish.privacy.public": "Öffentlich",
"publish.privacy.contacts": "Kontakte",
@@ -930,7 +935,7 @@
"securitySettings.masterNew": "Neues Master Passwort",
"securitySettings.masterRepeat": "Wiederholen",
"securitySettings.masterMismatch": "Die Passwörter stimmen nicht überein.",
"securitySettings.masterNote": "Merk es dir gut: Ohne das Passwort sind Identitäten und gespeicherte Passwörter weg.",
"securitySettings.masterNote": "Du musst es bei jeder neuen Sitzung (Neuladen oder neuer Tab) wieder eingeben. Merk es dir gut: Ohne das Passwort sind Identitäten und gespeicherte Passwörter weg.",
"sync.subtitle": "Deine Daten auf allen Geräten",
"sync.intro": "Ein Konto besteht nur aus einer zufälligen Nummer, optional mit Passwort. Keine Mail, kein Name. Alles wird auf deinem Gerät verschlüsselt, bevor es hochgeladen wird. Der Server sieht nur unlesbare Daten.",
"sync.create.title": "Neues Konto",
@@ -994,5 +999,12 @@
"sync.error.pow_required": "Sicherheitsprüfung fehlgeschlagen, bitte nochmal versuchen.",
"sync.error.conflict": "Ein anderes Gerät hat inzwischen etwas geändert.",
"sync.error.payload_too_large": "Zu viele Daten für die Synchronisierung (max. 1 MB).",
"sync.error.generic": "Synchronisierung fehlgeschlagen."
"sync.error.generic": "Synchronisierung fehlgeschlagen.",
"mobile.tab.channels": "Kanäle",
"mobile.tab.chat": "Chat",
"mobile.tab.info": "Info",
"mobile.mic": "Mikro",
"mobile.sound": "Ton",
"mobile.leave": "Trennen",
"mobile.talk": "Sprechen"
}
+17 -5
View File
@@ -19,7 +19,7 @@
"menu.help.about": "About WebSpeak3",
"menu.help.github": "GitHub",
"menu.help.changelog": "Changelog",
"menu.help.translate": "Help translate (Weblate)",
"menu.help.translate": "Help translate (GitHub)",
"menu.extras.identities": "Identities",
"menu.extras.contacts": "Contacts",
"menu.extras.collectedUrls": "Collected URLs",
@@ -407,7 +407,8 @@
"app.language.zh-CN": "简体中文",
"app.language.fa": "فارسی (بتا)",
"app.language.cs-CZ": "Čeština",
"app.language.helpTranslate": "Missing your language or spotted a wrong translation? Help out on Weblate →",
"app.language.ru": "Русский (бета)",
"app.language.helpTranslate": "Missing your language or spotted a wrong translation? Here's how to help →",
"app.serverBanner": "Show server banners",
"app.serverBanner.hint": "The banner loads straight from the address the server admin set, and that host sees your IP address.",
"app.chatImages": "Load images in chat",
@@ -489,10 +490,13 @@
"publish.alphaTitle": "Alpha - unstable, may change or break at any time",
"publish.demoUnavailable": "Streaming is not available in the demo - it needs a real TeamSpeak 6 server.",
"publish.alphaNote": "Streaming is alpha. It speaks TeamSpeak 6's undocumented Stream/Call protocol, so connecting, picture quality and viewer handling can fail or change without notice. Not meant for production use.",
"publish.start": "Share your screen",
"publish.start": "Share your screen or camera",
"publish.stop": "Stop sharing",
"publish.title": "Your broadcast",
"publish.screen": "Screen",
"publish.camera": "Camera",
"publish.kind": "Share",
"publish.kind.display": "Screen / window",
"publish.starting": "Starting…",
"publish.viewers": "{count} watching",
"publish.request.allow": "Allow",
@@ -507,6 +511,7 @@
"publish.preset": "Preset",
"publish.preset.presentation": "Presentation",
"publish.audio": "Capture audio",
"publish.audio.cameraHint": "With the camera, your sound goes out through your microphone as usual.",
"publish.privacy": "Privacy",
"publish.privacy.public": "Public",
"publish.privacy.contacts": "Contacts",
@@ -930,7 +935,7 @@
"securitySettings.masterNew": "New master password",
"securitySettings.masterRepeat": "Repeat",
"securitySettings.masterMismatch": "The passwords don't match.",
"securitySettings.masterNote": "Remember it well: without it, identities and saved passwords are lost.",
"securitySettings.masterNote": "You'll have to enter it again in every new session (reload or new tab). Remember it well: without it, identities and saved passwords are lost.",
"sync.subtitle": "Your data on all your devices",
"sync.intro": "An account is just a random number, optionally with a password. No email, no name. Everything is encrypted on your device before it is uploaded. The server only sees unreadable data.",
"sync.create.title": "New account",
@@ -994,5 +999,12 @@
"sync.error.pow_required": "Security check failed, please try again.",
"sync.error.conflict": "Another device changed something in the meantime.",
"sync.error.payload_too_large": "Too much data to sync (max. 1 MB).",
"sync.error.generic": "Sync failed."
"sync.error.generic": "Sync failed.",
"mobile.tab.channels": "Channels",
"mobile.tab.chat": "Chat",
"mobile.tab.info": "Info",
"mobile.mic": "Mic",
"mobile.sound": "Sound",
"mobile.leave": "Leave",
"mobile.talk": "Talk"
}
+17 -5
View File
@@ -19,7 +19,7 @@
"menu.help.about": "درباره WebSpeak3",
"menu.help.github": "گیت‌هاب",
"menu.help.changelog": "تاریخچه تغییرات",
"menu.help.translate": "کمک به ترجمه (Weblate)",
"menu.help.translate": "کمک به ترجمه (GitHub)",
"menu.extras.identities": "هویت‌ها",
"menu.extras.contacts": "مخاطبین",
"menu.extras.collectedUrls": "لینک‌های جمع‌آوری‌شده",
@@ -407,7 +407,8 @@
"app.language.zh-CN": "简体中文",
"app.language.fa": "فارسی (بتا)",
"app.language.cs-CZ": "Čeština",
"app.language.helpTranslate": "زبان شما موجود نیست یا ترجمه‌ای اشتباه دیدید؟ در Weblate کمک کنید →",
"app.language.ru": "Русский (бета)",
"app.language.helpTranslate": "زبان شما موجود نیست یا ترجمه‌ای اشتباه دیدید؟ روش کمک کردن →",
"app.serverBanner": "نمایش بنر سرور",
"app.serverBanner.hint": "بنر مستقیماً از نشانی‌ای بارگیری می‌شود که مدیر سرور تعیین کرده است و آن میزبان نشانی IP شما را می‌بیند.",
"app.chatImages": "بارگیری تصاویر در گفتگو",
@@ -488,10 +489,13 @@
"publish.alphaTitle": "آلفا - ناپایدار، ممکن است هر زمان تغییر کند یا از کار بیفتد",
"publish.demoUnavailable": "پخش زنده در حالت دمو در دسترس نیست - به یک سرور واقعی TeamSpeak 6 نیاز دارد.",
"publish.alphaNote": "پخش زنده در مرحله آلفا است. این ویژگی از پروتکل مستندنشده Stream/Call در TeamSpeak 6 استفاده می‌کند، بنابراین اتصال، کیفیت تصویر و مدیریت بینندگان ممکن است بدون اطلاع قبلی دچار خطا شوند یا تغییر کنند. برای استفاده تولیدی مناسب نیست.",
"publish.start": "اشتراک‌گذاری صفحه",
"publish.start": "اشتراک‌گذاری صفحه یا دوربین",
"publish.stop": "توقف اشتراک‌گذاری",
"publish.title": "پخش زنده تو",
"publish.screen": "صفحه نمایش",
"publish.camera": "دوربین",
"publish.kind": "اشتراک‌گذاری",
"publish.kind.display": "صفحه / پنجره",
"publish.starting": "در حال شروع…",
"publish.viewers": "{count} بیننده",
"publish.request.allow": "اجازه دادن",
@@ -506,6 +510,7 @@
"publish.preset": "پیش‌تنظیم",
"publish.preset.presentation": "ارائه",
"publish.audio": "ضبط صدا",
"publish.audio.cameraHint": "با دوربین، صدای شما مثل همیشه از طریق میکروفون ارسال می‌شود.",
"publish.privacy": "حریم خصوصی",
"publish.privacy.public": "عمومی",
"publish.privacy.contacts": "مخاطبین",
@@ -929,7 +934,7 @@
"securitySettings.masterNew": "رمز اصلی جدید",
"securitySettings.masterRepeat": "تکرار",
"securitySettings.masterMismatch": "رمزها یکسان نیستند.",
"securitySettings.masterNote": "آن را به خاطر بسپارید: بدون آن، هویت‌ها و رمزهای ذخیره‌شده از دست می‌روند.",
"securitySettings.masterNote": "باید آن را در هر جلسهٔ جدید (بارگذاری دوباره یا زبانهٔ جدید) دوباره وارد کنید. آن را به خاطر بسپارید: بدون آن، هویت‌ها و رمزهای ذخیره‌شده از دست می‌روند.",
"sync.subtitle": "داده‌های تو روی همه دستگاه‌ها",
"sync.intro": "حساب فقط یک شماره تصادفی است، در صورت تمایل با رمز عبور. بدون ایمیل، بدون نام. همه چیز پیش از بارگذاری روی دستگاه تو رمزگذاری می‌شود. سرور فقط داده‌های ناخوانا می‌بیند.",
"sync.create.title": "حساب جدید",
@@ -993,5 +998,12 @@
"sync.error.pow_required": "بررسی امنیتی ناموفق بود، دوباره امتحان کن.",
"sync.error.conflict": "دستگاه دیگری در این فاصله چیزی را تغییر داده است.",
"sync.error.payload_too_large": "داده برای همگام‌سازی بیش از حد است (حداکثر ۱ مگابایت).",
"sync.error.generic": "همگام‌سازی ناموفق بود."
"sync.error.generic": "همگام‌سازی ناموفق بود.",
"mobile.tab.channels": "کانال‌ها",
"mobile.tab.chat": "گفتگو",
"mobile.tab.info": "اطلاعات",
"mobile.mic": "میکروفون",
"mobile.sound": "صدا",
"mobile.leave": "خروج",
"mobile.talk": "صحبت"
}
File diff suppressed because it is too large. Load diff
+17 -5
View File
@@ -301,7 +301,8 @@
"app.language.zh-CN": "简体中文",
"app.language.fa": "فارسی (بتا)",
"app.language.cs-CZ": "Čeština",
"app.language.helpTranslate": "没有你的语言,或发现翻译有误?欢迎到 Weblate 参与改进 →",
"app.language.ru": "Русский (бета)",
"app.language.helpTranslate": "没有你的语言,或发现翻译有误?了解如何参与 →",
"app.serverBanner": "显示服务器横幅",
"app.serverBanner.hint": "横幅直接从服务器管理员设置的地址加载,该主机会看到你的 IP 地址。",
"app.chatImages": "在聊天中加载图片",
@@ -592,7 +593,7 @@
"menu.help.about": "关于 WebSpeak3",
"menu.help.github": "GitHub",
"menu.help.changelog": "更新日志",
"menu.help.translate": "参与翻译(Weblate)",
"menu.help.translate": "参与翻译(GitHub)",
"menu.extras.feedback": "发送反馈",
"feedback.fab.nudge": "你觉得 WebSpeak3 怎么样?欢迎反馈!",
"donate.label": "捐助",
@@ -701,10 +702,13 @@
"publish.alphaTitle": "内测阶段 —— 不稳定,可能随时变更或失效",
"publish.demoUnavailable": "演示模式下无法使用直播功能 —— 需要真实的 TeamSpeak 6 服务器。",
"publish.alphaNote": "直播功能处于内测阶段,使用的是 TeamSpeak 6 未公开文档的 Stream/Call 协议,因此连接、画质和观众处理可能会出错或在无预警的情况下发生变化,不建议用于正式场合。",
"publish.start": "共享屏幕",
"publish.start": "共享屏幕或摄像头",
"publish.stop": "停止共享",
"publish.title": "你的直播",
"publish.screen": "屏幕",
"publish.camera": "摄像头",
"publish.kind": "共享内容",
"publish.kind.display": "屏幕 / 窗口",
"publish.starting": "启动中…",
"publish.viewers": "{count} 人观看",
"publish.request.allow": "允许",
@@ -719,6 +723,7 @@
"publish.preset": "预设",
"publish.preset.presentation": "演示",
"publish.audio": "采集音频",
"publish.audio.cameraHint": "使用摄像头时,你的声音照常通过麦克风发送。",
"publish.privacy": "可见范围",
"publish.privacy.public": "公开",
"publish.privacy.contacts": "联系人",
@@ -929,7 +934,7 @@
"securitySettings.masterNew": "新主密码",
"securitySettings.masterRepeat": "重复",
"securitySettings.masterMismatch": "两次密码不一致。",
"securitySettings.masterNote": "请牢记:没有它,身份和已保存的密码将丢失。",
"securitySettings.masterNote": "每次新会话(重新加载或新标签页)都需要重新输入。请牢记:没有它,身份和已保存的密码将丢失。",
"sync.subtitle": "在所有设备上使用你的数据",
"sync.intro": "账户只是一个随机号码,可选附加密码。无需邮箱,无需姓名。所有数据在上传前都会在你的设备上加密,服务器只能看到无法读取的数据。",
"sync.create.title": "新账户",
@@ -993,5 +998,12 @@
"sync.error.pow_required": "安全检查失败,请重试。",
"sync.error.conflict": "另一台设备在此期间做了更改。",
"sync.error.payload_too_large": "同步数据过多(最多 1 MB)。",
"sync.error.generic": "同步失败。"
"sync.error.generic": "同步失败。",
"mobile.tab.channels": "频道",
"mobile.tab.chat": "聊天",
"mobile.tab.info": "信息",
"mobile.mic": "麦克风",
"mobile.sound": "声音",
"mobile.leave": "断开",
"mobile.talk": "说话"
}
+15 -9
View File
@@ -46,6 +46,8 @@ export const StreamMode = {
export interface StreamPublishOptions {
name: string;
/** Screen/window via the browser's picker, or the webcam. */
source: "display" | "camera";
/** Send the capture's audio track too, when the source has one. */
audio: boolean;
/** One of StreamAccess. */
@@ -112,15 +114,16 @@ export class StreamPublisher {
}
/**
* Captures a screen and announces the stream.
* Captures a screen or the webcam and announces the stream.
*
* `getDisplayMedia` is secure-context-only, so this throws on a plain-http
* Both capture APIs are secure-context-only, so this fails on a plain-http
* origin - the same limitation the microphone already has.
*/
async start(options: StreamPublishOptions): Promise<void> {
if (this.state === "live" || this.state === "starting") return;
if (!navigator.mediaDevices?.getDisplayMedia) {
this.fail("Screen sharing requires HTTPS (or localhost) - the site is not a secure context.");
const camera = options.source === "camera";
if (!(camera ? navigator.mediaDevices?.getUserMedia : navigator.mediaDevices?.getDisplayMedia)) {
this.fail("Streaming requires HTTPS (or localhost) - the site is not a secure context.");
return;
}
@@ -132,13 +135,15 @@ export class StreamPublisher {
if (options.fps > 0) video.frameRate = { ideal: options.fps };
try {
this.media = await navigator.mediaDevices.getDisplayMedia({
video: Object.keys(video).length > 0 ? video : true,
audio: options.audio,
});
const constraints = { video: Object.keys(video).length > 0 ? video : true };
// A camera's "audio" would be the microphone, which already goes out as
// voice - sending it again would only echo.
this.media = camera
? await navigator.mediaDevices.getUserMedia({ ...constraints, audio: false })
: await navigator.mediaDevices.getDisplayMedia({ ...constraints, audio: options.audio });
} catch (err) {
this.setState("idle");
this.fail(`Could not capture the screen: ${describe(err)}`);
this.fail(`Could not capture the ${camera ? "camera" : "screen"}: ${describe(err)}`);
return;
}
@@ -423,6 +428,7 @@ export class StreamPublisher {
* advance. A browser tab has no TS6 equivalent and reads closest to a window.
*/
private detectSourceType(): number {
if (this.options?.source === "camera") return StreamSource.CAMERA;
const surface = this.media?.getVideoTracks()[0]?.getSettings().displaySurface;
return surface === "monitor" ? StreamSource.SCREEN : StreamSource.WINDOW;
}