From e25bd009501793681c2fc52080846cd092bb917e Mon Sep 17 00:00:00 2001 From: TNTcraft <35992542+TNTcraftHIM@users.noreply.github.com> Date: Sun, 15 Nov 2026 18:23:50 -0400 Subject: [PATCH] feat(maintenance): improve invitations and playback controls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem and outcome / 问题与结果 Inviting another device, changing sources and adjusting playback should preserve the selected access and accepted settings. This update adds local QR invitations, optional translations and a video buffer setting, and repairs App discovery, source retirement, shared controls, remote-input geometry and audio reporting within the existing 2.x contracts. ## Release notes ### English This update makes invitations easier to share and playback easier to adjust, while improving App connection, source switching and everyday controls. It also adds optional interface translations and more useful audio diagnostics. - Show the current invitation as a locally generated QR code for another device to scan, preserving the selected access information. - Add optional Traditional Chinese, Japanese and Korean translations. Chinese and English remain direct choices; the third menu includes extra languages and visual mode. Missing translations use English. - Add an **Increase playback buffering** switch with an adjustable target. More buffering may reduce stalls from uneven packet arrival, at the cost of added viewing delay. Automatic remains the default. - Ignore remote-control clicks on blank space outside a zoomed or rotated video. - Check for a local Piik App once when a site opens. Automatic discovery respects local-network permission; explicit connection keeps approval under your control, and passive failures stay quiet. - Keep a pending Browser screen or camera selection when the previous Native source ends or the App disconnects. Release the old source while allowing the new selection to finish; cancellation and Stop still end the operation correctly. - Improve App-to-App connections when port mappings shift during setup. - Keep playback hints clear of sharing controls, selection indicators inside their tracks, disabled action icons visible, and numeric settings aligned with accepted values. - Use receiver audio reports for outgoing shared-sound loss statistics, and add opt-in Windows capture-progress diagnostics to help locate missing audio. Existing 2.x App/site compatibility, saved room data and invitation privacy are preserved. Update the App for Native changes. After updating a hosted Server, refresh open site pages; App-local pages use the Web UI included in the updated App package. ### 中文 本次更新让邀请分享和播放调整更方便,并改善 App 连接、切换来源及日常控件。同时增加可选界面译文和更有帮助的音频诊断。 - 将当前邀请在本地生成二维码,保留所选访问凭证,方便另一台设备扫码加入。 - 增加繁体中文、日语和韩语可选译文。中英文保留快捷入口,第三个菜单提供附加语言与纯视觉模式;缺少的译文回退英文。 - 增加 **增加播放缓冲** 开关,并可调整目标值。更多缓冲可减少数据到达不均造成的停顿,但会增加观看延迟;默认仍由系统自动决定。 - 缩放或旋转画面后,不再把画面外空白区域的点击误传给远端。 - 打开站点时检查一次本地 Piik App。自动发现遵循本地网络权限,主动连接时才由你批准访问;被动发现失败保持安静。 - 旧 Native 来源结束或 App 断开时,保留正在进行的浏览器屏幕或摄像头选择。释放旧来源后仍可完成新选择;取消或主动停止时正确收尾。 - 改善建立连接时端口映射变化情况下的 App 间连接。 - 避免播放提示遮挡分享控件,让选中指示保持在轨道内,保留禁用按钮图标,并让数值设置显示实际接受的值。 - 共享声音的发送端丢包统计改用接收方音频报告,并增加可选的 Windows 采集进度诊断,帮助定位无声发生在哪一段。 保留现有 2.x App/站点兼容性、已保存的房间数据和邀请隐私。Native 改动需要更新 App。托管 Server 更新后请刷新已打开的页面;App 本地页面使用新版 App 包内的网页。 ## Verification / 验证 - Complete frontend check: TypeScript, 110 test files / 2001 tests, Web build. Go core check: format, tests, vet and supported cross-target builds; macOS App builds require their native SDK. - QR invitations passed independent local decoding, credential/rotation checks and short-window layout. Language/visual menus and guidance passed native and forced-polyfill Browser checks. - Native preparation passed actual Pion socket adoption, VP8 SRTP and reverse SRTCP controls. Remote-input geometry and accepted numeric settings have focused regressions. - Optional buffer transitions passed real P2P and actual SFU subscriber receiver-API controls for automatic to 300 ms to automatic. The SFU control used a Browser mock upstream rather than the embedded backend; Native preview delegation has unit coverage only. - Windows diagnostics passed strict translation compilation, counter tests and stderr-to-diagnostic-ZIP verification. Physical capture, optical QR scanning and a public-network success-rate improvement are not claimed. ## Impact / 影响 Compatible 2.x update: Browser/server v24, Native control v10, capture v7 and SQLite schema 2 remain unchanged. Optional translations preserve English fallback and the independent visual preference. Playback buffer is a local viewing preference and leaves the default automatic. Existing room authority and invitation handling are preserved. The HTTP compression dependency receives a compatible patch update. Mirror preparation detects a rejected missing tag before original-artifact downloads; the platform restriction remains open, with original-package validation and continuation rules intact. This does not establish fixes for #499, #502, #529 or #534. --- .github/workflows/atomgit-mirror.yml | 5 +- docs/adr/0009-optional-nat-prediction.md | 7 +- docs/guide/getting-started.md | 4 +- docs/guide/getting-started.zh-CN.md | 3 +- docs/guide/translating.md | 30 +- docs/guide/translating.zh-CN.md | 17 +- docs/operations/github.md | 9 +- docs/research/nat-traversal.md | 10 + docs/standards/engineering.md | 8 + docs/standards/media-quality.md | 11 + docs/standards/presentation-lifecycle.md | 12 +- docs/standards/rooms-access.md | 4 + docs/todo.md | 2 - go.mod | 2 +- go.sum | 2 + internal/app/mediaedge/punch.go | 8 +- internal/app/mediaedge/punch_sockets.go | 55 +- internal/app/mediaedge/punch_test.go | 149 +++- internal/httpassets/compress.go | 2 +- internal/server/app/static_test.go | 2 + licenses/qrcodegen-MIT.txt | 22 + licenses/upstream.json | 5 + native/capture/windows/process_audio.cpp | 70 +- package-lock.json | 11 + package.json | 1 + scripts/mirror-release.mjs | 22 +- scripts/package-licenses.mjs | 6 +- scripts/release-mirror-prepare.mjs | 66 ++ scripts/release-mirror-ready.mjs | 33 +- .../components/living/AppConnectionButton.tsx | 38 +- src/client/components/living/InviteQrCode.tsx | 48 + .../components/living/LanguageControl.tsx | 101 ++- .../components/living/NumberControl.tsx | 3 +- .../components/living/PlaybackControls.tsx | 2 +- .../components/living/PlaybackSettings.tsx | 29 +- src/client/components/living/Tooltip.tsx | 41 +- .../components/living/invite-qr-code.css | 5 + .../components/living/segmented-control.css | 15 +- src/client/lib/room-preferences.ts | 2 + src/client/locales/en.ts | 12 +- src/client/locales/index.ts | 26 +- src/client/locales/ja.ts | 839 ++++++++++++++++++ src/client/locales/ko.ts | 839 ++++++++++++++++++ src/client/locales/zh-Hant.ts | 839 ++++++++++++++++++ src/client/locales/zh.ts | 14 +- src/client/media/video-geometry.ts | 4 + src/client/media/viewer-sfu-route.ts | 16 + src/client/native/client.ts | 4 +- src/client/native/media-bridge.ts | 20 + src/client/native/native-viewer-peer.ts | 18 + src/client/pages/ControlsPreview.tsx | 2 + src/client/pages/HostPage.tsx | 52 +- src/client/pages/PlaybackPreviewPage.tsx | 8 +- src/client/pages/ViewerPage.tsx | 46 +- src/client/sfu/subscriber.ts | 19 + src/client/styles.css | 4 +- src/client/ui/copy.ts | 3 +- src/client/ui/glyph.css | 2 +- src/client/ui/icons.tsx | 1 + src/client/webrtc/receiver-buffer-target.ts | 24 + src/client/webrtc/stats.ts | 44 +- src/client/webrtc/viewer-peer.ts | 23 + tests/app-connection-button.test.ts | 114 ++- tests/audio-stats.test.ts | 24 + tests/client-state.test.ts | 14 +- tests/copy.test.ts | 71 +- tests/host-quality-ownership.test.ts | 87 +- tests/native-client.test.ts | 16 +- tests/native-media-bridge.test.ts | 28 + tests/quality-controls.test.ts | 5 +- tests/receiver-buffer-target.test.ts | 17 + tests/release-mirror-ready.test.ts | 70 +- tests/remote-input.test.ts | 17 + tests/room-preferences.test.ts | 13 + tests/sfu-client.test.ts | 37 +- tests/viewer-buffering.test.ts | 86 ++ tests/viewer-peer-generation.test.ts | 25 + 77 files changed, 4073 insertions(+), 272 deletions(-) create mode 100644 licenses/qrcodegen-MIT.txt create mode 100644 scripts/release-mirror-prepare.mjs create mode 100644 src/client/components/living/InviteQrCode.tsx create mode 100644 src/client/components/living/invite-qr-code.css create mode 100644 src/client/locales/ja.ts create mode 100644 src/client/locales/ko.ts create mode 100644 src/client/locales/zh-Hant.ts create mode 100644 src/client/webrtc/receiver-buffer-target.ts create mode 100644 tests/receiver-buffer-target.test.ts create mode 100644 tests/viewer-buffering.test.ts diff --git a/.github/workflows/atomgit-mirror.yml b/.github/workflows/atomgit-mirror.yml index 2d6b40c6f..6482fb3dd 100644 --- a/.github/workflows/atomgit-mirror.yml +++ b/.github/workflows/atomgit-mirror.yml @@ -47,11 +47,12 @@ jobs: with: node-version-file: .node-version cache: npm - - name: Check mirror readiness without build dependencies + - name: Prepare mirror before downloading original artifacts id: readiness - run: node scripts/release-mirror-ready.mjs + run: node scripts/release-mirror-prepare.mjs env: GH_TOKEN: ${{ github.token }} + ATOMGIT_TOKEN: ${{ secrets.ATOMGIT_TOKEN }} - run: npm ci --ignore-scripts if: steps.readiness.outputs.status == 'ready' - name: Resolve the published source diff --git a/docs/adr/0009-optional-nat-prediction.md b/docs/adr/0009-optional-nat-prediction.md index fe3d023fa..df35a01f8 100644 --- a/docs/adr/0009-optional-nat-prediction.md +++ b/docs/adr/0009-optional-nat-prediction.md @@ -78,10 +78,13 @@ connection acquisition reuses the route controller's existing opportunity ledger PeerConnection. It reuses the current peer/session/connection authorization and the same share policy; Browser peers decline immediately. Each Engine permits one preparation: an ordered three-destination observation, then - checks against one bounded peer endpoint. Three equal observations retain + checks against a bounded peer endpoint. Three equal observations retain that exact socket; a positive sequential observation closes it before opening at most eight temporary sockets. These cases can pair in either direction; - neither observation establishes a permanent NAT classification. The bound + neither observation establishes a permanent NAT classification. A retained + stable socket may alternate two predicted sequential peer endpoints within + the existing rounds, locking one tuple upon its first authenticated request + or matching transaction response. Other tuples are then ignored. The bound remains 64 requests and 64 authenticated replies. Survey readers, writers and cancellation callbacks retire before socket reuse or transfer. The page waits at most 3.5 seconds; the App diff --git a/docs/guide/getting-started.md b/docs/guide/getting-started.md index 3301bb64d..bafb0ede4 100644 --- a/docs/guide/getting-started.md +++ b/docs/guide/getting-started.md @@ -36,8 +36,8 @@ you do not need to create a room in your App to watch them. 2. Select **Start sharing**, then **Browser** for a screen, window or tab, or **Camera** where your computer or phone browser supports it. Enable source audio if the picker offers it. -3. Confirm the preview and select **Copy invite link**. Open that link on a - second device or send it to a friend. +3. Confirm the preview and select **Copy invite link**, or show the **QR code** + for another device to scan. Both use the currently selected invitation link. 4. Select **Stop sharing** when finished. On iPhone/iPad, screen sharing requires **Safari on iOS/iPadOS 27 or later**. diff --git a/docs/guide/getting-started.zh-CN.md b/docs/guide/getting-started.zh-CN.md index 00e10efaa..8050abec4 100644 --- a/docs/guide/getting-started.zh-CN.md +++ b/docs/guide/getting-started.zh-CN.md @@ -33,7 +33,8 @@ Piik 支持一位房主分享屏幕,最多 20 位受邀观众观看。先选 1. 在浏览器中打开 [demo.piik.tv](https://demo.piik.tv)。 2. 点击 **开始分享**,选择 **浏览器** 分享屏幕、窗口或标签页;也可在电脑或手机上选择 **摄像头**(需浏览器支持访问)。如需来源声音且选择器提供该选项,启用音频。 -3. 确认预览后,点击 **复制邀请链接**,用另一台设备打开,或发送给朋友。 +3. 确认预览后,点击 **复制邀请链接** 发给朋友,或展开 **二维码** 让另一台设备扫码。 + 两种方式使用当前选择的同一邀请链接。 4. 分享结束后,点击 **停止分享**。 iPhone/iPad 屏幕分享需使用 **iOS/iPadOS 27 及以上的 Safari**。 diff --git a/docs/guide/translating.md b/docs/guide/translating.md index ea76dc0c2..4608c8bcf 100644 --- a/docs/guide/translating.md +++ b/docs/guide/translating.md @@ -1,9 +1,16 @@ # Help translate Piik +The 2.x interface keeps Chinese, English and Visual only, and offers partial +Traditional Chinese, Japanese and Korean message catalogs. Missing messages, +text titles and playful copy use English. Visual-only presentation, saved +preferences and the Chinese/English/visual App console keep their existing roles. +New copy is required in Chinese and English; remove obsolete keys from every +catalog when removing a message. + [中文](./translating.zh-CN.md) · [Contributing](../../CONTRIBUTING.md) -Piik includes Simplified Chinese and English. Suggest wording, correct a -translation or add a language through GitHub issues and pull requests. +Suggest wording, correct a translation or add a language through GitHub issues +and pull requests. For a wording suggestion, [open an issue](https://github.com/TNTcraftHIM/Piik/issues/new/choose) with the language, page/control, current text, proposed text and reason. Include @@ -28,7 +35,8 @@ personal content. You can send a suggestion without setting up development tools 4. Preview the affected screen and run the [relevant checks](#preview-and-check). For a typo in one language, edit that language. If the underlying meaning - changes, update the corresponding messages in every registered language. + changes, update Chinese and English; remove an outdated optional translation + when it would misrepresent the behavior. 5. Open a PR to `main` with the wording problem, languages/surfaces changed and preview results. For PR format, follow [Contributing](../../CONTRIBUTING.md#pull-request-scope). @@ -36,7 +44,7 @@ personal content. You can send a suggestion without setting up development tools | Surface | Editable source | | --- | --- | -| App launcher and shared Browser/App UI, including tooltips and accessible labels | [English](../../src/client/locales/en.ts), [Chinese](../../src/client/locales/zh.ts) | +| App launcher and shared Browser/App UI, including tooltips and accessible labels | [Locale registry](../../src/client/locales/index.ts), [English](../../src/client/locales/en.ts), [Chinese](../../src/client/locales/zh.ts); extra languages live beside them | | Welcome lines, waiting captions and changing browser-tab titles | The `enPlayful` / `zhPlayful` pools and title-frame catalogs in those same files; website welcome lines reuse these pools | | Website | [Page markup](../../site/index.html) and [interactive labels](../../site/main.js); text is paired by `en` and `zh-CN` | | Introduction film | [Film sources](../../site/film/README.md); captions, artwork and playback labels have their own bilingual text | @@ -94,11 +102,12 @@ layout questions, so contributors can coordinate work and review. 1. Copy `src/client/locales/en.ts` to a file such as `fr.ts`. Translate the messages and title labels, write natural [playful entries](#playful-copy), and - rename the three exports. Retain `Record`, `TitleFrameCatalog` - and `PlayfulCatalog` from `zh.ts`. + rename the three exports. Use `Partial>` for optional + message catalogs; retain `TitleFrameCatalog` and `PlayfulCatalog` from `zh.ts`. + You can reuse the English title/playful + catalogs until those optional surfaces are translated. Chinese currently defines the key set; either existing language can provide - context. Complete all keys rather than spreading an English catalog over - missing translations. + context. Include translated keys only; missing messages use the shared English fallback. 2. Import the exports in [locales/index.ts](../../src/client/locales/index.ts) and add one registry entry. For example, **after translating** the catalogs: @@ -110,7 +119,8 @@ layout questions, so contributors can coordinate work and review. Use an ASCII filename/key, the language's native name in `name`, a recognizable one-to-three-character button label in `short`, and a matching language tag in `tag`. Distinguish coexisting regional/script variants. - Extra languages appear in a shared dropdown after visual mode. Check language + Extra languages share the third control's dropdown with visual mode, beside + the Chinese and English shortcuts. Check language selection, saved preferences and App handoff against the [system-language policy](../standards/presentation-lifecycle.md#visual-language). 3. Check complete screens and the launch flow. New UI languages use English in @@ -130,7 +140,7 @@ Each language owns its welcome and waiting arrays, and each playful title has a fixed `label` plus a `variations` array. Add or remove entries in that language without matching another language's count, order or references. An empty array omits the decoration; one entry stays static. Operational keys and title labels -still require complete translations. Errors, pauses, endings, required actions +remain complete in Chinese and English. Errors, pauses, endings, required actions and slogans stay fixed. Welcome entries carry `text` and two `symbols`, chosen from the existing diff --git a/docs/guide/translating.zh-CN.md b/docs/guide/translating.zh-CN.md index 9cd17f177..5b28bfbb5 100644 --- a/docs/guide/translating.zh-CN.md +++ b/docs/guide/translating.zh-CN.md @@ -1,8 +1,12 @@ # 参与 Piik 翻译 +2.x 保留简体中文、英文与纯视觉模式,并提供部分繁体中文、日文和韩文消息译文。 +缺少的消息、文字标题与俏皮话回退英文;纯视觉表现、已保存的偏好及中英/纯视觉终端各自职责保持不变。 +新增文案须补齐中英文,删除文案时同步清除各词库中的过时键名。 + [English](./translating.md) · [贡献指南](../../CONTRIBUTING.md) -Piik 提供简体中文和英文,可通过 GitHub Issue 与 Pull Request(PR)建议措辞、修正译文或新增语言。 +可通过 GitHub Issue 与 Pull Request(PR)建议措辞、修正译文或新增语言。 只想改一句话,可以直接[提交建议](https://github.com/TNTcraftHIM/Piik/issues/new/choose): 写明语言、页面或控件、原文、建议译文及理由。附上截图或进入该页面的步骤,便于理解上下文; @@ -22,7 +26,7 @@ Piik 提供简体中文和英文,可通过 GitHub Issue 与 Pull Request(PR ``` 4. 预览对应界面并运行[相关检查](#预览与检查)。仅修正某种语言的错字时,修改该语言即可; - 如果调整的是功能含义,需要同步所有已登记语言中的对应内容。 + 如果调整的是功能含义,同步中英文;可选语言中会误导用户的旧译文应移除以使用回退。 5. 向 `main` 提交 PR,说明措辞问题、修改的语言和页面,以及预览结果。 PR 格式见[贡献指南](../../CONTRIBUTING.md#pull-request-scope)。 @@ -77,9 +81,10 @@ App 启动错误需同时翻译网页与终端的说明,保留共用的原因 1. 复制 `src/client/locales/en.ts`,例如命名为 `fr.ts`。翻译正文与标题标签,按语境编写 [俏皮话](#俏皮话),修改三个导出变量名。 - 保留从 `zh.ts` 引入的 `Record`、`TitleFrameCatalog`、`PlayfulCatalog` 类型。 + 可选消息词库使用 `Partial>`,保留 `TitleFrameCatalog` 和 `PlayfulCatalog`。 + 标题与俏皮话尚未翻译时可复用英文词库。 中文词库目前定义键名集合,理解内容时可以参考任一现有语言。 - 请补全全部键名,不要用展开英文词库的方式填充缺失译文。 + 只提供已翻译的键名,缺少的消息由公共格式化函数回退英文。 2. 在 [locales/index.ts](../../src/client/locales/index.ts) 中导入三个导出变量,并添加一项登记。 例如,**完成词库翻译后**: @@ -90,7 +95,7 @@ App 启动错误需同时翻译网页与终端的说明,保留共用的原因 文件名和键名使用 ASCII,`name` 使用语言本名,`short` 使用一至三个易识别的字符, `tag` 使用对应语言标签;同时提供地区或文字变体时,简称应能区分。 - 额外语言显示在纯视觉模式后的共用下拉菜单中。 + 中英文保留快捷入口,额外语言与纯视觉模式共同显示在第三个控件的下拉菜单中。 按[系统语言规则](../standards/presentation-lifecycle.md#visual-language)检查初始选择、偏好保存与 App 跳转。 3. 检查完整界面与启动流程。新增的界面语言在 App 终端中暂用英文; 翻译终端时,还需同步启动服务和 loopback 对语言的校验,相关位置见 @@ -104,7 +109,7 @@ App 启动错误需同时翻译网页与终端的说明,保留共用的原因 各语言独立维护欢迎语、等待短句数组;可轮换标题由固定的 `label` 和 `variations` 数组组成。 可以单独增删某种语言的条目,不要求与其他语言的数量、顺序或梗一一对应。 -空数组不显示装饰文案;只有一条时保持静止。操作键名和标题标签仍须完整翻译, +空数组不显示装饰文案;只有一条时保持静止。操作键名和标题标签的中英文仍须完整, 错误、暂停、结束、必需操作提示及 slogan 保持固定。 欢迎语每项包含 `text` 和两个 `symbols`,从现有的 diff --git a/docs/operations/github.md b/docs/operations/github.md index fe2d0966b..777bdf553 100644 --- a/docs/operations/github.md +++ b/docs/operations/github.md @@ -93,10 +93,13 @@ Image checks, version identity and retries follow [AtomGit TNTcraftHIM/Piik](https://atomgit.com/TNTcraftHIM/Piik) is the public download mirror. GitHub owns development, issues, source identity and original packages. The **AtomGit mirror** GitHub workflow copies published binary assets. Repository -synchronization is optional and must not gate package distribution. A mirror's +synchronization is intended to remain independent of package distribution; the +Pull-mirror tag restriction below remains an unresolved platform dependency. A mirror's local Release tag only locates attachments; the GitHub source marker and verified -original package digests establish their identity. Release creation uses the -mirror's initialized default branch when the local tag does not exist. +original package digests establish their identity. Before downloading original +artifacts, publication prepares the prerelease using the mirror's initialized +default branch when the local tag does not exist. A rejected missing tag fails +this step. Pure readiness checks remain read-only. Its repository Actions secret is `ATOMGIT_TOKEN`. Never put this token in source, a remote URL or a distributed package. GitHub publication keeps its scoped token. diff --git a/docs/research/nat-traversal.md b/docs/research/nat-traversal.md index 3744566de..f73056dea 100644 --- a/docs/research/nat-traversal.md +++ b/docs/research/nat-traversal.md @@ -577,6 +577,16 @@ Blocked initial/retransmission writes and unused stable-socket retirement have regression coverage. The shared wire decoder requires an explicit zero step; missing/null fields cannot silently select this behavior. +A stable retained socket also checks the original sequential anchor and one +anchor four steps farther within the same rounds and packet budget. It pins the +first authenticated eligible tuple before replying and adopts that actual tuple. +The 2026-11-14 production Pion virtual-network controls cover four independent STUN mappings +allocated after survey, with either Native endpoint stable: socket adoption carries +VP8 SRTP and reverse SRTCP. Wrong keys, unrelated transactions, another eligible +tuple after locking, cancellation and alternate-port overflow have focused controls. +This establishes a bounded allocation-drift improvement in that model, not an +Internet success rate or a benefit for two sequential peers. + A focused in-memory preparation check on 2026-10-17 retained the existing sequential-NAT fixture and three ordered destinations. Losing the first request to one destination recovered through Pion retransmission in 300 ms; delaying diff --git a/docs/standards/engineering.md b/docs/standards/engineering.md index 0f132b080..34bfdc77b 100644 --- a/docs/standards/engineering.md +++ b/docs/standards/engineering.md @@ -190,6 +190,14 @@ in [introduction design](./public-introduction.md) and the [website runbook](../ Remove superseded paths in the same change; retain no unused legacy copy. A platform adapter can be justified with one implementation; judge its boundary and consumers before removing it. +- Prefer one rule derived from the responsible owner's state, capabilities and + user intent over accumulating platform, page, event-order or incident-specific + exceptions. Before adding another case, check whether the shared model or + boundary should change so the behavior follows naturally for all its consumers. + Keep branches for real differences in authority, semantics, lifecycle or platform + capability. Fewer `if` statements are not a goal in themselves: do not conceal + exceptions in flags or tables, invent a generic manager, or weaken necessary + validation merely to reduce the visible branch count. - Keep simple logic at its call site. Extract a helper for actual reuse, a substantial boundary, or a distinct concept whose name makes the caller clearer. In longer orchestration, keep the main flow readable and move substantial diff --git a/docs/standards/media-quality.md b/docs/standards/media-quality.md index 93f935d8c..d50495dad 100644 --- a/docs/standards/media-quality.md +++ b/docs/standards/media-quality.md @@ -11,6 +11,17 @@ contract. [Status](../status.md) indexes delivery and remaining acceptance. ## Capture And Controls +Viewer playback defaults to automatic receiver buffering. Where the current +Browser receiver supports `jitterBufferTarget`, a Viewer may request a total +buffer target of 0–4000 ms in Playback settings. The preference follows active +and replacement P2P, SFU and Native-to-Browser playback receivers; it does not +change Host encoding or room voice. More buffering may smooth network jitter at +the cost of delay, including downstream Browser relays. It does not restore +encoded detail or increase available bandwidth. The Browser controls actual +buffering; the target and measured delay remain distinct. Unsupported paths +retain normal playback. [WebRTC receiver buffering](https://www.w3.org/TR/webrtc/#dom-rtcrtpreceiver-jitterbuffertarget) +owns the target range and platform behavior. + Room voice handles Host and Viewer conversation microphones, separate from source sound and optional Host source commentary. Its Browser capture owner supplies device selection, input gain and optional speech processing, including on App-backed pages. Settings diff --git a/docs/standards/presentation-lifecycle.md b/docs/standards/presentation-lifecycle.md index 1fef522b5..8497fdb33 100644 --- a/docs/standards/presentation-lifecycle.md +++ b/docs/standards/presentation-lifecycle.md @@ -169,10 +169,14 @@ a permission query retain bounded discovery. Chinese, English, and pure-visual modes are three expressions of the same typed state and command catalog. On first use, the App and Server UI match the Browser's primary system language against registered locales, using English -when none matches. Current catalogs cover Simplified Chinese and English. -Both Simplified and Traditional Chinese system locales select the current -Chinese catalog across App, Server UI and website; this includes region and -script tags such as `zh-CN`, `zh-TW`, `zh-HK`, `zh-Hans` and `zh-Hant`. +when none matches. Simplified Chinese and English catalogs are complete; +Traditional Chinese, Japanese and Korean UI catalogs provide partial translations +with English fallback. System-language matching distinguishes Chinese scripts, +including `zh-TW`, `zh-HK` and `zh-Hant` for Traditional Chinese. The website +retains its separate bilingual presentation. Additional UI languages use the +existing dropdown alongside pure-visual mode. Chinese and English remain direct +controls; the third control opens that menu and reflects the current extra +language or visual mode without changing their independent stored preferences. Pure-visual mode remains an explicit choice. An explicit later choice is persisted and takes precedence over that default, including App launch handoff. Explicit launcher choices apply only to the presentation domains the user chose. diff --git a/docs/standards/rooms-access.md b/docs/standards/rooms-access.md index bc96c4369..6b48cd973 100644 --- a/docs/standards/rooms-access.md +++ b/docs/standards/rooms-access.md @@ -104,6 +104,10 @@ existing invitations or clear a recipient's valid authorization. The ordinary room address retains the server-provided site and room path; it follows site access and code-entry rules. An invite-only room has no ordinary-address entry. +The invitation QR code is generated locally from the same selected link, +including its fragment. Credential choice, rotation and revocation update it +with the copied link; no external QR service receives the invitation. + Code-only admission is independent of invitations: - `open` admits a site-authorized Viewer by room code; diff --git a/docs/todo.md b/docs/todo.md index c63327cb3..86730a3dd 100644 --- a/docs/todo.md +++ b/docs/todo.md @@ -85,8 +85,6 @@ own behavior; research and Git/PRs own evidence and completed history. - [ ] **iOS native App.** Paused in favor of Browser use. Preserve the isolated implementation on `feat/ios-client`; native development and publication stay outside the current phase. -- [ ] **QR invitations.** Deferred from the maintenance release on 2026-10-24. - Keep the local QR implementation on `archive/deferred-prototypes` for later acceptance. - [ ] **Additional collaboration cursors.** Deferred by the owner. Keep the shared system mouse; do not add multi-cursor or pointer-ownership visualization. - [ ] **Persistent-loss estimator replacement.** Deferred on 2026-10-18. diff --git a/go.mod b/go.mod index e2742f6c4..9321141e0 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/charmbracelet/x/term v0.2.2 github.com/coder/websocket v1.8.15 github.com/go-logr/logr v1.4.4 - github.com/klauspost/compress v1.20.2 + github.com/klauspost/compress v1.20.4 github.com/livekit/livekit-server v1.13.11-0.20261016133420-cde3991916cf github.com/livekit/mediatransportutil v0.0.0-20261014192331-dd8e31a0adc0 github.com/livekit/protocol v1.52.2-0.20261012065025-9bb708cdb819 diff --git a/go.sum b/go.sum index 75a394dc0..be66f986e 100644 --- a/go.sum +++ b/go.sum @@ -153,6 +153,8 @@ github.com/klauspost/compress v1.20.1 h1:T7kKElXUMXrUJ2E9QhQhxFtcK5rPyLdsGZvdbLM github.com/klauspost/compress v1.20.1/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= github.com/klauspost/compress v1.20.2 h1:v5tiZvm1KGLyg5d5oXdXe3lsSPrbEUiKoXGia//I7Qo= github.com/klauspost/compress v1.20.2/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= +github.com/klauspost/compress v1.20.4 h1:dD0v/bvxtjCBqQu6sx1TNWkalEY5lNTIe+HY9w8TeNI= +github.com/klauspost/compress v1.20.4/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= github.com/klauspost/cpuid/v2 v2.4.0 h1:S6Hrbc7+ywsr0r+RLapfGBHfyefhCTwEh3A0tV913Dw= github.com/klauspost/cpuid/v2 v2.4.0/go.mod h1:19jmZ9mjzoF//ddRSUsv0zfBTJWh3QJh9FNxZTMrGxU= github.com/koron/go-ssdp v0.0.4 h1:1IDwrghSKYM7yLf7XCzbByg2sJ/JcNOZRXS2jczTwz0= diff --git a/internal/app/mediaedge/punch.go b/internal/app/mediaedge/punch.go index dc70f26dc..b63260167 100644 --- a/internal/app/mediaedge/punch.go +++ b/internal/app/mediaedge/punch.go @@ -240,9 +240,13 @@ func (preparation *PunchPreparation) Run(remote PunchPrediction) bool { preparation.socket = nil } preparation.mu.Unlock() + var alternate *net.UDPAddr + if retained != nil && remote.Step > 0 && target.Port+4*remote.Step <= 65535 { + alternate = &net.UDPAddr{IP: target.IP, Port: target.Port + 4*remote.Step} + } winner, err := punchSocketArray(preparation.ctx, func() (net.PacketConn, error) { return preparation.engine.listenPacket("udp", preparation.engine.bindAddress) - }, target, preparation.secret, retained) + }, target, preparation.secret, retained, alternate) preparation.mu.Lock() defer preparation.mu.Unlock() if err != nil || preparation.ctx.Err() != nil || preparation.stage != "running" { @@ -251,7 +255,7 @@ func (preparation *PunchPreparation) Run(remote PunchPrediction) bool { } return false } - preparation.socket = &PunchedSocket{PacketConn: winner, remote: target} + preparation.socket = winner preparation.stage = "complete" return true } diff --git a/internal/app/mediaedge/punch_sockets.go b/internal/app/mediaedge/punch_sockets.go index f09daa497..d4a944eb5 100644 --- a/internal/app/mediaedge/punch_sockets.go +++ b/internal/app/mediaedge/punch_sockets.go @@ -15,7 +15,7 @@ import ( // A bounded, authenticated preflight on eight fresh sockets, or the one retained // observation socket when its mapping was stable. This function owns retained. // All readers stop before the winner transfers to the existing Pion owner. -func punchSocketArray(ctx context.Context, listen func() (net.PacketConn, error), remote *net.UDPAddr, secret []byte, retained net.PacketConn) (net.PacketConn, error) { +func punchSocketArray(ctx context.Context, listen func() (net.PacketConn, error), remote *net.UDPAddr, secret []byte, retained net.PacketConn, alternate *net.UDPAddr) (*PunchedSocket, error) { var sockets []net.PacketConn count := 8 if retained != nil { @@ -33,6 +33,16 @@ func punchSocketArray(ctx context.Context, listen func() (net.PacketConn, error) if remote == nil || remote.IP.To4() == nil || remote.Port < 1 || remote.Port > 65535 || len(secret) != 32 { return nil, errors.New("invalid peer or generation secret") } + if alternate != nil && (retained == nil || !alternate.IP.Equal(remote.IP) || alternate.Port < 1024 || alternate.Port > 65535) { + return nil, errors.New("invalid alternate peer") + } + // One mutex owns the selected tuple across the reader and periodic sender. + // Only the retained stable socket can search two predicted remote tuples. + var targetMu sync.Mutex + selected := remote + if alternate != nil { + selected = nil + } parent := ctx ctx, cancel := context.WithTimeout(parent, 1100*time.Millisecond) defer cancel() @@ -67,14 +77,19 @@ func punchSocketArray(ctx context.Context, listen func() (net.PacketConn, error) var proved atomic.Bool var requestsLeft atomic.Int32 requestsLeft.Store(64) - sendCheck := func(index int, reserve int32) { + sendCheck := func(index int, reserve int32, target *net.UDPAddr) { for { left := requestsLeft.Load() if left <= reserve { return } if requestsLeft.CompareAndSwap(left, left-1) { - _, _ = sockets[index].WriteTo(requests[index].Raw, remote) + targetMu.Lock() + if selected != nil { + target = selected + } + _, _ = sockets[index].WriteTo(requests[index].Raw, target) + targetMu.Unlock() return } } @@ -91,7 +106,25 @@ func punchSocketArray(ctx context.Context, listen func() (net.PacketConn, error) return } message := &stun.Message{Raw: buffer[:n]} - if addr.String() != remote.String() || message.Decode() != nil || integrity.Check(message) != nil { + if message.Decode() != nil || integrity.Check(message) != nil { + continue + } + validResponse := message.Type == stun.BindingSuccess && message.TransactionID == requests[i].TransactionID + if message.Type != stun.BindingRequest && !validResponse { + continue + } + targetMu.Lock() + if selected == nil { + switch addr.String() { + case remote.String(): + selected = remote + case alternate.String(): + selected = alternate + } + } + target := selected + targetMu.Unlock() + if target == nil || addr.String() != target.String() { continue } switch message.Type { @@ -100,12 +133,12 @@ func punchSocketArray(ctx context.Context, listen func() (net.PacketConn, error) continue } reply := stun.MustBuild(stun.BindingSuccess, stun.NewTransactionIDSetter(message.TransactionID), - &stun.XORMappedAddress{IP: remote.IP, Port: remote.Port}, integrity, stun.Fingerprint) - _, _ = connection.WriteTo(reply.Raw, remote) + &stun.XORMappedAddress{IP: target.IP, Port: target.Port}, integrity, stun.Fingerprint) + _, _ = connection.WriteTo(reply.Raw, target) if !proved.Load() { // The peer may start after our initial fanout. Check the // authenticated tuple through this same socket and budget. - sendCheck(i, 0) + sendCheck(i, 0, target) } case stun.BindingSuccess: if message.TransactionID == requests[i].TransactionID { @@ -122,11 +155,15 @@ func punchSocketArray(ctx context.Context, listen func() (net.PacketConn, error) // Keep the existing eight-round send window, reserving one check per socket // for authenticated peer-triggered work. Both share the same 64-request bound. for round := 0; round < 8 && ctx.Err() == nil; round++ { + target := remote + if alternate != nil && round%2 == 1 { + target = alternate + } for i := range sockets { if ctx.Err() != nil { break } - sendCheck(i, int32(len(sockets))) + sendCheck(i, int32(len(sockets)), target) } select { case <-ctx.Done(): @@ -154,7 +191,7 @@ func punchSocketArray(ctx context.Context, listen func() (net.PacketConn, error) winner = -1 return nil, err } - return sockets[winner], nil + return &PunchedSocket{PacketConn: sockets[winner], remote: selected}, nil default: return nil, errors.New("bounded socket array found no authenticated tuple") } diff --git a/internal/app/mediaedge/punch_test.go b/internal/app/mediaedge/punch_test.go index d4d97a7d5..8fe00fc8b 100644 --- a/internal/app/mediaedge/punch_test.go +++ b/internal/app/mediaedge/punch_test.go @@ -3,6 +3,7 @@ package mediaedge import ( "bytes" "context" + "encoding/hex" "errors" "math" "net" @@ -59,14 +60,17 @@ func TestPunchAdoptsProvedTupleIntoMediaAndFeedback(t *testing.T) { left, right vnet.NATType skew time.Duration dropLate bool + driftSide int // One-based side; zero keeps the original survey conditions. }{ - {"sequential", sequentialPunchNAT, sequentialPunchNAT, 0, false}, - {"sequential-delayed", sequentialPunchNAT, sequentialPunchNAT, 250 * time.Millisecond, false}, - {"sequential-late", sequentialPunchNAT, sequentialPunchNAT, 900 * time.Millisecond, false}, - {"stable-sender", stable, sequentialPunchNAT, 250 * time.Millisecond, false}, - {"stable-sender-late-loss", stable, sequentialPunchNAT, 900 * time.Millisecond, true}, - {"stable-receiver", sequentialPunchNAT, stable, 250 * time.Millisecond, false}, - {"both-stable", stable, stable, 0, false}, + {"sequential", sequentialPunchNAT, sequentialPunchNAT, 0, false, 0}, + {"sequential-delayed", sequentialPunchNAT, sequentialPunchNAT, 250 * time.Millisecond, false, 0}, + {"sequential-late", sequentialPunchNAT, sequentialPunchNAT, 900 * time.Millisecond, false, 0}, + {"stable-sender", stable, sequentialPunchNAT, 250 * time.Millisecond, false, 0}, + {"stable-sender-late-loss", stable, sequentialPunchNAT, 900 * time.Millisecond, true, 0}, + {"stable-receiver", sequentialPunchNAT, stable, 250 * time.Millisecond, false, 0}, + {"both-stable", stable, stable, 0, false, 0}, + {"stable-sender-drift4", stable, sequentialPunchNAT, 250 * time.Millisecond, false, 2}, + {"stable-receiver-drift4", sequentialPunchNAT, stable, 250 * time.Millisecond, false, 1}, } { t.Run(scenario.name, func(t *testing.T) { network := newPunchLab(t, scenario.left, scenario.right) @@ -84,6 +88,21 @@ func TestPunchAdoptsProvedTupleIntoMediaAndFeedback(t *testing.T) { t.Cleanup(func() { _ = source.Close() }) left, leftPrediction := preparePunch(t, engines[0], source, "connection", strings.Repeat("42", 32)) right, rightPrediction := preparePunch(t, engines[1], nil, "connection", strings.Repeat("42", 32)) + if scenario.driftSide != 0 { + // Real unrelated mappings consume the sequential allocator after survey. + // Each allocation receives a STUN response before preparation begins. + for range 4 { + connection, err := engines[scenario.driftSide-1].listenPacket("udp", engines[scenario.driftSide-1].bindAddress) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = connection.Close() }) + if _, err := querySTUNBinding(t.Context(), connection, + &net.UDPAddr{IP: net.ParseIP(punchSTUNIP), Port: 3478}, stun.MustBuild(stun.TransactionID, stun.BindingRequest)); err != nil { + t.Fatal(err) + } + } + } var observing, late atomic.Bool var checks, replies [2]atomic.Int32 var lateChecks, dropped atomic.Int32 @@ -124,6 +143,16 @@ func TestPunchAdoptsProvedTupleIntoMediaAndFeedback(t *testing.T) { t.Fatal("authenticated preparation failed") } } + if scenario.driftSide != 0 { + stableSide := 2 - scenario.driftSide + predictions := []*PunchPrediction{leftPrediction, rightPrediction} + preparations := []*PunchPreparation{left, right} + anchor, _ := predictions[scenario.driftSide-1].Target() + anchor.Port += 4 * predictions[scenario.driftSide-1].Step + if actual := preparations[stableSide].socket.remote; actual.String() != anchor.String() { + t.Fatalf("adoption lost authenticated alternate: got %s want %s", actual, anchor) + } + } observing.Store(false) for side := range 2 { if checks[side].Load() > 64 || replies[side].Load() > 64 { @@ -196,7 +225,7 @@ func TestPunchAdoptsProvedTupleIntoMediaAndFeedback(t *testing.T) { func TestPunchRetiresStableObservationSocket(t *testing.T) { stable := vnet.NATType{MappingBehavior: vnet.EndpointIndependent, FilteringBehavior: vnet.EndpointAddrPortDependent} - for _, scenario := range []string{"connection", "source", "engine", "cancel-during", "no-response"} { + for _, scenario := range []string{"connection", "source", "engine", "cancel-during", "no-response", "alternate-overflow"} { t.Run(scenario, func(t *testing.T) { network := newPunchLab(t, stable, sequentialPunchNAT) engine := punchEngine(t, network, 0) @@ -234,9 +263,16 @@ func TestPunchRetiresStableObservationSocket(t *testing.T) { if scenario == "cancel-during" { connections[0].firstWrite = preparation.cancel } - if preparation.Run(PunchPrediction{Address: network.public[1], Port: 5000, Step: 1}) { + port := 5000 + if scenario == "alternate-overflow" { + port = 65531 // Primary 65535 remains valid; only the alternate overflows. + } + if preparation.Run(PunchPrediction{Address: network.public[1], Port: port, Step: 1}) { t.Fatal("unreachable peer completed preparation") } + if scenario == "alternate-overflow" && connections[0].writes.Load() == before { + t.Fatal("alternate overflow suppressed valid primary checks") + } engine.ClosePunch("stable") } if len(connections) != 1 || !connections[0].closed.Load() || connections[0].writes.Load()-before > 8 { @@ -265,6 +301,99 @@ func TestPunchRejectsAnotherGenerationOnStableMapping(t *testing.T) { } } +func TestPunchAlternatePinsOnlyAnAuthenticatedTuple(t *testing.T) { + stable := vnet.NATType{MappingBehavior: vnet.EndpointIndependent, FilteringBehavior: vnet.EndpointIndependent} + network := newPunchLab(t, stable, stable) + socket := func(side int) (net.PacketConn, *net.UDPAddr) { + t.Helper() + connection, err := network.nets[side].ListenPacket("udp4", network.private[side]+":0") + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = connection.Close() }) + mapped, err := querySTUNBinding(t.Context(), &punchSurveySocket{PacketConn: connection}, + &net.UDPAddr{IP: net.ParseIP(punchSTUNIP), Port: 3478}, stun.MustBuild(stun.TransactionID, stun.BindingRequest)) + if err != nil { + t.Fatal(err) + } + if err := connection.SetReadDeadline(time.Now().Add(2 * time.Second)); err != nil { + t.Fatal(err) + } + return connection, &net.UDPAddr{IP: mapped.IP, Port: mapped.Port} + } + retained, local := socket(0) + primary, primaryAddress := socket(1) + alternate, alternateAddress := socket(1) + outsider, outsiderAddress := socket(1) + var forbiddenReplies atomic.Int32 + network.wan.AddChunkFilter(func(chunk vnet.Chunk) bool { + if chunk.DestinationAddr().String() == primaryAddress.String() || chunk.DestinationAddr().String() == outsiderAddress.String() { + message := &stun.Message{Raw: chunk.UserData()} + if message.Decode() == nil && message.Type == stun.BindingSuccess { + forbiddenReplies.Add(1) + } + } + return true + }) + secret := bytes.Repeat([]byte{42}, 32) + integrity := stun.NewShortTermIntegrity(hex.EncodeToString(secret)) + type result struct { + socket *PunchedSocket + err error + } + done := make(chan result, 1) + go func() { + winner, err := punchSocketArray(t.Context(), nil, primaryAddress, secret, retained, alternateAddress) + done <- result{winner, err} + }() + buffer := make([]byte, 1024) + n, _, err := primary.ReadFrom(buffer) + if err != nil { + t.Fatal(err) + } + check := &stun.Message{Raw: bytes.Clone(buffer[:n])} + if err := check.Decode(); err != nil { + t.Fatal(err) + } + send := func(connection net.PacketConn, message *stun.Message) { + t.Helper() + if _, err := connection.WriteTo(message.Raw, local); err != nil { + t.Fatal(err) + } + } + // Neither an unrelated transaction, a wrong key nor an unauthorized tuple + // may lock the primary before the legitimate alternate request arrives. + send(primary, stun.MustBuild(stun.BindingSuccess, stun.TransactionID, integrity)) + send(primary, stun.MustBuild(stun.BindingRequest, stun.TransactionID, stun.NewShortTermIntegrity("wrong"))) + request := stun.MustBuild(stun.BindingRequest, stun.TransactionID, integrity) + send(outsider, request) + send(alternate, request) + for { + n, _, err := alternate.ReadFrom(buffer) + if err != nil { + t.Fatal(err) + } + message := &stun.Message{Raw: buffer[:n]} + if message.Decode() == nil && integrity.Check(message) == nil && message.Type == stun.BindingSuccess && message.TransactionID == request.TransactionID { + break + } + } + // Once the alternate is pinned, even the other eligible authenticated + // tuple must receive no response and cannot replace the adopted endpoint. + send(primary, request) + send(alternate, stun.MustBuild(stun.BindingSuccess, stun.NewTransactionIDSetter(check.TransactionID), integrity)) + finished := <-done + if finished.err != nil || finished.socket == nil { + t.Fatalf("alternate preparation failed: %v", finished.err) + } + if finished.socket.PacketConn != retained || finished.socket.remote.String() != alternateAddress.String() { + t.Fatal("adoption did not retain the proved socket and alternate tuple") + } + if forbiddenReplies.Load() != 0 { + t.Fatal("unproved tuple received a response") + } +} + func TestPunchSurveyViewRetiresWithoutClosingRetainedSocket(t *testing.T) { network := newPunchLab(t, sequentialPunchNAT, sequentialPunchNAT) socket, err := network.nets[0].ListenPacket("udp4", network.private[0]+":0") @@ -481,7 +610,7 @@ func TestPunchSocketResourcesAreBoundedOnFailure(t *testing.T) { if scenario == "invalid-secret" { secret = nil } - winner, err := punchSocketArray(ctx, listen, &net.UDPAddr{IP: net.ParseIP(network.public[1]), Port: 50000}, secret, nil) + winner, err := punchSocketArray(ctx, listen, &net.UDPAddr{IP: net.ParseIP(network.public[1]), Port: 50000}, secret, nil, nil) if err == nil || winner != nil { t.Fatal("failed preparation transferred a socket") } diff --git a/internal/httpassets/compress.go b/internal/httpassets/compress.go index bc87e7e16..ccf67adea 100644 --- a/internal/httpassets/compress.go +++ b/internal/httpassets/compress.go @@ -9,7 +9,7 @@ import ( // Compress negotiates gzip for text assets, leaving precompressed media alone. func Compress(handler http.Handler) http.Handler { - compress, err := gzhttp.NewWrapper(gzhttp.EnableZstd(false), gzhttp.ContentTypes([]string{ + compress, err := gzhttp.NewWrapper(gzhttp.EnableZstd(false), gzhttp.AcceptWildcards(true), gzhttp.ContentTypes([]string{ "text/html", "text/javascript", "application/javascript", "text/css", })) if err != nil { diff --git a/internal/server/app/static_test.go b/internal/server/app/static_test.go index 4a3fec0ba..2ca53ca98 100644 --- a/internal/server/app/static_test.go +++ b/internal/server/app/static_test.go @@ -30,6 +30,8 @@ func TestStaticCompressionKeepsNegotiationAndServeContentSemantics(t *testing.T) }{ {"/", "GET", "gzip", "", 200, true, len(body)}, {"/app.js", "GET", "br, gzip", "", 200, true, len(body)}, + {"/app.js", "GET", "*", "", 200, true, len(body)}, + {"/app.js", "GET", "gzip;q=0, *", "", 200, false, len(body)}, {"/app.mjs", "GET", "zstd, gzip", "", 200, true, len(body)}, {"/app.css", "GET", "gzip", "", 200, true, len(body)}, {"/app.js", "GET", "gzip;q=0", "", 200, false, len(body)}, diff --git a/licenses/qrcodegen-MIT.txt b/licenses/qrcodegen-MIT.txt new file mode 100644 index 000000000..4f9a9faad --- /dev/null +++ b/licenses/qrcodegen-MIT.txt @@ -0,0 +1,22 @@ +QR Code generator library (TypeScript) + +Copyright (c) Project Nayuki. +https://www.nayuki.io/page/qr-code-generator-library + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/licenses/upstream.json b/licenses/upstream.json index b62ae9dda..2226777e1 100644 --- a/licenses/upstream.json +++ b/licenses/upstream.json @@ -1,4 +1,9 @@ { + "qrcodegen/qrcode.react@4.2.0": { + "file": "qrcodegen-MIT.txt", + "source": "https://raw.githubusercontent.com/zpao/qrcode.react/v4.2.0/src/third-party/qrcodegen/LICENSE", + "sha256": "ba5a977288ff7463c51ea0cc5bf5a34372707985655c1ccc054f2a0caa3d9bff" + }, "libc++@ndk-30.0.16248370": { "file": "libcxx-ndk-30.txt", "source": "https://github.com/llvm/llvm-project/blob/2d287f51eff2a5fbf84458a33f7fb2493cf67965/libcxx/LICENSE.TXT", diff --git a/native/capture/windows/process_audio.cpp b/native/capture/windows/process_audio.cpp index f439697b4..b97c89b09 100644 --- a/native/capture/windows/process_audio.cpp +++ b/native/capture/windows/process_audio.cpp @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -28,6 +29,44 @@ using Microsoft::WRL::ClassicCom; namespace piik::capture { namespace { +// Opt-in observation only; capture and delivery retain their existing owners. +struct AudioCaptureCounts { + AudioCaptureCounts(const char* capture_mode, const HRESULT& capture_result) + : mode(capture_mode), result(capture_result) { + wchar_t value[2]{}; + enabled = GetEnvironmentVariableW(L"PIIK_CAPTURE_DEBUG", value, 2) == 1 && value[0] == L'1'; + } + ~AudioCaptureCounts() { + if (!enabled) return; + std::ostringstream line; + line << "wasapi-capture-summary mode=" << mode + << " started=" << started << " result=" << static_cast(result) + << " packets=" << packets << " input_frames=" << input_frames + << " silent_packets=" << silent_packets + << " discontinuity_packets=" << discontinuity_packets + << " timestamp_error_packets=" << timestamp_error_packets + << " assembled_chunks=" << assembled_chunks + << " written_chunks=" << written_chunks << " primed=" << primed << '\n'; + std::cerr << line.str(); + } + void Packet(UINT32 frames, DWORD flags) { + if (!enabled) return; + ++packets; + input_frames += frames; + silent_packets += (flags & AUDCLNT_BUFFERFLAGS_SILENT) != 0; + discontinuity_packets += (flags & AUDCLNT_BUFFERFLAGS_DATA_DISCONTINUITY) != 0; + timestamp_error_packets += (flags & AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR) != 0; + } + void Assembled() { if (enabled) ++assembled_chunks; } + void Delivered(HRESULT delivery) { if (enabled && SUCCEEDED(delivery)) ++written_chunks; } + const char* mode; + const HRESULT& result; + bool enabled = false, started = false, primed = false; + std::uint64_t packets = 0, input_frames = 0, silent_packets = 0; + std::uint64_t discontinuity_packets = 0, timestamp_error_packets = 0; + std::uint64_t assembled_chunks = 0, written_chunks = 0; +}; + class ActivationHandler final : public RuntimeClass< RuntimeClassFlags, FtmBase, IActivateAudioInterfaceCompletionHandler> { public: @@ -107,6 +146,7 @@ HRESULT ActivateEndpoint(ComPtr* client, bool microphone = false, } HRESULT CaptureAudioFrames(ComPtr client, HANDLE process, bool loopback, + AudioCaptureCounts& counts, HANDLE stop_event, const StopProbe& stop_probe, const ReadyWriter& ready_writer, const PCMWriter& writer) { @@ -143,12 +183,16 @@ HRESULT CaptureAudioFrames(ComPtr client, HANDLE process, bool loo } if (SUCCEEDED(result)) result = client->GetService(IID_PPV_ARGS(&capture)); if (SUCCEEDED(result)) result = client->SetEventHandle(sampleReady); - if (SUCCEEDED(result)) result = client->Start(); + if (SUCCEEDED(result)) { + result = client->Start(); + if (counts.enabled) counts.started = SUCCEEDED(result); + } if (SUCCEEDED(result)) result = processAlive(); if (SUCCEEDED(result)) result = ready_writer(); if (SUCCEEDED(result)) { std::array silence{}; result = writer(0, silence.data(), static_cast(silence.size())); + if (counts.enabled) counts.primed = SUCCEEDED(result); } std::vector pending; @@ -192,6 +236,7 @@ HRESULT CaptureAudioFrames(ComPtr client, HANDLE process, bool loo UINT64 qpcPosition = 0; result = capture->GetBuffer(&data, &frames, &flags, &devicePosition, &qpcPosition); if (FAILED(result)) break; + counts.Packet(frames, flags); const size_t bytes = static_cast(frames) * format.nBlockAlign; if ((flags & AUDCLNT_BUFFERFLAGS_TIMESTAMP_ERROR) != 0) { capture->ReleaseBuffer(frames); @@ -214,8 +259,10 @@ HRESULT CaptureAudioFrames(ComPtr client, HANDLE process, bool loo capture->ReleaseBuffer(frames); while (pending.size() - consumed >= kAudioBytesPerChunk) { if (FAILED(result = processAlive())) break; + counts.Assembled(); result = writer(nextTimestamp, pending.data() + consumed, kAudioBytesPerChunk); + counts.Delivered(result); if (FAILED(result)) break; consumed += kAudioBytesPerChunk; nextTimestamp += kAudioChunkDuration100ns; @@ -250,18 +297,19 @@ HRESULT CaptureProcessAudio(DWORD pid, UINT64 expectedCreationTime, bool exclude HANDLE stop_event, const StopProbe& stop_probe, const ReadyWriter& ready_writer, const PCMWriter& writer) { - HRESULT com_result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); - if (FAILED(com_result)) return com_result; + HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); + AudioCaptureCounts counts(exclude ? "process-exclude" : "process-include", result); + if (FAILED(result)) return result; // Validate and watch the same handle so PID reuse cannot change the target. HANDLE process = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION | SYNCHRONIZE, FALSE, pid); - HRESULT result = process ? ValidateProcessTarget(process, expectedCreationTime) + result = process ? ValidateProcessTarget(process, expectedCreationTime) : HRESULT_FROM_WIN32(GetLastError()); ComPtr client; if (SUCCEEDED(result)) { result = ActivateProcessLoopback(pid, exclude, &client); } if (SUCCEEDED(result)) { - result = CaptureAudioFrames(client, process, true, stop_event, stop_probe, + result = CaptureAudioFrames(client, process, true, counts, stop_event, stop_probe, ready_writer, writer); } if (process != nullptr) CloseHandle(process); @@ -273,12 +321,13 @@ HRESULT CaptureProcessAudio(DWORD pid, UINT64 expectedCreationTime, bool exclude HRESULT CaptureSystemAudio(HANDLE stop_event, const StopProbe& stop_probe, const ReadyWriter& ready_writer, const PCMWriter& writer) { - HRESULT com_result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); - if (FAILED(com_result)) return com_result; + HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); + AudioCaptureCounts counts("default-endpoint", result); + if (FAILED(result)) return result; ComPtr client; - HRESULT result = ActivateEndpoint(&client); + result = ActivateEndpoint(&client); if (SUCCEEDED(result)) { - result = CaptureAudioFrames(client, nullptr, true, stop_event, stop_probe, + result = CaptureAudioFrames(client, nullptr, true, counts, stop_event, stop_probe, ready_writer, writer); } client.Reset(); @@ -289,11 +338,12 @@ HRESULT CaptureSystemAudio(HANDLE stop_event, const StopProbe& stop_probe, HRESULT CaptureMicrophone(const std::wstring& device_id, HANDLE stop_event, const StopProbe& stop_probe, const ReadyWriter& ready_writer, const PCMWriter& writer) { HRESULT result = CoInitializeEx(nullptr, COINIT_MULTITHREADED); + AudioCaptureCounts counts("microphone", result); if (FAILED(result)) return result; ComPtr client; result = ActivateEndpoint(&client, true, device_id); if (SUCCEEDED(result)) { - result = CaptureAudioFrames(client, nullptr, false, stop_event, stop_probe, ready_writer, writer); + result = CaptureAudioFrames(client, nullptr, false, counts, stop_event, stop_probe, ready_writer, writer); } client.Reset(); CoUninitialize(); diff --git a/package-lock.json b/package-lock.json index f0e6ee2a4..f1c27e4cc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "@types/ws": "8.18.1", "@vitejs/plugin-react": "6.0.5", "esbuild": "0.28.2", + "qrcode.react": "4.2.0", "react": "19.2.8", "react-dom": "19.2.8", "sdp-transform": "3.0.0", @@ -1503,6 +1504,16 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/qrcode.react": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-4.2.0.tgz", + "integrity": "sha512-QpgqWi8rD9DsS9EP3z7BT+5lY5SFhsqGjpgW5DY/i3mK4M9DTBNz3ErMi8BWYEfI3L0d8GIbGmcdFAS1uIRGjA==", + "dev": true, + "license": "ISC", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, "node_modules/react": { "version": "19.2.8", "resolved": "https://registry.npmjs.org/react/-/react-19.2.8.tgz", diff --git a/package.json b/package.json index 9622c2835..f32243ad6 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "@types/ws": "8.18.1", "@vitejs/plugin-react": "6.0.5", "esbuild": "0.28.2", + "qrcode.react": "4.2.0", "react": "19.2.8", "react-dom": "19.2.8", "sdp-transform": "3.0.0", diff --git a/scripts/mirror-release.mjs b/scripts/mirror-release.mjs index cb287b0d2..4249ec0b8 100644 --- a/scripts/mirror-release.mjs +++ b/scripts/mirror-release.mjs @@ -3,6 +3,7 @@ import { createHash } from "node:crypto"; import { openAsBlob } from "node:fs"; import { setTimeout as delay } from "node:timers/promises"; import { readReleaseArtifacts } from "./release-artifacts.mjs"; +import { prepareMirrorRelease, mirrorReleaseBody } from "./release-mirror-prepare.mjs"; const [directory, version, revision, option] = process.argv.slice(2); if (option && option !== "--dry-run") { @@ -11,7 +12,6 @@ if (option && option !== "--dry-run") { const { files } = readReleaseArtifacts(directory, version, revision); const repository = "TNTcraftHIM/Piik"; const api = `https://api.atomgit.com/api/v5/repos/${repository}`; -const marker = ``; const token = process.env.ATOMGIT_TOKEN?.trim(); function requireLatestSource() { @@ -108,22 +108,10 @@ if (option === "--dry-run") { throw new Error(`GitHub attachment checksum mismatch or unavailable: ${file.name}`); } } - let release = await request(`/releases/tags/${version}`); - if (release && (release.tag_name !== version || - (release.prerelease !== false && release.prerelease !== true) || - !release.body?.split(/\r?\n/).includes(marker))) { - throw new Error("Existing mirror release belongs to a different or unknown source revision"); - } - const body = `${source.body ?? ""}\n\n此镜像分发 GitHub 的原始安装包;源码以 GitHub 为准。 / This mirror distributes the original GitHub packages; GitHub owns their source.\n\nSource: https://github.com/${repository}/commit/${revision}\n\n${marker}\n`; - if (!release || release.prerelease) requireLatestSource(); - if (!release) { - const repo = await request(""); - if (!repo || repo.private || !repo.default_branch) throw new Error("A public initialized AtomGit mirror is required"); - release = await request("/releases", "POST", { - tag_name: version, name: source.name || `Piik ${version}`, body, release_status: "pre", - target_commitish: repo.default_branch, - }); - } + const existing = await request(`/releases/tags/${encodeURIComponent(version)}`); + if (!existing || existing.prerelease) requireLatestSource(); + let release = await prepareMirrorRelease(source, request, existing); + const body = mirrorReleaseBody(source); const attachments = release.assets; if (!Array.isArray(attachments)) throw new Error("Unexpected mirror attachment list"); for (const file of files) { diff --git a/scripts/package-licenses.mjs b/scripts/package-licenses.mjs index c38e58446..d377aa180 100644 --- a/scripts/package-licenses.mjs +++ b/scripts/package-licenses.mjs @@ -14,7 +14,7 @@ const section = (label, body) => `\n===== ${label} =====\n\n${body.trim()}\n`; // The packages the Vite bundle ships to the Browser. Nothing installs // node_modules at runtime any more, so this list is the notice contract rather // than package.json's dependencies field. -const WEB_BUNDLE_PACKAGES = ["@oddbird/popover-polyfill", "react", "react-dom", "sdp-transform", "semver", "zod"]; +const WEB_BUNDLE_PACKAGES = ["@oddbird/popover-polyfill", "react", "react-dom", "qrcode.react", "sdp-transform", "semver", "zod"]; // Both binaries embed the Web bundle, which serves its own notice file. const WEB_NOTICE_LINE = "Web dependencies: served at /third-party-licenses.txt\n"; @@ -56,9 +56,11 @@ export function writeWebLicenseNotices(repositoryRoot, outputFile, packages = WE } const key = `${dependency.name}@${dependency.version}`; const files = noticesIn(directory); - const body = files.length + let body = files.length ? files.map((file) => section(file, readFileSync(join(directory, file), "utf8"))).join("") : pinnedNotice(key); + // The bundled QR encoder MIT notice is absent from the npm archive. + if (dependency.name === "qrcode.react") body += section("Bundled QR Code generator (MIT)", pinnedNotice(`qrcodegen/qrcode.react@${dependency.version}`)); entries.set(key, section(`${key} (${dependency.license ?? "see license text"})`, body)); for (const child of Object.keys(dependency.dependencies ?? {})) queue.push([child, path]); } diff --git a/scripts/release-mirror-prepare.mjs b/scripts/release-mirror-prepare.mjs new file mode 100644 index 000000000..66f5729e2 --- /dev/null +++ b/scripts/release-mirror-prepare.mjs @@ -0,0 +1,66 @@ +// Prepare the attachment container before downloading original build artifacts. +// The local tag locates attachments; their original source +// identity comes from the GitHub marker and verified package digests. +import { execFileSync } from "node:child_process"; +import { appendFileSync } from "node:fs"; +import { pathToFileURL } from "node:url"; +import { mirrorReadiness, readMirror, validateMirrorSource, validateMirrorRelease } from "./release-mirror-ready.mjs"; + +async function requestMirror(path, method = "GET", body) { + if (method === "GET") return readMirror(path); + const token = process.env.ATOMGIT_TOKEN?.trim(); + if (!token) throw new Error("ATOMGIT_TOKEN is required to prepare the mirror before downloading artifacts"); + const response = await fetch(`https://api.atomgit.com/api/v5/repos/TNTcraftHIM/Piik${path}`, { + method, redirect: "error", signal: AbortSignal.timeout(30_000), + headers: { Accept: "application/json", "PRIVATE-TOKEN": token, "Content-Type": "application/json" }, + body: JSON.stringify(body), + }); + if (!response.ok) { + const detail = await response.json().catch(() => null); + const reason = detail?.message ?? detail?.error_message ?? detail?.error; + const message = typeof reason === "string" ? reason.replaceAll(token, "[redacted]").slice(0, 500) : ""; + throw new Error(`AtomGit preparation ${method} ${path}: HTTP ${response.status}${message ? `: ${message}` : ""}. Mirror publication remains incomplete.`); + } + return response.json(); +} + +export function mirrorReleaseBody(source) { + const revision = source.target_commitish; + return `${source.body ?? ""}\n\n此镜像分发 GitHub 的原始安装包;源码以 GitHub 为准。 / This mirror distributes the original GitHub packages; GitHub owns their source.\n\nSource: https://github.com/TNTcraftHIM/Piik/commit/${revision}\n\n\n`; +} + +export async function prepareMirrorRelease(source, request = requestMirror, existing) { + validateMirrorSource(source); + const version = source.tag_name; + let release = existing === undefined ? await request(`/releases/tags/${encodeURIComponent(version)}`) : existing; + if (!release) { + const repo = await request(""); + if (!repo || repo.private || !repo.default_branch) throw new Error("A public initialized AtomGit mirror is required"); + release = await request("/releases", "POST", { + tag_name: version, name: source.name || `Piik ${version}`, + body: mirrorReleaseBody(source), + target_commitish: repo.default_branch, release_status: "pre", + }); + if (release?.prerelease !== true) throw new Error("AtomGit did not confirm the prepared prerelease; mirror publication remains incomplete"); + } + validateMirrorRelease(source, release); + return release; +} + +export async function prepareMirror(source, request = requestMirror) { + const result = await mirrorReadiness(source, path => request(path)); + if (result.status !== "complete") await prepareMirrorRelease(source, request); + return result; +} + +if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { + const source = JSON.parse(execFileSync("gh", ["api", "repos/TNTcraftHIM/Piik/releases/latest"], { + encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 30_000, + })); + const result = await prepareMirror(source); + if (process.env.GITHUB_OUTPUT) appendFileSync(process.env.GITHUB_OUTPUT, `status=${result.status}\n`); + if (process.env.GITHUB_STEP_SUMMARY) appendFileSync(process.env.GITHUB_STEP_SUMMARY, + result.status === "complete" ? `Mirror ${result.version} is already stable with the complete published attachment inventory.\n` + : `Mirror ${result.version} is prepared to resume from original CI artifacts; it remains incomplete until all packages pass verification.\n`); + console.log(JSON.stringify(result)); +} diff --git a/scripts/release-mirror-ready.mjs b/scripts/release-mirror-ready.mjs index 42d36c49a..c78e9ef06 100644 --- a/scripts/release-mirror-ready.mjs +++ b/scripts/release-mirror-ready.mjs @@ -1,7 +1,3 @@ -import { execFileSync } from "node:child_process"; -import { appendFileSync } from "node:fs"; -import { pathToFileURL } from "node:url"; - const repository = "TNTcraftHIM/Piik"; export async function readMirror(path) { const response = await fetch(`https://api.atomgit.com/api/v5/repos/${repository}${path}`, { @@ -12,15 +8,24 @@ export async function readMirror(path) { return response.json(); } -export async function mirrorReadiness(source, read = readMirror) { +export function validateMirrorSource(source) { if (source.draft !== false || source.prerelease !== false || typeof source.tag_name !== "string" || !/^[a-f0-9]{40}$/.test(source.target_commitish)) throw new Error("A published GitHub release with a full source SHA is required"); +} + +export function validateMirrorRelease(source, release) { + if (!release || release.tag_name !== source.tag_name || ![true, false].includes(release.prerelease) + || !release.body?.split(/\r?\n/).includes(``)) { + throw new Error("Existing mirror release belongs to a different or unknown source revision"); + } +} + +export async function mirrorReadiness(source, read = readMirror) { const version = source.tag_name, revision = source.target_commitish; + validateMirrorSource(source); const mirror = await read(`/releases/tags/${encodeURIComponent(version)}`); if (mirror) { - if (mirror.tag_name !== version || ![true, false].includes(mirror.prerelease) - || !mirror.body?.split(/\r?\n/).includes(``)) - throw new Error("Existing mirror release belongs to a different or unknown source revision"); + validateMirrorRelease(source, mirror); const packages = source.assets?.filter(asset => asset.name?.startsWith("piik-")); const complete = packages?.length > 0 && Array.isArray(mirror.assets) && packages.every(asset => { const matches = mirror.assets.filter(candidate => candidate.type === "attach" && candidate.name === asset.name); @@ -35,15 +40,3 @@ export async function mirrorReadiness(source, read = readMirror) { } return { status: "ready", version, revision }; } - -if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) { - const source = JSON.parse(execFileSync("gh", ["api", `repos/${repository}/releases/latest`], { - encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], timeout: 30_000, - })); - const result = await mirrorReadiness(source); - if (process.env.GITHUB_OUTPUT) appendFileSync(process.env.GITHUB_OUTPUT, `status=${result.status}\n`); - if (process.env.GITHUB_STEP_SUMMARY) appendFileSync(process.env.GITHUB_STEP_SUMMARY, - result.status === "complete" ? `Mirror ${result.version} is already stable with the complete published attachment inventory.\n` - : `Mirror ${result.version} is ready to resume from original CI artifacts.\n`); - console.log(JSON.stringify(result)); -} diff --git a/src/client/components/living/AppConnectionButton.tsx b/src/client/components/living/AppConnectionButton.tsx index 53a877190..a58b361ed 100644 --- a/src/client/components/living/AppConnectionButton.tsx +++ b/src/client/components/living/AppConnectionButton.tsx @@ -20,6 +20,7 @@ interface AppConnectionProps { interface ConnectionAttempt { controller: AbortController; popup: Window | null; + automatic: boolean; open?: () => void; cancel?: () => void; } @@ -36,15 +37,21 @@ export function AppConnectionButton({ onConnected }: AppConnectionProps) { useAnchoredPopover(trigger, help); const pending = useRef(null); const healthCheck = useRef(null); + const automaticFailed = useRef(false); + const [automaticHint, setAutomaticHint] = useState(false); const [build, setBuild] = useState(); const { update: release, refresh: checkRelease } = useReleaseUpdate(build); function rememberBuild(health: Partial | null) { setBuild(health?.version && health.revision ? { version: health.version, revision: health.revision, packageTarget: health.packageTarget } : undefined); } + useEffect(() => { + void connect(false, true); + return () => { pending.current?.controller.abort(); pending.current?.popup?.close(); pending.current = null; }; + }, []); useEffect(() => { const refresh = async () => { - if (pending.current || help.current?.matches(":popover-open") || !isClientActivated()) return; + if (automaticFailed.current || pending.current || help.current?.matches(":popover-open") || !isClientActivated()) return; healthCheck.current?.abort(); const current = healthCheck.current = new AbortController(); const native = await import("../../native/client"); @@ -55,10 +62,10 @@ export function AppConnectionButton({ onConnected }: AppConnectionProps) { rememberBuild(health); setState(health ? "ready" : "idle"); } - } catch (error) { + } catch { if (!current.signal.aborted && !pending.current) { rememberBuild(null); - setState(error instanceof native.NativeCompatibilityError ? "incompatible" : "idle"); + setState("idle"); } } }; @@ -70,21 +77,24 @@ export function AppConnectionButton({ onConnected }: AppConnectionProps) { const unwatch = watchClientActivation(onFocus); return () => { healthCheck.current?.abort(); window.removeEventListener("focus", onFocus); unwatch(); }; }, []); - useEffect(() => () => { pending.current?.controller.abort(); pending.current?.popup?.close(); }, []); function showHelp(): void { if (trigger.current) help.current?.showPopover({ source: trigger.current }); } - async function connect(wake = false): Promise { - if (pending.current) { pending.current.open?.(); return; } + async function connect(wake = false, automatic = false): Promise { + if (!automatic) setAutomaticHint(false); + if (pending.current) { + if (!automatic) pending.current.automatic = false; + pending.current.open?.(); return; + } let manage = state === "ready"; healthCheck.current?.abort(); // Discovery and its browser permission prompt stay in the current tab. // A fresh click opens the real approval page without reserving a blank tab. - const attempt: ConnectionAttempt = { controller: new AbortController(), popup: null }; + const attempt: ConnectionAttempt = { controller: new AbortController(), popup: null, automatic }; pending.current = attempt; - showHelp(); + if (!automatic) showHelp(); const signal = attempt.controller.signal; let native: typeof import("../../native/client") | undefined; let approving = false; @@ -123,8 +133,11 @@ export function AppConnectionButton({ onConnected }: AppConnectionProps) { if (!keepPage) attempt.popup?.close(); if (pending.current === attempt) { pending.current = null; - setState(result); - if (result === "unavailable" || result === "incompatible") showHelp(); + automaticFailed.current = result !== "ready"; + const failed = result === "unavailable" || result === "incompatible"; + setAutomaticHint(false); + setState(attempt.automatic && failed ? "idle" : result); + if (!attempt.automatic && failed) showHelp(); else help.current?.hidePopover(); } }; @@ -147,7 +160,7 @@ export function AppConnectionButton({ onConnected }: AppConnectionProps) { try { native = await import("../../native/client"); if (signal.aborted) return; - const url = await native.discoverNativeConnect(signal); + const url = await native.discoverNativeConnect({ signal, waitForPermission: !attempt.automatic }); if (signal.aborted) return; if (!url) { finish("unavailable"); return; } const health = await native.discoverNativeHealth({ signal, waitForPermission: false }); @@ -171,6 +184,7 @@ export function AppConnectionButton({ onConnected }: AppConnectionProps) { if (manage) finish("ready", true); else { setState("approving"); help.current?.hidePopover(); } }; + setAutomaticHint(automatic && !manage); setState(manage ? "ready" : "approval"); } catch (error) { if (!signal.aborted) finish(native && error instanceof native.NativeCompatibilityError ? "incompatible" : "unavailable"); @@ -199,7 +213,7 @@ export function AppConnectionButton({ onConnected }: AppConnectionProps) { const title = availableUpdate ? t("client.connect.update", { current: build!.version, version: update.version }) : label; return <> + autoOpen={automaticHint} place="below" align="end"> + + {open && url && <> + +

