Files
Piik/docs/README.md
T
AAA 383f3656c7 fix(media): stabilize sharing startup and recovery
## Problem and outcome / 问题与结果

Sharing could fail when an optional output or encoder comparison failed, while retired Browser work could block media cleanup. Browser pooling also spent its startup protection before publication and classified its synthetic transport clock as realtime video, delaying recovery after a bandwidth drop. These repairs stay within the existing capture, producer, edge and connection owners.

Self-hosting samples now follow the configured public Origin and permit the site's requested camera/microphone capture. Piik's own Origin rejection has a specific bilingual explanation, distinct from arbitrary proxy 403 responses.

## Release notes

### 中文

这是一次分享稳定性维护更新,重点修复开播、换源与画质恢复,并改善自部署站点的配置和错误说明。

- Windows 自动选择编码器时,如果已验证 H.264 可用,后续软件编码对比失败或超时会保留可用的 H.264,避免因此无法开播。
- 较低画质输出或单条音频发送连接失败时,保留仍然健康的分享和其他连接。
- 修复停止分享、换源和媒体连接退役时,旧异步任务阻塞清理与恢复的问题。
- 改善浏览器共享编码的首播画质与网络波动后的恢复,避免因短时码率变化反复重建编码器。
- 自部署配置示例默认跟随站点网址;创建房间因网址未获允许而返回 403 时,页面会指出需要检查的配置。nginx 示例也修正了对本站摄像头、麦克风的权限限制。

已有自部署站点若遇到 403,请检查 `PUBLIC_BASE_URL` 与 `ALLOWED_ORIGINS`。使用旧 nginx 示例的站点需更新 `Permissions-Policy`;步骤见[自部署教程](https://piik.tv/docs/zh/self-hosting)。本次更新不改变房间、信令或 App 控制协议。

### English

This maintenance update improves sharing startup, source changes and video-quality recovery, with clearer configuration and error guidance for self-hosted sites.

- Windows automatic codec selection retains a verified H.264 encoder if the subsequent software comparison fails or times out, instead of failing to start sharing.
- A failed lower-quality output or individual audio sender no longer interrupts healthy sharing and other connections.
- Fixes retired asynchronous work blocking cleanup and recovery when stopping sharing, changing sources or retiring media connections.
- Improves initial quality and recovery after network fluctuations in Browser pooled encoding, while avoiding unnecessary encoder recreation after short bitrate changes.
- The self-hosting sample follows the configured site address by default. Piik's Origin-related room-creation 403 now identifies the settings to check. The nginx sample also permits camera and microphone requests from the site itself.

If an existing self-hosted site returns 403, check `PUBLIC_BASE_URL` and `ALLOWED_ORIGINS`. Sites using the old nginx sample must update `Permissions-Policy`; see the [self-hosting guide](https://piik.tv/docs/self-hosting). Room, signaling and App control protocols are unchanged.

## Verification / 验证

- `npm run check`: 75 files / 1,106 tests, TypeScript and production Web build passed.
- `npm run check:go`: Go formatting, tests, vet, supported core builds, Windows native compile and regressions passed. Darwin cgo packaging remains owned by its macOS CI runner.
- Repository hygiene, documentation checks and website/documentation build passed.
- Isolated VP8/H.264 Browser checks: constrained-child isolation and recovery, short congestion pulse, live and quiet settings, pause/resume, source replacement and ordinary fallback passed. Controlled bandwidth can still cause temporary low resolution, stalls and A/V jitter.
- Windows native Auto/H.264/VP8 startup, window resize/fullscreen/minimize/restore, Browser-to-App fanout and embedded-SFU checks passed in the bounded local fixtures.
- Old-code negative controls reproduce the repaired failure paths. A real Chromium policy check rejects camera/microphone with the previous nginx header and captures both fake devices with the corrected same-origin policy; geolocation remains denied.
- Independent read-only review covered root ownership, cancellation and the producer/carrier adaptation boundary.

## Impact / 影响

Compatible patch release, planned as v1.6.4. No wire, storage, routing-authority or interaction-model change. Matching Server restart interrupts current process-owned media; package cutover retains the existing bounded rollback procedure. Unknown field reports still require device/network evidence and are not claimed resolved by local fixtures. Raw diagnostics and experiment artifacts remain ignored; accepted constraints and concise evidence live in their existing documentation owners.
2026-09-25 14:42:59 +08:00

6.1 KiB

Piik Documentation

About Piik · 中文介绍 · 中文上手指南

For using Piik, troubleshooting or self-hosting, start with the reader documentation · 中文文档中心. This page also indexes developer and maintainer references.

Guides And References

Task Guide
Use Piik online Open the online site · Online sharing guide
Watch a friend or share my first screen Getting started
Choose an App mode or fix sound and connection trouble First-use help
Page opens but video will not connect / 网页能打开,画面连不上 Connection troubleshooting · 中文排查
Run Piik App, check platform requirements, or build a package App guide · 中文 App 指南
Try or change the source code Run from source
Find a directory or the module responsible for a behavior Repository layout and module map
Find the shared product, design and lifecycle rules Standards index
Host a site for my group Self-hosting · 中文部署
Keep a server running with systemd or Docker Service management · 中文服务管理
Set passwords, ports, or room storage Configuration
Update my server Server updates
Build, publish or recover a maintained release Maintainer release tooling
Send a useful bug report Diagnostics and export
Translate Piik or improve wording Translation guide · 中文翻译教程
Check release and platform readiness Current status

The introduction, getting-started, App, self-hosting, service-management and translation guides are available in English and Chinese. Technical references keep one shared version.

Run from source

You can try the Browser application locally with Node from .node-version, npm from package.json, and Go 1.26 from go.mod. Run these commands from the repository root.

Start the web UI:

npm ci
npm run dev

In a second terminal, start the server. For a POSIX shell:

PORT=8788 PUBLIC_BASE_URL=http://localhost:8787 go run ./cmd/piik-server

Or in PowerShell:

$env:PORT = '8788'
$env:PUBLIC_BASE_URL = 'http://localhost:8787'
go build -o build/dev/piik-server.exe ./cmd/piik-server
./build/dev/piik-server.exe

The fixed Windows executable path avoids repeated firewall prompts from go run. Open localhost:8787, start sharing, and open the invitation in another browser tab to try watching. This localhost invitation stays on your computer; remote invitations need a reachable origin as described in configuration. Browser capture requires localhost or HTTPS.

For the self-contained App, follow App development and packaging, including the platform's native capture requirements.

Work on Piik

Contributing covers the workflow and choosing focused checks. The main verification commands are:

npm run check
npm run check:go

Use the naming and copy guide for product names, commands, role labels and Chinese/English voice. Piik-owned code uses MIT; see the licensing guide for third-party components.

For the public website, see the introduction design and website preview and publishing.

Understand the product

Topic Its reference
Invitations, room codes and passwords Rooms and access
How viewers connect Routing and transport
Screen capture, quality controls and sound Media quality
Host and viewer behavior Presentation and lifecycle
Why a design was chosen Architecture decisions
Measurements and platform limits Research and verification status
Camera and Host microphone Capture scope and limits
Room voice proposal and media-fidelity boundaries Design assessment

Shared conventions

When changing… Follow this owner
Module responsibilities or interfaces Engineering and contract map
Product/tool names, role labels or copy Naming and copy
UI colour, illustration, motion or layout Visual language
Overlays, titles or state indicators Media status
Releases, protocols or stored formats Versions and compatibility
Main protection or automatic publishing GitHub operations
Documentation or a duplicated rule Documentation ownership
Checks, PRs, integration or cleanup Contributing

For ongoing work, use TODO. Project memory provides the compact product map; status indexes current source and deployment boundaries. Completed work lives in Git history and pull requests.