{t("host.invite.qrHint")}

+ } + , document.body)} + ; +} diff --git a/src/client/components/living/LanguageControl.tsx b/src/client/components/living/LanguageControl.tsx index 85a939845..ad1261adb 100644 --- a/src/client/components/living/LanguageControl.tsx +++ b/src/client/components/living/LanguageControl.tsx @@ -13,7 +13,8 @@ export function LanguageControl() { const menuRef = useRef(null); const extraLanguages = (Object.keys(locales) as Lang[]).filter((key): boolean => key !== "zh" && key !== "en"); const selectedExtra = !vis && extraLanguages.includes(lang) ? locales[lang] : null; - useAnchoredPopover(triggerRef, menuRef, { maxHeight: 360, enabled: extraLanguages.length > 0 }); + const selectedLabel = vis ? t("mode.vis") : selectedExtra?.name; + useAnchoredPopover(triggerRef, menuRef, { maxHeight: 360 }); useEffect(() => { const menu = menuRef.current; @@ -66,15 +67,10 @@ export function LanguageControl() { onClick={() => setLang(key)} >{locales[key].short} ))} - - {extraLanguages.length > 0 && ( - + - )} - - {extraLanguages.length > 0 && ( - { - // Returning to the trigger lets its native action close the menu. - if (event.relatedTarget !== triggerRef.current && - !event.currentTarget.contains(event.relatedTarget as Node | null)) { - event.currentTarget.hidePopover(); - } - }} - > - {extraLanguages.map((key) => { - const locale = locales[key]; - const selected = !vis && lang === key; - return ; - })} - )} + + { + // Either part of the language shortcut can toggle the native menu. + if (!triggerRef.current?.parentElement?.contains(event.relatedTarget as Node | null) && + !event.currentTarget.contains(event.relatedTarget as Node | null)) { + event.currentTarget.hidePopover(); + } + }} + > + {extraLanguages.map((key) => { + const locale = locales[key]; + const selected = !vis && lang === key; + return ; + })} + + ; } diff --git a/src/client/components/living/NumberControl.tsx b/src/client/components/living/NumberControl.tsx index 10967aa6f..b24c3fbe9 100644 --- a/src/client/components/living/NumberControl.tsx +++ b/src/client/components/living/NumberControl.tsx @@ -59,8 +59,7 @@ export function NumberControl({ value, min, max, step, unit, showUnit = true, na if (event.currentTarget.contains(event.relatedTarget)) return; const field = input.current!; const valid = field.validity.valid && Number.isFinite(field.valueAsNumber); - setInvalid(!valid); - if (valid && field.valueAsNumber !== value) onChange(field.valueAsNumber); + if (valid) select(field.valueAsNumber); else setInvalid(true); }}>{children(number, select)} {invalid && {t("host.quality.invalidNumber", { min: String(min), max: String(max), step: String(step), unit, diff --git a/src/client/components/living/PlaybackControls.tsx b/src/client/components/living/PlaybackControls.tsx index e6d957a5f..f291e39d5 100644 --- a/src/client/components/living/PlaybackControls.tsx +++ b/src/client/components/living/PlaybackControls.tsx @@ -265,7 +265,7 @@ function PlaybackMore({ anchor, settings, overlaySettings, onReconnect, reconnec const id = useId(); const panel = useRef(null); const [open, setOpen] = useState(false); - const detailed = Boolean(settings?.preview || settings?.remoteTouch || overlaySettings || settings?.route || settings?.relayVolunteer || onReconnect); + const detailed = Boolean(settings?.preview || settings?.buffering || settings?.remoteTouch || overlaySettings || settings?.route || settings?.relayVolunteer || onReconnect); const available = detailed || Boolean(settings); useAnchoredPopover(anchor, panel, { align: "center", minVisibleHeight: 160, enabled: available }); const reconnect = onReconnect ? void; pictureRotation: VideoRotation; setPictureRotation: (rotation: VideoRotation) => void; + buffering?: { + target: number | null; + status: "supported" | "unsupported" | "failed" | null; + onChange(target: number | null): void; + }; preview?: { autoPause: boolean; onChange: (enabled: boolean) => void; @@ -71,7 +80,7 @@ export function RemoteTouchSettings({ mode, onChange }: NonNullable & { +export function PlaybackSettings({ picture, preview, remoteTouch, route, relayVolunteer, buffering, overlaySettings, reconnect }: Pick & { picture?: PlaybackSettingsProps; overlaySettings?: ReactNode; reconnect: ReactNode; }) { @@ -79,7 +88,7 @@ export function PlaybackSettings({ picture, preview, remoteTouch, route, relayVo const routeHint = route?.rejected ? "playback.routeRejected" : route?.sfuOnly ? "playback.routeSfuOnly" : route?.peerOnly ? "playback.routePeerOnly" : !route?.sfuAvailable ? "playback.routeNoSfu" : `playback.routeHint.${route.preference}` as const; - const detailedSections = [preview, remoteTouch, overlaySettings, route || relayVolunteer || reconnect].filter(Boolean).length; + const detailedSections = [preview, buffering, remoteTouch, overlaySettings, route || relayVolunteer || reconnect].filter(Boolean).length; return
{picture &&
@@ -95,6 +104,20 @@ export function PlaybackSettings({ picture, preview, remoteTouch, route, relayVo label={t("host.previewAutoPause")} note={t("host.previewAutoPauseHint")} hint="hint-local-pause" /> {!vis &&

{t("host.previewAutoPauseHint")}

}
} + {buffering &&
+

{t("playback.buffering")}

+ buffering.onChange(enabled ? INITIAL_MANUAL_BUFFER_TARGET_MS : null)} + disabled={buffering.status === "unsupported" && buffering.target === null} + label={t("playback.increaseBuffer")} icon="clock" /> + {buffering.target !== null && {input =>
+ {input} +
}
} + {!vis &&

{t("playback.bufferHint")}

} + {buffering.status === "unsupported" && } + {buffering.status === "failed" && } +
} {remoteTouch && } {overlaySettings &&
diff --git a/src/client/components/living/Tooltip.tsx b/src/client/components/living/Tooltip.tsx index c7da24539..e5915223c 100644 --- a/src/client/components/living/Tooltip.tsx +++ b/src/client/components/living/Tooltip.tsx @@ -174,8 +174,8 @@ export function Tooltip({ }; // Re-pick alignment from the trigger's live geometry. The configured align - // wins whenever it fits; otherwise the first alignment that keeps the whole - // panel inside the viewport, then whichever clips least (panel wider than + // wins when it fits and clears neighbouring controls; otherwise prefer + // viewport fit and the least overlap (panel wider than // the viewport is impossible — CSS caps it — but stay total). const pickAlign = () => { const wrap = wrapRef.current; @@ -198,7 +198,7 @@ export function Tooltip({ const surface = wrap.closest("[popover], :fullscreen"); const insideSurface = (element: HTMLElement | null) => element && (!surface || surface.contains(element)) ? element : null; // A wrapped control row remains one working area, including on narrow screens. - const controlBar = insideSurface(wrap.closest(".lr-playback, .lr-source-picker-options, .lr-host-share-controls")); + const controlBar = insideSurface(wrap.closest(".lr-media-toolbar, .lr-source-picker-options")); const playback = Boolean(controlBar?.closest(".lr-playback")); const avoid = controlBar?.getBoundingClientRect() ?? rect; const screen = insideSurface(wrap.closest(".lr-tv-screen")); @@ -255,11 +255,40 @@ export function Tooltip({ align, ...(["center", "start", "end"] as Align[]).filter((a) => a !== align), ]; - const fits = order.find((a) => clipped(boxes[a]) === 0); - const selected = fits ?? order.reduce((a, b) => (clipped(boxes[a]) <= clipped(boxes[b]) ? a : b)); - let left = Math.max(x + EDGE_MARGIN, Math.min(boxes[selected].left, right - width - EDGE_MARGIN)); let top = livePlace === "below" ? below + EDGE_MARGIN : avoid.top - panelHeight - EDGE_MARGIN; top = Math.max(y + EDGE_MARGIN, Math.min(top, bottom - panelHeight - EDGE_MARGIN)); + // Viewport fit comes first; within it, keep guidance off neighbouring + // media controls. Reserve auto-hidden bars too: entering the player can + // reveal them while this guidance is still open. + const controls = [...(surface ?? wrap.ownerDocument).querySelectorAll(".lr-media-toolbar")] + .filter(element => !element.contains(wrap) && element.getClientRects().length) + .map(element => element.getBoundingClientRect()); + const boundedLeft = (left: number) => Math.max(x + EDGE_MARGIN, Math.min(left, right - width - EDGE_MARGIN)); + const overlap = (left: number) => controls.reduce((area, control) => area + + Math.max(0, Math.min(left + width, control.right) - Math.max(left, control.left)) + * Math.max(0, Math.min(top + panelHeight + EDGE_MARGIN, control.bottom) - Math.max(top - EDGE_MARGIN, control.top)), 0); + const leastClipped = Math.min(...order.map(a => clipped(boxes[a]))); + const candidates = order.filter(a => clipped(boxes[a]) === leastClipped); + const selected = candidates.reduce((a, b) => overlap(boundedLeft(boxes[a].left)) <= overlap(boundedLeft(boxes[b].left)) ? a : b); + let left = boundedLeft(boxes[selected].left); + const preferredLeft = left; + // A wide neighbouring bar can cover all trigger alignments. Use its + // nearest clear edge when that position still fits the viewport. + for (const control of controls) { + for (const candidate of [control.left - width - EDGE_MARGIN, control.right + EDGE_MARGIN]) { + if (candidate === boundedLeft(candidate) && (overlap(candidate) < overlap(left) + || overlap(candidate) === overlap(left) && Math.abs(candidate - preferredLeft) < Math.abs(left - preferredLeft))) left = candidate; + } + } + // At phone widths there may be no clear side. Keep the panel above its + // complete control bar when the preferred lower space covers another bar. + const above = avoid.top - panelHeight - EDGE_MARGIN; + if (livePlace === "below" && overlap(left) > 0 && above >= y + EDGE_MARGIN) { + const previousTop = top, previousOverlap = overlap(left); + top = above; + if (overlap(left) < previousOverlap) livePlace = "above"; + else top = previousTop; + } let caret = Math.max(14, Math.min(center - left, width - 14)); if (livePlace === "left") { left = (player ?? avoid).left - width - EDGE_MARGIN; diff --git a/src/client/components/living/invite-qr-code.css b/src/client/components/living/invite-qr-code.css new file mode 100644 index 000000000..8f8f60a76 --- /dev/null +++ b/src/client/components/living/invite-qr-code.css @@ -0,0 +1,5 @@ +.lr-invite-qr:is(:popover-open, .\:popover-open) { display: flex; flex-direction: column; width: min(288px, calc(100vw - 16px)); gap: 12px; } +.lr-invite-qr header { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; } +.lr-invite-qr header > button { margin-left: auto; } +.lr-invite-qr > svg { display: block; flex: 0 1 auto; min-height: 0; width: 100%; height: auto; aspect-ratio: 1; } +.lr-invite-qr > p { flex: none; margin: 0; text-align: center; font-size: 13px; line-height: 1.5; } diff --git a/src/client/components/living/segmented-control.css b/src/client/components/living/segmented-control.css index 2ac055c1a..b1b00ed81 100644 --- a/src/client/components/living/segmented-control.css +++ b/src/client/components/living/segmented-control.css @@ -17,9 +17,8 @@ .lr-lang { --lr-segments: 3; --selection-item-size: calc(var(--control-compact-size) - 12px); - grid-auto-columns: var(--selection-item-size); + grid-template-columns: repeat(2, var(--selection-item-size)) auto; } -.lr-lang:has(.lr-lang-more) { --lr-segments: 4; } :is(.lr-toggle, .lr-lang)::before { content: ""; position: absolute; @@ -29,15 +28,16 @@ background: var(--control-selected); box-shadow: inset 0 0 0 var(--control-border-width) var(--action); transform: translateX(calc(var(--lr-selected-index) * 100%)); - transition: transform 260ms var(--spring); + transition: transform 260ms ease-out; pointer-events: none; } +.lr-lang::before { width: var(--selection-item-size); } :is(.lr-toggle, .lr-lang):not(:has(.is-selected, input:checked))::before, .lr-toggle:disabled::before { opacity: 0; } :is(.lr-toggle, .lr-lang):has(> :nth-child(2).is-selected, > :nth-child(2) .is-selected, > label:nth-of-type(2) input:checked) { --lr-selected-index: 1; } :is(.lr-toggle, .lr-lang):has(> :nth-child(3).is-selected, > :nth-child(3) .is-selected, > label:nth-of-type(3) input:checked) { --lr-selected-index: 2; } :is(.lr-toggle, .lr-lang):has(> :nth-child(4).is-selected, > :nth-child(4) .is-selected, > label:nth-of-type(4) input:checked) { --lr-selected-index: 3; } -.lr-toggle button, .lr-lang > button, .lr-toggle > label > span { +.lr-toggle button, .lr-lang button, .lr-toggle > label > span { position: relative; z-index: 1; display: inline-flex; @@ -55,9 +55,10 @@ font-weight: 600; transition: color 140ms ease, background-color 140ms ease, var(--control-motion); } -.lr-lang > button { min-width: 0; padding: 0; } -.lr-toggle button, .lr-lang > button { cursor: pointer; } -.lr-toggle button:disabled, .lr-lang > button:disabled { cursor: default; } +.lr-lang button { min-width: 0; padding: 0; } +.lr-lang-extra { display: grid; grid-template-columns: var(--selection-item-size) 24px; gap: 0; } +.lr-toggle button, .lr-lang button { cursor: pointer; } +.lr-toggle button:disabled, .lr-lang button:disabled { cursor: default; } .lr-toggle button > .lr-glyph { flex: none; } .lr-toggle > label { position: relative; min-width: 0; } .lr-toggle > label > input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; } diff --git a/src/client/lib/room-preferences.ts b/src/client/lib/room-preferences.ts index fff23d6c5..01427084f 100644 --- a/src/client/lib/room-preferences.ts +++ b/src/client/lib/room-preferences.ts @@ -1,6 +1,7 @@ import { z } from "zod"; import { viewerRoutePreferenceSchema } from "../../shared/protocol"; import { remoteControlModeSchema, remoteShortcutKeySchema } from "../remote-control/protocol"; +import { MAX_PLAYBACK_BUFFER_TARGET_MS } from "../webrtc/receiver-buffer-target"; const STORAGE_KEY = "piik:room-preferences:v1"; export const CHAT_OVERLAY_LIMITS = { scale: [.8, 1.3], opacity: [.4, 1], speed: [.5, 1.5] } as const; @@ -11,6 +12,7 @@ const roomPreferencesSchema = z.object({ pictureFit: z.enum(["contain", "cover", "fill"]).default("contain"), pictureRotation: z.union([z.literal(0), z.literal(90), z.literal(180), z.literal(270)]).catch(0).default(0), previewAutoPause: z.boolean().default(true), + screenBufferTargetMs: z.number().min(0).max(MAX_PLAYBACK_BUFFER_TARGET_MS).nullable().default(null), routePreference: viewerRoutePreferenceSchema.default("auto"), overlayEnabled: z.boolean().default(false), overlayAppearance: z.object({ diff --git a/src/client/locales/en.ts b/src/client/locales/en.ts index acbb5be6e..2cfe5cd2d 100644 --- a/src/client/locales/en.ts +++ b/src/client/locales/en.ts @@ -2,6 +2,16 @@ import type { CopyKey, PlayfulCatalog, TitleFrameCatalog } from "./zh"; // Community translations are data-only and type-checked against zh. export const en: Record = { + "playback.buffering": "Playback buffering", + "playback.increaseBuffer": "Increase playback buffering", + "playback.bufferTarget": "Total buffer target", + "playback.bufferHint": "Set how long the receiver aims to wait for data. This may reduce stalls caused by network jitter, but adds viewing delay and may delay relayed pictures.", + "playback.bufferUnsupported": "The current receive path cannot set a buffer target.", + "playback.bufferFailed": "Could not apply this buffer target. Playback continues.", + "host.invite.qr": "Invitation QR code", + "host.invite.qrShort": "QR code", + "host.invite.qrHint": "Scan with another device to join the room.", + "host.invite.qrFailed": "Could not create a QR code. Copy the invitation link instead.", "state.peer.present": "In the room", "state.peer.voiceConnected": "Voice connected", "host.topology.idle": "In the room. No active media routes.", @@ -809,7 +819,7 @@ export const en: Record = { "viewer.hint.generic": "Reload this page to try again in a moment.", "mode.language": "Interface language", - "mode.more": "More languages", + "mode.more": "Language and display", "header.more": "More options", "mode.vis": "Visual only", "theme.dark": "Switch to dark mode", diff --git a/src/client/locales/index.ts b/src/client/locales/index.ts index f150499bd..380ffe481 100644 --- a/src/client/locales/index.ts +++ b/src/client/locales/index.ts @@ -1,6 +1,9 @@ import { en, enPlayful, enTitleFrames } from "./en"; import { visualTitleFrames } from "./visual"; import { zh, zhPlayful, zhTitleFrames } from "./zh"; +import { zhHant } from "./zh-Hant"; +import { ja } from "./ja"; +import { ko } from "./ko"; export type { CopyKey, TitleContent, TitleFrameKey, WelcomeEntry } from "./zh"; @@ -8,6 +11,10 @@ export type { CopyKey, TitleContent, TitleFrameKey, WelcomeEntry } from "./zh"; export const locales = { zh: { name: "简体中文", short: "中", tag: "zh-CN", copy: zh, titleFrames: zhTitleFrames, playful: zhPlayful }, en: { name: "English", short: "EN", tag: "en", copy: en, titleFrames: enTitleFrames, playful: enPlayful }, + // Partial message catalogs retain the existing English title and playful defaults. + "zh-Hant": { name: "繁體中文", short: "繁", tag: "zh-Hant", copy: zhHant, titleFrames: enTitleFrames, playful: enPlayful }, + ja: { name: "日本語", short: "日", tag: "ja", copy: ja, titleFrames: enTitleFrames, playful: enPlayful }, + ko: { name: "한국어", short: "한", tag: "ko", copy: ko, titleFrames: enTitleFrames, playful: enPlayful }, }; export type Lang = keyof typeof locales; @@ -16,11 +23,20 @@ export function isLang(value: unknown): value is Lang { } export function resolveLang(language?: string): Lang { - const tag = language?.toLowerCase(); - const exact = (Object.keys(locales) as Lang[]).find((key) => - key.toLowerCase() === tag || locales[key].tag.toLowerCase() === tag); - const base = tag?.split("-")[0]; - return exact ?? (isLang(base) ? base : "en"); + if (!language) return "en"; + try { + const requested = new Intl.Locale(language); + const keys = Object.keys(locales) as Lang[]; + const exact = keys.find((key) => key.toLowerCase() === requested.baseName.toLowerCase() + || locales[key].tag.toLowerCase() === requested.baseName.toLowerCase()); + if (exact) return exact; + const candidates = keys.filter((key) => new Intl.Locale(locales[key].tag).language === requested.language); + const script = requested.maximize().script; + return candidates.find((key) => new Intl.Locale(locales[key].tag).maximize().script === script) + ?? candidates[0] ?? "en"; + } catch { + return "en"; + } } // The App console currently translates these three presentations only. diff --git a/src/client/locales/ja.ts b/src/client/locales/ja.ts new file mode 100644 index 000000000..19a51a436 --- /dev/null +++ b/src/client/locales/ja.ts @@ -0,0 +1,839 @@ +import type { CopyKey } from "./zh"; + +// Partial translations reused only where both canonical English and Chinese match. +export const ja: Partial> = { + "state.peer.present": "ルームに参加中", + "state.peer.voiceConnected": "通話接続済み", + "host.topology.idle": "ルームに参加中です。有効なメディア経路はありません。", + "remote.textShared": "操作中の人が 1 人の場合にテキストを送信できます。", + "remote.participant.control": "リモート操作に参加中", + "remote.gamepadHelp": "最初に接続された標準コントローラーを、ホスト側の独立したコントローラーとして使います。このページにフォーカスを置いてください。", + "remote.gamepadHostHelp": "各プレイヤーが自分のコントローラーを使用できます。", + "remote.gamepadSetup": "ゲームパッドの設定", + "remote.reason.gamepad": "仮想ゲームパッドを利用できません。ホストのゲームパッド設定と空きスロットを確認してください。", + "remote.keyboard": "リモートキーボード", + "remote.inputTools": "入力ツール", + "remote.keyboardRequiresControl": "リモートキーボードを使うには操作権を取得してください", + "remote.mouse": "マウス", + "remote.mouseLeft": "マウスの左ボタン", + "remote.mouseRight": "マウスの右ボタン", + "remote.mouseWheel": "スクロールホイールと中央ボタン", + "remote.mouseExpand": "仮想マウスを展開", + "remote.mouseCollapse": "マウスを最小化", + "remote.mouseReposition": "ドラッグで移動します。端に置くと収納します", + "remote.mouseMove": "ドラッグしてポインターを移動", + "remote.mouseScroll": "タップで中央クリック、スワイプでスクロール、長押しでドラッグ", + "remote.touchMode": "既定のタッチ操作", + "remote.touchMode.direct": "直接タッチ", + "remote.touchMode.trackpad": "トラックパッド", + "remote.touchMode.directHint": "映像の操作したい位置を直接タップします。", + "remote.touchMode.trackpadHint": "スワイプでポインターを動かし、タップでクリックします。", + "remote.keyPages": "キーボードの種類", + "remote.keys.letters": "文字キー", + "remote.keys.symbols": "数字と記号", + "remote.keys.functions": "ファンクションキー", + "remote.keys.text": "テキスト", + "remote.keyboardHelp": "キーを押し続けると長押しし、離すと解除します。", + "remote.combinationHelp": "Ctrl、Shift、Alt を選んでから別のキーを押します。同時に解除されます。", + "remote.combinationMode": "キーの組み合わせモード", + "remote.key.ShiftLeft": "Shift", + "remote.key.Windows": "Windows キー", + "remote.key.Command": "Command キー", + "remote.key.Super": "Super キー", + "remote.key.Space": "スペース", + "remote.key.Insert": "Insert", + "remote.key.Delete": "Delete", + "remote.key.Home": "Home", + "remote.key.End": "End", + "remote.key.PageUp": "Page Up", + "remote.key.PageDown": "Page Down", + "remote.key.CapsLock": "Caps Lock を切り替え", + "remote.key.PrintScreen": "Print Screen", + "remote.key.ScrollLock": "Scroll Lock", + "remote.key.NumLock": "Num Lock", + "remote.text": "テキスト、コマンド、コードを入力または貼り付け", + "remote.sendText": "リモートで入力", + "remote.typeText": "リモートで入力", + "remote.textHelp": "Enter で改行します。ボタンを押すと接続先のカーソル位置に入力します。", + "remote.textTooLong": "2 KB 以下に分割してください。", + "remote.touchHelp": "2 本指のタップで右クリック、ピンチで拡大縮小します。2 本指のスワイプは通常スクロールし、拡大中や仮想マウスの展開中は表示位置を移動します。", + "remote.resetZoom": "映像の拡大率をリセット", + "remote.key.Escape": "Escape", + "remote.key.Tab": "Tab", + "remote.key.ArrowLeft": "左矢印", + "remote.key.ArrowUp": "上矢印", + "remote.key.ArrowDown": "下矢印", + "remote.key.ArrowRight": "右矢印", + "remote.key.Backspace": "Backspace", + "remote.key.Enter": "Enter", + "remote.key.ControlA": "接続先のパソコンですべて選択", + "remote.key.ControlC": "接続先のパソコンでコピー", + "remote.key.ControlV": "接続先のパソコンで貼り付け", + "remote.key.MetaLeft": "接続先のパソコンでスタートを開く", + "remote.key.InputLanguage": "接続先の入力言語を切り替え", + "remote.key.SwitchWindow": "接続先のウィンドウを切り替え", + "remote.key.SwitchApp": "接続先のアプリを切り替え", + "remote.title": "リモート操作", + "remote.requests": "操作リクエスト", + "remote.authorization": "操作の許可", + "remote.mode.ask": "毎回確認", + "remote.mode.room": "ルームの視聴者", + "remote.mode.password": "パスワード", + "remote.help.ask": "操作リクエストごとに許可するか選びます。", + "remote.help.room": "ルームの視聴者は個別の承認なしで操作できます。", + "remote.help.password": "視聴者は操作用パスワードを入力すると、このパソコンを操作できます。", + "remote.policyLifetime": "この共有ソースだけに適用します。ソースの変更や共有の停止でリモート操作はオフになります。", + "remote.password": "操作用パスワード", + "remote.apply": "適用", + "remote.enable": "有効にする", + "remote.enableRoom": "視聴者に許可", + "remote.connecting": "操作に接続中", + "remote.reason.password": "操作用パスワードが違います", + "remote.reason.retry": "少し待ってから再試行してください", + "remote.reason.busy": "別の人が操作中です。ホストに切り替えを依頼してください", + "remote.simultaneous": "同時操作を許可", + "remote.simultaneousHelp": "承認済みの視聴者が一緒に操作できます。キーボードとマウスの入力は共有されます。設定を変更すると、現在の操作権とリクエストを終了します。", + "remote.request": "操作をリクエスト", + "remote.inlineRequired": "操作するには映像をこのページに戻してください", + "remote.playbackRequired": "操作リクエストの前に映像を再生してください", + "remote.unavailable": "現在の共有では操作できません", + "remote.cancel": "リクエストをキャンセル", + "remote.stop": "操作を終了", + "remote.allow": "許可", + "remote.decline": "拒否", + "remote.surface": "リモートのキーボードとマウス入力", + "remote.controlling": "操作中", + "remote.hostFocus": "共有中のウィンドウや画面を操作可能な状態にしてください", + "remote.suspended": "共有中のウィンドウや画面が利用可能になるのを待っています", + "remote.gameMouse": "ゲーム用マウス", + "remote.gameMouseHelp": "マウスをキャプチャしてゲーム内の視点を連続で動かします。Esc で解除します。", + "remote.releaseMouse": "マウスを解放", + "remote.unlockMouse": "Esc でマウスを解放します。操作の許可は維持されます。", + "remote.lockFailed": "マウスをキャプチャできませんでした。もう一度クリックしてください。", + "remote.pending": "ホストの承認を待っています", + "remote.failed": "リモート操作を利用できません。もう一度リクエストしてください。", + "remote.inputFailed": "直前の入力を反映できませんでした。再試行してください。", + "remote.decisionFailed": "選択を反映できませんでした。再試行してください。", + "remote.macPermission": "操作を有効にできませんでした。「システム設定」→「プライバシーとセキュリティ」→「アクセシビリティ」で Piik を許可し、再試行してください。", + "remote.linuxStop": "ここで操作を終了するか、システムのインジケーターから共有を停止してください。", + "remote.linuxEnable": "有効にする際、システムのダイアログで操作する画面を選択してください。", + "remote.consent": "操作を許可すると、この視聴者がこのパソコンのマウスとキーボードを使用できます。", + "remote.waiting": "操作をリクエスト中", + "remote.shortcut": "このパソコンですぐに停止:", + "remote.hostStopKey": "ホストの停止ショートカット", + "remote.hostStopKeyHelp": "このパソコンのどのアプリからでも操作を停止できます。このサイト用に保存します。", + "remote.releaseKey": "操作終了のショートカット", + "remote.releaseKeyHelp": "このページまたは切り離したキーボードから自分の操作を終了します。このブラウザーに保存します。", + "remote.shortcutFailed": "ショートカットを使用できません。別のものを選んで再試行してください。", + "common.loading": "読み込み中", + "playback.controls": "プレーヤーの操作", + "playback.showControls": "再生コントロールを表示", + "playback.overlay": "画面上のチャット", + "playback.more": "再生設定", + "playback.pictureFit": "映像の表示方法", + "playback.viewControls": "視聴オプション", + "playback.windowControls": "プレーヤーウィンドウ", + "playback.changeFit": "映像の表示方法を切り替え", + "playback.fitCycle": "現在:{current}。{next}に切り替えます。自分の表示だけに適用します。", + "playback.rotation": "映像を回転", + "playback.rotationHint": "このデバイスで映像を時計回りに 90° 回転します。", + "playback.connection": "接続", + "playback.fit.contain": "全体を表示", + "playback.fit.cover": "枠に合わせる", + "playback.fit.fill": "引き伸ばす", + "playback.fitFull": "元の縦横比で映像全体を表示します。", + "playback.fitCrop": "プレーヤー全体に表示します。端が一部切れる場合があります。", + "playback.fitStretch": "映像を引き伸ばしてプレーヤー全体に表示します。", + "playback.route.auto": "自動", + "playback.route.p2p": "P2P のみ", + "playback.route.sfu": "SFU のみ", + "playback.routeHint.auto": "P2P を優先し、必要に応じてサーバーで中継します。", + "playback.routeHint.p2p": "他の参加者からだけ受信します。", + "playback.routeHint.sfu": "サーバーからだけ受信します。", + "playback.routeSfuOnly": "このサイトではサーバー中継が必要です。", + "playback.routePeerOnly": "ホストがサーバー中継を無効にしています。", + "playback.routeNoSfu": "このサイトではサーバー中継が有効になっていません。", + "playback.routeRejected": "この経路は利用できません。別の選択肢を選んでください。", + "playback.play": "再生", + "playback.pause": "このデバイスで一時停止", + "playback.mute": "ミュート", + "playback.unmute": "ミュート解除", + "playback.noAudio": "この共有に音声はありません", + "playback.volume": "音量を 0%〜200% で調整", + "host.shareVolume": "共有音声:0%〜200% · すべての視聴者に反映", + "voice.quality.saver": "節約", + "voice.quality.standard": "標準", + "voice.quality.clear": "クリア", + "host.shareVolume.mute": "すべての視聴者の共有音声をミュート", + "host.shareVolume.unmute": "すべての視聴者の共有音声を戻す", + "playback.volumeBasic": "音量を 0%〜100% で調整", + "playback.fullscreen": "全画面表示", + "playback.fullscreenWaiting": "映像の準備ができると全画面表示を利用できます。", + "playback.fullscreenFailed": "全画面表示を切り替えられませんでした。再試行してください。", + "playback.exitFullscreen": "全画面表示を終了", + "playback.pip": "ピクチャーインピクチャー", + "playback.exitPip": "ページに戻す", + "playback.pipUnavailable": "このブラウザーではピクチャーインピクチャーを利用できません", + "playback.pipFailed": "ピクチャーインピクチャーを切り替えられませんでした。再試行してください", + "playback.pipWaiting": "映像の準備ができるとピクチャーインピクチャーを利用できます", + "debug.start": "デバッグ", + "debug.startHint": "ページを再読み込みしてブラウザーの診断を記録", + "debug.startConfirm": "ブラウザーの診断を開始してページを再読み込みしますか?現在の共有や視聴は中断されます。", + "debug.export": "Web レポート", + "debug.exportHint": "ブラウザーの診断をダウンロードします。ネットワークアドレスやデバイス情報が含まれる場合があります", + "debug.exportFailed": "診断をダウンロードできませんでした。再試行してください", + "brand.home": "Piik ホーム", + "help.title": "ヘルプ", + "help.hint": "ヘルプ、診断、バージョン情報", + "help.troubleshooting": "トラブルシューティング", + "common.roomCode": "ルームコード", + "host.roomCodePending": "共有を開始するとルームコードが表示されます", + "host.createRoom": "ルームを作成", + "host.createRoomHint": "チャットと通話用のルームを作成します。共有は後から開始できます。", + "common.copy": "コピー", + "common.copied": "コピーしました", + "common.copyFailed": "コピーできませんでした", + "common.cancel": "キャンセル", + "common.back": "戻る", + "common.retry": "再試行", + "common.refresh": "ページを再読み込み", + "common.edit": "編集", + "common.close": "閉じる", + "notice.dismiss": "通知を閉じる", + "common.enable": "{name}を有効にする", + "common.disable": "{name}を無効にする", + "common.increase": "{name}を増やす", + "common.decrease": "{name}を減らす", + "host.join.hide": "ルームへの入り口を非表示", + "host.advanced.hide": "共有設定を非表示", + "host.password.settingsHide": "パスワード設定を非表示", + "host.sourcePicker.audioOn": "音声を共有", + "host.sourcePicker.audioOff": "音声の共有を停止", + "host.sourcePicker.audioLocked": "ソースの切り替え時に音声共有は変わりません", + "common.viewers": "視聴者", + "common.you": "自分", + "common.host": "ホスト", + "common.name.viewerDefault": "視聴者", + "common.name.hostDefault": "ホスト", + "client.launch.title": "Piik を開く", + "client.launch.version": "インストール済み:{version}", + "client.launch.localHint": "同じローカルネットワークで使用", + "client.launch.link": "公開招待", + "client.connect.action": "Piik App に接続", + "client.connect.hint": "App に接続して Piik の全機能を利用しましょう。", + "client.connect.discovering": "Piik App を探しています…", + "client.connect.wakeApp": "Piik App を開く", + "client.connect.returnToBrowser": "Piik App を開いた後、ここに戻ると接続を続けられます。", + "native.confirmInApp": "App で確認", + "host.sourcePicker.tab.picker": "システムの選択画面", + "client.connect.permissionHint": "ブラウザーに確認された場合は、このデバイスまたはローカルネットワークへのアクセスを許可して App を探してください。", + "client.connect.found": "Piik App が見つかりました。App のページを開いて続けてください。", + "client.connect.open": "App のページを開く", + "client.connect.approving": "App の承認を待っています…", + "client.connect.standby": "App の準備完了", + "client.connect.guide": "サイトに接続", + "client.connect.addSite": "サイトを開く", + "client.connect.addSiteHint": "Piik のサイトアドレスを入力し、App へのアクセスを承認してください。", + "client.connect.siteAddress": "サイトのアドレス", + "client.connect.continue": "続ける", + "client.connect.openSite": "サイトを開く", + "client.connect.approveAndOpen": "許可して開く", + "client.connect.standbyHint": "Piik サイトの右上で「App」→「App のページを開く」を選び、「アクセスを許可」で承認してください。", + "client.connect.remove": "このサイトの App へのアクセスを取り消す", + "client.connect.openOnStart": "App 起動時にこのサイトを開く", + "client.connect.openOwnedOnStart": "App 起動時に自分のサイトを開く({mode})", + "client.connect.manage": "App の準備ができました。App を管理します。", + "client.connect.update": "App {current}。{version}に更新します。", + "client.connect.approveTitle": "このサイトに Piik App の使用を許可しますか?", + "client.connect.approve": "アクセスを許可", + "client.connect.approved": "このサイトで App を使用できるようになりました", + "client.connect.return": "このページを閉じて、サイトに戻れます。", + "client.connect.close": "ページを閉じる", + "client.connect.changed": "このサイトの許可は取り消されています。起動時に開くには、アクセスを許可してください。", + "client.connect.saveFailed": "設定を保存できませんでした。再試行してください。", + "client.connect.invalid": "サイトのアドレスが無効です", + "client.connect.unavailable": "App に接続できませんでした。Piik App を起動したままにし、ブラウザーでポップアップとローカルネットワークへのアクセスを許可してください。", + "client.connect.download": "App をダウンロード", + "client.connect.browserHint": "ブラウザーでも視聴や、ブラウザーが対応するソースの共有を利用できます。", + "client.launch.lanAddress": "ローカル招待のアドレス", + "client.launch.chooseAddress": "アドレスを選択", + "client.launch.lanHint": "友だちと同じネットワークのアドレスを選択してください。", + "client.launch.localHTTPS": "ローカル招待は HTTPS を使用します。初回アクセス時にローカル証明書を確認してください。", + "client.launch.lanUnavailable": "ローカルネットワークのアドレスがありません。ネットワークに接続し、ページを再読み込みしてください。", + "client.launch.go": "Piik を開く", + "client.launch.starting": "Piik を準備中", + "client.launch.retryHint": "再試行するか、下の設定を調整してください。", + "client.launch.errorDetails": "技術的な詳細", + "client.launch.failure.tunnel-exited": "公開招待サービスに接続できませんでした。ネットワークを確認するか、既存の Piik サイトで App を使用してください。", + "client.launch.failure.tunnel-timeout": "公開招待の接続がタイムアウトしました。ネットワークを確認するか、既存の Piik サイトで App を使用してください。", + "client.launch.failure.tunnel-unavailable": "公開招待の構成要素を利用できません。Piik App が完全にインストールされているか確認してください。", + "client.launch.failure.tunnel-start": "公開招待の構成要素を起動できませんでした。技術的な詳細を確認してください。", + "client.launch.failure.tunnel-stopped": "公開招待の接続が切れました。招待を作り直して新しいリンクを送ってください。", + "client.launch.failure.local-network": "ローカルネットワークのアドレスを利用できません。ネットワークを確認し、招待アドレスを選び直してください。", + "client.launch.failure.configuration": "App の設定を適用できませんでした。技術的な詳細を確認してください。", + "client.launch.failure.native-control": "App の接続サービスを利用できません。技術的な詳細を確認してください。", + "client.launch.failure.launcher": "App のランチャーを利用できません。技術的な詳細を確認してください。", + "client.launch.failure.diagnostics": "診断ログを保存できませんでした。ログフォルダーと書き込み権限を確認してください。", + "client.launch.failure.local-server": "ローカルのルームサービスを利用できません。技術的な詳細を確認してください。", + "client.launch.debugFailed": "診断を開始できませんでした。再試行してください。", + "client.launch.loadFailed": "ランチャーの設定を読み込めませんでした。再読み込みしてください", + "client.update.available": "新しい Piik のリリースがあります", + "client.update.major": "Piik の新しいメジャーリリース", + "client.update.majorHint": "この更新には互換性のない変更が含まれます。更新前にリリースノートを確認してください。", + "client.update.downloads": "AtomGit ミラー", + "client.update.download": "{version}をダウンロード", + "client.update.differentBuild": "このビルドは公式リリースと異なります", + "client.update.official": "Piik の公式リリースがあります", + "gate.title": "サイトへのアクセス", + "gate.hint": "サイトの合言葉を入力してください", + "gate.password": "サイトの合言葉", + "gate.submit": "サイトに入る", + "gate.checking": "サイトへのアクセスを確認中", + "gate.wrong": "合言葉が違います。再試行してください", + "gate.unavailable": "現在、サイトへのアクセスを確認できません", + "gate.malformed": "ルームコードの形式が無効です", + "gate.malformedHint": "1000〜9999 の 4 桁のルームコードを入力してください", + "gate.unavailableRoute": "利用不可", + "startup.failed": "ページを読み込めませんでした", + "startup.retry": "ページを再読み込みして再試行してください。", + "join.title": "ルームに参加", + "join.hint": "{site}のルームコードを入力してください", + "join.field": "ルームコード", + "join.submit": "参加", + "join.invalid": "1000〜9999 の 4 桁のルームコードを入力してください", + "join.password": "ルームのパスワード", + "join.passwordError": "参加できませんでした。再試行してください", + "join.passwordRule": "表示可能な文字を 1〜{max} 文字入力してください", + "join.passwordAction": "ルームのパスワードを入力", + "join.full": "ルームは満員です", + "host.title": "{name}の画面", + "host.start": "共有を開始", + "host.sourcePicker.title": "共有するものを選択", + "host.sourcePicker.browserHint": "ブラウザーの共有ダイアログで、画面、ウィンドウ、タブを選択します。", + "host.sourcePicker.camera": "カメラを共有:{title}", + "host.camera.denied": "カメラへのアクセスが許可されませんでした。許可してから再試行してください。", + "host.camera.unavailable": "カメラを利用できません。接続されているか、他のアプリで使用中でないか確認してください。", + "host.microphone.settings": "マイク設定", + "host.commentary.include": "自分のマイクを含める", + "host.commentary.unavailable": "マイクのミックスを利用できません。映像とソース音声の共有は継続します。", + "host.commentary.description": "ルームの通話に参加せずに、共有映像に自分の声を加えます。", + "host.commentary.duplicate": "共有と通話の両方でマイクが有効です。片方が無音になったりエコーが聞こえたりする場合は、どちらか一方を使用してください。", + "host.commentary.failed": "共有用のマイクを開始できませんでした。権限と選択したデバイスを確認してください。", + "host.audioInput.stopped": "音声入力が停止しました。映像の共有は継続します。", + "host.device.microphone": "マイク", + "host.device.camera": "カメラ", + "host.device.default": "既定のデバイス", + "host.device.missing": "デバイスを利用できません。別のものを選択してください", + "host.device.refresh": "デバイス一覧を更新", + "host.device.listFailed": "デバイスを読み込めませんでした。一覧を更新してください。", + "host.device.permission.microphone": "マイクをオンにしてアクセスを許可すると、ここに使用可能なデバイスを表示します。", + "host.microphone.volume": "マイクの音量", + "host.microphone.voiceProcessing": "ノイズとエコーを抑える", + "host.microphone.voiceProcessingHint": "マイクのノイズとエコーを抑え、音量を自動調整します。入力側ですでに音声処理をしている場合はオフにしてください。", + "interaction.open": "交流", + "interaction.title": "交流", + "interaction.chat": "チャット", + "interaction.voice": "通話", + "voice.join": "通話に参加", + "voice.settings": "通話設定", + "voice.details.title": "ルームの通話", + "voice.details.joined": "通話に参加中", + "voice.details.unavailable": "通話の接続に問題があります", + "voice.details.partial": "一部の音声が未接続です", + "voice.details.sendTo": "{name}へ", + "voice.details.receiveFrom": "{name}から", + "voice.details.send": "ローカル送信", + "voice.details.receive": "ローカル受信", + "voice.details.via": "{name}経由", + "voice.details.forwardTo": "{source}を{name}に転送", + "stats.rttHint": "接続先のピアまたは SFU までの往復時間です。", + "stats.avgRttHint": "往復時間の平均です。ピアまたは SFU への各接続を 1 回ずつ数えます。", + "stats.totalBitrateHint": "この方向のストリームのビットレート合計です。", + "stats.avgLossHint": "各ストリームの最新のパケット損失報告の平均です。", + "stats.localCapture": "ローカルキャプチャ", + "stats.audioPresent": "あり", + "stats.audioAbsent": "なし", + "stats.droppedHint": "現在の計測区間で欠落した映像フレーム数です。", + "stats.inputFpsHint": "エンコーダーに入力されるフレームレートです。", + "stats.pictureSend": "映像送信", + "stats.pictureReceive": "映像受信", + "stats.voiceSend": "通話送信", + "stats.voiceReceive": "通話受信", + "stats.totalBitrate": "合計ビットレート", + "stats.avgLoss": "平均パケット損失", + "stats.avgRtt": "平均 RTT", + "stats.avgJitter": "平均ジッター", + "stats.resolutionRange": "解像度の範囲", + "stats.fpsRange": "フレームレートの範囲", + "voice.details.codec": "音声コーデック", + "voice.listening": "通話を聞く", + "voice.listeningVolume": "通話全体の音量", + "voice.personVolume": "個別の音量", + "voice.listenPerson": "この人の声を聞く", + "voice.listeningVolumeHint": "自分に聞こえる通話の音量を 0%〜200% で調整します。共有ソースの音声には影響しません。", + "voice.open": "ルームの通話を開く", + "voice.openHint": "ルームのメンバーが自由に参加できます。マイクはオンにするまでオフのままです。", + "voice.close": "ルームの通話を閉じる", + "voice.closeHint": "全員の通話を終了します。共有とチャットは継続します。", + "voice.closedHint": "ホストがルームの通話を開いていません。", + "voice.deafen": "聞くのを一時停止", + "voice.undeafen": "聞くのを再開", + "voice.deafenHint": "自分の通話音声の再生を一時停止します。マイクと転送は継続します。", + "voice.undeafenHint": "マイクを変更せずに通話音声の再生を再開します。", + "voice.leave": "通話から退出", + "voice.microphoneOn": "マイクをオン", + "voice.microphoneOff": "マイクをオフ", + "voice.captureCancel": "マイクのリクエストをキャンセル", + "voice.play": "通話音声を再生", + "voice.muteForMe": "自分だけミュート", + "voice.unmuteForMe": "自分のミュートを解除", + "voice.self": "自分", + "voice.participant": "参加者", + "voice.outside": "通話に未参加", + "voice.microphoneInactive": "マイクはオフ", + "voice.listeningPaused": "聞くのを一時停止中", + "voice.microphoneActive": "マイクはオン", + "voice.speaking": "発言中", + "voice.bitrate": "ルームの通話ビットレート", + "voice.bitrateHint": "ホストが全員の通話の上限を設定します。実際のビットレートは発話と回線状況に応じて変わります。{min}〜{max} kbps を入力してください。", + "voice.participants": "参加者", + "host.sourceAudio.unavailable": "ソースの音声が停止しました。映像の共有は継続します。", + "voice.unavailable": "一部の通話経路を利用できません。チャットと共有は利用できます。", + "voice.reconnecting": "ルームの通話に再接続中", + "voice.error.microphoneUnavailable": "このページではマイクを利用できません。HTTPS または localhost のアドレスを使用してください。", + "voice.error.microphoneMissing": "利用可能なマイクが見つかりませんでした。", + "voice.error.microphoneFailed": "マイクを開始できませんでした。再試行してください。", + "voice.error.transport": "通話に接続できませんでした。ルームは開いたままです。別のネットワークやブラウザーをお試しください。", + "voice.error.rejected": "通話の操作が受け入れられませんでした。通話に参加し直して再試行してください。", + "voice.error.closed": "ホストがルームの通話を開いていません。", + "interaction.settings": "チャット設定", + "interaction.settingsHint": "画面上のチャット設定は自分の映像だけに適用します。", + "interaction.overlay.scale": "文字サイズ", + "interaction.overlay.opacity": "不透明度", + "interaction.overlay.speed": "スクロール速度", + "interaction.overlay.speedHint": "新しい画面上のメッセージに適用します。すでに流れているメッセージの速度は変わりません。", + "interaction.overlay.colorBySender": "参加者の色を使用", + "interaction.export": "チャットを書き出す", + "interaction.exportLimit": "このページで受信した最新 {count} 件までのメッセージをテキストとして保存します。", + "interaction.close": "交流ウィンドウを非表示", + "interaction.focus": "交流ウィンドウを表示", + "floating.detach": "最前面のウィンドウで開く", + "floating.focus": "切り離したウィンドウを表示", + "floating.detachFailed": "別ウィンドウを開けませんでした。再試行してください。", + "floating.move": "ウィンドウを移動", + "floating.moveHint": "タイトルバーをドラッグするか、矢印キーでウィンドウを移動します。", + "floating.resize": "ウィンドウのサイズを変更", + "floating.resizeHint": "角をドラッグするか、矢印キーでサイズを変更します。", + "interaction.overlay.show": "画面上にチャットを表示", + "interaction.overlay.hide": "画面上のチャットを非表示", + "interaction.overlay.showHint": "新しいメッセージを自分の映像上に表示します。", + "interaction.overlay.hideHint": "画面上のメッセージを非表示にします。チャットウィンドウには残ります。", + "interaction.ephemeral": "メッセージはこのページに保持され、再読み込みすると消去されます。", + "interaction.empty": "くつろいで、あいさつしてみよう。", + "interaction.placeholder": "メッセージを入力…", + "interaction.send": "送信", + "interaction.reactions": "リアクション", + "interaction.express": "リアクションする", + "interaction.moreReactions": "その他のリアクション", + "interaction.toPerson": "宛先", + "interaction.withPerson": "{name}と交流", + "interaction.participant": "ルームの参加者", + "interaction.receivedReaction": "{sender}から{target}へ:{reaction}。", + "interaction.expressedReaction": "{sender}:{reaction}。", + "interaction.unread": "新しいメッセージ {count} 件", + "interaction.latest": "最新に戻る", + "interaction.reconnecting": "接続するとメッセージとリアクションを送れます", + "interaction.error.offline": "送信できませんでした。少し待ってから再試行してください。", + "interaction.error.unconfirmed": "サーバーからの確認がまだ届いていません。", + "interaction.error.rate-limited": "操作が速すぎます。少し待ってから再試行してください。", + "interaction.error.target-unavailable": "相手が退出しました。別の人を選んでください。", + "interaction.error.not-subscribed": "リアクションとチャットを利用できません。ルームに参加し直してください。", + "interaction.error.busy": "接続が混み合っています。少し待ってから再試行してください。", + "interaction.reaction.wave": "手を振る", + "interaction.reaction.heart": "大好き", + "interaction.reaction.clap": "拍手", + "interaction.reaction.laugh": "笑う", + "interaction.reaction.clown": "ピエロ", + "interaction.reaction.eyeroll": "呆れる", + "interaction.reaction.thumbsup": "いいね", + "interaction.reaction.thumbsdown": "よくないね", + "interaction.reaction.wow": "びっくり", + "interaction.reaction.party": "お祝い", + "interaction.reaction.fire": "最高", + "interaction.reaction.eyes": "見てるよ", + "interaction.reaction.star": "星を贈る", + "interaction.reaction.sleep": "眠い", + "interaction.reaction.tomato": "トマトを投げる", + "interaction.reaction.poop": "うんちを投げる", + "host.shareControls": "共有の操作", + "host.sourcePicker.tab.camera": "カメラ", + "host.sourcePicker.tab.browser": "ブラウザー", + "host.sourcePicker.tab.window": "アプリ / ウィンドウ", + "host.sourcePicker.tab.display": "画面", + "host.sourcePicker.windowAudio": "アプリの音声", + "host.sourcePicker.systemAudio": "システムの音声", + "host.sourcePicker.excludeAudio": "アプリの音声を除外", + "host.sourcePicker.refreshApplications": "アプリ一覧を更新", + "host.sourcePicker.excludeListFailed": "アプリを読み込めませんでした。一覧を更新して再試行してください。", + "host.fail.sourceAudio": "ソースの音声を更新できませんでした。再試行してください。", + "host.sourcePicker.excludeNone": "なし", + "host.sourcePicker.excludeMissing": "一覧にありません。選び直してください", + "host.sourcePicker.excludeAudioChoose": "除外するアプリのウィンドウを選択してください。見つからない場合はウィンドウを開いて一覧を更新してください。", + "host.sourcePicker.excludeAudioLifetime": "アプリが終了するとソース音声を停止します。一覧を更新し、選び直してください。", + "host.sourcePicker.excludeAudioHint": "選択したプロセスとその子プロセスを除き、すべての出力デバイスの音声を共有します。終了した場合、選び直すまでソース音声を停止します。", + "host.sourcePicker.showCaptureBorder": "キャプチャの枠を表示", + "host.sourcePicker.showCaptureBorderHint": "オフにすると Windows が許可する場合に枠を非表示にします。他のキャプチャによって表示され続ける場合があります。", + "host.sourcePicker.empty": "利用可能なソースがありません。一覧を更新してください", + "host.sourcePicker.failed": "ソースを読み込めませんでした。一覧を更新して再試行してください。", + "native.incompatible": "App とページのバージョンに互換性がありません。App を更新し、ページを再読み込みしてください。", + "native.fail.edge": "Piik App のメディア接続に失敗しました", + "native.fail.browserMedia": "ブラウザーがメディア接続を作成できませんでした。再読み込みしてください。", + "native.fail.signaling": "Piik App のシグナリングに失敗しました", + "native.fail.receiver": "Piik App のメディア受信に失敗しました", + "native.fail.controlDisconnected": "Piik App との接続が切れました。「App」ボタンから再接続してください。", + "native.fail.requestTimeout": "Piik App がタイムアウトしました。少し待ってから再試行してください。", + "native.fail.invalidResponse": "ページが Piik App の応答を読み取れませんでした。App を更新し、ページを再読み込みしてください。", + "native.fail.captureStart": "App のキャプチャに失敗しました。別のソースをお試しください。", + "native.fail.edgePrepare": "Piik App がメディア接続を準備できませんでした。診断を有効にして再試行してください。", + "shareHelp.title": "共有のトラブルシューティング", + "shareHelp.open": "状態ランプを選ぶと解決方法を表示します", + "shareHelp.source": "別の通常のウィンドウや画面をお試しください。ソースを開いたままにし、システムに求められたら画面収録を許可してください。", + "shareHelp.compare": "ブラウザーのソース選択でも比較してください。Windows では同じソースで「自動」または VP8 もお試しください。", + "shareHelp.report": "解決しない場合は診断を有効にして再試行し、その際のレポートを保存してください。エラーメッセージ、Piik のバージョン、実行していた操作を添えてください。", + "shareHelp.appDebug": "下のボタンではブラウザーの診断を記録します。App のログについてはトラブルシューティングガイドをご覧ください。", + "shareHelp.site": "サイトのアドレスとアクセス権を確認してください。自前のサイトの場合は PUBLIC_BASE_URL、ALLOWED_ORIGINS、リバースプロキシの設定を確認してください。手順はガイドをご覧ください。", + "shareHelp.appConnection": "App を起動したまま、このページ上部の「App」から接続してください。ブラウザーに求められたらローカルネットワークへのアクセスを許可してください。", + "shareHelp.mediaConnection": "ブラウザーで WebRTC とローカルネットワークへのアクセスを許可し、再読み込みして再試行してください。別のブラウザーでも比較できます。", + "shareHelp.permission": "このページに戻り、「共有」を押してソースを選び直してください。システムやブラウザーに求められたら画面収録を許可してください。", + "shareHelp.camera": "カメラの権限とデバイスの接続を確認してください。カメラを占有しているアプリを閉じ、選び直してください。", + "shareHelp.guide": "トラブルシューティングガイドを開く", + "shareHelp.copy": "エラーの詳細をコピー", + "shareHelp.copied": "コピーしました", + "shareHelp.copyFailed": "コピーできませんでした。エラーコードを手動で選択してください。", + "host.sourcePicker.window": "ウィンドウを共有:{title}", + "host.sourcePicker.display": "画面を共有:{title}", + "host.sourcePicker.system": "システムの画面・ウィンドウ選択", + "host.sourcePicker.systemAction": "システムの選択画面で画面またはウィンドウを選択", + "host.sourcePicker.audioHint": "ウィンドウではアプリの音声、画面ではシステムの音声を使用します", + "host.sourcePicker.refresh": "共有ソース一覧を更新", + "host.sourcePicker.loading": "共有ソースを探しています", + "host.join": "ルームに参加", + "host.starting": "接続中", + "host.cancelStart": "キャンセル", + "host.live": "共有中", + "host.paused": "一時停止中", + "host.ended": "共有を停止しました", + "host.roomReady": "ルームの準備完了", + "host.pause": "共有を一時停止", + "host.resume": "共有を再開", + "host.switchSource": "ソースを切り替え", + "host.switching": "選択中", + "host.stop": "共有を停止", + "host.noAudio": "ソースの音声は共有していません", + "host.localPreviewPaused": "ローカルプレビューは一時停止中です。共有は継続します", + "host.preview": "ローカルプレビュー", + "host.previewAutoPause": "プレビューを自動で一時停止", + "host.previewAutoPauseHint": "タブやウィンドウを切り替えると、共有を続けたままローカルプレビューを一時停止します。別のモニターで確認する場合はオフにしてください。", + "host.pauseNotice": "音声と映像の共有を一時停止しました", + "host.stopNotice": "共有を停止しました", + "host.roomReplaced": "ルームコードを変更しました", + "host.roomInvalid": "このルームは期限切れです。共有を開始すると新しいルームを作成します。", + "host.roomReplace": "ルームコードを変更", + "host.roomReplaceConfirm": "ルームコードを変更すると、現在の共有を終了し、視聴者の接続を切断します", + "host.terminated.stale": "ページが更新されました。再読み込みして続けてください", + "host.terminated.session": "別のページがこのセッションを引き継ぎました。そちらで続けてください", + "host.terminated.signal": "サーバー接続が終了しました。再読み込みして続けてください", + "host.notice.qualityApplied": "共有設定を適用しました", + "host.notice.qualitySet": "画質を{label}に変更しました", + "host.notice.audioSet": "音声のビットレート上限を {kbps} kbps に設定しました", + "host.notice.partialApply": "設定を更新しましたが、一部の視聴者の接続に適用できませんでした", + "host.notice.sourceSwitch.ok": "共有ソースを切り替えました", + "host.notice.sourceSwitch.partial": "ソースを切り替えましたが、{warning}", + "host.name": "表示名", + "host.nameSave": "表示名を保存", + "host.nameCancel": "編集をキャンセル", + "host.nameEdit": "表示名を編集", + "host.nameError": "名前が無効か、24 文字を超えています", + "host.nameOffline": "名前を保存しました。接続が復旧すると他の人に反映されます", + "host.invite": "招待リンク", + "host.invite.copy": "招待リンクをコピー", + "host.invite.copyFailed": "リンクをコピーできませんでした。再試行してください", + "host.invite.rotate": "招待リンクを更新します。以前のリンクを使った視聴者は再参加が必要です", + "host.invite.revoke": "招待リンクを無効にし、そのリンクで参加した視聴者の接続を切断します", + "host.invite.rotateShort": "リンクを更新", + "host.invite.revokeShort": "リンクを無効にする", + "host.invite.updated": "招待リンクを更新しました", + "host.invite.revoked": "招待リンクを無効にしました", + "host.invite.emptyOpen": "招待リンクはありません。ルームコードは引き続き使用できます", + "host.invite.address": "ルームのアドレス", + "host.invite.copyAddress": "ルームのアドレスをコピー", + "host.invite.includeCredential": "パスワードを省略", + "host.invite.credentialHint": "このリンクを持つ人は誰でもルームに参加できます", + "host.invite.credentialRequired": "このルームは招待制です。「パスワードを省略」をオンにしてください", + "host.invite.emptyPassword": "招待リンクはありません。ルームコードとパスワードで参加できます", + "host.invite.emptyPrivate": "招待リンクはありません。招待前にリンクを更新してください", + "host.policy": "入室方法", + "host.policy.open": "公開", + "host.policy.private": "非公開", + "host.policy.currentOpen": "ルームコードで入室", + "host.policy.currentPassword": "ルームコードとパスワード", + "host.policy.currentInvite": "招待のみ", + "host.policy.openHint": "ルームコードを知っていれば誰でも参加できます", + "host.policy.privateHint": "招待リンクで参加できます。ルームのパスワードを設定すると、コードでも参加できます", + "host.policy.privatePasswordHint": "招待リンク、またはルームコードとパスワードで参加できます", + "host.policy.setOpen": "ルームを公開しました", + "host.policy.setPrivateInvite": "ルームを非公開にしました。招待リンクでのみ参加できます", + "host.policy.setPrivatePassword": "ルームを非公開にしました。招待リンクまたはパスワードで参加できます", + "host.password.set": "ルームのパスワード設定済み", + "host.password.unset": "ルームのパスワードなし", + "host.password.placeholder": "設定するとコードで入室できます", + "host.password.setAction": "ルームのパスワードを設定", + "host.password.changeAction": "ルームのパスワードを変更", + "host.password.remove": "ルームのパスワードを削除", + "host.password.show": "ルームのパスワードを表示", + "host.password.hide": "ルームのパスワードを非表示", + "host.password.saved": "ルームのパスワードを設定しました", + "host.password.updated": "ルームのパスワードを更新しました", + "host.password.removed": "パスワードを削除しました。招待リンクでのみ参加できます", + "host.password.rule": "表示可能な文字を 1〜{max} 文字", + "host.accessFailed": "現在ルーム設定を更新できません。後でもう一度お試しください", + "host.viewers.empty": "視聴者はまだいません", + "host.viewerOverview": "すべての視聴者の接続", + "host.quality": "映像プリセット", + "host.quality.light": "軽量", + "host.quality.hd": "HD", + "host.quality.highFps": "高フレームレート", + "host.quality.720p30": "720p 30 fps", + "host.quality.1080p30": "1080p 30 fps", + "host.quality.1080p60": "1080p 60 fps", + "host.advanced": "共有設定", + "host.settings.button": "共有設定", + "host.settings.picture": "映像", + "host.settings.pictureDetails": "映像の詳細設定", + "host.settings.pictureLimits": "現在の映像上限", + "host.settings.sound": "音声", + "host.settings.connection": "接続設定", + "host.advanced.resolution": "解像度の上限", + "host.advanced.framerate": "フレームレートの上限", + "host.advanced.bitrate": "ビットレートの上限", + "host.advanced.preference": "映像の優先項目", + "host.advanced.preference.resolution": "鮮明さ", + "host.advanced.preference.balanced": "バランス", + "host.advanced.preference.framerate": "なめらかさ", + "host.advanced.preference.resolutionHint": "細部を維持", + "host.advanced.preference.balancedHint": "自動で調整", + "host.advanced.preference.framerateHint": "フレームレートを優先", + "host.advanced.audio": "音質", + "host.advanced.audioBitrate": "音声ビットレートの上限", + "host.video.width": "幅の上限(ピクセル)", + "host.video.height": "高さの上限(ピクセル)", + "host.video.commonRange": "一般的な範囲", + "host.video.custom": "カスタム", + "host.video.returnCommon": "一般的な範囲を使用", + "host.video.returnCommonHint": "最も近い一般的な値 {value} {unit} を使用します。", + "host.video.inputHint": "ドラッグで一般的な値を選ぶか、{min}〜{max} {unit} を直接入力してください。", + "host.video.resolutionHint": "幅 ≤ {width} px、高さ ≤ {height} px、総画素数 ≤ {pixels}。ソースの縦横比を維持し、サイズに応じてフレームレートの上限が変わります。", + "host.video.resolutionPreset": "最大 {width} × {height} ピクセル", + "host.video.resolution1440p": "最大 {width} × {height} ピクセル(QHD、通称 2K)", + "host.video.resolution2160p": "最大 {width} × {height} ピクセル(4K)", + "host.video.resolutionInvalid": "縦横を 4〜{width} × {height} の偶数にし、総画素数を {pixels} 以内にしてください。", + "host.quality.invalidNumber": "{min}〜{max} {unit} を {step} 刻みで指定してください。", + "host.audio.bitrateHint": "音声ビットレートの上限:{min}〜{max} kbps。", + "host.advanced.audio.saver": "標準", + "host.advanced.audio.music": "音楽", + "host.advanced.audio.veryHigh": "スタジオ", + "host.advanced.route": "経路の方針", + "host.advanced.route.sfuOnly": "サーバー経由", + "host.advanced.route.sfuOnlyHint": "このサイトでは共有するすべての映像と音声をメディアサーバー経由で送信します", + "host.advanced.route.topo": "接続構成を自動調整", + "host.advanced.route.topoHint": "配信中に少しずつ安定した経路を選びます", + "host.advanced.route.peerOnly": "プライバシーモード", + "host.advanced.route.peerOnlyHint": "ピアツーピア(P2P)接続だけで共有します。接続できない場合、視聴者は視聴できません", + "host.advanced.route.peerOnlyRequired": "このサービスはピアツーピア(P2P)のメディア接続だけに対応しているため、プライバシーモードは常にオンです", + "host.advanced.codec": "映像コーデック", + "host.advanced.codec.auto": "自動", + "host.advanced.codec.autoHint": "自動で選択", + "host.advanced.codec.vp8Hint": "互換性を優先", + "host.details": "接続の詳細", + "host.details.show": "接続の詳細を表示", + "host.details.hide": "接続の詳細を非表示", + "host.topology": "接続構成", + "host.topology.show": "接続構成を表示", + "host.topology.hide": "接続構成を非表示", + "host.topology.pending": "接続中", + "state.signal.connected": "サーバーに接続済み", + "state.signal.connecting": "接続中", + "state.signal.reconnecting": "復旧中", + "state.signal.offline": "サーバーに未接続", + "state.peer.connected": "接続済み", + "state.peer.connecting": "接続中", + "state.peer.routing": "経路を設定中", + "state.peer.waiting": "共有を待っています", + "state.peer.reconnecting": "復旧中", + "state.peer.disconnected": "接続が切れました", + "state.route.p2p": "P2P 直接接続", + "state.route.sfu": "サーバー経由", + "stats.title": "接続データ", + "stats.sharedMedia": "共有映像と音声", + "stats.relay": "中継データ", + "stats.downstream": "下流の受信データ", + "stats.more": "詳細な指標", + "stats.group.network": "ネットワーク", + "stats.group.encoding": "エンコード", + "stats.group.capture": "エンコードとキャプチャ", + "stats.group.playback": "再生", + "stats.group.sourceAudio": "ソースの音声", + "stats.less": "詳細な指標を非表示", + "stats.resolution": "解像度", + "stats.fps": "フレームレート", + "stats.bitrate": "ビットレート", + "stats.loss": "パケット損失", + "stats.rtt": "RTT", + "stats.codec": "映像コーデック", + "stats.jitter": "ジッター", + "stats.dropped": "欠落フレーム", + "stats.encoder": "エンコーダー", + "stats.audio": "音声ビットレート", + "stats.unknown": "不明", + "stats.outgoing": "利用可能な上り帯域", + "stats.qualityState": "画質の状態", + "stats.quality.normal": "通常", + "stats.quality.bandwidth": "帯域による制限", + "stats.quality.cpu": "エンコーダーによる制限", + "stats.quality.other": "その他の制限", + "stats.quality.unclassified": "未分類の制限", + "stats.capture": "キャプチャ設定", + "stats.inputFps": "入力フレームレート", + "stats.encodeMs": "1 フレームのエンコード時間", + "stats.decodeMs": "1 フレームのデコード時間", + "state.peer.stuttering": "最近、再生が途切れました", + "stats.freezeCount": "映像の停止回数", + "stats.freezeDuration": "映像の停止時間", + "stats.audioLoss": "音声パケット損失", + "stats.audioJitter": "音声ジッター", + "stats.playoutDelta": "映像と音声の再生時間差", + "stats.videoBuffer": "映像バッファー", + "stats.audioBuffer": "音声バッファー", + "stats.audioConcealedRate": "音声補間率", + "stats.audioConcealed": "音声補間数", + "viewer.title": "{name}の画面", + "viewer.titleFallback": "友だちの画面", + "viewer.title.watching": "視聴中", + "viewer.title.waiting": "待機中", + "viewer.reconnect": "再接続", + "viewer.theater": "シアターモード", + "viewer.theater.exit": "シアターモードを終了", + "viewer.msg.joining": "ルームに参加中", + "viewer.msg.waitingHost": "ホストの共有を待っています", + "viewer.msg.preparingP2p": "P2P 接続を確立中", + "viewer.msg.connectionRetry": "再試行中({current}/{total})", + "viewer.msg.preparingSfu": "サーバー中継に接続中", + "viewer.msg.allocating": "経路を割り当て中", + "viewer.msg.receiving": "映像を受信中", + "viewer.msg.playing": "再生中", + "viewer.msg.needsPlay": "タップして再生", + "viewer.msg.hostPaused": "ホストが一時停止しました", + "viewer.msg.recovering": "接続を復旧中", + "viewer.msg.routeFailed": "利用可能なメディア経路がありません。再読み込みして再試行してください", + "viewer.msg.videoRejected": "このブラウザーは映像を受信できません。別のブラウザーをお試しください", + "viewer.msg.playbackFailed": "この配信を再生できません。再読み込みして再試行してください", + "viewer.msg.hostOffline": "ホストとの接続が切れました", + "viewer.msg.serverError": "接続サービスを利用できません", + "viewer.msg.notFound": "ルームが見つかりません", + "viewer.msg.denied": "現在、このルームにコードでは参加できません", + "viewer.msg.invalidInvite": "招待リンクは無効になりました", + "viewer.msg.closed": "ルームを閉じました", + "viewer.msg.full": "ルームは満員です", + "viewer.msg.accessFailed": "ルームに参加できません", + "viewer.hint.accessFailed": "このページを再読み込みするか、ホストからの招待リンクを使用してください。", + "viewer.hint.full": "空きができたら再試行してください。", + "viewer.msg.stale": "ページが更新されました。再読み込みして続けてください", + "viewer.msg.sessionReplaced": "別のページがこのセッションを引き継ぎました", + "viewer.msg.signalTerminated": "接続が終了しました。再読み込みして続けてください", + "viewer.notice.signalRecovering": "サーバーに再接続中", + "viewer.notice.hostOffline": "ホストとの接続が切れました。映像が止まる場合があります", + "viewer.hint.denied": "ホストの招待リンクを使用するか、ルームのパスワードをお試しください。", + "viewer.hint.notFound": "ルームコードが {site} のものか確認するか、ホストの招待リンクを開いてください。", + "viewer.hint.closed": "ホストに新しいルームの作成と招待を依頼してください。", + "viewer.hint.sessionReplaced": "別のページで続けるか、このページを再読み込みして再接続してください。", + "viewer.hint.invite": "ホストに新しい招待リンクを依頼してください。", + "viewer.hint.generic": "少し待ってからこのページを再読み込みしてください。", + "mode.language": "表示言語", + "header.more": "その他のオプション", + "theme.dark": "ダークモードに切り替え", + "theme.light": "ライトモードに切り替え", + "theme.dark.short": "ダーク", + "theme.light.short": "ライト", + "gate.connectFailed": "サイトに接続できません。接続を確認して再試行してください", + "gate.expired": "サイトへのアクセスが期限切れです。もう一度認証してください", + "gate.serviceUnavailable": "サイトのサービスを利用できません({status})。後でもう一度お試しください", + "api.originNotAllowed": "サーバーがこのアドレスを許可していません(403)。サイト管理者に連絡してください。", + "host.notStarted": "未開始", + "host.startCancelled": "開始をキャンセルしました", + "host.switchingSource": "ソースを切り替え中", + "host.stageAria": "共有またはルームに参加", + "host.captureAria": "実際のキャプチャ設定値", + "host.quality.title": "{label} · {mbps} Mbps", + "host.audio.title": "{label} · 上限 {kbps} kbps", + "host.roomClosed": "ルームを閉じました", + "host.pause.noTracksResume": "共有を再開できません。ソースを選び直してください", + "host.pause.signalRecovering": "サーバーに再接続中です。共有は一時停止のままです", + "host.pause.noTracksPause": "共有を一時停止できません。ソースを選び直してください", + "host.pause.stillPaused": "共有は一時停止のままです", + "host.shareEnded": "現在の共有は終了しました", + "host.fail.start": "共有を開始できませんでした", + "host.err.createConnection": "接続を作成できませんでした", + "host.err.codecUnsupported": "映像コーデックに対応していません。更新するか別のブラウザーをお試しください", + "host.fail.source": "共有ソースを切り替えられませんでした", + "host.fail.quality": "画質設定を適用できませんでした", + "host.fail.connection": "視聴者の接続処理に失敗しました", + "host.fail.room": "ルームの操作に失敗しました", + "host.err.invalidToken": "共有の認証情報が無効になりました。ルームを作成し直してください", + "host.err.accessDenied": "許可されていません", + "host.err.alreadyConnected": "このルームは別のページですでに共有中です", + "host.err.peerGone": "視聴者の接続が退出しました", + "host.err.forbidden": "操作を利用できません", + "host.err.serverError": "サービスを一時的に利用できません。後でもう一度お試しください", + "host.err.createRoomStatus": "現在ルームを作成できません({status})", + "host.err.roomCapacity": "すべてのルームコードが使用中です。後で再試行するか、別の Piik サイトを使用してください。", + "host.err.replaceRoomStatus": "現在ルームを変更できません({status})", + "host.err.updateRoomStatus": "現在ルーム設定を更新できません({status})", + "host.capture.cancelled": "画面の選択がキャンセルされたか、許可されませんでした", + "host.capture.noSource": "共有できる画面ソースがありません", + "host.capture.readFailed": "選択したソースを読み取れません。選び直してください", + "host.capture.unavailable": "このページでは画面共有を開始できません", + "host.capture.inactive": "このページに戻り、「共有」を押してソースを選び直してください。", + "host.capture.constraints": "選択したソースは現在の映像設定に対応できません。設定を下げるか、別のソースを選んでください。", + "host.notice.reconnecting": "一部の視聴者が再接続中です", + "host.notice.sfuRecovering": "サーバー転送のソース切り替えに失敗しました。視聴者の接続を復旧しています", + "host.password.inputPlaceholder": "パスワードを入力", + "stats.warn.codec": "映像コーデックは {codec} です。H264 または VP8 を想定しています", + "stats.warn.audioCodec": "音声コーデックは {codec} です。Opus を想定しています", + "viewer.msg.joinUnavailable": "現在ルームに参加できません", + "viewer.stageAria": "共有映像", + "host.warn.audioUnread": "ブラウザーが音声ビットレートの上限を報告しませんでした", + "host.warn.audioRewritten": "ブラウザーが音声ビットレートの上限を {kbps} kbps に変更しました", + "host.warn.senderPartial": "ブラウザーが {params} を完全には受け入れませんでした", + "host.warn.param.maxBitrate": "ビットレートの上限", + "host.warn.param.maxFramerate": "フレームレートの上限", + "host.warn.param.scaleResolutionDownBy": "解像度の縮小率", + "host.warn.param.degradationPreference": "画質の優先項目", + "host.warn.param.scalabilityMode": "スケーラビリティモード", + "host.warn.sfuRecover": "サーバー転送:{params}に失敗しました。自動復旧を開始しました", + "host.warn.sfuStage.connect": "接続", + "host.warn.sfuStage.source": "ソース", + "host.warn.sfuStage.videoPublish": "映像の配信", + "host.warn.sfuStage.senderConfig": "送信設定", + "host.warn.sfuStage.audioPublish": "音声の配信", + "host.warn.sfuStage.transport": "トランスポート", + "host.fail.sfuSwitch": "サーバー転送のソースを切り替えられませんでした", + "host.fail.sfuAudioParams": "サーバー転送の音声パラメーターを適用できませんでした", + "host.fail.sfuParams": "サーバー転送の送信パラメーターを適用できませんでした", + "client.connect.replace": "{site}を置き換え、その App セッションを切断します。", + "voice.offline": "未接続", + "interaction.effects": "リアクションの効果を表示", + "host.capture.fpsUnknown": "フレームレート不明", + "host.capture.codecPending": "コーデック未確定", + "host.capture.hasAudio": "ソース音声あり", + "host.capture.noAudio": "ソース音声なし" +}; diff --git a/src/client/locales/ko.ts b/src/client/locales/ko.ts new file mode 100644 index 000000000..72a69a39c --- /dev/null +++ b/src/client/locales/ko.ts @@ -0,0 +1,839 @@ +import type { CopyKey } from "./zh"; + +// Partial translations reused only where both canonical English and Chinese match. +export const ko: Partial> = { + "state.peer.present": "방에 있음", + "state.peer.voiceConnected": "음성 연결됨", + "host.topology.idle": "방에 있어요. 활성 미디어 경로는 없어요.", + "remote.textShared": "제어자가 한 명일 때 텍스트를 보낼 수 있어요.", + "remote.participant.control": "원격 제어 참여 중", + "remote.gamepadHelp": "처음 연결한 표준 컨트롤러를 호스트의 별도 컨트롤러로 사용해요. 이 페이지의 포커스를 유지하세요.", + "remote.gamepadHostHelp": "각 플레이어가 자신의 컨트롤러를 사용할 수 있어요.", + "remote.gamepadSetup": "게임패드 설정", + "remote.reason.gamepad": "가상 게임패드를 사용할 수 없어요. 호스트의 게임패드 설정과 남은 컨트롤러 슬롯을 확인하세요.", + "remote.keyboard": "원격 키보드", + "remote.inputTools": "입력 도구", + "remote.keyboardRequiresControl": "원격 키보드를 사용하려면 제어권을 받으세요", + "remote.mouse": "마우스", + "remote.mouseLeft": "마우스 왼쪽 버튼", + "remote.mouseRight": "마우스 오른쪽 버튼", + "remote.mouseWheel": "스크롤 휠 및 가운데 버튼", + "remote.mouseExpand": "가상 마우스 펼치기", + "remote.mouseCollapse": "마우스 최소화", + "remote.mouseReposition": "드래그하여 위치를 바꾸고 가장자리에 놓아 숨기세요", + "remote.mouseMove": "드래그하여 포인터 이동", + "remote.mouseScroll": "탭하면 가운데 클릭, 쓸어 넘기면 스크롤, 길게 누르면 드래그", + "remote.touchMode": "기본 터치 모드", + "remote.touchMode.direct": "직접 터치", + "remote.touchMode.trackpad": "트랙패드", + "remote.touchMode.directHint": "화면의 원하는 위치를 직접 탭하세요.", + "remote.touchMode.trackpadHint": "쓸어 넘겨 포인터를 움직이고 탭하여 클릭하세요.", + "remote.keyPages": "키보드 영역", + "remote.keys.letters": "문자 키", + "remote.keys.symbols": "숫자 및 기호", + "remote.keys.functions": "기능 키", + "remote.keys.text": "텍스트", + "remote.keyboardHelp": "길게 누르면 키가 눌린 상태로 유지되고 손을 떼면 해제돼요.", + "remote.combinationHelp": "Ctrl, Shift, Alt 중 하나를 선택한 뒤 다른 키를 선택하세요. 함께 해제돼요.", + "remote.combinationMode": "키 조합 모드", + "remote.key.ShiftLeft": "Shift", + "remote.key.Windows": "Windows 키", + "remote.key.Command": "Command 키", + "remote.key.Super": "Super 키", + "remote.key.Space": "스페이스", + "remote.key.Insert": "Insert", + "remote.key.Delete": "Delete", + "remote.key.Home": "Home", + "remote.key.End": "End", + "remote.key.PageUp": "Page Up", + "remote.key.PageDown": "Page Down", + "remote.key.CapsLock": "Caps Lock 전환", + "remote.key.PrintScreen": "Print Screen", + "remote.key.ScrollLock": "Scroll Lock", + "remote.key.NumLock": "Num Lock", + "remote.text": "텍스트, 명령어 또는 코드를 입력하거나 붙여 넣으세요", + "remote.sendText": "원격으로 입력", + "remote.typeText": "원격으로 입력", + "remote.textHelp": "Enter를 누르면 줄을 바꿔요. 버튼을 누르면 원격 커서 위치에 입력해요.", + "remote.textTooLong": "각각 2KB 이하로 나누어 보내세요.", + "remote.touchHelp": "두 손가락으로 탭하면 오른쪽 클릭, 오므리거나 벌리면 확대·축소해요. 두 손가락으로 쓸어 넘기면 스크롤하고, 확대 중이거나 가상 마우스가 펼쳐져 있으면 화면을 이동해요.", + "remote.resetZoom": "화면 확대 초기화", + "remote.key.Escape": "Escape", + "remote.key.Tab": "Tab", + "remote.key.ArrowLeft": "왼쪽 화살표", + "remote.key.ArrowUp": "위쪽 화살표", + "remote.key.ArrowDown": "아래쪽 화살표", + "remote.key.ArrowRight": "오른쪽 화살표", + "remote.key.Backspace": "Backspace", + "remote.key.Enter": "Enter", + "remote.key.ControlA": "원격 컴퓨터에서 모두 선택", + "remote.key.ControlC": "원격 컴퓨터에서 복사", + "remote.key.ControlV": "원격 컴퓨터에서 붙여넣기", + "remote.key.MetaLeft": "원격 컴퓨터에서 시작 메뉴 열기", + "remote.key.InputLanguage": "원격 입력 언어 전환", + "remote.key.SwitchWindow": "원격 창 전환", + "remote.key.SwitchApp": "원격 앱 전환", + "remote.title": "원격 제어", + "remote.requests": "제어 요청", + "remote.authorization": "제어 권한", + "remote.mode.ask": "매번 확인", + "remote.mode.room": "방 시청자", + "remote.mode.password": "비밀번호", + "remote.help.ask": "제어 요청마다 허용 여부를 결정해요.", + "remote.help.room": "방 시청자가 개별 승인 없이 제어권을 받을 수 있어요.", + "remote.help.password": "시청자가 제어 비밀번호를 입력하면 이 컴퓨터를 제어할 수 있어요.", + "remote.policyLifetime": "현재 공유 소스에만 적용돼요. 소스를 바꾸거나 공유를 중지하면 원격 제어가 꺼져요.", + "remote.password": "제어 비밀번호", + "remote.apply": "적용", + "remote.enable": "사용", + "remote.enableRoom": "시청자 허용", + "remote.connecting": "제어 연결 중", + "remote.reason.password": "제어 비밀번호가 올바르지 않아요", + "remote.reason.retry": "잠시 후 다시 시도하세요", + "remote.reason.busy": "다른 사람이 제어 중이에요. 호스트에게 제어권 전환을 요청하세요", + "remote.simultaneous": "동시 제어 허용", + "remote.simultaneousHelp": "승인된 시청자가 함께 제어할 수 있어요. 키보드와 마우스 입력을 공유해요. 이 설정을 바꾸면 현재 제어 권한과 요청이 종료돼요.", + "remote.request": "제어 요청", + "remote.inlineRequired": "제어하려면 영상을 이 페이지로 되돌리세요", + "remote.playbackRequired": "제어를 요청하려면 먼저 영상을 재생하세요", + "remote.unavailable": "현재 공유에서는 제어할 수 없어요", + "remote.cancel": "요청 취소", + "remote.stop": "제어 종료", + "remote.allow": "허용", + "remote.decline": "거절", + "remote.surface": "원격 키보드 및 마우스 입력", + "remote.controlling": "제어 중", + "remote.hostFocus": "제어할 공유 창이나 화면을 사용할 수 있게 유지하세요", + "remote.suspended": "공유 창이나 화면을 사용할 수 있을 때까지 기다리는 중", + "remote.gameMouse": "게임 마우스", + "remote.gameMouseHelp": "마우스를 고정하여 게임 카메라를 연속으로 움직여요. Esc를 누르면 해제돼요.", + "remote.releaseMouse": "마우스 고정 해제", + "remote.unlockMouse": "Esc를 누르면 마우스 고정이 해제돼요. 제어 권한은 유지돼요.", + "remote.lockFailed": "마우스를 고정하지 못했어요. 다시 클릭하세요.", + "remote.pending": "호스트의 승인 기다리는 중", + "remote.failed": "원격 제어를 사용할 수 없어요. 다시 요청하세요.", + "remote.inputFailed": "마지막 입력을 적용하지 못했어요. 다시 시도하세요.", + "remote.decisionFailed": "선택을 적용하지 못했어요. 다시 시도하세요.", + "remote.macPermission": "제어를 켜지 못했어요. 시스템 설정 → 개인정보 보호 및 보안 → 손쉬운 사용에서 Piik을 허용한 뒤 다시 시도하세요.", + "remote.linuxStop": "여기서 제어를 끝내거나 시스템 표시에서 공유를 중지하세요.", + "remote.linuxEnable": "제어를 켤 때 시스템 대화상자에서 제어할 화면을 선택하세요.", + "remote.consent": "제어를 허용하면 이 시청자가 이 컴퓨터의 마우스와 키보드를 사용할 수 있어요.", + "remote.waiting": "제어 요청 중", + "remote.shortcut": "이 컴퓨터에서 즉시 중지:", + "remote.hostStopKey": "호스트 중지 단축키", + "remote.hostStopKeyHelp": "이 컴퓨터의 어떤 앱에서든 제어를 중지해요. 이 사이트에 저장돼요.", + "remote.releaseKey": "제어 종료 단축키", + "remote.releaseKeyHelp": "이 페이지나 분리된 키보드에서 내 제어를 종료해요. 이 브라우저에 저장돼요.", + "remote.shortcutFailed": "사용할 수 없는 단축키예요. 다른 단축키를 선택하고 다시 시도하세요.", + "common.loading": "불러오는 중", + "playback.controls": "플레이어 제어", + "playback.showControls": "재생 컨트롤 표시", + "playback.overlay": "화면 위 채팅", + "playback.more": "재생 설정", + "playback.pictureFit": "화면 맞춤", + "playback.viewControls": "보기 옵션", + "playback.windowControls": "플레이어 창", + "playback.changeFit": "화면 맞춤 전환", + "playback.fitCycle": "현재: {current}. {next}(으)로 전환해요. 내 화면에만 적용돼요.", + "playback.rotation": "화면 회전", + "playback.rotationHint": "이 기기에서 화면을 시계 방향으로 90° 회전해요.", + "playback.connection": "연결", + "playback.fit.contain": "맞추기", + "playback.fit.cover": "채우기", + "playback.fit.fill": "늘리기", + "playback.fitFull": "원래 비율을 유지하며 화면 전체를 표시해요.", + "playback.fitCrop": "플레이어를 가득 채워요. 가장자리가 일부 잘릴 수 있어요.", + "playback.fitStretch": "화면을 늘려 플레이어를 가득 채워요.", + "playback.route.auto": "자동", + "playback.route.p2p": "P2P만", + "playback.route.sfu": "SFU만", + "playback.routeHint.auto": "P2P를 우선 사용하고 필요하면 서버로 중계해요.", + "playback.routeHint.p2p": "다른 참여자에게서만 받아요.", + "playback.routeHint.sfu": "서버에서만 받아요.", + "playback.routeSfuOnly": "이 사이트는 서버 중계가 필요해요.", + "playback.routePeerOnly": "호스트가 서버 중계를 껐어요.", + "playback.routeNoSfu": "이 사이트에서는 서버 중계를 사용하지 않아요.", + "playback.routeRejected": "사용할 수 없는 경로예요. 다른 옵션을 선택하세요.", + "playback.play": "재생", + "playback.pause": "이 기기에서 일시 정지", + "playback.mute": "음소거", + "playback.unmute": "음소거 해제", + "playback.noAudio": "이 공유에는 소리가 없어요", + "playback.volume": "볼륨 조절: 0%~200%", + "host.shareVolume": "공유 소리: 0%~200% · 모든 시청자에게 적용", + "voice.quality.saver": "절약", + "voice.quality.standard": "표준", + "voice.quality.clear": "선명", + "host.shareVolume.mute": "모든 시청자의 공유 소리 끄기", + "host.shareVolume.unmute": "모든 시청자의 공유 소리 켜기", + "playback.volumeBasic": "볼륨 조절: 0%~100%", + "playback.fullscreen": "전체 화면", + "playback.fullscreenWaiting": "영상이 준비되면 전체 화면을 사용할 수 있어요.", + "playback.fullscreenFailed": "전체 화면을 전환하지 못했어요. 다시 시도하세요.", + "playback.exitFullscreen": "전체 화면 종료", + "playback.pip": "화면 속 화면", + "playback.exitPip": "페이지로 돌아가기", + "playback.pipUnavailable": "이 브라우저에서는 화면 속 화면을 사용할 수 없어요", + "playback.pipFailed": "화면 속 화면을 전환하지 못했어요. 다시 시도하세요", + "playback.pipWaiting": "영상이 준비되면 화면 속 화면을 사용할 수 있어요", + "debug.start": "디버그", + "debug.startHint": "브라우저 진단을 기록하고 이 페이지 새로고침", + "debug.startConfirm": "브라우저 진단을 시작하고 이 페이지를 새로고침할까요? 진행 중인 공유나 시청이 중단돼요.", + "debug.export": "웹 보고서", + "debug.exportHint": "브라우저 진단 다운로드. 네트워크 주소와 기기 정보가 포함될 수 있어요", + "debug.exportFailed": "진단을 다운로드하지 못했어요. 다시 시도하세요", + "brand.home": "Piik 홈", + "help.title": "도움말", + "help.hint": "도움말, 진단 및 버전 정보", + "help.troubleshooting": "문제 해결", + "common.roomCode": "방 코드", + "host.roomCodePending": "공유를 시작하면 방 코드가 표시돼요", + "host.createRoom": "방 만들기", + "host.createRoomHint": "채팅과 음성을 위한 방을 만드세요. 공유는 나중에 시작해도 돼요.", + "common.copy": "복사", + "common.copied": "복사됨", + "common.copyFailed": "복사 실패", + "common.cancel": "취소", + "common.back": "뒤로", + "common.retry": "다시 시도", + "common.refresh": "페이지 새로고침", + "common.edit": "편집", + "common.close": "닫기", + "notice.dismiss": "알림 닫기", + "common.enable": "{name} 켜기", + "common.disable": "{name} 끄기", + "common.increase": "{name} 늘리기", + "common.decrease": "{name} 줄이기", + "host.join.hide": "방 입장 영역 숨기기", + "host.advanced.hide": "공유 설정 숨기기", + "host.password.settingsHide": "비밀번호 설정 숨기기", + "host.sourcePicker.audioOn": "소리 공유", + "host.sourcePicker.audioOff": "소리 공유 중지", + "host.sourcePicker.audioLocked": "소스를 바꿔도 소리 공유 설정은 유지돼요", + "common.viewers": "시청자", + "common.you": "나", + "common.host": "호스트", + "common.name.viewerDefault": "시청자", + "common.name.hostDefault": "호스트", + "client.launch.title": "Piik 열기", + "client.launch.version": "설치된 버전 {version}", + "client.launch.localHint": "같은 로컬 네트워크에서 사용", + "client.launch.link": "공개 초대", + "client.connect.action": "Piik App 연결", + "client.connect.hint": "App을 연결하면 Piik의 모든 기능을 사용할 수 있어요.", + "client.connect.discovering": "Piik App 찾는 중…", + "client.connect.wakeApp": "Piik App 열기", + "client.connect.returnToBrowser": "Piik App을 연 뒤 여기로 돌아와 연결을 계속하세요.", + "native.confirmInApp": "App에서 확인", + "host.sourcePicker.tab.picker": "시스템 선택기", + "client.connect.permissionHint": "브라우저에서 물으면 App을 찾을 수 있도록 이 기기나 로컬 네트워크 접근을 허용하세요.", + "client.connect.found": "Piik App을 찾았어요. App 페이지를 열어 계속하세요.", + "client.connect.open": "App 페이지 열기", + "client.connect.approving": "App 승인 기다리는 중…", + "client.connect.standby": "App 준비 완료", + "client.connect.guide": "사이트 연결", + "client.connect.addSite": "사이트 열기", + "client.connect.addSiteHint": "Piik 사이트 주소를 입력한 뒤 App 접근을 허용하세요.", + "client.connect.siteAddress": "사이트 주소", + "client.connect.continue": "계속", + "client.connect.openSite": "사이트 열기", + "client.connect.approveAndOpen": "허용하고 열기", + "client.connect.standbyHint": "Piik 사이트 오른쪽 위의 App을 누르고 App 페이지 열기를 선택한 뒤 접근 허용을 확인하세요.", + "client.connect.remove": "이 사이트의 App 접근 취소", + "client.connect.openOnStart": "App 시작 시 이 사이트 열기", + "client.connect.openOwnedOnStart": "App 시작 시 내 사이트 열기 ({mode})", + "client.connect.manage": "App이 준비됐어요. App 관리.", + "client.connect.update": "App {current}. {version}(으)로 업데이트하세요.", + "client.connect.approveTitle": "이 사이트가 Piik App을 사용하도록 허용할까요?", + "client.connect.approve": "접근 허용", + "client.connect.approved": "이제 이 사이트에서 App을 사용할 수 있어요", + "client.connect.return": "이 페이지를 닫고 사이트로 돌아가도 돼요.", + "client.connect.close": "페이지 닫기", + "client.connect.changed": "이 사이트는 더 이상 승인된 상태가 아니에요. 시작 사이트로 선택하려면 먼저 접근을 허용하세요.", + "client.connect.saveFailed": "설정을 저장하지 못했어요. 다시 시도해 주세요.", + "client.connect.invalid": "유효하지 않은 사이트 주소", + "client.connect.unavailable": "App에 연결하지 못했어요. Piik App을 실행한 상태로 유지하고 브라우저에서 팝업과 로컬 네트워크 접근을 허용하세요.", + "client.connect.download": "App 다운로드", + "client.connect.browserHint": "브라우저가 지원하는 소스로 공유하거나 시청할 수 있어요.", + "client.launch.lanAddress": "로컬 초대 주소", + "client.launch.chooseAddress": "주소 선택", + "client.launch.lanHint": "친구와 같은 네트워크의 주소를 선택하세요.", + "client.launch.localHTTPS": "로컬 초대는 HTTPS를 사용해요. 처음 방문할 때 로컬 인증서를 확인하세요.", + "client.launch.lanUnavailable": "로컬 네트워크 주소가 없어요. 네트워크에 연결하고 이 페이지를 새로고침하세요.", + "client.launch.go": "Piik 열기", + "client.launch.starting": "Piik 준비 중", + "client.launch.retryHint": "다시 시도하거나 아래 설정을 조정하세요.", + "client.launch.errorDetails": "기술 정보", + "client.launch.failure.tunnel-exited": "공개 초대 서비스에 연결하지 못했어요. 네트워크를 확인하거나 기존 Piik 사이트와 함께 App을 사용하세요.", + "client.launch.failure.tunnel-timeout": "공개 초대 연결 시간이 초과됐어요. 네트워크를 확인하거나 기존 Piik 사이트와 함께 App을 사용하세요.", + "client.launch.failure.tunnel-unavailable": "공개 초대 구성 요소를 사용할 수 없어요. Piik App이 완전히 설치됐는지 확인하세요.", + "client.launch.failure.tunnel-start": "공개 초대 구성 요소를 시작하지 못했어요. 기술 정보를 확인하세요.", + "client.launch.failure.tunnel-stopped": "공개 초대 연결이 끊겼어요. 새 초대 링크를 만들어 보내세요.", + "client.launch.failure.local-network": "로컬 네트워크 주소를 사용할 수 없어요. 네트워크를 확인하고 초대 주소를 다시 선택하세요.", + "client.launch.failure.configuration": "App 설정을 적용하지 못했어요. 기술 정보를 확인하세요.", + "client.launch.failure.native-control": "App 연결 서비스를 사용할 수 없어요. 기술 정보를 확인하세요.", + "client.launch.failure.launcher": "App 시작 프로그램을 사용할 수 없어요. 기술 정보를 확인하세요.", + "client.launch.failure.diagnostics": "진단 로그를 저장하지 못했어요. 로그 폴더와 쓰기 권한을 확인하세요.", + "client.launch.failure.local-server": "로컬 방 서비스를 사용할 수 없어요. 기술 정보를 확인하세요.", + "client.launch.debugFailed": "진단을 시작하지 못했어요. 다시 시도해 주세요.", + "client.launch.loadFailed": "시작 설정을 읽지 못했어요. 새로고침하여 다시 시도하세요", + "client.update.available": "새 Piik 버전이 있어요", + "client.update.major": "Piik 새 주요 버전", + "client.update.majorHint": "이 업데이트에는 호환되지 않는 변경 사항이 있어요. 업그레이드 전에 릴리스 노트를 읽어 보세요.", + "client.update.downloads": "AtomGit 미러", + "client.update.download": "{version} 다운로드", + "client.update.differentBuild": "공식 릴리스와 다른 빌드예요", + "client.update.official": "Piik 공식 릴리스가 있어요", + "gate.title": "사이트 접근", + "gate.hint": "사이트 암호를 입력하세요", + "gate.password": "사이트 암호", + "gate.submit": "사이트 입장", + "gate.checking": "사이트 접근 확인 중", + "gate.wrong": "암호가 올바르지 않아요. 다시 시도하세요", + "gate.unavailable": "지금은 사이트 접근을 확인할 수 없어요", + "gate.malformed": "방 코드 형식이 올바르지 않아요", + "gate.malformedHint": "1000~9999 사이의 네 자리 방 코드를 입력하세요", + "gate.unavailableRoute": "사용 불가", + "startup.failed": "페이지를 불러오지 못했어요", + "startup.retry": "페이지를 새로고침하여 다시 시도하세요.", + "join.title": "방 참여", + "join.hint": "{site}의 방 코드를 입력하세요", + "join.field": "방 코드", + "join.submit": "참여", + "join.invalid": "1000~9999 사이의 네 자리 방 코드를 입력하세요", + "join.password": "방 비밀번호", + "join.passwordError": "참여하지 못했어요. 다시 시도하세요", + "join.passwordRule": "눈에 보이는 문자 1~{max}자를 입력하세요", + "join.passwordAction": "방 비밀번호 입력", + "join.full": "방이 가득 찼어요", + "host.title": "{name}의 화면", + "host.start": "공유 시작", + "host.sourcePicker.title": "공유할 항목 선택", + "host.sourcePicker.browserHint": "브라우저의 공유 대화상자에서 화면, 창 또는 탭을 선택하세요.", + "host.sourcePicker.camera": "카메라 공유: {title}", + "host.camera.denied": "카메라 접근이 허용되지 않았어요. 접근을 허용한 뒤 다시 시도하세요.", + "host.camera.unavailable": "카메라를 사용할 수 없어요. 연결되어 있는지, 다른 앱이 사용 중인지 확인하세요.", + "host.microphone.settings": "마이크 설정", + "host.commentary.include": "내 마이크 포함", + "host.commentary.unavailable": "마이크 믹싱을 사용할 수 없어요. 화면과 소스 소리는 계속 공유돼요.", + "host.commentary.description": "방 음성에 참여하지 않고 공유 화면에 내 목소리를 더해요.", + "host.commentary.duplicate": "공유 마이크와 음성 마이크가 모두 켜져 있어요. 소리가 안 들리거나 울리면 하나만 사용하세요.", + "host.commentary.failed": "공유 마이크를 시작하지 못했어요. 권한과 선택한 기기를 확인하세요.", + "host.audioInput.stopped": "오디오 입력이 중지됐어요. 화면 공유는 계속돼요.", + "host.device.microphone": "마이크", + "host.device.camera": "카메라", + "host.device.default": "기본 기기", + "host.device.missing": "기기를 사용할 수 없어요. 다른 기기를 선택하세요", + "host.device.refresh": "기기 새로고침", + "host.device.listFailed": "기기를 불러오지 못했어요. 새로고침해 보세요.", + "host.device.permission.microphone": "마이크를 켜고 접근을 허용하면 사용할 수 있는 기기가 여기에 표시돼요.", + "host.microphone.volume": "마이크 볼륨", + "host.microphone.voiceProcessing": "소음 및 에코 감소", + "host.microphone.voiceProcessingHint": "마이크 소음과 에코를 줄이고 볼륨을 자동으로 조절해요. 입력 장치에서 이미 음성을 처리한다면 이 옵션을 끄세요.", + "interaction.open": "소통", + "interaction.title": "소통", + "interaction.chat": "채팅", + "interaction.voice": "음성", + "voice.join": "음성 참여", + "voice.settings": "음성 설정", + "voice.details.title": "방 음성", + "voice.details.joined": "음성 참여 중", + "voice.details.unavailable": "음성 연결 문제", + "voice.details.partial": "일부 음성이 연결되지 않음", + "voice.details.sendTo": "{name}에게", + "voice.details.receiveFrom": "{name}에게서", + "voice.details.send": "로컬 송신", + "voice.details.receive": "로컬 수신", + "voice.details.via": "{name} 경유", + "voice.details.forwardTo": "{source} → {name} 전달", + "stats.rttHint": "연결된 피어 또는 SFU까지의 왕복 시간이에요.", + "stats.avgRttHint": "평균 왕복 시간이에요. 각 피어 또는 SFU 연결을 한 번씩 계산해요.", + "stats.totalBitrateHint": "이 방향의 스트림 비트레이트 합계예요.", + "stats.avgLossHint": "이 스트림들의 최신 패킷 손실 보고서 평균이에요.", + "stats.localCapture": "로컬 캡처", + "stats.audioPresent": "있음", + "stats.audioAbsent": "없음", + "stats.droppedHint": "현재 측정 구간에 누락된 영상 프레임 수예요.", + "stats.inputFpsHint": "인코더에 도달하는 프레임 레이트예요.", + "stats.pictureSend": "화면 송신", + "stats.pictureReceive": "화면 수신", + "stats.voiceSend": "음성 송신", + "stats.voiceReceive": "음성 수신", + "stats.totalBitrate": "총 비트레이트", + "stats.avgLoss": "평균 패킷 손실", + "stats.avgRtt": "평균 RTT", + "stats.avgJitter": "평균 지터", + "stats.resolutionRange": "해상도 범위", + "stats.fpsRange": "프레임 레이트 범위", + "voice.details.codec": "오디오 코덱", + "voice.listening": "음성 듣기", + "voice.listeningVolume": "전체 음성 볼륨", + "voice.personVolume": "개별 볼륨", + "voice.listenPerson": "이 사용자의 음성 듣기", + "voice.listeningVolumeHint": "내 방 음성 볼륨을 0%~200%로 조절해요. 공유 소스 소리는 영향을 받지 않아요.", + "voice.open": "방 음성 열기", + "voice.openHint": "방 참여자는 자유롭게 참여할 수 있어요. 마이크는 직접 켜기 전까지 꺼져 있어요.", + "voice.close": "방 음성 닫기", + "voice.closeHint": "모두의 음성을 종료해요. 공유와 채팅은 계속돼요.", + "voice.closedHint": "호스트가 아직 방 음성을 열지 않았어요.", + "voice.deafen": "듣기 일시 중지", + "voice.undeafen": "듣기 재개", + "voice.deafenHint": "내 방 음성 재생을 일시 중지해요. 마이크와 전달은 계속돼요.", + "voice.undeafenHint": "마이크 설정을 바꾸지 않고 방 음성 재생을 재개해요.", + "voice.leave": "음성 나가기", + "voice.microphoneOn": "마이크 켜기", + "voice.microphoneOff": "마이크 끄기", + "voice.captureCancel": "마이크 요청 취소", + "voice.play": "음성 재생", + "voice.muteForMe": "나에게만 음소거", + "voice.unmuteForMe": "나에게만 음소거 해제", + "voice.self": "나", + "voice.participant": "참여자", + "voice.outside": "음성 미참여", + "voice.microphoneInactive": "마이크 꺼짐", + "voice.listeningPaused": "듣기 일시 중지됨", + "voice.microphoneActive": "마이크 켜짐", + "voice.speaking": "말하는 중", + "voice.bitrate": "방 음성 비트레이트", + "voice.bitrateHint": "호스트가 모두의 음성 한도를 설정해요. 실제 비트레이트는 말소리와 네트워크 상태에 따라 조정돼요. {min}~{max}kbps를 입력하세요.", + "voice.participants": "참여자", + "host.sourceAudio.unavailable": "소스 소리가 중지됐어요. 화면 공유는 계속돼요.", + "voice.unavailable": "일부 음성 경로를 사용할 수 없어요. 채팅과 공유는 계속 사용할 수 있어요.", + "voice.reconnecting": "방 음성 재연결 중", + "voice.error.microphoneUnavailable": "이 페이지에서는 마이크를 사용할 수 없어요. HTTPS 또는 localhost 주소를 사용하세요.", + "voice.error.microphoneMissing": "사용 가능한 마이크를 찾지 못했어요.", + "voice.error.microphoneFailed": "마이크를 시작하지 못했어요. 다시 시도하세요.", + "voice.error.transport": "음성을 연결하지 못했어요. 방은 계속 열려 있어요. 다른 네트워크나 브라우저를 사용해 보세요.", + "voice.error.rejected": "음성 작업이 승인되지 않았어요. 음성에 다시 참여한 뒤 시도하세요.", + "voice.error.closed": "호스트가 아직 방 음성을 열지 않았어요.", + "interaction.settings": "채팅 설정", + "interaction.settingsHint": "화면 위 채팅 설정은 내 화면에만 적용돼요.", + "interaction.overlay.scale": "글자 크기", + "interaction.overlay.opacity": "불투명도", + "interaction.overlay.speed": "흐르는 속도", + "interaction.overlay.speedHint": "새 화면 위 메시지에 적용돼요. 이미 움직이는 메시지는 기존 속도를 유지해요.", + "interaction.overlay.colorBySender": "참여자 색상 사용", + "interaction.export": "채팅 내보내기", + "interaction.exportLimit": "이 페이지에서 받은 최신 메시지를 최대 {count}개까지 텍스트로 저장해요.", + "interaction.close": "소통 창 숨기기", + "interaction.focus": "소통 창 표시", + "floating.detach": "항상 위에 표시되는 창으로 열기", + "floating.focus": "분리된 창 표시", + "floating.detachFailed": "분리된 창을 열지 못했어요. 다시 시도하세요.", + "floating.move": "창 이동", + "floating.moveHint": "제목 표시줄을 드래그하거나 방향키로 창을 이동하세요.", + "floating.resize": "창 크기 조절", + "floating.resizeHint": "모서리를 드래그하거나 방향키로 크기를 조절하세요.", + "interaction.overlay.show": "화면 위 채팅 표시", + "interaction.overlay.hide": "화면 위 채팅 숨기기", + "interaction.overlay.showHint": "새 메시지를 내 화면 위에만 표시해요.", + "interaction.overlay.hideHint": "화면 위 메시지를 숨겨요. 메시지는 채팅 창에 그대로 있어요.", + "interaction.ephemeral": "메시지는 이 페이지에 보관되며 새로고침하면 지워져요.", + "interaction.empty": "편하게 앉아서 인사를 건네 보세요.", + "interaction.placeholder": "이야기를 나눠 보세요…", + "interaction.send": "보내기", + "interaction.reactions": "반응", + "interaction.express": "반응하기", + "interaction.moreReactions": "반응 더 보기", + "interaction.toPerson": "받는 사람", + "interaction.withPerson": "{name}와 소통", + "interaction.participant": "방 참여자", + "interaction.receivedReaction": "{sender} → {target}: {reaction}.", + "interaction.expressedReaction": "{sender}: {reaction}.", + "interaction.unread": "새 메시지 {count}개", + "interaction.latest": "최신 메시지로", + "interaction.reconnecting": "메시지와 반응을 보내려면 연결하세요", + "interaction.error.offline": "보내지 못했어요. 잠시 후 다시 시도하세요.", + "interaction.error.unconfirmed": "아직 서버에서 확인을 받지 못했어요.", + "interaction.error.rate-limited": "너무 빨라요. 잠시 후 다시 시도하세요.", + "interaction.error.target-unavailable": "방금 나간 사용자예요. 다른 사람을 선택하세요.", + "interaction.error.not-subscribed": "반응과 채팅을 사용할 수 없어요. 방에 다시 참여하세요.", + "interaction.error.busy": "연결이 혼잡해요. 잠시 후 다시 시도하세요.", + "interaction.reaction.wave": "손 흔들기", + "interaction.reaction.heart": "좋아요", + "interaction.reaction.clap": "박수", + "interaction.reaction.laugh": "웃음", + "interaction.reaction.clown": "광대", + "interaction.reaction.eyeroll": "눈 굴리기", + "interaction.reaction.thumbsup": "엄지 올리기", + "interaction.reaction.thumbsdown": "엄지 내리기", + "interaction.reaction.wow": "놀라움", + "interaction.reaction.party": "축하", + "interaction.reaction.fire": "최고야", + "interaction.reaction.eyes": "시청 중", + "interaction.reaction.star": "금별", + "interaction.reaction.sleep": "졸려요", + "interaction.reaction.tomato": "토마토 던지기", + "interaction.reaction.poop": "똥 던지기", + "host.shareControls": "공유 제어", + "host.sourcePicker.tab.camera": "카메라", + "host.sourcePicker.tab.browser": "브라우저", + "host.sourcePicker.tab.window": "앱 / 창", + "host.sourcePicker.tab.display": "화면", + "host.sourcePicker.windowAudio": "앱 소리", + "host.sourcePicker.systemAudio": "시스템 소리", + "host.sourcePicker.excludeAudio": "앱 소리 제외", + "host.sourcePicker.refreshApplications": "앱 목록 새로고침", + "host.sourcePicker.excludeListFailed": "앱을 불러오지 못했어요. 새로고침하여 다시 시도하세요.", + "host.fail.sourceAudio": "소스 소리를 업데이트하지 못했어요. 다시 시도해 주세요.", + "host.sourcePicker.excludeNone": "없음", + "host.sourcePicker.excludeMissing": "목록에 없어요. 다시 선택하세요", + "host.sourcePicker.excludeAudioChoose": "제외할 앱 창을 선택하세요. 보이지 않으면 해당 창을 열고 새로고침하세요.", + "host.sourcePicker.excludeAudioLifetime": "앱이 종료되면 소스 소리가 중지돼요. 새로고침하고 다시 선택하세요.", + "host.sourcePicker.excludeAudioHint": "선택한 프로세스와 하위 프로세스를 제외한 모든 출력 장치의 소리를 공유해요. 프로세스가 종료되면 다시 선택할 때까지 소스 소리가 중지돼요.", + "host.sourcePicker.showCaptureBorder": "캡처 테두리 표시", + "host.sourcePicker.showCaptureBorderHint": "Windows에서 허용하는 경우 끄면 테두리가 숨겨져요. 다른 캡처에서는 계속 표시될 수 있어요.", + "host.sourcePicker.empty": "사용 가능한 소스가 없어요. 목록을 새로고침하세요", + "host.sourcePicker.failed": "소스를 불러오지 못했어요. 새로고침하여 다시 시도하세요.", + "native.incompatible": "App과 페이지 버전이 호환되지 않아요. App을 업데이트하고 새로고침하세요.", + "native.fail.edge": "Piik App 미디어 연결 실패", + "native.fail.browserMedia": "브라우저가 미디어 연결을 만들지 못했어요. 새로고침하여 다시 시도하세요.", + "native.fail.signaling": "Piik App 시그널링 실패", + "native.fail.receiver": "Piik App 미디어 수신 실패", + "native.fail.controlDisconnected": "Piik App 연결이 끊겼어요. App 버튼으로 재연결하세요.", + "native.fail.requestTimeout": "Piik App 연결 시간이 초과됐어요. 잠시 후 다시 시도하세요.", + "native.fail.invalidResponse": "페이지에서 Piik App의 응답을 읽지 못했어요. App을 업데이트하고 페이지를 새로고침하세요.", + "native.fail.captureStart": "App 캡처에 실패했어요. 다른 소스를 선택하세요.", + "native.fail.edgePrepare": "Piik App이 미디어 연결을 준비하지 못했어요. 진단을 켜고 다시 시도하세요.", + "shareHelp.title": "공유 문제 해결", + "shareHelp.open": "문제 해결 도움말을 보려면 상태 표시등을 선택하세요", + "shareHelp.source": "다른 일반 창이나 화면을 선택해 보세요. 소스를 열어 둔 채 시스템이 요청하면 화면 기록을 허용하세요.", + "shareHelp.compare": "브라우저 소스 선택기와 비교해 보세요. Windows에서는 같은 소스로 자동 또는 VP8도 사용해 보세요.", + "shareHelp.report": "계속 실패하면 진단을 켜고 다시 시도한 뒤 해당 시도의 보고서를 저장하세요. 오류 메시지, Piik 버전, 당시 수행한 작업을 함께 알려 주세요.", + "shareHelp.appDebug": "아래 버튼은 브라우저 진단을 기록해요. App 로그는 문제 해결 가이드를 참고하세요.", + "shareHelp.site": "사이트 주소와 접근 권한을 확인하세요. 직접 호스팅한 사이트라면 PUBLIC_BASE_URL, ALLOWED_ORIGINS, 리버스 프록시 설정을 확인하세요. 자세한 절차는 가이드를 참고하세요.", + "shareHelp.appConnection": "App을 실행한 상태에서 이 페이지 상단의 App을 눌러 연결하세요. 브라우저에서 요청하면 로컬 네트워크 접근을 허용하세요.", + "shareHelp.mediaConnection": "브라우저가 WebRTC와 로컬 네트워크 접근을 허용하는지 확인한 뒤 새로고침하고 다시 시도하세요. 다른 브라우저와 비교해 볼 수도 있어요.", + "shareHelp.permission": "이 페이지로 돌아와 공유를 누르고 소스를 다시 선택하세요. 시스템이나 브라우저가 요청하면 화면 기록을 허용하세요.", + "shareHelp.camera": "카메라 권한과 기기 연결을 확인하세요. 카메라를 독점 사용 중인 앱을 닫고 다시 선택하세요.", + "shareHelp.guide": "문제 해결 가이드 열기", + "shareHelp.copy": "오류 정보 복사", + "shareHelp.copied": "복사됨", + "shareHelp.copyFailed": "복사하지 못했어요. 오류 코드를 직접 선택하세요.", + "host.sourcePicker.window": "창 공유: {title}", + "host.sourcePicker.display": "화면 공유: {title}", + "host.sourcePicker.system": "시스템 화면 또는 창 선택기", + "host.sourcePicker.systemAction": "시스템 선택기에서 화면이나 창을 선택하세요", + "host.sourcePicker.audioHint": "창은 앱 소리, 화면은 시스템 소리", + "host.sourcePicker.refresh": "공유 소스 새로고침", + "host.sourcePicker.loading": "공유 소스 찾는 중", + "host.join": "방 참여", + "host.starting": "연결 중", + "host.cancelStart": "취소", + "host.live": "공유 중", + "host.paused": "일시 중지됨", + "host.ended": "공유 중지됨", + "host.roomReady": "방 준비 완료", + "host.pause": "공유 일시 중지", + "host.resume": "공유 재개", + "host.switchSource": "소스 전환", + "host.switching": "선택 중", + "host.stop": "공유 중지", + "host.noAudio": "소스 소리를 공유하지 않고 있어요", + "host.localPreviewPaused": "로컬 미리보기 일시 중지됨. 공유는 계속돼요", + "host.preview": "로컬 미리보기", + "host.previewAutoPause": "미리보기 자동 일시 중지", + "host.previewAutoPauseHint": "탭이나 창을 바꾸면 로컬 미리보기를 일시 중지해요. 공유는 계속돼요. 다른 모니터에서 보려면 이 옵션을 끄세요.", + "host.pauseNotice": "영상 및 소리 공유 일시 중지됨", + "host.stopNotice": "공유 중지됨", + "host.roomReplaced": "방 코드 변경됨", + "host.roomInvalid": "만료된 방이에요. 공유를 시작하면 새 방을 만들어요.", + "host.roomReplace": "방 코드 변경", + "host.roomReplaceConfirm": "방 코드를 변경하면 현재 공유가 종료되고 시청자의 연결이 끊겨요", + "host.terminated.stale": "페이지가 업데이트됐어요. 새로고침하여 계속하세요", + "host.terminated.session": "다른 페이지에서 이 세션을 이어받았어요. 해당 페이지에서 계속하세요", + "host.terminated.signal": "서버 연결이 종료됐어요. 새로고침하여 계속하세요", + "host.notice.qualityApplied": "공유 설정 적용됨", + "host.notice.qualitySet": "화질이 {label}(으)로 변경됐어요", + "host.notice.audioSet": "오디오 비트레이트 한도가 {kbps}kbps로 설정됐어요", + "host.notice.partialApply": "설정을 업데이트했지만 일부 시청자 연결에는 적용하지 못했어요", + "host.notice.sourceSwitch.ok": "공유 소스 전환됨", + "host.notice.sourceSwitch.partial": "소스는 전환됐지만 {warning}", + "host.name": "표시 이름", + "host.nameSave": "표시 이름 저장", + "host.nameCancel": "편집 취소", + "host.nameEdit": "표시 이름 편집", + "host.nameError": "이름이 올바르지 않거나 24자를 넘었어요", + "host.nameOffline": "이름을 저장했어요. 연결이 복구되면 다른 사람에게 표시돼요", + "host.invite": "초대 링크", + "host.invite.copy": "초대 링크 복사", + "host.invite.copyFailed": "링크를 복사하지 못했어요. 다시 시도하세요", + "host.invite.rotate": "초대 링크를 재발급해요. 이전 링크를 사용하는 시청자는 다시 참여해야 해요", + "host.invite.revoke": "초대 링크를 폐기하고 해당 링크로 참여한 시청자의 연결을 끊어요", + "host.invite.rotateShort": "링크 재발급", + "host.invite.revokeShort": "링크 폐기", + "host.invite.updated": "초대 링크 재발급됨", + "host.invite.revoked": "초대 링크 폐기됨", + "host.invite.emptyOpen": "초대 링크가 없어요. 방 코드는 계속 사용할 수 있어요", + "host.invite.address": "방 주소", + "host.invite.copyAddress": "방 주소 복사", + "host.invite.includeCredential": "비밀번호 생략", + "host.invite.credentialHint": "링크가 있는 사람은 누구나 방에 참여할 수 있어요", + "host.invite.credentialRequired": "초대 전용 방이에요. 비밀번호 생략을 켜세요", + "host.invite.emptyPassword": "초대 링크가 없어요. 방 코드와 비밀번호로 참여할 수 있어요", + "host.invite.emptyPrivate": "초대 링크가 없어요. 초대하기 전에 새 링크를 발급하세요", + "host.policy": "입장 방식", + "host.policy.open": "열기", + "host.policy.private": "비공개", + "host.policy.currentOpen": "방 코드로 입장", + "host.policy.currentPassword": "방 코드 + 비밀번호", + "host.policy.currentInvite": "초대 전용", + "host.policy.openHint": "방 코드가 있는 사람은 누구나 참여할 수 있어요", + "host.policy.privateHint": "초대 링크로 참여하거나, 방 비밀번호를 설정하면 코드로도 입장할 수 있어요", + "host.policy.privatePasswordHint": "초대 링크 또는 방 코드와 비밀번호로 참여해요", + "host.policy.setOpen": "방이 공개 상태로 변경됐어요", + "host.policy.setPrivateInvite": "방이 비공개로 변경됐어요. 초대 링크로만 참여할 수 있어요", + "host.policy.setPrivatePassword": "방이 비공개로 변경됐어요. 초대 링크나 비밀번호로 참여할 수 있어요", + "host.password.set": "방 비밀번호 설정됨", + "host.password.unset": "방 비밀번호 없음", + "host.password.placeholder": "설정하면 코드로 입장할 수 있어요", + "host.password.setAction": "방 비밀번호 설정", + "host.password.changeAction": "방 비밀번호 변경", + "host.password.remove": "방 비밀번호 삭제", + "host.password.show": "방 비밀번호 표시", + "host.password.hide": "방 비밀번호 숨기기", + "host.password.saved": "방 비밀번호 설정됨", + "host.password.updated": "방 비밀번호 변경됨", + "host.password.removed": "비밀번호가 삭제됐어요. 초대 링크로만 참여할 수 있어요", + "host.password.rule": "눈에 보이는 문자 1~{max}자", + "host.accessFailed": "지금은 방 설정을 바꿀 수 없어요. 나중에 다시 시도하세요", + "host.viewers.empty": "아직 시청자가 없어요", + "host.viewerOverview": "모든 시청자 연결", + "host.quality": "영상 프리셋", + "host.quality.light": "가볍게", + "host.quality.hd": "HD", + "host.quality.highFps": "높은 FPS", + "host.quality.720p30": "720p 30 fps", + "host.quality.1080p30": "1080p 30 fps", + "host.quality.1080p60": "1080p 60 fps", + "host.advanced": "공유 설정", + "host.settings.button": "공유 설정", + "host.settings.picture": "화면", + "host.settings.pictureDetails": "화면 세부 조정", + "host.settings.pictureLimits": "현재 화면 한도", + "host.settings.sound": "소리", + "host.settings.connection": "연결 설정", + "host.advanced.resolution": "해상도 한도", + "host.advanced.framerate": "FPS 한도", + "host.advanced.bitrate": "비트레이트 한도", + "host.advanced.preference": "화면 우선순위", + "host.advanced.preference.resolution": "선명도", + "host.advanced.preference.balanced": "균형", + "host.advanced.preference.framerate": "부드러움", + "host.advanced.preference.resolutionHint": "세부 묘사 유지", + "host.advanced.preference.balancedHint": "자동 균형 조정", + "host.advanced.preference.framerateHint": "프레임 레이트 우선", + "host.advanced.audio": "오디오 품질", + "host.advanced.audioBitrate": "오디오 비트레이트 한도", + "host.video.width": "너비 한도 (픽셀)", + "host.video.height": "높이 한도 (픽셀)", + "host.video.commonRange": "일반 범위", + "host.video.custom": "직접 설정", + "host.video.returnCommon": "일반 범위 사용", + "host.video.returnCommonHint": "가장 가까운 일반 값 사용: {value} {unit}.", + "host.video.inputHint": "드래그하여 일반 값을 선택하거나 {min}~{max} {unit} 범위에서 직접 입력하세요.", + "host.video.resolutionHint": "너비 ≤ {width}px, 높이 ≤ {height}px, 총 {pixels}픽셀 이하예요. 소스 비율은 유지되며 FPS 한도는 크기에 따라 달라져요.", + "host.video.resolutionPreset": "최대 {width} × {height}픽셀", + "host.video.resolution1440p": "최대 {width} × {height}픽셀 (QHD, 흔히 2K라고 해요)", + "host.video.resolution2160p": "최대 {width} × {height}픽셀 (4K)", + "host.video.resolutionInvalid": "가로·세로를 4부터 {width} × {height}까지 짝수로 지정하세요. 총 {pixels}픽셀 이하여야 해요.", + "host.quality.invalidNumber": "{min}~{max} {unit} 범위에서 {step} 단위로 입력하세요.", + "host.audio.bitrateHint": "오디오 비트레이트 한도: {min}~{max}kbps.", + "host.advanced.audio.saver": "표준", + "host.advanced.audio.music": "음악", + "host.advanced.audio.veryHigh": "스튜디오", + "host.advanced.route": "경로 정책", + "host.advanced.route.sfuOnly": "서버 미디어", + "host.advanced.route.sfuOnlyHint": "이 사이트는 모든 공유 영상과 소리를 미디어 서버를 통해 전송해요", + "host.advanced.route.topo": "자동 연결 경로 조정", + "host.advanced.route.topoHint": "실시간으로 더 나은 경로를 점진적으로 선택해요", + "host.advanced.route.peerOnly": "개인정보 보호 모드", + "host.advanced.route.peerOnlyHint": "피어 간 직접 연결(P2P)로만 공유해요. 연결에 실패하면 시청자가 볼 수 없어요", + "host.advanced.route.peerOnlyRequired": "이 서비스는 피어 간 직접 연결(P2P) 미디어만 지원하므로 개인정보 보호 모드가 항상 켜져 있어요", + "host.advanced.codec": "영상 코덱", + "host.advanced.codec.auto": "자동", + "host.advanced.codec.autoHint": "자동 선택", + "host.advanced.codec.vp8Hint": "호환성 우선", + "host.details": "연결 정보", + "host.details.show": "연결 정보 표시", + "host.details.hide": "연결 정보 숨기기", + "host.topology": "연결 구조", + "host.topology.show": "연결 구조 표시", + "host.topology.hide": "연결 구조 숨기기", + "host.topology.pending": "연결 중", + "state.signal.connected": "서버 연결됨", + "state.signal.connecting": "연결 중", + "state.signal.reconnecting": "복구 중", + "state.signal.offline": "서버에 연결되지 않음", + "state.peer.connected": "연결됨", + "state.peer.connecting": "연결 중", + "state.peer.routing": "경로 설정 중", + "state.peer.waiting": "공유 기다리는 중", + "state.peer.reconnecting": "복구 중", + "state.peer.disconnected": "연결 끊김", + "state.route.p2p": "P2P 직접 연결", + "state.route.sfu": "서버 경유", + "stats.title": "연결 데이터", + "stats.sharedMedia": "공유 화면 및 소리", + "stats.relay": "중계 데이터", + "stats.downstream": "하위 수신 데이터", + "stats.more": "상세 지표", + "stats.group.network": "네트워크", + "stats.group.encoding": "인코딩", + "stats.group.capture": "인코딩 및 캡처", + "stats.group.playback": "재생", + "stats.group.sourceAudio": "소스 소리", + "stats.less": "상세 지표 숨기기", + "stats.resolution": "해상도", + "stats.fps": "프레임 레이트", + "stats.bitrate": "비트레이트", + "stats.loss": "패킷 손실", + "stats.rtt": "RTT", + "stats.codec": "영상 코덱", + "stats.jitter": "지터", + "stats.dropped": "누락 프레임", + "stats.encoder": "인코더", + "stats.audio": "오디오 비트레이트", + "stats.unknown": "알 수 없음", + "stats.outgoing": "사용 가능한 업링크", + "stats.qualityState": "품질 상태", + "stats.quality.normal": "정상", + "stats.quality.bandwidth": "대역폭 제한", + "stats.quality.cpu": "인코더 제한", + "stats.quality.other": "기타 제한", + "stats.quality.unclassified": "분류되지 않은 제한", + "stats.capture": "캡처 설정", + "stats.inputFps": "입력 프레임 레이트", + "stats.encodeMs": "프레임당 인코딩 시간", + "stats.decodeMs": "프레임당 디코딩 시간", + "state.peer.stuttering": "최근 재생 끊김", + "stats.freezeCount": "화면 멈춤 횟수", + "stats.freezeDuration": "화면 멈춤 시간", + "stats.audioLoss": "오디오 패킷 손실", + "stats.audioJitter": "오디오 지터", + "stats.playoutDelta": "영상·음성 재생 시간 차이", + "stats.videoBuffer": "영상 버퍼", + "stats.audioBuffer": "오디오 버퍼", + "stats.audioConcealedRate": "오디오 손실 보정 비율", + "stats.audioConcealed": "오디오 손실 보정 횟수", + "viewer.title": "{name}의 화면", + "viewer.titleFallback": "친구의 화면", + "viewer.title.watching": "시청 중", + "viewer.title.waiting": "대기 중", + "viewer.reconnect": "재연결", + "viewer.theater": "극장 모드", + "viewer.theater.exit": "극장 모드 종료", + "viewer.msg.joining": "방 참여 중", + "viewer.msg.waitingHost": "호스트의 공유 기다리는 중", + "viewer.msg.preparingP2p": "P2P 연결 중", + "viewer.msg.connectionRetry": "다시 시도 중 ({current}/{total})", + "viewer.msg.preparingSfu": "서버 중계 연결 중", + "viewer.msg.allocating": "경로 할당 중", + "viewer.msg.receiving": "영상 수신 중", + "viewer.msg.playing": "재생 중", + "viewer.msg.needsPlay": "탭하여 재생", + "viewer.msg.hostPaused": "호스트가 일시 중지함", + "viewer.msg.recovering": "연결 복구 중", + "viewer.msg.routeFailed": "사용 가능한 미디어 경로가 없어요. 새로고침하여 다시 시도하세요", + "viewer.msg.videoRejected": "이 브라우저에서는 영상을 받을 수 없어요. 다른 브라우저를 사용해 보세요", + "viewer.msg.playbackFailed": "이 스트림을 재생할 수 없어요. 새로고침하여 다시 시도하세요", + "viewer.msg.hostOffline": "호스트 연결 끊김", + "viewer.msg.serverError": "연결 서비스 사용 불가", + "viewer.msg.notFound": "방을 찾지 못했어요", + "viewer.msg.denied": "지금은 방 코드로 참여할 수 없어요", + "viewer.msg.invalidInvite": "더 이상 유효하지 않은 초대 링크예요", + "viewer.msg.closed": "방이 닫혔어요", + "viewer.msg.full": "방이 가득 찼어요", + "viewer.msg.accessFailed": "방에 참여할 수 없어요", + "viewer.hint.accessFailed": "이 페이지를 새로고침하여 다시 시도하거나 호스트의 초대 링크를 사용하세요.", + "viewer.hint.full": "빈자리가 생기면 다시 시도하세요.", + "viewer.msg.stale": "페이지가 업데이트됐어요. 새로고침하여 계속하세요", + "viewer.msg.sessionReplaced": "다른 페이지에서 이 세션을 이어받았어요", + "viewer.msg.signalTerminated": "연결이 종료됐어요. 새로고침하여 계속하세요", + "viewer.notice.signalRecovering": "서버 재연결 중", + "viewer.notice.hostOffline": "호스트 연결이 끊겨 화면이 멈출 수 있어요", + "viewer.hint.denied": "호스트의 초대 링크를 사용하거나 방 비밀번호를 입력해 보세요.", + "viewer.hint.notFound": "방 코드가 {site}의 코드인지 확인하거나 호스트의 초대 링크를 여세요.", + "viewer.hint.closed": "호스트에게 새 방을 만들고 초대 링크를 보내 달라고 요청하세요.", + "viewer.hint.sessionReplaced": "다른 페이지에서 계속하거나 여기서 새로고침하여 재연결하세요.", + "viewer.hint.invite": "호스트에게 새 초대 링크를 요청하세요.", + "viewer.hint.generic": "잠시 후 이 페이지를 새로고침하여 다시 시도하세요.", + "mode.language": "인터페이스 언어", + "header.more": "더 보기", + "theme.dark": "다크 모드로 전환", + "theme.light": "라이트 모드로 전환", + "theme.dark.short": "다크", + "theme.light.short": "가볍게", + "gate.connectFailed": "사이트에 연결할 수 없어요. 연결을 확인하고 다시 시도하세요", + "gate.expired": "사이트 접근이 만료됐어요. 다시 인증하세요", + "gate.serviceUnavailable": "사이트 서비스를 사용할 수 없어요 ({status}). 나중에 다시 시도하세요", + "api.originNotAllowed": "서버에서 이 주소를 허용하지 않아요 (403). 사이트 관리자에게 문의하세요.", + "host.notStarted": "시작 전", + "host.startCancelled": "시작 취소됨", + "host.switchingSource": "소스 전환 중", + "host.stageAria": "공유하거나 방에 참여하세요", + "host.captureAria": "실제 캡처 매개변수", + "host.quality.title": "{label} · {mbps}Mbps", + "host.audio.title": "{label} · 최대 {kbps}kbps", + "host.roomClosed": "방이 닫혔어요", + "host.pause.noTracksResume": "공유를 재개할 수 없어요. 소스를 다시 선택하세요", + "host.pause.signalRecovering": "서버 재연결 중이에요. 공유는 일시 중지 상태를 유지해요", + "host.pause.noTracksPause": "공유를 일시 중지할 수 없어요. 소스를 다시 선택하세요", + "host.pause.stillPaused": "공유는 일시 중지 상태를 유지해요", + "host.shareEnded": "현재 공유가 종료됐어요", + "host.fail.start": "공유를 시작하지 못했어요", + "host.err.createConnection": "연결을 만들지 못했어요", + "host.err.codecUnsupported": "영상 코덱을 지원하지 않아요. 업데이트하거나 다른 브라우저를 사용하세요", + "host.fail.source": "공유 소스를 전환하지 못했어요", + "host.fail.quality": "화질 설정을 적용하지 못했어요", + "host.fail.connection": "시청자 연결을 처리하지 못했어요", + "host.fail.room": "방 작업에 실패했어요", + "host.err.invalidToken": "공유 인증 정보가 더 이상 유효하지 않아요. 방을 다시 만드세요", + "host.err.accessDenied": "허용되지 않음", + "host.err.alreadyConnected": "이미 다른 페이지에서 공유 중인 방이에요", + "host.err.peerGone": "시청자 연결이 종료됐어요", + "host.err.forbidden": "사용할 수 없는 작업", + "host.err.serverError": "일시적으로 서비스를 사용할 수 없어요. 나중에 다시 시도하세요", + "host.err.createRoomStatus": "지금은 방을 만들 수 없어요 ({status})", + "host.err.roomCapacity": "모든 방 코드를 사용 중이에요. 나중에 다시 시도하거나 다른 Piik 사이트를 사용하세요.", + "host.err.replaceRoomStatus": "지금은 방을 바꿀 수 없어요 ({status})", + "host.err.updateRoomStatus": "지금은 방 설정을 바꿀 수 없어요 ({status})", + "host.capture.cancelled": "화면 선택이 취소되었거나 허용되지 않았어요", + "host.capture.noSource": "공유 가능한 화면 소스가 없어요", + "host.capture.readFailed": "선택한 소스를 읽을 수 없어요. 다시 선택하세요", + "host.capture.unavailable": "이 페이지에서는 화면 공유를 시작할 수 없어요", + "host.capture.inactive": "이 페이지로 돌아와 공유를 누르고 소스를 다시 선택하세요.", + "host.capture.constraints": "선택한 소스가 현재 화면 설정을 충족할 수 없어요. 설정을 낮추거나 다른 소스를 선택하세요.", + "host.notice.reconnecting": "일부 시청자가 재연결 중이에요", + "host.notice.sfuRecovering": "서버 전달 소스를 전환하지 못했어요. 시청자 연결을 복구하고 있어요", + "host.password.inputPlaceholder": "비밀번호 입력", + "stats.warn.codec": "영상 코덱이 {codec}이에요. H264 또는 VP8이 필요해요", + "stats.warn.audioCodec": "오디오 코덱이 {codec}이에요. Opus가 필요해요", + "viewer.msg.joinUnavailable": "지금은 방에 참여할 수 없어요", + "viewer.stageAria": "공유 화면", + "host.warn.audioUnread": "브라우저가 오디오 비트레이트 상한을 보고하지 않았어요", + "host.warn.audioRewritten": "브라우저가 오디오 비트레이트 상한을 {kbps}kbps로 바꿨어요", + "host.warn.senderPartial": "브라우저가 {params}을(를) 완전히 수락하지 않았어요", + "host.warn.param.maxBitrate": "비트레이트 상한", + "host.warn.param.maxFramerate": "프레임 레이트 상한", + "host.warn.param.scaleResolutionDownBy": "해상도 배율", + "host.warn.param.degradationPreference": "품질 우선순위", + "host.warn.param.scalabilityMode": "확장성 모드", + "host.warn.sfuRecover": "서버 전달: {params} 실패. 자동 복구를 시작했어요", + "host.warn.sfuStage.connect": "연결", + "host.warn.sfuStage.source": "소스", + "host.warn.sfuStage.videoPublish": "영상 게시", + "host.warn.sfuStage.senderConfig": "송신 설정", + "host.warn.sfuStage.audioPublish": "오디오 게시", + "host.warn.sfuStage.transport": "전송", + "host.fail.sfuSwitch": "서버 전달 소스를 전환하지 못했어요", + "host.fail.sfuAudioParams": "서버 전달 오디오 매개변수를 적용하지 못했어요", + "host.fail.sfuParams": "서버 전달 송신 매개변수를 적용하지 못했어요", + "client.connect.replace": "{site}을(를) 대체하고 해당 사이트의 App 세션 연결을 끊어요.", + "voice.offline": "연결 끊김", + "interaction.effects": "반응 효과 표시", + "host.capture.fpsUnknown": "프레임 레이트 알 수 없음", + "host.capture.codecPending": "코덱 확인 중", + "host.capture.hasAudio": "소스 소리 포함", + "host.capture.noAudio": "소스 소리 없음" +}; diff --git a/src/client/locales/zh-Hant.ts b/src/client/locales/zh-Hant.ts new file mode 100644 index 000000000..218422224 --- /dev/null +++ b/src/client/locales/zh-Hant.ts @@ -0,0 +1,839 @@ +import type { CopyKey } from "./zh"; + +// Partial translations reused only where both canonical English and Chinese match. +export const zhHant: Partial> = { + "state.peer.present": "已在房間", + "state.peer.voiceConnected": "語音已連線", + "host.topology.idle": "已在房間,暫無媒體線路。", + "remote.textShared": "僅一人控制時可傳送文字。", + "remote.participant.control": "正在參與遠端控制", + "remote.gamepadHelp": "使用本頁第一個已連線的標準遊戲控制器,在房主電腦上獨立操作。請保持本頁在前景。", + "remote.gamepadHostHelp": "每位玩家可使用自己的遊戲控制器。", + "remote.gamepadSetup": "遊戲控制器設定", + "remote.reason.gamepad": "虛擬遊戲控制器無法使用,請檢查房主的控制器設定及可用位置。", + "remote.keyboard": "遠端鍵盤", + "remote.inputTools": "輸入工具", + "remote.keyboardRequiresControl": "取得控制權後可使用遠端鍵盤", + "remote.mouse": "滑鼠", + "remote.mouseLeft": "滑鼠左鍵", + "remote.mouseRight": "滑鼠右鍵", + "remote.mouseWheel": "滾輪與中鍵", + "remote.mouseExpand": "展開虛擬滑鼠", + "remote.mouseCollapse": "縮為迷你滑鼠", + "remote.mouseReposition": "拖曳調整位置,貼邊停留可自動收納", + "remote.mouseMove": "拖曳移動游標", + "remote.mouseScroll": "輕點可按下中鍵,滑動可捲動,長按後可拖曳", + "remote.touchMode": "預設觸控方式", + "remote.touchMode.direct": "直接觸控", + "remote.touchMode.trackpad": "游標觸控板", + "remote.touchMode.directHint": "直接點選畫面上的位置。", + "remote.touchMode.trackpadHint": "滑動移動游標,輕點點選。", + "remote.keyPages": "鍵盤分區", + "remote.keys.letters": "字母鍵", + "remote.keys.symbols": "數字與符號", + "remote.keys.functions": "功能鍵", + "remote.keys.text": "文字", + "remote.keyboardHelp": "按住即長按,放手即鬆開。", + "remote.combinationHelp": "先選 Ctrl、Shift 等按鍵,再按另一個按鍵;完成後會自動鬆開。", + "remote.combinationMode": "組合鍵模式", + "remote.key.ShiftLeft": "Shift 鍵", + "remote.key.Windows": "Windows 鍵", + "remote.key.Command": "Command 鍵", + "remote.key.Super": "Super 鍵", + "remote.key.Space": "空格鍵", + "remote.key.Insert": "插入鍵", + "remote.key.Delete": "刪除鍵", + "remote.key.Home": "Home 鍵", + "remote.key.End": "End 鍵", + "remote.key.PageUp": "向上翻頁", + "remote.key.PageDown": "向下翻頁", + "remote.key.CapsLock": "切換大寫鎖定", + "remote.key.PrintScreen": "螢幕擷取鍵", + "remote.key.ScrollLock": "捲動鎖定鍵", + "remote.key.NumLock": "數字鎖定鍵", + "remote.text": "輸入或貼上文字、指令、程式碼", + "remote.sendText": "輸入到對方", + "remote.typeText": "輸入到對方", + "remote.textHelp": "按 Enter 可換行;點選按鈕後,文字會輸入到對方目前選取的位置。", + "remote.textTooLong": "內容較長,請分段輸入(每次最多 2 KB)。", + "remote.touchHelp": "以雙指輕點可按右鍵,捏合可縮放。雙指滑動預設會捲動;縮放後或展開虛擬滑鼠時,則會平移畫面。", + "remote.resetZoom": "還原畫面大小", + "remote.key.Escape": "退出鍵", + "remote.key.Tab": "Tab 鍵", + "remote.key.ArrowLeft": "向左", + "remote.key.ArrowUp": "向上", + "remote.key.ArrowDown": "向下", + "remote.key.ArrowRight": "向右", + "remote.key.Backspace": "Backspace 鍵", + "remote.key.Enter": "Enter 鍵", + "remote.key.ControlA": "在對方電腦全選", + "remote.key.ControlC": "在對方電腦複製", + "remote.key.ControlV": "在對方電腦貼上", + "remote.key.MetaLeft": "在對方電腦開啟開始選單", + "remote.key.InputLanguage": "切換對方電腦的輸入法", + "remote.key.SwitchWindow": "切換對方電腦的視窗", + "remote.key.SwitchApp": "切換對方電腦的應用程式", + "remote.title": "遠端控制", + "remote.requests": "控制請求", + "remote.authorization": "控制授權", + "remote.mode.ask": "每次詢問", + "remote.mode.room": "房間觀眾", + "remote.mode.password": "控制密碼", + "remote.help.ask": "收到請求後,由你決定是否允許控制。", + "remote.help.room": "房間觀眾不需要逐次批准,即可操作電腦。", + "remote.help.password": "觀眾輸入控制密碼後,可操作這台電腦。", + "remote.policyLifetime": "只對目前分享來源有效;切換來源或停止分享後,遠端控制會關閉。", + "remote.password": "控制密碼", + "remote.apply": "套用", + "remote.enable": "開啟遠端控制", + "remote.enableRoom": "允許觀眾控制", + "remote.connecting": "正在取得控制權", + "remote.reason.password": "控制密碼不正確", + "remote.reason.retry": "請稍等片刻後重試", + "remote.reason.busy": "控制正被占用,請聯絡房主切換控制", + "remote.simultaneous": "允許多人同時控制", + "remote.simultaneousHelp": "已獲授權的觀眾可一起控制,共用鍵盤和滑鼠。更改此設定會結束目前控制授權和請求。", + "remote.request": "請求控制", + "remote.inlineRequired": "將畫面返回頁面後,再請求控制", + "remote.playbackRequired": "播放畫面後,再請求控制", + "remote.unavailable": "目前分享暫不可控制", + "remote.cancel": "取消請求", + "remote.stop": "結束控制", + "remote.allow": "允許控制", + "remote.decline": "拒絕", + "remote.surface": "遠端鍵鼠控制區域", + "remote.controlling": "正在控制", + "remote.hostFocus": "請保持共享視窗或螢幕可操作", + "remote.suspended": "等待共享視窗或螢幕恢復", + "remote.gameMouse": "遊戲滑鼠", + "remote.gameMouseHelp": "鎖定滑鼠以持續轉動遊戲視角;按 Esc 可解除鎖定。", + "remote.releaseMouse": "解除滑鼠鎖定", + "remote.unlockMouse": "按 Esc 解除滑鼠鎖定,控制權限仍會保留", + "remote.lockFailed": "未能鎖定滑鼠,請再次點選", + "remote.pending": "等待房主允許", + "remote.failed": "遠端控制不可用,請重新請求", + "remote.inputFailed": "剛才的操作未執行,請重試。", + "remote.decisionFailed": "操作未完成,請重試", + "remote.macPermission": "無法開啟控制。請到「系統設定 → 隱私權與安全性 → 輔助使用」允許 Piik,再試一次。", + "remote.linuxStop": "可在本面板結束控制,也可透過系統指示圖示停止共享。", + "remote.linuxEnable": "開啟時,需在系統視窗中選擇要控制的螢幕。", + "remote.consent": "允許後,對方可以操作這台電腦的滑鼠和鍵盤。", + "remote.waiting": "請求控制", + "remote.shortcut": "本機立即結束控制:", + "remote.hostStopKey": "房主停止快速鍵", + "remote.hostStopKeyHelp": "在本機任何應用程式中按下即可停止控制,設定儲存在目前站點。", + "remote.releaseKey": "退出控制快速鍵", + "remote.releaseKeyHelp": "在目前頁面或獨立鍵盤視窗中退出控制,由目前瀏覽器儲存。", + "remote.shortcutFailed": "快速鍵不可用,請更換後重試。", + "common.loading": "正在載入", + "playback.controls": "播放器控制項", + "playback.showControls": "顯示播放控制項", + "playback.overlay": "彈幕", + "playback.more": "播放設定", + "playback.pictureFit": "畫面顯示", + "playback.viewControls": "觀看選項", + "playback.windowControls": "播放器視窗", + "playback.changeFit": "切換畫面調整", + "playback.fitCycle": "目前:{current}。點選切換為{next},只影響自己的畫面。", + "playback.rotation": "旋轉畫面", + "playback.rotationHint": "將本機觀看的畫面順時針旋轉 90°。", + "playback.connection": "連線", + "playback.fit.contain": "完整顯示", + "playback.fit.cover": "依比例填滿", + "playback.fit.fill": "延展填滿", + "playback.fitFull": "保留完整畫面與原始比例。", + "playback.fitCrop": "依原始比例填滿,邊緣可能會被裁切。", + "playback.fitStretch": "延展至播放器大小,畫面比例可能會改變。", + "playback.route.auto": "自動", + "playback.route.p2p": "僅 P2P", + "playback.route.sfu": "僅 SFU", + "playback.routeHint.auto": "優先 P2P,必要時使用伺服器中轉。", + "playback.routeHint.p2p": "只透過其他參與者接收畫面。", + "playback.routeHint.sfu": "只透過伺服器接收畫面。", + "playback.routeSfuOnly": "此站點僅提供伺服器中轉。", + "playback.routePeerOnly": "房主已關閉伺服器中轉。", + "playback.routeNoSfu": "此站點未啟用伺服器中轉。", + "playback.routeRejected": "目前無法選擇這條線路,請重新選擇。", + "playback.play": "播放", + "playback.pause": "暫停本機播放", + "playback.mute": "靜音", + "playback.unmute": "取消靜音", + "playback.noAudio": "分享來源沒有音訊", + "playback.volume": "調節音量,支援 0%–200%", + "host.shareVolume": "分享音量,支援 0%–200% · 對所有觀眾生效", + "voice.quality.saver": "節省流量", + "voice.quality.standard": "標準", + "voice.quality.clear": "清晰", + "host.shareVolume.mute": "關閉所有觀眾的分享聲音", + "host.shareVolume.unmute": "恢復所有觀眾的分享聲音", + "playback.volumeBasic": "調節音量,支援 0%–100%", + "playback.fullscreen": "全螢幕觀看", + "playback.fullscreenWaiting": "畫面準備好後可全螢幕", + "playback.fullscreenFailed": "未能切換全螢幕,請重試", + "playback.exitFullscreen": "退出全螢幕", + "playback.pip": "浮動小視窗", + "playback.exitPip": "返回頁面觀看", + "playback.pipUnavailable": "目前瀏覽器暫不支援浮動小視窗", + "playback.pipFailed": "小視窗切換失敗,請重試", + "playback.pipWaiting": "畫面就緒後可開啟浮動小視窗", + "debug.start": "診斷", + "debug.startHint": "重新載入頁面並記錄瀏覽器診斷", + "debug.startConfirm": "頁面將重新載入,目前分享或觀看會中斷。是否開啟瀏覽器診斷?", + "debug.export": "網頁報告", + "debug.exportHint": "下載網頁診斷,可能包含網路地址和裝置資訊", + "debug.exportFailed": "診斷下載失敗,請重試", + "brand.home": "Piik 首頁", + "help.title": "說明", + "help.hint": "說明、診斷與版本資訊", + "help.troubleshooting": "疑難排解", + "common.roomCode": "房間代碼", + "host.roomCodePending": "開始分享後產生房間代碼", + "host.createRoom": "建立房間", + "host.createRoomHint": "建立房間後即可聊天和語音,稍後再開始分享。", + "common.copy": "複製", + "common.copied": "已複製", + "common.copyFailed": "複製失敗", + "common.cancel": "取消", + "common.back": "返回", + "common.retry": "重試", + "common.refresh": "重新整理頁面", + "common.edit": "編輯", + "common.close": "收起", + "notice.dismiss": "關閉提示", + "common.enable": "開啟{name}", + "common.disable": "關閉{name}", + "common.increase": "增大{name}", + "common.decrease": "減小{name}", + "host.join.hide": "收起加入房間", + "host.advanced.hide": "收起分享設定", + "host.password.settingsHide": "收起密碼設定", + "host.sourcePicker.audioOn": "分享聲音", + "host.sourcePicker.audioOff": "停止分享聲音", + "host.sourcePicker.audioLocked": "切換來源時保持原來的聲音分享狀態", + "common.viewers": "觀眾", + "common.you": "你", + "common.host": "房主", + "common.name.viewerDefault": "觀眾", + "common.name.hostDefault": "房主", + "client.launch.title": "開啟 Piik", + "client.launch.version": "目前版本 {version}", + "client.launch.localHint": "同一區域網路內使用", + "client.launch.link": "網際網路邀請", + "client.connect.action": "連線 Piik App", + "client.connect.hint": "連線 App,獲得更完整的體驗。", + "client.connect.discovering": "正在尋找 Piik App…", + "client.connect.wakeApp": "開啟 Piik App", + "client.connect.returnToBrowser": "開啟 Piik App 後返回此頁,繼續連線。", + "native.confirmInApp": "前往 App 確認", + "host.sourcePicker.tab.picker": "系統選擇器", + "client.connect.permissionHint": "如果瀏覽器詢問,請允許存取此裝置或區域網路,以尋找 App。", + "client.connect.found": "已找到 Piik App,請開啟 App 頁面繼續。", + "client.connect.open": "開啟 App 頁面", + "client.connect.approving": "正在等待 App 授權…", + "client.connect.standby": "App 已就緒", + "client.connect.guide": "如何連線站點", + "client.connect.addSite": "開啟站點", + "client.connect.addSiteHint": "輸入 Piik 站點網址,再確認它使用 App 的權限。", + "client.connect.siteAddress": "站點網址", + "client.connect.continue": "繼續", + "client.connect.openSite": "開啟站點", + "client.connect.approveAndOpen": "允許並開啟", + "client.connect.standbyHint": "在 Piik 站點右上角點選 App,選擇「開啟 App 頁面」,再確認「允許使用」。", + "client.connect.remove": "取消此站點的 App 授權", + "client.connect.openOnStart": "啟動 App 時開啟此站點", + "client.connect.openOwnedOnStart": "啟動 App 時開啟我的站點({mode})", + "client.connect.manage": "App 已就緒,點選管理。", + "client.connect.update": "App {current},可更新至 {version}。", + "client.connect.approveTitle": "允許使用 Piik App?", + "client.connect.approve": "允許使用", + "client.connect.approved": "已允許此站點使用 App", + "client.connect.return": "可以關閉此頁面,返回原站點繼續。", + "client.connect.close": "關閉此頁", + "client.connect.changed": "此站點已取消授權,請重新允許使用後再設為啟動站點。", + "client.connect.saveFailed": "未能儲存設定,請重試。", + "client.connect.invalid": "站點網址無效", + "client.connect.unavailable": "未能連線 App。請保持 Piik App 執行,並允許瀏覽器開啟新視窗和存取區域網路。", + "client.connect.download": "下載 App", + "client.connect.browserHint": "仍可觀看,並使用瀏覽器支援的分享方式。", + "client.launch.lanAddress": "區域網路邀請網址", + "client.launch.chooseAddress": "選擇網址", + "client.launch.lanHint": "選擇與朋友處於同一網路的地址。", + "client.launch.localHTTPS": "區域網路邀請使用本機 HTTPS;首次開啟時需要確認本機憑證。", + "client.launch.lanUnavailable": "沒有可用的區域網路地址,請連線網路後重新整理頁面", + "client.launch.go": "進入 Piik", + "client.launch.starting": "正在準備 Piik", + "client.launch.retryHint": "可直接重試,也可調整下方設定。", + "client.launch.errorDetails": "技術詳細資訊", + "client.launch.failure.tunnel-exited": "網際網路邀請服務未能建立連線。可檢查網路,或透過已有 Piik 站點使用 App。", + "client.launch.failure.tunnel-timeout": "連線網際網路邀請服務逾時。可檢查網路,或透過已有 Piik 站點使用 App。", + "client.launch.failure.tunnel-unavailable": "網際網路邀請元件不可用,請檢查 Piik App 是否完整安裝。", + "client.launch.failure.tunnel-start": "無法啟動網際網路邀請元件,請查看技術詳細資訊。", + "client.launch.failure.tunnel-stopped": "網際網路邀請已中斷。重新建立後,請傳送新的邀請連結。", + "client.launch.failure.local-network": "區域網路地址不可用,請檢查網路並重新選擇邀請地址。", + "client.launch.failure.configuration": "無法套用 App 設定,請查看技術詳細資訊。", + "client.launch.failure.native-control": "App 聯動服務不可用,請查看技術詳細資訊。", + "client.launch.failure.launcher": "App 啟動頁不可用,請查看技術詳細資訊。", + "client.launch.failure.diagnostics": "無法儲存診斷記錄檔,請檢查記錄檔目錄及寫入權限。", + "client.launch.failure.local-server": "本機房間服務不可用,請查看技術詳細資訊。", + "client.launch.debugFailed": "未能開啟診斷,請重試。", + "client.launch.loadFailed": "無法讀取啟動設定,請重新整理頁面重試", + "client.update.available": "發現新的 Piik 版本", + "client.update.major": "發現新的 Piik 大版本", + "client.update.majorHint": "此更新含不相容改動。升級前請查看版本說明。", + "client.update.downloads": "AtomGit 備用下載", + "client.update.download": "下載 {version}", + "client.update.differentBuild": "目前構建與官方發行版不同", + "client.update.official": "可取得 Piik 正式發行版", + "gate.title": "站點存取", + "gate.hint": "請輸入站點口令", + "gate.password": "站點口令", + "gate.submit": "進入站點", + "gate.checking": "正在驗證站點存取", + "gate.wrong": "站點口令不正確,請重試", + "gate.unavailable": "暫時無法驗證站點存取", + "gate.malformed": "房間代碼格式不正確", + "gate.malformedHint": "請輸入 1000 至 9999 的四位房間代碼", + "gate.unavailableRoute": "無法存取", + "startup.failed": "頁面未能載入", + "startup.retry": "請重新整理頁面後重試。", + "join.title": "加入房間", + "join.hint": "輸入 {site} 的房間代碼", + "join.field": "房間代碼", + "join.submit": "加入", + "join.invalid": "請輸入 1000 至 9999 的四位房間代碼", + "join.password": "房間密碼", + "join.passwordError": "無法加入房間,請重試", + "join.passwordRule": "請輸入 1-{max} 個可見字元", + "join.passwordAction": "輸入房間密碼", + "join.full": "房間已滿", + "host.title": "{name} 的螢幕", + "host.start": "開始分享", + "host.sourcePicker.title": "選擇分享來源", + "host.sourcePicker.browserHint": "在瀏覽器彈出視窗中選擇螢幕、視窗或分頁。", + "host.sourcePicker.camera": "分享攝影機:{title}", + "host.camera.denied": "未獲得攝影機權限,請允許存取後重試。", + "host.camera.unavailable": "暫時無法使用攝影機,請檢查連線,以及是否正被其他應用程式占用。", + "host.microphone.settings": "麥克風設定", + "host.commentary.include": "分享麥克風", + "host.commentary.unavailable": "麥克風混音不可用,畫面和源聲音仍可繼續分享。", + "host.commentary.description": "將你的聲音加入分享畫面,不需要加入房間語音。", + "host.commentary.duplicate": "分享與語音都已開啟麥克風。若出現回音或其中一路沒有聲音,請關閉其中一路。", + "host.commentary.failed": "分享麥克風未能開啟,請檢查權限和所選裝置。", + "host.audioInput.stopped": "一項聲音輸入已停止,畫面分享繼續。", + "host.device.microphone": "麥克風", + "host.device.camera": "攝影機", + "host.device.default": "預設裝置", + "host.device.missing": "裝置不可用,請重新選擇", + "host.device.refresh": "重新整理裝置", + "host.device.listFailed": "暫時無法取得裝置,請重新整理重試。", + "host.device.permission.microphone": "開啟麥克風並允許存取後,可以在這裡選擇裝置。", + "host.microphone.volume": "麥克風音量", + "host.microphone.voiceProcessing": "降噪與回聲消除", + "host.microphone.voiceProcessingHint": "開啟後由瀏覽器降低雜音、消除回聲並自動調節音量;輸入裝置已有語音處理時可關閉。", + "interaction.open": "互動", + "interaction.title": "互動", + "interaction.chat": "聊天", + "interaction.voice": "語音", + "voice.join": "加入語音", + "voice.settings": "語音設定", + "voice.details.title": "房間語音", + "voice.details.joined": "已加入語音", + "voice.details.unavailable": "語音連線異常", + "voice.details.partial": "部分語音未連通", + "voice.details.sendTo": "發往 {name}", + "voice.details.receiveFrom": "來自 {name}", + "voice.details.send": "本機傳送", + "voice.details.receive": "本機接收", + "voice.details.via": "經 {name}", + "voice.details.forwardTo": "轉發 {source} → {name}", + "stats.rttHint": "目前連線到對端或 SFU 的往返時間。", + "stats.avgRttHint": "到對端或 SFU 的平均往返時間,連線不重復計數。", + "stats.totalBitrateHint": "目前方向各路位元率之和。", + "stats.avgLossHint": "各路最新上報封包遺失率的平均值。", + "stats.localCapture": "本機擷取", + "stats.audioPresent": "已包含", + "stats.audioAbsent": "未包含", + "stats.droppedHint": "目前取樣期間捨棄的影格數。", + "stats.inputFpsHint": "交給編碼器的影格率。", + "stats.pictureSend": "畫面傳送", + "stats.pictureReceive": "畫面接收", + "stats.voiceSend": "語音傳送", + "stats.voiceReceive": "語音接收", + "stats.totalBitrate": "總位元率", + "stats.avgLoss": "平均封包遺失率", + "stats.avgRtt": "平均 RTT", + "stats.avgJitter": "平均抖動", + "stats.resolutionRange": "解析度範圍", + "stats.fpsRange": "影格率範圍", + "voice.details.codec": "音訊編碼", + "voice.listening": "收聽語音", + "voice.listeningVolume": "總收聽音量", + "voice.personVolume": "個人音量", + "voice.listenPerson": "收聽此人", + "voice.listeningVolumeHint": "調整你聽到的房間語音,範圍 0%–200%,不影響分享來源的聲音。", + "voice.open": "開啟房間語音", + "voice.openHint": "房間成員可自行加入,麥克風仍需手動開啟。", + "voice.close": "關閉房間語音", + "voice.closeHint": "結束所有人的語音,畫面分享和聊天不受影響。", + "voice.closedHint": "房主尚未開啟房間語音。", + "voice.deafen": "暫停收聽", + "voice.undeafen": "恢復收聽", + "voice.deafenHint": "僅暫停你這裡的語音播放,麥克風與轉發繼續。", + "voice.undeafenHint": "恢復房間語音收聽,不改變麥克風狀態。", + "voice.leave": "退出語音", + "voice.microphoneOn": "開啟麥克風", + "voice.microphoneOff": "關閉麥克風", + "voice.captureCancel": "取消開啟麥克風", + "voice.play": "播放語音", + "voice.muteForMe": "本機靜音", + "voice.unmuteForMe": "恢復聲音", + "voice.self": "你", + "voice.participant": "參與者", + "voice.outside": "尚未加入語音", + "voice.microphoneInactive": "麥克風已關閉", + "voice.listeningPaused": "已暫停收聽", + "voice.microphoneActive": "麥克風已開啟", + "voice.speaking": "正在說話", + "voice.bitrate": "房間語音位元率", + "voice.bitrateHint": "房主統一調整語音上限,實際位元率隨發言與網路變化。可填寫 {min}–{max} kbps。", + "voice.participants": "參與者", + "host.sourceAudio.unavailable": "來源聲音已停止,畫面分享繼續。", + "voice.unavailable": "部分語音線路暫不可用,聊天和畫面分享仍可使用。", + "voice.reconnecting": "正在重新連線房間語音", + "voice.error.microphoneUnavailable": "此頁面無法使用麥克風,請透過 HTTPS 或本機地址存取。", + "voice.error.microphoneMissing": "沒有找到可用的麥克風。", + "voice.error.microphoneFailed": "未能開啟麥克風,請重試。", + "voice.error.transport": "語音未能連線,房間仍可使用。請換個網路或瀏覽器重試。", + "voice.error.rejected": "語音操作未獲接受,請重新加入語音後重試。", + "voice.error.closed": "房主尚未開啟房間語音。", + "interaction.settings": "聊天設定", + "interaction.settingsHint": "彈幕設定僅影響自己的畫面。", + "interaction.overlay.scale": "彈幕文字大小", + "interaction.overlay.opacity": "不透明度", + "interaction.overlay.speed": "捲動速度", + "interaction.overlay.speedHint": "用於新收到的彈幕,已在畫面上的彈幕保持原來的速度。", + "interaction.overlay.colorBySender": "使用參與者顏色", + "interaction.export": "匯出聊天記錄", + "interaction.exportLimit": "將本頁保留的最近 {count} 則訊息儲存為文字檔。", + "interaction.close": "收起互動視窗", + "interaction.focus": "顯示互動視窗", + "floating.detach": "在置頂視窗中開啟", + "floating.focus": "顯示獨立視窗", + "floating.detachFailed": "未能開啟獨立視窗,請重試。", + "floating.move": "移動視窗", + "floating.moveHint": "拖曳標題欄移動視窗;方向鍵可微調。", + "floating.resize": "調整視窗大小", + "floating.resizeHint": "拖曳角落或按方向鍵調整大小。", + "interaction.overlay.show": "顯示彈幕", + "interaction.overlay.hide": "隱藏彈幕", + "interaction.overlay.showHint": "在畫面上顯示新訊息,僅對自己生效。", + "interaction.overlay.hideHint": "隱藏畫面上的訊息,聊天視窗仍可查看。", + "interaction.ephemeral": "僅保留本頁收到的訊息,重新整理後清空。", + "interaction.empty": "坐下來,聊兩句。", + "interaction.placeholder": "說點什麼…", + "interaction.send": "傳送", + "interaction.reactions": "表情與小道具", + "interaction.express": "發表情", + "interaction.moreReactions": "更多表情", + "interaction.toPerson": "送給", + "interaction.withPerson": "與 {name} 互動", + "interaction.participant": "房間成員", + "interaction.receivedReaction": "{sender} 對 {target} 使用了「{reaction}」。", + "interaction.expressedReaction": "{sender}:{reaction}。", + "interaction.unread": "{count} 則新訊息", + "interaction.latest": "回到最新訊息", + "interaction.reconnecting": "連線後即可傳送", + "interaction.error.offline": "暫時未能傳送,請稍後重試。", + "interaction.error.unconfirmed": "暫未收到傳送確認。", + "interaction.error.rate-limited": "發得有點快,稍等一下再試。", + "interaction.error.target-unavailable": "對方剛剛離開了,換個人試試。", + "interaction.error.not-subscribed": "互動暫不可用,請重新進入房間。", + "interaction.error.busy": "連線正忙,稍後再試。", + "interaction.reaction.wave": "打個招呼", + "interaction.reaction.heart": "比個心", + "interaction.reaction.clap": "鼓掌", + "interaction.reaction.laugh": "笑出聲", + "interaction.reaction.clown": "小丑", + "interaction.reaction.eyeroll": "翻個白眼", + "interaction.reaction.thumbsup": "讚", + "interaction.reaction.thumbsdown": "倒讚", + "interaction.reaction.wow": "震驚", + "interaction.reaction.party": "撒花", + "interaction.reaction.fire": "太熱血了", + "interaction.reaction.eyes": "圍觀", + "interaction.reaction.star": "亮個星", + "interaction.reaction.sleep": "睏了", + "interaction.reaction.tomato": "丟番茄", + "interaction.reaction.poop": "丟便便", + "host.shareControls": "分享控制", + "host.sourcePicker.tab.camera": "攝影機", + "host.sourcePicker.tab.browser": "瀏覽器", + "host.sourcePicker.tab.window": "程式 / 視窗", + "host.sourcePicker.tab.display": "螢幕", + "host.sourcePicker.windowAudio": "應用程式聲音", + "host.sourcePicker.systemAudio": "系統聲音", + "host.sourcePicker.excludeAudio": "排除應用程式聲音", + "host.sourcePicker.refreshApplications": "重新整理應用程式清單", + "host.sourcePicker.excludeListFailed": "無法取得應用程式清單,請重新整理重試。", + "host.fail.sourceAudio": "未能更新來源聲音,請重試", + "host.sourcePicker.excludeNone": "不排除", + "host.sourcePicker.excludeMissing": "不在清單中,請重新選擇", + "host.sourcePicker.excludeAudioChoose": "選擇要排除聲音的應用程式視窗;若應用程式未列出,請先開啟它的視窗,再重新整理。", + "host.sourcePicker.excludeAudioLifetime": "應用程式結束後來源聲音會停止,請重新整理並重新選擇。", + "host.sourcePicker.excludeAudioHint": "分享所有輸出裝置的聲音,但不包含所選處理程序及其子處理程序。應用程式結束後,來源聲音會停止,需要重新選擇。", + "host.sourcePicker.showCaptureBorder": "顯示擷取邊框", + "host.sourcePicker.showCaptureBorderHint": "關閉後嘗試隱藏黃框;Windows 或其他擷取程式可能仍要求顯示。", + "host.sourcePicker.empty": "暫無可用來源,請重新整理清單", + "host.sourcePicker.failed": "無法讀取來源清單,請重新整理重試。", + "native.incompatible": "App 與頁面不相容,請更新 App 並重新整理頁面。", + "native.fail.edge": "Piik App 媒體連線失敗", + "native.fail.browserMedia": "瀏覽器無法建立媒體連線,請重新整理頁面重試。", + "native.fail.signaling": "Piik App 信令失敗", + "native.fail.receiver": "Piik App 媒體接收失敗", + "native.fail.controlDisconnected": "與 Piik App 的連線已中斷,請透過 App 按鈕重新連線。", + "native.fail.requestTimeout": "Piik App 回應逾時,請稍後重試。", + "native.fail.invalidResponse": "無法辨識 Piik App 回傳的資料。請更新 App 並重新整理頁面。", + "native.fail.captureStart": "App 未能擷取所選來源,請換一個來源重試。", + "native.fail.edgePrepare": "Piik App 未能準備媒體連線。請開啟診斷後重試。", + "shareHelp.title": "分享疑難排解", + "shareHelp.open": "點選狀態燈查看排解方法", + "shareHelp.source": "先換一個普通視窗或螢幕重試,確認來源仍然開啟,並允許系統請求的螢幕錄製權限。", + "shareHelp.compare": "試著使用「瀏覽器」選擇來源進行對照。Windows 也可將編碼器改為「自動」或 VP8,再試同一個來源。", + "shareHelp.report": "仍然失敗時,開啟診斷後再試一次,並儲存同一次嘗試的報告。請附上失敗提示、Piik 版本和當時的操作。", + "shareHelp.appDebug": "下方按鈕記錄網頁診斷,App 記錄檔的取得方法見問題排查文件。", + "shareHelp.site": "確認目前站點網址與存取權限。自行部署的站點請核對 PUBLIC_BASE_URL、ALLOWED_ORIGINS 與反向代理設定,詳細步驟請見疑難排解文件。", + "shareHelp.appConnection": "確認 App 仍在執行,點選頁面頂部的 App 完成連線;瀏覽器詢問區域網路權限時,請允許存取。", + "shareHelp.mediaConnection": "檢查瀏覽器是否允許 WebRTC 和區域網路存取,再重新整理頁面重試;也可換一個瀏覽器對照。", + "shareHelp.permission": "回到目前頁面,重新點選分享並選擇來源;若系統或瀏覽器詢問螢幕錄製權限,請允許存取。", + "shareHelp.camera": "檢查攝影機權限,確認裝置已連線且未被其他程式獨占,再重新選擇攝影機。", + "shareHelp.guide": "開啟疑難排解文件", + "shareHelp.copy": "複製失敗資訊", + "shareHelp.copied": "已複製", + "shareHelp.copyFailed": "未能複製,請手動選擇錯誤編號", + "host.sourcePicker.window": "分享視窗:{title}", + "host.sourcePicker.display": "分享螢幕:{title}", + "host.sourcePicker.system": "系統螢幕與視窗選擇器", + "host.sourcePicker.systemAction": "使用系統選擇器選擇螢幕或視窗", + "host.sourcePicker.audioHint": "視窗分享應用程式聲音,整個螢幕分享系統聲音", + "host.sourcePicker.refresh": "重新整理分享來源", + "host.sourcePicker.loading": "正在尋找分享來源", + "host.join": "加入房間", + "host.starting": "正在連線", + "host.cancelStart": "取消", + "host.live": "分享中", + "host.paused": "已暫停", + "host.ended": "已停止分享", + "host.roomReady": "房間已就緒", + "host.pause": "暫停分享", + "host.resume": "恢復分享", + "host.switchSource": "切換來源", + "host.switching": "正在選擇", + "host.stop": "停止分享", + "host.noAudio": "未分享來源聲音", + "host.localPreviewPaused": "本機預覽已暫停,分享仍在繼續", + "host.preview": "本機預覽", + "host.previewAutoPause": "自動暫停預覽", + "host.previewAutoPauseHint": "切換分頁或視窗時暫停本機預覽,分享仍繼續;第二螢幕觀看時可關閉。", + "host.pauseNotice": "影音分享已暫停", + "host.stopNotice": "已停止分享", + "host.roomReplaced": "房間代碼已更換", + "host.roomInvalid": "房間已失效,開始分享時將建立新房", + "host.roomReplace": "更換房間代碼", + "host.roomReplaceConfirm": "確認更換房間代碼:目前分享會結束,觀眾需要重新加入", + "host.terminated.stale": "頁面版本已更新,請重新整理後重試", + "host.terminated.session": "連線已由另一個頁面接管,請前往該頁繼續", + "host.terminated.signal": "伺服器連線已終止,請重新整理後重試", + "host.notice.qualityApplied": "分享設定已套用", + "host.notice.qualitySet": "畫質已切換為 {label}", + "host.notice.audioSet": "音訊位元率上限已設為 {kbps} kbps", + "host.notice.partialApply": "分享設定已更新,但部分觀看連線未能套用新參數", + "host.notice.sourceSwitch.ok": "分享來源已切換", + "host.notice.sourceSwitch.partial": "分享來源已切換,但{warning}", + "host.name": "暱稱", + "host.nameSave": "儲存暱稱", + "host.nameCancel": "取消編輯暱稱", + "host.nameEdit": "編輯暱稱", + "host.nameError": "暱稱格式無效或超過 24 個字元", + "host.nameOffline": "暱稱已儲存,連線恢復後同步給其他人", + "host.invite": "邀請連結", + "host.invite.copy": "複製邀請連結", + "host.invite.copyFailed": "無法複製連結,請稍後重試", + "host.invite.rotate": "更新邀請連結;使用舊連結的觀眾需要重新加入", + "host.invite.revoke": "撤銷邀請連結,並中斷透過該連結加入的觀眾", + "host.invite.rotateShort": "更新連結", + "host.invite.revokeShort": "撤銷連結", + "host.invite.updated": "邀請連結已更新", + "host.invite.revoked": "邀請連結已撤銷", + "host.invite.emptyOpen": "暫無邀請連結,仍可憑房間代碼加入", + "host.invite.address": "房間網址", + "host.invite.copyAddress": "複製房間網址", + "host.invite.includeCredential": "免密碼邀請", + "host.invite.credentialHint": "收到連結即可加入此房間", + "host.invite.credentialRequired": "目前僅限邀請,請開啟免密碼邀請", + "host.invite.emptyPassword": "暫無邀請連結,仍可憑房間代碼和密碼加入", + "host.invite.emptyPrivate": "暫無邀請連結,請先更新連結再邀請他人", + "host.policy": "準入方式", + "host.policy.open": "公開", + "host.policy.private": "私密", + "host.policy.currentOpen": "房間代碼可加入", + "host.policy.currentPassword": "憑房間代碼和密碼加入", + "host.policy.currentInvite": "僅限邀請", + "host.policy.openHint": "知道房間代碼即可加入", + "host.policy.privateHint": "憑邀請連結加入;設定密碼後也可憑房間代碼加入", + "host.policy.privatePasswordHint": "憑邀請連結,或房間代碼和密碼加入", + "host.policy.setOpen": "房間已設為公開", + "host.policy.setPrivateInvite": "房間已設為私密,僅限邀請加入", + "host.policy.setPrivatePassword": "房間已設為私密,可憑邀請或密碼加入", + "host.password.set": "房間密碼已設定", + "host.password.unset": "房間密碼未設定", + "host.password.placeholder": "設定後可憑房間代碼加入", + "host.password.setAction": "設定房間密碼", + "host.password.changeAction": "更改房間密碼", + "host.password.remove": "移除房間密碼", + "host.password.show": "顯示房間密碼", + "host.password.hide": "隱藏房間密碼", + "host.password.saved": "房間密碼已設定", + "host.password.updated": "房間密碼已更新", + "host.password.removed": "房間密碼已移除,僅限邀請加入", + "host.password.rule": "房間密碼只需 1-{max} 個可見字元", + "host.accessFailed": "目前無法更新房間設定,請稍後重試", + "host.viewers.empty": "暫無觀眾", + "host.viewerOverview": "全員連線資料", + "host.quality": "畫質預設", + "host.quality.light": "輕量", + "host.quality.hd": "高畫質", + "host.quality.highFps": "高影格率", + "host.quality.720p30": "720p 30 影格", + "host.quality.1080p30": "1080p 30 影格", + "host.quality.1080p60": "1080p 60 影格", + "host.advanced": "分享設定", + "host.settings.button": "分享設定", + "host.settings.picture": "畫面", + "host.settings.pictureDetails": "畫面細調", + "host.settings.pictureLimits": "目前畫面上限", + "host.settings.sound": "聲音", + "host.settings.connection": "連線設定", + "host.advanced.resolution": "解析度上限", + "host.advanced.framerate": "影格率上限", + "host.advanced.bitrate": "視訊位元率上限", + "host.advanced.preference": "畫面偏好", + "host.advanced.preference.resolution": "清晰", + "host.advanced.preference.balanced": "均衡", + "host.advanced.preference.framerate": "流暢", + "host.advanced.preference.resolutionHint": "保留細節", + "host.advanced.preference.balancedHint": "自動權衡", + "host.advanced.preference.framerateHint": "優先影格率", + "host.advanced.audio": "音訊品質", + "host.advanced.audioBitrate": "音訊位元率上限", + "host.video.width": "寬度上限(像素)", + "host.video.height": "高度上限(像素)", + "host.video.commonRange": "常用範圍", + "host.video.custom": "自訂", + "host.video.returnCommon": "返回常用範圍", + "host.video.returnCommonHint": "使用最接近的常用級距:{value} {unit}。", + "host.video.inputHint": "拖曳選擇常用值,也可直接輸入 {min}–{max} {unit}。", + "host.video.resolutionHint": "寬 ≤ {width},高 ≤ {height} 像素;總像素 ≤ {pixels}。保留來源比例,影格率上限隨尺寸調整。", + "host.video.resolutionPreset": "最高 {width} × {height} 像素", + "host.video.resolution1440p": "最高 {width} × {height} 像素(QHD,常稱 2K)", + "host.video.resolution2160p": "最高 {width} × {height} 像素(4K)", + "host.video.resolutionInvalid": "寬高需為不小於 4 的偶數,上限為 {width} × {height},總像素不超過 {pixels}。", + "host.quality.invalidNumber": "請輸入 {min}–{max} {unit},間隔為 {step}。", + "host.audio.bitrateHint": "音訊位元率上限:{min}–{max} kbps。", + "host.advanced.audio.saver": "普通", + "host.advanced.audio.music": "音樂", + "host.advanced.audio.veryHigh": "保真", + "host.advanced.route": "路由策略", + "host.advanced.route.sfuOnly": "伺服器轉發", + "host.advanced.route.sfuOnlyHint": "此站點的共享畫面與聲音統一由媒體伺服器轉發", + "host.advanced.route.topo": "自動優化拓撲", + "host.advanced.route.topoHint": "觀看時逐步選擇較穩定的連線", + "host.advanced.route.peerOnly": "隱私模式", + "host.advanced.route.peerOnlyHint": "僅透過裝置間連線(P2P)傳輸畫面。連線不通時,觀眾將無法觀看", + "host.advanced.route.peerOnlyRequired": "目前服務僅支援裝置間連線(P2P),隱私模式無法關閉", + "host.advanced.codec": "視訊編碼", + "host.advanced.codec.auto": "自動", + "host.advanced.codec.autoHint": "自動選擇", + "host.advanced.codec.vp8Hint": "相容優先", + "host.details": "連線詳細資訊", + "host.details.show": "顯示連線詳細資訊", + "host.details.hide": "隱藏連線詳細資訊", + "host.topology": "連線拓撲", + "host.topology.show": "顯示連線拓撲", + "host.topology.hide": "隱藏連線拓撲", + "host.topology.pending": "連線中", + "state.signal.connected": "伺服器已連線", + "state.signal.connecting": "正在連線", + "state.signal.reconnecting": "正在恢復", + "state.signal.offline": "未連線伺服器", + "state.peer.connected": "已連線", + "state.peer.connecting": "正在連線", + "state.peer.routing": "線路分配中", + "state.peer.waiting": "等待開始分享", + "state.peer.reconnecting": "正在恢復", + "state.peer.disconnected": "連線中斷", + "state.route.p2p": "P2P 直連", + "state.route.sfu": "伺服器中轉", + "stats.title": "連線資料", + "stats.sharedMedia": "分享畫面與聲音", + "stats.relay": "轉發資料", + "stats.downstream": "下游接收資料", + "stats.more": "詳細指標", + "stats.group.network": "網路", + "stats.group.encoding": "編碼", + "stats.group.capture": "編碼與擷取", + "stats.group.playback": "播放", + "stats.group.sourceAudio": "來源聲音", + "stats.less": "收起詳細指標", + "stats.resolution": "解析度", + "stats.fps": "影格率", + "stats.bitrate": "位元率", + "stats.loss": "封包遺失率", + "stats.rtt": "RTT", + "stats.codec": "視訊編碼", + "stats.jitter": "網路抖動", + "stats.dropped": "本次遺失影格", + "stats.encoder": "編碼器", + "stats.audio": "音訊位元率", + "stats.unknown": "未知", + "stats.outgoing": "可用上傳頻寬", + "stats.qualityState": "品質狀態", + "stats.quality.normal": "正常", + "stats.quality.bandwidth": "頻寬受限", + "stats.quality.cpu": "編碼受限", + "stats.quality.other": "其他限制", + "stats.quality.unclassified": "未分類限制", + "stats.capture": "擷取設定", + "stats.inputFps": "輸入影格率", + "stats.encodeMs": "每影格編碼", + "stats.decodeMs": "每影格解碼", + "state.peer.stuttering": "最近畫面卡頓", + "stats.freezeCount": "卡頓次數", + "stats.freezeDuration": "卡頓時長", + "stats.audioLoss": "音訊封包遺失率", + "stats.audioJitter": "音訊抖動", + "stats.playoutDelta": "影音播放差", + "stats.videoBuffer": "視訊緩衝", + "stats.audioBuffer": "音訊緩衝", + "stats.audioConcealedRate": "音訊補償率", + "stats.audioConcealed": "音訊補償", + "viewer.title": "{name} 的螢幕", + "viewer.titleFallback": "好友螢幕", + "viewer.title.watching": "觀看中", + "viewer.title.waiting": "等待中", + "viewer.reconnect": "重新連線", + "viewer.theater": "劇場模式", + "viewer.theater.exit": "退出劇場模式", + "viewer.msg.joining": "正在加入房間", + "viewer.msg.waitingHost": "等待開始分享", + "viewer.msg.preparingP2p": "正在建立 P2P", + "viewer.msg.connectionRetry": "正在重試({current}/{total})", + "viewer.msg.preparingSfu": "正在連線伺服器中轉", + "viewer.msg.allocating": "正在分配線路", + "viewer.msg.receiving": "正在接收畫面", + "viewer.msg.playing": "正在播放", + "viewer.msg.needsPlay": "點選播放", + "viewer.msg.hostPaused": "房主已暫停分享", + "viewer.msg.recovering": "正在恢復連線", + "viewer.msg.routeFailed": "沒有可用的媒體線路,可重新整理重試", + "viewer.msg.videoRejected": "目前瀏覽器無法接收畫面,請嘗試更換瀏覽器", + "viewer.msg.playbackFailed": "無法播放目前畫面,請重新整理重試", + "viewer.msg.hostOffline": "房主連線已中斷", + "viewer.msg.serverError": "連線服務暫時不可用", + "viewer.msg.notFound": "房間不存在", + "viewer.msg.denied": "目前無法透過房間代碼加入", + "viewer.msg.invalidInvite": "邀請連結無效或已失效", + "viewer.msg.closed": "房間已關閉", + "viewer.msg.full": "房間已滿", + "viewer.msg.accessFailed": "暫時無法加入房間", + "viewer.hint.accessFailed": "重新整理頁面後重試,或使用房主發來的邀請連結。", + "viewer.hint.full": "等有空位後再試。", + "viewer.msg.stale": "頁面版本已更新,請重新整理後重試", + "viewer.msg.sessionReplaced": "連線已由另一個頁面接管", + "viewer.msg.signalTerminated": "連線已終止,請重新整理後重試", + "viewer.notice.signalRecovering": "伺服器連線正在恢復", + "viewer.notice.hostOffline": "房主連線已中斷,畫面可能停住", + "viewer.hint.denied": "請使用房主發來的邀請連結,或輸入房間密碼。", + "viewer.hint.notFound": "請確認這是 {site} 的房間代碼,或開啟房主的邀請連結。", + "viewer.hint.closed": "請讓房主重新建立房間並傳送邀請。", + "viewer.hint.sessionReplaced": "請前往另一頁面繼續,或重新整理本頁重新連線。", + "viewer.hint.invite": "請讓房主重新傳送邀請連結。", + "viewer.hint.generic": "請稍後重新整理頁面重試。", + "mode.language": "介面語言", + "header.more": "更多選項", + "theme.dark": "切換為深色模式", + "theme.light": "切換為淺色模式", + "theme.dark.short": "深色", + "theme.light.short": "淺色", + "gate.connectFailed": "無法連線站點,請檢查網路後重試", + "gate.expired": "站點存取已失效,請重新驗證", + "gate.serviceUnavailable": "站點服務暫不可用 ({status}),請稍後重試", + "api.originNotAllowed": "目前網址不在伺服器允許的範圍內 (403),請聯絡管理員。", + "host.notStarted": "尚未開始", + "host.startCancelled": "啟動已取消", + "host.switchingSource": "正在切換來源", + "host.stageAria": "分享或加入房間", + "host.captureAria": "實際擷取參數", + "host.quality.title": "{label} · {mbps} Mbps", + "host.audio.title": "{label} · {kbps} kbps 上限", + "host.roomClosed": "房間已關閉", + "host.pause.noTracksResume": "無法恢復分享,請重新選擇來源", + "host.pause.signalRecovering": "伺服器連線正在恢復,分享仍保持暫停", + "host.pause.noTracksPause": "無法暫停分享,請重新選擇來源", + "host.pause.stillPaused": "分享仍保持暫停", + "host.shareEnded": "目前分享已經結束", + "host.fail.start": "啟動分享失敗", + "host.err.createConnection": "建立連線失敗", + "host.err.codecUnsupported": "瀏覽器不支援所需的視訊編碼,請更新或更換瀏覽器", + "host.fail.source": "切換分享來源失敗", + "host.fail.quality": "套用畫質設定失敗", + "host.fail.connection": "觀看連線處理失敗", + "host.fail.room": "房間操作失敗", + "host.err.invalidToken": "分享憑證已失效,請重新建立房間", + "host.err.accessDenied": "目前操作沒有權限", + "host.err.alreadyConnected": "此房間已在另一個頁面中分享", + "host.err.peerGone": "對應的觀看連線已經離開", + "host.err.forbidden": "目前操作不可用", + "host.err.serverError": "服務暫時不可用,請稍後重試", + "host.err.createRoomStatus": "目前無法建立房間 ({status})", + "host.err.roomCapacity": "站點房間代碼已用滿,請稍後重試或使用其他 Piik 站點。", + "host.err.replaceRoomStatus": "目前無法更換房間 ({status})", + "host.err.updateRoomStatus": "目前無法更新房間設定 ({status})", + "host.capture.cancelled": "螢幕選擇已取消或沒有共享權限", + "host.capture.noSource": "沒有可用的螢幕分享來源", + "host.capture.readFailed": "無法讀取所選分享來源,請重新選擇來源", + "host.capture.unavailable": "目前頁面無法啟動螢幕分享", + "host.capture.inactive": "請回到目前頁面,再點選分享並選擇來源。", + "host.capture.constraints": "所選來源無法滿足目前畫面設定。請降低設定或換一個來源。", + "host.notice.reconnecting": "部分觀眾正在重新連線", + "host.notice.sfuRecovering": "伺服器中轉的畫面來源未切換成功,正在恢復觀看連線", + "host.password.inputPlaceholder": "輸入密碼", + "stats.warn.codec": "視訊編碼為 {codec},預期 H264 或 VP8", + "stats.warn.audioCodec": "音訊編碼為 {codec},預期 Opus", + "viewer.msg.joinUnavailable": "暫時無法加入房間", + "viewer.stageAria": "共享畫面", + "host.warn.audioUnread": "瀏覽器未讀回音訊位元率上限", + "host.warn.audioRewritten": "瀏覽器將音訊位元率上限改寫為 {kbps} kbps", + "host.warn.senderPartial": "瀏覽器未完整接受{params}", + "host.warn.param.maxBitrate": "位元率上限", + "host.warn.param.maxFramerate": "影格率上限", + "host.warn.param.scaleResolutionDownBy": "解析度縮放", + "host.warn.param.degradationPreference": "品質優先級", + "host.warn.param.scalabilityMode": "可擴充模式", + "host.warn.sfuRecover": "伺服器中轉{params}失敗,已啟動自動恢復", + "host.warn.sfuStage.connect": "連線", + "host.warn.sfuStage.source": "分享來源", + "host.warn.sfuStage.videoPublish": "視訊發布", + "host.warn.sfuStage.senderConfig": "影片參數組態", + "host.warn.sfuStage.audioPublish": "音訊發布", + "host.warn.sfuStage.transport": "傳輸", + "host.fail.sfuSwitch": "切換伺服器中轉的畫面來源失敗", + "host.fail.sfuAudioParams": "套用伺服器中轉的音訊參數失敗", + "host.fail.sfuParams": "套用伺服器中轉的傳送參數失敗", + "client.connect.replace": "將替換 {site},並中斷它的 App 連線。", + "voice.offline": "已中斷連線", + "interaction.effects": "顯示互動動效", + "host.capture.fpsUnknown": "影格率未知", + "host.capture.codecPending": "編碼待定", + "host.capture.hasAudio": "含來源音訊", + "host.capture.noAudio": "無來源音訊" +}; diff --git a/src/client/locales/zh.ts b/src/client/locales/zh.ts index 2bd13e437..d7cd2546e 100644 --- a/src/client/locales/zh.ts +++ b/src/client/locales/zh.ts @@ -1,7 +1,17 @@ import type { GlyphName } from "../ui/icons"; -// Canonical catalog: add keys here first; every other locale must match it. +// Canonical keys; English stays complete and other languages may be partial. export const zh = { + "playback.buffering": "播放缓冲", + "playback.increaseBuffer": "增加播放缓冲", + "playback.bufferTarget": "总缓冲目标", + "playback.bufferHint": "设置接收端等待数据的目标时间,可减少网络抖动造成的卡顿,但会增加观看延迟,也可能延后转发的画面。", + "playback.bufferUnsupported": "当前接收路径不支持设置缓冲目标。", + "playback.bufferFailed": "未能应用此缓冲目标,播放继续。", + "host.invite.qr": "邀请二维码", + "host.invite.qrShort": "二维码", + "host.invite.qrHint": "用另一台设备扫码加入房间。", + "host.invite.qrFailed": "无法生成二维码,请复制邀请链接。", "state.peer.present": "已在房间", "state.peer.voiceConnected": "语音已连接", "host.topology.idle": "已在房间,暂无媒体线路。", @@ -809,7 +819,7 @@ export const zh = { "viewer.hint.generic": "请稍后刷新页面重试。", "mode.language": "界面语言", - "mode.more": "更多语言", + "mode.more": "语言与显示", "header.more": "更多选项", "mode.vis": "纯视觉", "theme.dark": "切换到暗色模式", diff --git a/src/client/media/video-geometry.ts b/src/client/media/video-geometry.ts index 6fb4bf21c..f182f8c8f 100644 --- a/src/client/media/video-geometry.ts +++ b/src/client/media/video-geometry.ts @@ -62,6 +62,10 @@ export function pictureRect(video: HTMLVideoElement): { left: number; top: numbe } export function picturePoint(video: HTMLVideoElement, clientX: number, clientY: number): PicturePoint | null { + // Cover can project source pixels beyond the video box, which clips them even after zoom/pan. + const bounds = video.getBoundingClientRect(); + if (clientX < bounds.left || clientX > bounds.left + bounds.width + || clientY < bounds.top || clientY > bounds.top + bounds.height) return null; const rect = pictureRect(video); if (!rect) return null; const x = (clientX - rect.left) / rect.width, y = (clientY - rect.top) / rect.height; diff --git a/src/client/media/viewer-sfu-route.ts b/src/client/media/viewer-sfu-route.ts index f99718212..0922c98af 100644 --- a/src/client/media/viewer-sfu-route.ts +++ b/src/client/media/viewer-sfu-route.ts @@ -1,3 +1,4 @@ +import { validatePlaybackBufferTarget, type PlaybackBufferStatus } from "../webrtc/receiver-buffer-target"; import type { ClientMessage, MediaRoutePhase, @@ -22,6 +23,8 @@ import { } from "./route-transition"; interface ViewerSubscriberTransport { + setPlaybackBufferTarget?(target: number | null): PlaybackBufferStatus; + getPlaybackBufferStatus?(): PlaybackBufferStatus; getRemoteInput?(): RTCDataChannel | null; connect(config: SfuConnectionConfig): Promise; updateConfig(config: SfuConnectionConfig): void; @@ -53,6 +56,7 @@ interface ViewerSubscriberSlot { } interface ViewerSfuRouteEvents { + onPlaybackBufferStatus?: (status: PlaybackBufferStatus) => void; onInputChanged?: () => void; activatePeer: ( assignment: ParticipantRouteAssignment, @@ -92,6 +96,7 @@ interface ViewerSfuRouteEvents { send: (message: ClientMessage) => boolean; createSubscriber?: ( events: { + onPlaybackBufferStatus?: (status: PlaybackBufferStatus) => void; onStream: (stream: MediaStream | null) => void; onVideoAvailability: (available: boolean) => void; onStats: (metrics: ConnectionMetrics) => void; @@ -103,6 +108,14 @@ interface ViewerSfuRouteEvents { } export class ViewerSfuRoute { + private playbackBufferTargetMs: number | null = null; + setPlaybackBufferTarget(target: number | null): PlaybackBufferStatus { + validatePlaybackBufferTarget(target); + this.playbackBufferTargetMs = target; + for (const slot of new Set([this.active, this.pending])) slot?.subscriber.setPlaybackBufferTarget?.(target); + return this.getPlaybackBufferStatus(); + } + getPlaybackBufferStatus(): PlaybackBufferStatus { return this.active?.subscriber.getPlaybackBufferStatus?.() ?? null; } getRemoteInput(): RTCDataChannel | null { return this.active?.subscriber.getRemoteInput?.() ?? null; } private readonly route = new MediaRouteTransition(); private pending: ViewerSubscriberSlot | null = null; @@ -456,6 +469,7 @@ export class ViewerSfuRoute { let slot: ViewerSubscriberSlot; const subscriberEvents = { send: this.events.send, + onPlaybackBufferStatus: (status: PlaybackBufferStatus) => { if (this.active === slot) this.events.onPlaybackBufferStatus?.(status); }, onInputChanged: () => { if (this.active === slot) this.events.onInputChanged?.(); }, onStream: (stream: MediaStream | null) => { if (stream) { @@ -524,6 +538,7 @@ export class ViewerSfuRoute { activationToken: null, }; this.pending = slot; + subscriber.setPlaybackBufferTarget?.(this.playbackBufferTargetMs); this.events.onSfuFailure?.(null, slot.revision); try { const connected = await subscriber.connect(message); @@ -866,6 +881,7 @@ export class ViewerSfuRoute { await disconnectSubscriber(slot.subscriber); return; } + this.events.onPlaybackBufferStatus?.(this.getPlaybackBufferStatus()); this.events.onSfuStream(slot.stream, assignment, true, slot.revision); if (previous && previous !== slot) { previous.failed = true; diff --git a/src/client/native/client.ts b/src/client/native/client.ts index 426269c69..d7c0e9ea2 100644 --- a/src/client/native/client.ts +++ b/src/client/native/client.ts @@ -130,7 +130,7 @@ export async function discoverNativeHealth( } /** A local approval address is not permission to use native media. */ -export async function discoverNativeConnect(signal?: AbortSignal): Promise { +export async function discoverNativeConnect(options: NativeDiscoveryOptions = {}): Promise { return discoverNative("connect-discovery", body => { const { connectURL } = nativeConnectSchema.parse(body); const url = new URL(connectURL); @@ -140,7 +140,7 @@ export async function discoverNativeConnect(signal?: AbortSignal): Promise( diff --git a/src/client/native/media-bridge.ts b/src/client/native/media-bridge.ts index 187ceafa5..44f3dbaab 100644 --- a/src/client/native/media-bridge.ts +++ b/src/client/native/media-bridge.ts @@ -1,3 +1,4 @@ +import { applyPlaybackBufferTarget, validatePlaybackBufferTarget, type PlaybackBufferStatus } from "../webrtc/receiver-buffer-target"; import type { SignalPayload } from "../../shared/protocol"; import { createOpaqueId } from "../lib/opaque-id"; import { browserDebugEnabled, debugError, debugEvent } from "../lib/debug"; @@ -60,6 +61,7 @@ export class NativeMediaBridge { private readonly onFailed: () => void, private readonly sourceConnectionId?: string, onRemoteInput: () => void = () => {}, + private playbackBuffer?: { target: number | null; changed?: (status: PlaybackBufferStatus) => void }, ) { this.remoteInput = new RemoteInputChannel(() => { if (!this.disposed) onRemoteInput(); }); let peer: RTCPeerConnection | undefined; @@ -74,6 +76,22 @@ export class NativeMediaBridge { } } + private playbackBufferStatus: PlaybackBufferStatus = null; + setPlaybackBufferTarget(target: number | null): PlaybackBufferStatus { + validatePlaybackBufferTarget(target); + this.playbackBuffer = { ...this.playbackBuffer, target }; + return this.applyPlaybackBuffer(); + } + getPlaybackBufferStatus(): PlaybackBufferStatus { return this.playbackBufferStatus; } + private applyPlaybackBuffer(): PlaybackBufferStatus { + // Host preview callers omit this optional Viewer-only preference entirely. + if (!this.playbackBuffer) return null; + const status = this.disposed ? null : applyPlaybackBufferTarget(this.peer.getReceivers(), this.playbackBuffer.target); + this.playbackBufferStatus = status; + this.playbackBuffer.changed?.(status); + return status; + } + collectMetrics(accumulator: StatsAccumulator): Promise { return collectConnectionMetrics(this.peer, "receive", accumulator); } @@ -96,6 +114,7 @@ export class NativeMediaBridge { this.remoteInput.attach(this.peer); this.peer.addEventListener("track", (event) => { if (this.disposed) return; + this.applyPlaybackBuffer(); if (!this.stream.getTracks().includes(event.track)) this.stream.addTrack(event.track); if (event.track.kind === "video") event.track.addEventListener("ended", () => this.fail("track-ended"), { once: true }); this.completeNegotiation?.(); @@ -131,6 +150,7 @@ export class NativeMediaBridge { dispose(): void { if (this.disposed) return; this.disposed = true; + this.applyPlaybackBuffer(); this.releaseDebug?.(); this.remoteInput.dispose(); this.lifetime.abort(); diff --git a/src/client/native/native-viewer-peer.ts b/src/client/native/native-viewer-peer.ts index bf4f0208f..3acfc1901 100644 --- a/src/client/native/native-viewer-peer.ts +++ b/src/client/native/native-viewer-peer.ts @@ -1,3 +1,4 @@ +import { validatePlaybackBufferTarget, type PlaybackBufferStatus } from "../webrtc/receiver-buffer-target"; import type { IceConfig, SignalPayload } from "../../shared/protocol"; import { parse, parsePayloads } from "sdp-transform"; import { observeDecodedFrameProof } from "../media/decoded-frame-proof"; @@ -71,6 +72,13 @@ export class NativeCapableViewerPeer implements ViewerMediaPeer { }; } + setPlaybackBufferTarget(target: number | null): PlaybackBufferStatus { + validatePlaybackBufferTarget(target); + this.options = { ...this.options, playbackBufferTargetMs: target }; + return this.backend?.setPlaybackBufferTarget?.(target) ?? null; + } + getPlaybackBufferStatus(): PlaybackBufferStatus { return this.backend?.getPlaybackBufferStatus?.() ?? null; } + acceptSignal(parentPeerId: string, payload: SignalPayload): Promise { if (payload.kind === "punch") { if (this.disposed) return Promise.resolve(); @@ -231,6 +239,7 @@ export class NativeCapableViewerPeer implements ViewerMediaPeer { } class NativeViewerPeer implements ViewerMediaPeer { + private playbackBufferTargetMs: number | null; getRemoteInput(): RTCDataChannel | null { return this.bridge?.getRemoteInput() ?? null; } private currentIceConfig: PeerIceConfig; private parentPeerId: string | null = null; @@ -282,6 +291,7 @@ class NativeViewerPeer implements ViewerMediaPeer { private readonly edgeCapacity: number, private readonly onFailure: () => void, ) { + this.playbackBufferTargetMs = options.playbackBufferTargetMs ?? null; this.currentIceConfig = iceConfig; this.recoveryOwner = options.recoveryOwner ?? "viewer"; this.recoveryBudget = options.recoveryBudget ?? createViewerRecoveryBudget(); @@ -292,6 +302,13 @@ class NativeViewerPeer implements ViewerMediaPeer { }); } + setPlaybackBufferTarget(target: number | null): PlaybackBufferStatus { + validatePlaybackBufferTarget(target); + this.playbackBufferTargetMs = target; + return this.bridge?.setPlaybackBufferTarget(target) ?? null; + } + getPlaybackBufferStatus(): PlaybackBufferStatus { return this.bridge?.getPlaybackBufferStatus() ?? null; } + async acceptSignal(parentPeerId: string, payload: SignalPayload): Promise { if (this.disposed) return; if (payload.kind === "punch") return; @@ -538,6 +555,7 @@ class NativeViewerPeer implements ViewerMediaPeer { () => this.handlePlaybackFailure(bridge, connectionId), connectionId, () => { if (this.bridge === bridge) this.emit(); }, + { target: this.playbackBufferTargetMs, changed: status => { if (this.bridge === bridge) this.events.onPlaybackBufferStatus?.(status); } }, ); this.bridge = bridge; void bridge.start(result.audio).then((stream) => { diff --git a/src/client/pages/ControlsPreview.tsx b/src/client/pages/ControlsPreview.tsx index 6c1e07607..0d6451777 100644 --- a/src/client/pages/ControlsPreview.tsx +++ b/src/client/pages/ControlsPreview.tsx @@ -11,6 +11,7 @@ import { RoomInteractions } from "../components/living/RoomInteractions"; import { RoomChatOverlay, RoomChatOverlaySettings, RoomChatToggle } from "../components/living/RoomChatOverlay"; import { REACTION_IDS, type ReactionId } from "../../shared/room-interactions"; import { PlaybackControls } from "../components/living/PlaybackControls"; +import { InviteQrCode } from "../components/living/InviteQrCode"; import { BrandMark } from "../components/living/BrandMark"; import { SharingSettings } from "../components/living/SharingSettings"; import { ShareMicrophoneSettings } from "../components/living/ShareMicrophoneSettings"; @@ -245,6 +246,7 @@ export function ControlsPreview() {
{inviteAvailable &&
+ diff --git a/src/client/pages/HostPage.tsx b/src/client/pages/HostPage.tsx index fdc8be164..9002deb39 100644 --- a/src/client/pages/HostPage.tsx +++ b/src/client/pages/HostPage.tsx @@ -31,6 +31,7 @@ import { LiveAudioExclusion } from "../components/living/AudioExclusionSelect"; import { RoomInteractions } from "../components/living/RoomInteractions"; import { RoomChatOverlay, RoomChatOverlaySettings, RoomChatToggle } from "../components/living/RoomChatOverlay"; import { PlaybackControls } from "../components/living/PlaybackControls"; +import { InviteQrCode } from "../components/living/InviteQrCode"; import { useTheaterMode } from "../components/living/use-theater-mode"; import { useHostPreviewPlayback } from "../components/living/use-host-preview-playback"; import { readRoomPreferences, saveRoomPreferences } from "../lib/room-preferences"; @@ -234,7 +235,12 @@ type NoticeValue = ( }; type StatusNoticeMessage = string | { key: CopyKey; vars?: Record; failureCode?: string }; -type SourceSwitch = { replacingVideo?: MediaStreamTrack; audioOnly?: boolean; nativePending?: boolean }; +type SourceSwitch = { + replacingVideo?: MediaStreamTrack; + audioOnly?: boolean; + nativePending?: boolean; + retireNative?: () => void; +}; type ViewerQualityEvidence = Extract< ServerMessage, @@ -1064,6 +1070,12 @@ export function HostPage({ setPhase("ended"); } + function endNativeSharing(message: StatusNoticeMessage, comic: ComicKind, tone: ComicTone): void { + const replacement = sourceSwitchRef.current?.retireNative; + if (replacement) replacement(); + else endSharing(message, true, comic, tone); + } + function endRoomSession( message: StatusNoticeMessage, comic: ComicKind, @@ -1414,9 +1426,8 @@ export function HostPage({ bridge?.dispose(); return; } - endSharing( + endNativeSharing( event.failed ? { key: "host.shareEnded", failureCode: "app/capture/failed" } : { key: "host.stopNotice" }, - true, event.failed ? "source-failed" : "share-ended", event.failed ? "bad" : "off", ); @@ -1521,7 +1532,7 @@ export function HostPage({ if (nativeMediaIngressRef.current) { recoverBrowserFanout(nativeMediaIngressRef.current); } else if (nativeModeRef.current && activeGenerationRef.current !== null) { - endSharing({ key: "native.fail.controlDisconnected", failureCode: "app/control/disconnected" }, true, "route-failed", "bad"); + endNativeSharing({ key: "native.fail.controlDisconnected", failureCode: "app/control/disconnected" }, "route-failed", "bad"); } updateHostRelayCapacity(); } @@ -3327,8 +3338,25 @@ export function HostPage({ } // Some browsers retire the old camera while opening the new one. That // transition belongs to this replacement, not the share-ended observer. - const token = { replacingVideo: source === "camera" && hostAudioRef.current?.sourceKind === "camera" + const wasNative = nativeModeRef.current; + const reboundPeerIds: string[] = []; + let nativeRetirement: Promise | null = null; + const token: SourceSwitch = { replacingVideo: source === "camera" && hostAudioRef.current?.sourceKind === "camera" ? streamRef.current?.getVideoTracks()[0] : undefined }; + if (wasNative) token.retireNative = () => { + // The old producer can end while independent Browser permission waits. + // Retire its resources without retiring this source-selection operation. + delete token.retireNative; + reboundPeerIds.push(...retireNativeSenderPeers()); + disposeNativeShare(); + streamRef.current?.getTracks().forEach(track => track.stop()); + streamRef.current = null; + setStream(null); + setDetails(null); + audioAvailableRef.current = false; + signalRef.current?.setAudioAvailable(false); + nativeRetirement = hostSfuRouteRef.current?.replaceStream(null, true) ?? Promise.resolve(true); + }; sourceSwitchRef.current = token; closeCaptureSourcePicker(); setSourceSwitch(token); @@ -3343,7 +3371,9 @@ export function HostPage({ isCurrentGeneration(generation) && sourceSwitchRef.current === token ) { - if (token.replacingVideo?.readyState === "ended") { + if (!streamRef.current && isCapturePermissionFailure(error, "source")) { + endSharing({ key: "host.stopNotice" }); + } else if (!streamRef.current || token.replacingVideo?.readyState === "ended") { endSharing({ key: "host.shareEnded" }, true, "source-failed", "bad"); } else { setCaptureError(error, source, "source"); @@ -3363,13 +3393,12 @@ export function HostPage({ try { if (source === "camera") setCameraDevice(deviceId); - const reboundPeerIds: string[] = []; - const wasNative = nativeModeRef.current; if (wasNative) { const shareGeneration = shareGenerationRef.current!; const audio = createBrowserAudio(captured, source, generation, shareGeneration); try { captured = await audio.start(); + await nativeRetirement; if (!isCurrentShare(generation, shareGeneration) || sourceSwitchRef.current !== token) { captured.getTracks().forEach(track => track.stop()); audio.dispose(); @@ -3384,6 +3413,7 @@ export function HostPage({ } // Permission and audio setup succeeded; only now retire the old source. token.replacingVideo = streamRef.current?.getVideoTracks()[0]; + delete token.retireNative; reboundPeerIds.push(...retireNativeSenderPeers()); disposeNativeShare(); hostAudioRef.current = audio; @@ -3399,7 +3429,10 @@ export function HostPage({ } } catch (error) { if (captured !== streamRef.current) captured.getVideoTracks().forEach(track => track.stop()); - if (isCurrentGeneration(generation)) setNoticeError(error, "source"); + if (isCurrentGeneration(generation)) { + if (!streamRef.current) endSharing({ key: "host.shareEnded" }, true, "source-failed", "bad"); + else setNoticeError(error, "source"); + } } finally { finishSourceSwitch(token); } @@ -4553,6 +4586,7 @@ export function HostPage({ />
+ {roomLink ? ( { - if (!viewer || new URLSearchParams(location.search).get("settings") !== "relay") return; + if (!viewer || !["relay", "buffering"].includes(new URLSearchParams(location.search).get("settings") ?? "")) return; const settings = document.querySelector(".lr-playback-more button"); settings?.scrollIntoView({ block: "center" }); const frame = requestAnimationFrame(() => { @@ -133,6 +133,8 @@ function PlaybackSample({ role }: { role: PreviewRole }) { const [pictureRotation, setPictureRotation] = useState(0); const [previewAutoPause, setPreviewAutoPause] = useState(() => readRoomPreferences().previewAutoPause); const [viewerRoute, setViewerRoute] = useState<"auto" | "p2p" | "sfu">("auto"); + const [bufferTarget, setBufferTarget] = useState(null); + const [bufferStatus, setBufferStatus] = useState<"supported" | "unsupported" | "failed">("supported"); const [relayVolunteer, setRelayVolunteer] = useState(false); const [relayCapacity, setRelayCapacity] = useState(DEFAULT_ENDPOINT_MEDIA_COPY_CAPACITY); const relayLimits = { capacity: relayVolunteer ? relayCapacity : DEFAULT_ENDPOINT_MEDIA_COPY_CAPACITY, @@ -184,6 +186,9 @@ function PlaybackSample({ role }: { role: PreviewRole }) { return
{!theaterMode ?
+ {viewer && }
@@ -230,6 +235,7 @@ function PlaybackSample({ role }: { role: PreviewRole }) { sourceAudio.current?.setVolume(muted ? 0 : level); setShareVolume({ level, muted }); } }} settings={{ pictureFit, setPictureFit, pictureRotation, setPictureRotation, + buffering: viewer ? { target: bufferTarget, status: bufferStatus, onChange: setBufferTarget } : undefined, preview: viewer ? undefined : { autoPause: previewAutoPause, onChange: autoPause => { setPreviewAutoPause(autoPause); saveRoomPreferences({ previewAutoPause: autoPause }); } }, diff --git a/src/client/pages/ViewerPage.tsx b/src/client/pages/ViewerPage.tsx index ae35f22e1..8f5108ce1 100644 --- a/src/client/pages/ViewerPage.tsx +++ b/src/client/pages/ViewerPage.tsx @@ -108,6 +108,7 @@ import { nextViewerMediaBinding, playbackFailure, prepareViewerPlayback, type Re import { observeCompositedVideoFrame } from "../media/video-frame-proof"; import { exactPeerSignalOwner } from "../media/route-transition"; import { ViewerSfuRoute } from "../media/viewer-sfu-route"; +import type { PlaybackBufferStatus } from "../webrtc/receiver-buffer-target"; import type { ConnectionMetrics, PeerSnapshot, @@ -263,6 +264,16 @@ export function ViewerPage({ const videoRef = useRef(null); const peerRef = useRef(null); const viewerSfuRouteRef = useRef(null); + const [screenBufferTargetMs, setScreenBufferTargetMs] = useState(() => readRoomPreferences().screenBufferTargetMs); + const screenBufferTargetRef = useRef(screenBufferTargetMs); + const [screenBufferStatus, setScreenBufferStatus] = useState(null); + const applyScreenBufferRef = useRef<((target: number | null) => void) | null>(null); + function changeScreenBuffer(target: number | null): void { + screenBufferTargetRef.current = target; + setScreenBufferTargetMs(target); + saveRoomPreferences({ screenBufferTargetMs: target }); + applyScreenBufferRef.current?.(target); + } const signalRef = useRef(null); const [interactionSession, setInteractionSession] = useState(null); const [roomVoiceSession, setRoomVoiceSession] = useState(null); @@ -504,6 +515,19 @@ export function ViewerPage({ Extract > = []; let pendingPeer: PendingPeerRoute | null = null; + function refreshScreenBufferStatus(): void { + if (!active) return; + setScreenBufferStatus(currentRouteAssignment?.upstream.kind === "sfu" + ? viewerSfuRoute?.getPlaybackBufferStatus() ?? null + : peerRef.current?.getPlaybackBufferStatus?.() ?? null); + } + applyScreenBufferRef.current = target => { + peerRef.current?.setPlaybackBufferTarget?.(target); + pendingPeer?.peer?.setPlaybackBufferTarget?.(target); + viewerSfuRoute?.setPlaybackBufferTarget(target); + refreshScreenBufferStatus(); + }; + setScreenBufferStatus(null); const messageAuthority = new ViewerMessageAuthority(); const relayChildEvidenceStore = new ViewerQualityEvidenceStore((values) => { if (active) setRelayChildEvidence(values); @@ -530,18 +554,23 @@ export function ViewerPage({ events: ViewerPeerEvents, options: ViewerPeerOptions, ): ViewerMediaPeer { + let peer: ViewerMediaPeer; + const receiverEvents = { ...events, onPlaybackBufferStatus: () => { + if (peerRef.current === peer) refreshScreenBufferStatus(); + } }; + const receiverOptions = { ...options, playbackBufferTargetMs: screenBufferTargetRef.current }; if (!clientActivationRef.current) { - return new ViewerPeer(iceConfig, events, options); - } - return new NativeCapableViewerPeer( + peer = new ViewerPeer(iceConfig, receiverEvents, receiverOptions); + } else peer = new NativeCapableViewerPeer( iceConfig, - events, - options, + receiverEvents, + receiverOptions, acquireNativeClient, () => { nativeViewerAvailable = false; }, nativeViewerSessionId, MAX_VIEWERS_PER_ROOM_LIMIT, ); + return peer; } let pageSuspended = document.visibilityState !== "visible"; @@ -747,6 +776,7 @@ export function ViewerPage({ activePeerMetrics = null; } pendingRouteConnection = null; + refreshScreenBufferStatus(); } function acceptRelayChildEvidence(evidence: ViewerQualityEvidence): void { @@ -1013,6 +1043,7 @@ export function ViewerPage({ } let route: ViewerSfuRoute; route = new ViewerSfuRoute(currentPeerId!, { + onPlaybackBufferStatus: refreshScreenBufferStatus, onInputChanged: () => refreshInput(value => value + 1), activatePeer: async (assignment, revision) => { if (!active || viewerSfuRoute !== route) { @@ -1243,6 +1274,7 @@ export function ViewerPage({ }); viewerSfuRoute = route; viewerSfuRouteRef.current = route; + route.setPlaybackBufferTarget(screenBufferTargetRef.current); return route; } @@ -1293,6 +1325,7 @@ export function ViewerPage({ peer?.dispose(); peerRef.current = null; activePeerMetrics = null; + refreshScreenBufferStatus(); setPeerSnapshot(null); if (clearMedia) { clearRemoteMedia(); @@ -1912,6 +1945,8 @@ export function ViewerPage({ signal.start(); return () => { active = false; + applyScreenBufferRef.current = null; + setScreenBufferStatus(null); requestRelayVolunteerRef.current = null; document.removeEventListener("freeze", suspendForPageLifecycle); document.removeEventListener("resume", recoverFromPageLifecycle); @@ -2331,6 +2366,7 @@ export function ViewerPage({ }, setPictureFit: fit => { setPictureFit(fit); saveRoomPreferences({ pictureFit: fit }); }, + buffering: { target: screenBufferTargetMs, status: screenBufferStatus, onChange: changeScreenBuffer }, remoteTouch: inputRoute.current ? { mode: remoteTouchMode, onChange: mode => { setRemoteTouchMode(mode); saveRoomPreferences({ remoteTouchMode: mode }); }, diff --git a/src/client/sfu/subscriber.ts b/src/client/sfu/subscriber.ts index e48af4593..a235fac5f 100644 --- a/src/client/sfu/subscriber.ts +++ b/src/client/sfu/subscriber.ts @@ -1,3 +1,4 @@ +import { applyPlaybackBufferTarget, validatePlaybackBufferTarget, type PlaybackBufferStatus } from "../webrtc/receiver-buffer-target"; import type { SfuSignalMessage } from "../../shared/protocol"; import { RemoteInputChannel } from "../webrtc/remote-input-channel"; import type { ConnectionMetrics } from "../types"; @@ -13,6 +14,7 @@ import { observeDecodedFrameProof } from "../media/decoded-frame-proof"; import { SfuPeer, type SfuConnectionConfig } from "./peer"; interface SubscriberEvents { + onPlaybackBufferStatus?: (status: PlaybackBufferStatus) => void; onInputChanged?: () => void; send: (message: SfuSignalMessage) => boolean; onStream: (stream: MediaStream | null) => void; @@ -46,7 +48,21 @@ export class SfuSubscriber { private proofMode: "fresh" | "progress" | null = null; private stopProof: (() => void) | null = null; + private playbackBufferTargetMs: number | null = null; + private playbackBufferStatus: PlaybackBufferStatus = null; constructor(private readonly events: SubscriberEvents) {} + setPlaybackBufferTarget(target: number | null): PlaybackBufferStatus { + validatePlaybackBufferTarget(target); + this.playbackBufferTargetMs = target; + return this.applyPlaybackBuffer(); + } + getPlaybackBufferStatus(): PlaybackBufferStatus { return this.playbackBufferStatus; } + private applyPlaybackBuffer(): PlaybackBufferStatus { + const status = applyPlaybackBufferTarget([this.video, this.audio].flatMap(track => track ? [track.receiver] : []), this.playbackBufferTargetMs); + this.playbackBufferStatus = status; + this.events.onPlaybackBufferStatus?.(status); + return status; + } async connect(config: SfuConnectionConfig): Promise { if (this.peer || this.closed) @@ -156,6 +172,7 @@ export class SfuSubscriber { this.detach(this.audio); this.video = null; this.audio = null; + this.applyPlaybackBuffer(); this.stats = createStatsAccumulator(); if (hadVideo) this.events.onVideoAvailability?.(false); if (this.streamEmitted) this.events.onStream(null); @@ -186,6 +203,7 @@ export class SfuSubscriber { this.stopProof = null; this.events.onVideoAvailability?.(false); } else this.audio = null; + this.applyPlaybackBuffer(); this.stats = createStatsAccumulator(); this.emitStream(); }, @@ -194,6 +212,7 @@ export class SfuSubscriber { this.stream.addTrack(track); if (isVideo) this.video = subscribed; else this.audio = subscribed; + this.applyPlaybackBuffer(); this.stats = createStatsAccumulator(); this.emitStream(); if (isVideo) { diff --git a/src/client/styles.css b/src/client/styles.css index ddced0ca5..0745ab70d 100644 --- a/src/client/styles.css +++ b/src/client/styles.css @@ -156,7 +156,7 @@ ul { margin: 0; padding: 0; list-style: none; } @keyframes lr-blink { 50% { opacity: .3; } } -/* Extra locales share one menu after the familiar shortcuts. */ +/* Extra locales and visual mode share the third language control's menu. */ .lr-lang-more > span { display: inline-flex; align-items: center; gap: 2px; pointer-events: none; } .lr-lang-more .lr-glyph:last-child { transition: transform 180ms var(--spring); } .lr-header-controls:has(.lr-language-menu:is(:popover-open, .\:popover-open)) .lr-lang-more .lr-glyph:last-child { transform: rotate(180deg); } @@ -176,7 +176,7 @@ ul { margin: 0; padding: 0; list-style: none; } font: 600 14px/1.4 var(--font); transform-origin: top right; } -.lr-language-menu:is(:popover-open, .\:popover-open) { animation: lr-language-open 180ms var(--spring); } +.lr-language-menu:is(:popover-open, .\:popover-open) { display: block; animation: lr-language-open 180ms var(--spring); } .lr-language-menu.is-above { transform-origin: bottom right; --language-offset: 5px; } @keyframes lr-language-open { from { opacity: 0; transform: translateY(var(--language-offset, -5px)) scale(.97); } } .lr-language-menu button { diff --git a/src/client/ui/copy.ts b/src/client/ui/copy.ts index d057d8a9f..08a8744c9 100644 --- a/src/client/ui/copy.ts +++ b/src/client/ui/copy.ts @@ -105,7 +105,8 @@ export function isCopyKey(value: string): value is CopyKey { } export function t(lang: Lang, key: CopyKey, vars?: Record): string { - let value = locales[lang].copy[key]; + const catalog: Partial> = locales[lang].copy; + let value = catalog[key] ?? locales.en.copy[key]; if (vars) { for (const [name, replacement] of Object.entries(vars)) { value = value.replace(`{${name}}`, () => replacement); diff --git a/src/client/ui/glyph.css b/src/client/ui/glyph.css index 25f532b55..3c4ab9f42 100644 --- a/src/client/ui/glyph.css +++ b/src/client/ui/glyph.css @@ -8,7 +8,7 @@ each stroke. Reduced motion and ordinary controls use the unanimated SVG. */ @media (prefers-reduced-motion: no-preference) { :where(html:not([data-reduced-motion])) { - .lr-glyph-draw:not(.lr-spin), + .lr-glyph-draw:not(.lr-spin):not(:disabled *, [aria-disabled="true"] *), :is(button, a):is(.lr-btn.is-primary, .lr-tv-big, .lr-join-go, .lr-tv-overlay):not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible) .lr-glyph:not(.lr-glyph-draw):not(.lr-spin) { & > :is(path, circle, rect, line) { stroke-dasharray: 1; diff --git a/src/client/ui/icons.tsx b/src/client/ui/icons.tsx index 6f5529038..2ca606a0b 100644 --- a/src/client/ui/icons.tsx +++ b/src/client/ui/icons.tsx @@ -61,6 +61,7 @@ const PATHS = { wifiOff: { body: (<>) }, moon: { body: (<>) }, pencil: { body: (<>) }, + qr: { body: (<>) }, link: { body: (<>) }, linkOff: { body: (<>) }, arrowRight: { body: (<>) }, diff --git a/src/client/webrtc/receiver-buffer-target.ts b/src/client/webrtc/receiver-buffer-target.ts new file mode 100644 index 000000000..c688d6952 --- /dev/null +++ b/src/client/webrtc/receiver-buffer-target.ts @@ -0,0 +1,24 @@ +export type PlaybackBufferStatus = "supported" | "unsupported" | "failed" | null; +// W3C RTCRtpReceiver.jitterBufferTarget accepts 0..4000 milliseconds, or null. +export const MAX_PLAYBACK_BUFFER_TARGET_MS = 4000; + +export function validatePlaybackBufferTarget(target: number | null): void { + if (target !== null && (!Number.isFinite(target) || target < 0 || target > MAX_PLAYBACK_BUFFER_TARGET_MS)) { + throw new RangeError("Playback buffer target must be null or 0..4000 milliseconds"); + } +} + +/** Only the receiving owner supplies current screen video/source-audio receivers. */ +export function applyPlaybackBufferTarget(receivers: readonly RTCRtpReceiver[], target: number | null): PlaybackBufferStatus { + validatePlaybackBufferTarget(target); + let status: PlaybackBufferStatus = null; + for (const receiver of receivers) { + if (!("jitterBufferTarget" in receiver)) { if (status !== "failed") status = "unsupported"; continue; } + try { + const buffered = receiver as RTCRtpReceiver & { jitterBufferTarget: number | null }; + if (buffered.jitterBufferTarget !== target) buffered.jitterBufferTarget = target; + status ??= "supported"; + } catch { status = "failed"; } + } + return status; +} diff --git a/src/client/webrtc/stats.ts b/src/client/webrtc/stats.ts index 22267c97e..cf004a464 100644 --- a/src/client/webrtc/stats.ts +++ b/src/client/webrtc/stats.ts @@ -47,6 +47,7 @@ export interface StatsAccumulator { audioSsrc: number | null; audioTrackIdentifier: string | null; audioLossSourceId: string | null; + audioLossReportTimestamp: number | null; audioBytes: number | null; audioTimestamp: number | null; previousAudioPacketsReceived: number | null; @@ -256,6 +257,7 @@ export function createStatsAccumulator(): StatsAccumulator { audioSsrc: null, audioTrackIdentifier: null, audioLossSourceId: null, + audioLossReportTimestamp: null, audioBytes: null, audioTimestamp: null, previousAudioPacketsReceived: null, @@ -268,6 +270,20 @@ export function createStatsAccumulator(): StatsAccumulator { }; } +// RTCP defines fractionLost over its own report interval. Consume each report +// once, independently of local RTP sampling and the companion media's feedback. +function remotePacketLossPercent( + report: StatsRecord | null, + previousTimestamp: number | null, + sameSource: boolean, +): number | null { + const timestamp = numberValue(report, "timestamp"); + const fraction = numberValue(report, "fractionLost"); + return sameSource && timestamp !== null && previousTimestamp !== null && + timestamp > previousTimestamp && fraction !== null && fraction >= 0 && fraction <= 1 + ? fraction * 100 : null; +} + function intervalDelta( current: number | null, previous: number | null, @@ -734,7 +750,6 @@ export function collectConnectionMetricsFromReport( const packetsSent = numberValue(media, "packetsSent"); const packetsReceived = numberValue(lossSource, "packetsReceived"); const packetsLost = numberValue(lossSource, "packetsLost"); - const fractionLost = numberValue(remoteInbound, "fractionLost"); const totalEncodeTime = numberValue(media, "totalEncodeTime"); const totalDecodeTime = numberValue(media, "totalDecodeTime"); const framesDropped = numberValue(media, "framesDropped"); @@ -837,19 +852,9 @@ export function collectConnectionMetricsFromReport( previous.previousPacketsLost, sampleWindowMs !== null && sameLossSource, ); - // RTCP already defines fractionLost over its own report interval. Consume a - // report once instead of mixing that remote interval with local send deltas. - const senderPacketLossPercent = - direction === "send" && - sameLossSource && - lossReportTimestamp !== null && - previous.lossReportTimestamp !== null && - lossReportTimestamp > previous.lossReportTimestamp && - fractionLost !== null && - fractionLost >= 0 && - fractionLost <= 1 - ? fractionLost * 100 - : null; + const senderPacketLossPercent = direction === "send" + ? remotePacketLossPercent(remoteInbound, previous.lossReportTimestamp, sameLossSource) + : null; const intervalFramesDecoded = direction === "receive" ? intervalDelta( @@ -966,6 +971,7 @@ export function collectConnectionMetricsFromReport( ? mediaTrackIdentifier(report, audio, direction) : null; const audioLossSourceId = audioLossSource?.id ?? null; + const audioLossReportTimestamp = numberValue(audioLossSource, "timestamp"); const sameAudio = audioMediaId !== null && audioMediaId === previous.audioMediaId && @@ -987,6 +993,9 @@ export function collectConnectionMetricsFromReport( audioTimestamp > previous.audioTimestamp ? audioTimestamp - previous.audioTimestamp : null; + const audioSenderPacketLossPercent = direction === "send" + ? remotePacketLossPercent(audioRemoteInbound, previous.audioLossReportTimestamp, sameAudioLossSource) + : null; const audioPacketsReceived = numberValue(audioLossSource, "packetsReceived"); const audioPacketsLost = numberValue(audioLossSource, "packetsLost"); const audioJitterBufferDelay = numberValue(audio, "jitterBufferDelay"); @@ -1056,6 +1065,7 @@ export function collectConnectionMetricsFromReport( previous.audioSsrc = audioSsrc; previous.audioTrackIdentifier = audioTrackIdentifier; previous.audioLossSourceId = audioLossSourceId; + previous.audioLossReportTimestamp = audioLossReportTimestamp; previous.audioBytes = audioBytes; previous.audioTimestamp = audioTimestamp; previous.previousAudioPacketsReceived = audioPacketsReceived; @@ -1143,10 +1153,8 @@ export function collectConnectionMetricsFromReport( codecProfile: codecEvidence.profile, codecParameters: codecEvidence.parameters, audioBitrateKbps, - audioPacketLossPercent: packetLossPercentFromDeltas( - audioPacketsReceivedDelta, - audioPacketsLostDelta, - ), + audioPacketLossPercent: direction === "send" ? audioSenderPacketLossPercent + : packetLossPercentFromDeltas(audioPacketsReceivedDelta, audioPacketsLostDelta), audioJitterMs: numberValue(audioLossSource, "jitter") !== null ? numberValue(audioLossSource, "jitter")! * 1_000 diff --git a/src/client/webrtc/viewer-peer.ts b/src/client/webrtc/viewer-peer.ts index 4c4340366..a548470a1 100644 --- a/src/client/webrtc/viewer-peer.ts +++ b/src/client/webrtc/viewer-peer.ts @@ -1,3 +1,4 @@ +import { applyPlaybackBufferTarget, validatePlaybackBufferTarget, type PlaybackBufferStatus } from "./receiver-buffer-target"; import type { CopyKey } from "../ui/copy"; import { RemoteInputChannel } from "./remote-input-channel"; import type { IceConfig, SignalPayload } from "../../shared/protocol"; @@ -37,6 +38,7 @@ type SignalCandidate = Extract< >["candidate"]; export interface ViewerPeerEvents { + onPlaybackBufferStatus?: (status: PlaybackBufferStatus) => void; sendSignal: (peerId: string, payload: SignalPayload) => boolean; sendRestartRequest: ( peerId: string, @@ -53,6 +55,7 @@ export interface ViewerPeerEvents { } export interface ViewerPeerOptions { + playbackBufferTargetMs?: number | null; natPredictionEnabled?: boolean; recoveryOwner?: "viewer" | "route"; recoveryBudget?: ViewerRecoveryBudget; @@ -69,6 +72,8 @@ export function createViewerRecoveryBudget(): ViewerRecoveryBudget { } export interface ViewerMediaPeer { + setPlaybackBufferTarget?(target: number | null): PlaybackBufferStatus; + getPlaybackBufferStatus?(): PlaybackBufferStatus; getRemoteInput?(): RTCDataChannel | null; acceptSignal(parentPeerId: string, payload: SignalPayload): Promise; updateIceConfig(iceConfig: IceConfig): void; @@ -87,6 +92,8 @@ export interface ViewerMediaPeer { } export class ViewerPeer implements ViewerMediaPeer { + private playbackBufferTargetMs: number | null; + private playbackBufferStatus: PlaybackBufferStatus = null; private readonly remoteInput = new RemoteInputChannel(() => this.emit()); getRemoteInput(): RTCDataChannel | null { return this.remoteInput.current; } private connection: RTCPeerConnection | null = null; @@ -120,12 +127,26 @@ export class ViewerPeer implements ViewerMediaPeer { private readonly events: ViewerPeerEvents, options: ViewerPeerOptions = {}, ) { + this.playbackBufferTargetMs = options.playbackBufferTargetMs ?? null; this.currentIceConfig = iceConfig; this.natPredictionEnabled = options.natPredictionEnabled ?? false; this.recoveryOwner = options.recoveryOwner ?? "viewer"; this.recoveryBudget = options.recoveryBudget ?? createViewerRecoveryBudget(); } + setPlaybackBufferTarget(target: number | null): PlaybackBufferStatus { + validatePlaybackBufferTarget(target); + this.playbackBufferTargetMs = target; + return this.applyPlaybackBuffer(); + } + getPlaybackBufferStatus(): PlaybackBufferStatus { return this.playbackBufferStatus; } + private applyPlaybackBuffer(): PlaybackBufferStatus { + const status = applyPlaybackBufferTarget(this.connection?.getReceivers() ?? [], this.playbackBufferTargetMs); + this.playbackBufferStatus = status; + this.events.onPlaybackBufferStatus?.(status); + return status; + } + async acceptSignal( parentPeerId: string, payload: SignalPayload, @@ -341,6 +362,7 @@ export class ViewerPeer implements ViewerMediaPeer { if (!this.remoteStream.getTrackById(event.track.id)) { this.remoteStream.addTrack(event.track); } + this.applyPlaybackBuffer(); this.events.onStream(this.remoteStream); }); connection.addEventListener("connectionstatechange", () => { @@ -752,6 +774,7 @@ export class ViewerPeer implements ViewerMediaPeer { this.connectionLifetime = null; this.connection?.close(); this.connection = null; + this.applyPlaybackBuffer(); this.connectionId = null; this.parentPeerId = null; this.snapshot = null; diff --git a/tests/app-connection-button.test.ts b/tests/app-connection-button.test.ts index c996b0dbb..2bfcdfb51 100644 --- a/tests/app-connection-button.test.ts +++ b/tests/app-connection-button.test.ts @@ -53,20 +53,20 @@ function collect(node: ts.Node): void { } collect(source); if (!connect || !effects.length) throw new Error("Missing App connection operation or cleanup"); -const executable = ts.transpileModule(`${rememberBuild}\n${connect}\nconst cleanups = [${effects.map(effect => `(${effect})()`).join(",")}]; - ({ connect, cleanup: () => cleanups.reverse().forEach(fn => fn?.()) });`, { +const executable = ts.transpileModule(`${rememberBuild}\n${connect}\nconst cleanups = [${effects.map(effect => effect.includes("connect(false, true)") ? `(automatic ? (${effect})() : undefined)` : `(${effect})()`).join(",")}]; + ({ connect, cleanup: () => { cleanups.reverse().forEach(fn => fn?.()); pending.current?.controller.abort(); pending.current?.popup?.close(); } });`, { compilerOptions: { target: ts.ScriptTarget.ES2022, module: ts.ModuleKind.CommonJS }, }).outputText; const settle = () => new Promise(resolve => setImmediate(resolve)); const site = "https://site.example"; const approval = `http://127.0.0.1:39721/client?site=${encodeURIComponent(site)}`; -function mount(activated = false, state: "idle" | "ready" = "idle", android = false) { +function mount(activated = false, state: "idle" | "ready" = "idle", android = false, automatic = false) { const popup = { closed: false, close: vi.fn(() => { popup.closed = true; }) }; const window = Object.assign(new EventTarget(), { open: vi.fn((): typeof popup | null => popup), location: { origin: site, assign: vi.fn() } }); const document = Object.assign(new EventTarget(), { visibilityState: "visible" }); const native = { - discoverNativeConnect: vi.fn(async (_signal: AbortSignal): Promise => approval), + discoverNativeConnect: vi.fn(async (_options: { signal: AbortSignal; waitForPermission?: boolean }): Promise => approval), discoverNativeHealth: vi.fn(async (options: { signal: AbortSignal; waitForPermission?: boolean }): Promise => options.waitForPermission === false && !activated ? null : {}), NativeCompatibilityError: class extends Error {}, @@ -80,7 +80,7 @@ function mount(activated = false, state: "idle" | "ready" = "idle", android = fa const activateClient = vi.fn(); const onConnected = vi.fn(); const operation = runInNewContext(executable, { - window, document, pending, healthCheck, help, showHelp, setState, setBuild, activateClient, onConnected, AbortController, URL, + automatic, automaticFailed: { current: false }, window, document, pending, healthCheck, help, showHelp, setState, setAutomaticHint: vi.fn(), setBuild, activateClient, onConnected, AbortController, URL, wakeURL: android ? "intent://app#Intent;scheme=piik;package=tv.piik.android;end" : null, state, isClientActivated: () => activated, watchClientActivation: (changed: () => void) => { @@ -290,7 +290,7 @@ describe("App connection approval", () => { expect(page.setState).toHaveBeenLastCalledWith("ready"); expect(page.popup.closed).toBe(true); expect(page.pending.current).toBeNull(); - expect(page.native.discoverNativeConnect.mock.calls[0]![0].aborted).toBe(true); + expect(page.native.discoverNativeConnect.mock.calls[0]![0].signal.aborted).toBe(true); page.message(); expect(page.native.discoverNativeHealth).toHaveBeenCalledOnce(); }); @@ -419,3 +419,105 @@ describe("App connection approval", () => { page.cleanup(); }); }); + + +describe("initial App discovery", () => { + it("keeps automatic permission passive and waits only for an explicit connection", async () => { + const page = mount(false, "idle", false, true); + page.native.discoverNativeConnect.mockResolvedValue(null); + try { + await settle(); + expect(page.native.discoverNativeConnect).toHaveBeenLastCalledWith(expect.objectContaining({ waitForPermission: false })); + await page.connect(); + expect(page.native.discoverNativeConnect).toHaveBeenLastCalledWith(expect.objectContaining({ waitForPermission: true })); + } finally { page.cleanup(); } + }); + + it("keeps passive focus incompatibility idle while explicit connection shows recovery", async () => { + const page = mount(true); + const incompatible = new page.native.NativeCompatibilityError("incompatible"); + page.native.discoverNativeHealth.mockRejectedValue(incompatible); + page.native.discoverNativeConnect.mockRejectedValue(incompatible); + try { + await settle(); + page.window.dispatchEvent(new Event("focus")); + await settle(); + expect(page.setState).toHaveBeenLastCalledWith("idle"); + expect(page.showHelp).not.toHaveBeenCalled(); + await page.connect(); + expect(page.setState).toHaveBeenLastCalledWith("incompatible"); + expect(page.showHelp).toHaveBeenCalled(); + } finally { page.cleanup(); } + }); + + it("automatically verifies an approved App without opening another page", async () => { + const page = mount(true, "idle", false, true); + await settle(); + expect(page.native.discoverNativeConnect).toHaveBeenCalledOnce(); + expect(page.onConnected).toHaveBeenCalledOnce(); + expect(page.window.open).not.toHaveBeenCalled(); + expect(page.showHelp).not.toHaveBeenCalled(); + page.cleanup(); + }); + + it("keeps unapproved discovery pending for the real approval click", async () => { + const page = mount(false, "idle", false, true); + await settle(); + expect(page.setState).toHaveBeenLastCalledWith("approval"); + expect(page.onConnected).not.toHaveBeenCalled(); + expect(page.window.open).not.toHaveBeenCalled(); + await page.connect(); + expect(page.window.open).toHaveBeenCalledOnce(); + page.cleanup(); + }); + + it("does not repeat failed discovery on focus and aborts a manual retry on unmount", async () => { + const page = mount(true, "idle", false, true); + page.native.discoverNativeConnect.mockResolvedValue(null); + await settle(); + expect(page.setState).toHaveBeenLastCalledWith("idle"); + page.window.dispatchEvent(new Event("focus")); + page.activateElsewhere(); + await settle(); + expect(page.native.discoverNativeConnect).toHaveBeenCalledOnce(); + expect(page.native.discoverNativeHealth).not.toHaveBeenCalled(); + let signal: AbortSignal | undefined; + page.native.discoverNativeConnect.mockImplementationOnce(value => { + signal = value.signal; + return new Promise(() => {}); + }); + void page.connect(); + await settle(); + expect(page.native.discoverNativeConnect).toHaveBeenCalledTimes(2); + page.cleanup(); + expect(signal?.aborted).toBe(true); + }); + + it.each([false, true])("automatic discovery stays idle; explicit failure keeps recovery guidance (incompatible: %s)", async incompatible => { + const page = mount(false, "idle", false, true); + page.native.discoverNativeConnect.mockImplementation(async () => { + if (incompatible) throw new page.native.NativeCompatibilityError("incompatible"); + return null; + }); + try { + await settle(); + expect(page.setState).toHaveBeenLastCalledWith("idle"); + expect(page.showHelp).not.toHaveBeenCalled(); + await page.connect(); + expect(page.setState).toHaveBeenLastCalledWith(incompatible ? "incompatible" : "unavailable"); + expect(page.showHelp).toHaveBeenCalled(); + } finally { page.cleanup(); } + }); + + it("an explicit approval click takes over the automatic attempt's failure feedback", async () => { + const page = mount(false, "idle", false, true); + try { + await settle(); + expect(page.setState).toHaveBeenLastCalledWith("approval"); + page.window.open.mockReturnValue(null); + await page.connect(); + expect(page.setState).toHaveBeenLastCalledWith("unavailable"); + expect(page.showHelp).toHaveBeenCalled(); + } finally { page.cleanup(); } + }); +}); diff --git a/tests/audio-stats.test.ts b/tests/audio-stats.test.ts index a717cface..a42fbce17 100644 --- a/tests/audio-stats.test.ts +++ b/tests/audio-stats.test.ts @@ -69,6 +69,30 @@ function outboundReport( } describe("audio stats selection", () => { + it("uses the same fresh RTCP loss for voice and screen sound without inheriting replaced tracks", () => { + const voicePrevious = createStatsAccumulator(), screenPrevious = createStatsAccumulator(); + const sample = (timestamp: number, feedbackTimestamp: number, track = "audio-a", fractionLost = 0.125) => { + const report = outboundReport(timestamp, timestamp * 10, timestamp * 20); + report.get(track + "-out").remoteId = "audio-feedback"; + (report as unknown as Map).set("audio-feedback", { + id: "audio-feedback", type: "remote-inbound-rtp", kind: "audio", + timestamp: feedbackTimestamp, fractionLost, + }); + const voice = collectConnectionMetricsFromReport(report, "send", voicePrevious, + { kind: "audio", trackIdentifier: track, audioTrackIdentifier: track }); + const screen = collectConnectionMetricsFromReport(report, "send", screenPrevious, + { trackIdentifier: "video-current", audioTrackIdentifier: track }); + expect(screen.audioPacketLossPercent).toBe(voice.packetLossPercent); + return screen.audioPacketLossPercent; + }; + expect(sample(1000, 900)).toBeNull(); + expect(sample(2000, 1900)).toBe(12.5); + expect(sample(3000, 1900)).toBeNull(); // Local polling is not a new RTCP report. + expect(sample(4000, 3900, "audio-b")).toBeNull(); // Reused feedback ID, different track. + expect(sample(5000, 4900, "audio-b", 0.25)).toBe(25); + expect(sample(6000, 5900, "audio-b", 0)).toBe(0); + }); + it("uses audio-only RTP identity, interval loss and transport RTT in both directions", () => { for (const direction of ["send", "receive"] as const) { const previous = createStatsAccumulator(); diff --git a/tests/client-state.test.ts b/tests/client-state.test.ts index 7cfd62cec..1e6d3b1d7 100644 --- a/tests/client-state.test.ts +++ b/tests/client-state.test.ts @@ -3473,12 +3473,13 @@ describe("WebRTC stats parsing", () => { }); }); - it("uses linked remote inbound counters for outbound audio loss", async () => { + it("uses linked RTCP feedback for outbound audio loss", async () => { const report = ( timestamp: number, audioBytesSent: number, packetsReceived: number | undefined, packetsLost: number | undefined, + fractionLost: number | undefined = 0.125, ) => new Map([ [ @@ -3533,6 +3534,7 @@ describe("WebRTC stats parsing", () => { kind: "audio", packetsReceived, packetsLost, + fractionLost, jitter: 0.004, }, ], @@ -3546,7 +3548,7 @@ describe("WebRTC stats parsing", () => { report(3_000, 50_000, 500, 1), report(5_000, 80_000, 650, 4), report(7_000, 110_000, 50, 1), - report(9_000, 140_000, 200, undefined), + report(9_000, 140_000, 200, undefined, -1), ]; const connection = { getStats: async () => reports.shift()!, @@ -3569,7 +3571,7 @@ describe("WebRTC stats parsing", () => { "send", accumulator, ); - const missing = await collectConnectionMetrics( + const invalid = await collectConnectionMetrics( connection, "send", accumulator, @@ -3586,8 +3588,8 @@ describe("WebRTC stats parsing", () => { audioCodecClockRate: 48_000, audioCodecChannels: 2, }); - expect(stable.audioPacketLossPercent).toBeCloseTo((3 / 153) * 100); - expect(reset.audioPacketLossPercent).toBeNull(); - expect(missing.audioPacketLossPercent).toBeNull(); + expect(stable.audioPacketLossPercent).toBe(12.5); + expect(reset.audioPacketLossPercent).toBe(12.5); // Cumulative counters do not define this RTCP interval. + expect(invalid.audioPacketLossPercent).toBeNull(); }); }); diff --git a/tests/copy.test.ts b/tests/copy.test.ts index d96a433e5..55516395f 100644 --- a/tests/copy.test.ts +++ b/tests/copy.test.ts @@ -1,6 +1,9 @@ import { afterEach, describe, expect, it, vi } from "vitest"; import { initialLanguage, rememberLanguage } from "../site/assets/language.js"; import { locales, visualTitleFrames } from "../src/client/locales"; +import { createElement } from "react"; +import { renderToStaticMarkup } from "react-dom/server"; +import { LanguageControl } from "../src/client/components/living/LanguageControl"; import { getTitleFrames, @@ -12,6 +15,21 @@ import { } from "../src/client/ui/copy.ts"; describe("copy catalog", () => { + it("keeps Chinese and English direct while visual and extra languages share the third control", () => { + for (const selection of [{ lang: "en", vis: false }, { lang: "ko", vis: false }, { lang: "ko", vis: true }] as const) { + setCopy(selection); + const html = renderToStaticMarkup(createElement(LanguageControl)); + const track = html.slice(0, html.indexOf('role="menu"')); + expect(track.match(/