## Problem and outcome This phase adds consented remote co-play to normal App/Web rooms and integrates the accepted audio, playback, participant-state and multi-site improvements. It also rebuilds the bilingual README/documentation reading path, refreshes real-component illustrations, and publishes the selected website film. The candidate preserves the established 2.x sharing/viewing contracts. Optional new behavior follows negotiated capabilities; Windows gamepads use an externally installed driver. The separate accompaniment experiment and unselected film studies are outside this phase. ## Release notes **Play together. Your turn!** Approved friends can now play together with shared keyboard and mouse controls or optional gamepads. **远程同乐,轮到你啦!** 获准的朋友现在可以共用键鼠,或使用可选手柄,一起玩本地多人游戏。 ### English Piik 2.4 adds remote co-play, improves shared sound and room controls, and rewrites the bilingual getting-started and help guides around what you want to do. #### Highlights - Let approved friends control together. Each player's held keys and gamepad retire independently; everyone shares the Host's mouse pointer. On Windows x64, optional virtual gamepads use a Host-installed ViGEmBus driver. Piik does not bundle or install it. - Control shared output volume from the Host's playback bar. The optional share microphone adds your voice to the picture, independently of room voice; stopping the share leaves room voice running. Room voice now defaults to 64 kbps and offers a Host bitrate control. - See voice and remote-control participation directly on the couch. Connection details group picture and voice by receive/send direction. Playback actions, chat-overlay settings and dismissible operation feedback have clearer, consistent places. - Approve several Piik sites in App and manage each separately, with one optional startup favorite. - Follow rewritten English and Chinese README and documentation paths: watching, starting a share, room tools, remote control/co-play, and symptom-based help. Illustrated guides use current product components, theme-aware screenshots and shared diagrams. A dedicated network guide covers campus networks, media UDP, SFU sites and optional virtual LANs. - The website has clearer App and co-play FAQs and the selected bilingual 64-second film, with shared playback controls and a held closing card. #### Fixes - Tolerate small macOS capture-crop rounding errors without accepting genuinely invalid geometry. - Keep shared-audio and microphone volume changes independent, preserve commentary through source replacement, and retire each input at its owning lifecycle boundary. - Improve narrow-player controls, touch-held volume menus, tooltip placement and feedback cleanup after reconnection. - Repair the release recovery test on macOS and refresh the build and tunnel runtimes. #### Updating and limits Update the Host's App and the room site, then refresh open pages to use the new features. Established sharing and viewing remain compatible within 2.x; older peers retain the features they support. The wire versions and SQLite schema are unchanged. Restarting App or Server interrupts active sessions. Before downgrading App, remove extra approved sites in the newer launcher so at most one remains. Use the [remote-control guide](https://piik.tv/docs/remote-control.html?lang=en) for the optional Windows driver. Linux gamepads remain experimental; macOS virtual gamepads are not currently available. Windows 10 window-sharing black screens ([#495](https://github.com/TNTcraftHIM/Piik/issues/495)) remain under investigation; use screen sharing if affected. ### 中文 Piik 2.4 新增多人远程同乐,改进分享声音与房间控制,并围绕实际任务重写双语上手教程和帮助文档。 #### 主要更新 - 允许获准的朋友同时控制。各人的按键持有和手柄独立释放,大家共用房主的鼠标指针。Windows x64 可使用房主自行安装的 ViGEmBus 驱动提供虚拟手柄;Piik 不捆绑或安装驱动。 - 房主可通过播控调整分享输出音量。可选的分享麦克风把说话声加入画面,与房间语音独立;停播后房间语音继续。房间语音默认提升至 64 kbps,并提供房主码率设置。 - 沙发人物直接呈现语音和远控参与状态;连接详情按画面/语音、接收/发送分组。播放操作、弹幕设置和可关闭的操作提示各有清楚、一致的位置。 - App 可授权多个 Piik 站点,逐个管理,并选择一个启动时打开的星标站点。 - 重写中英文 README 和文档中心:从观看、开始分享、房间工具、远控/同乐到按症状排障。图文教程使用当前正式组件、明暗主题截图与同源示意图;独立网络指南说明校园网、媒体 UDP、SFU 站点和可选虚拟局域网的用法。 - 官网改进 App 与多人同乐 FAQ,采用选定的双语 64 秒短片,复用产品播控并保留结尾品牌卡。 #### 修复 - 容忍 macOS 采集裁剪中的微小舍入误差,仍拒绝真正无效的画面边界。 - 分享总音量与麦克风音量分别更新;换源保留解说,各项输入按所属生命周期释放。 - 改进窄屏播控、触摸长按音量菜单、提示定位,以及重连后的提示清理。 - 修复 macOS 上发布恢复测试的可移植性,更新构建与公网隧道运行组件。 #### 更新与限制 将房主 App 和房间站点更新后,刷新已打开的页面,即可使用新功能。2.x 内保留已有分享与观看兼容性,旧端继续使用其支持的功能;协议版本和 SQLite schema 不变。重启 App 或 Server 会中断当前会话。 如需降级 App,先在新版启动页删除额外授权,最多保留一个站点。可选的 Windows 驱动安装方法见[远控指南](https://piik.tv/docs/zh/remote-control.html)。Linux 手柄仍属实验能力,macOS 当前暂不提供虚拟手柄。Windows 10 窗口分享黑屏而整屏正常的反馈([#495](https://github.com/TNTcraftHIM/Piik/issues/495))仍在调查,本版不声称已修复。 ## Verification - Integrated Web typecheck, 98 test files / 1,734 tests and production build passed. Later scoped UI repairs passed focused typecheck/tests and preview checks. - Focused Go checks cover input grant/held-state ownership, delayed device retirement, native control/Host, config/launcher/loopback, voice negotiation and source-volume binding. Windows capture compilation/probe and the isolated Linux uinput kernel gate passed. - Normal-page P2P (22 checks) and embedded-SFU (19 checks) gates passed. P2P explicitly exercised source commentary with room voice, independent shutdown, share retirement and the next share's default-off state; SFU also covers live voice bitrate and voice recovery. - Documentation links (108 Markdown files), generated-diagram freshness, the complete bilingual/theme screenshot pipeline and website production build passed. Website/readers were checked at 320, 768 and 1440 px with both languages/themes. - macOS crop logic retains geometric self-tests; this Windows environment did not repeat a macOS SDK/hardware run. Linux desktop/game recognition and macOS virtual-gamepad entitlement/runtime remain explicit limits. - Windows native window-sharing acceptance passed: Host/Viewer decoding, live and paused quality changes, resize/minimize/restore, source replacement, stop and restart. Capturing the Host Chrome window also passed with Auto/H.264 and VP8, including decoded-frame and pixel checks. The Windows 10 case in #495 was not reproduced and remains separate. - Current Go serializers passed the published v2.0.0/v2.3.0 TypeScript readers; existing native input opt-in checks passed. This checks payload compatibility, not an end-to-end run of old published clients. ## Impact Compatible 2.x feature release; Browser/server v24, Native control v10, capture v7 and SQLite schema 2 remain unchanged. New co-play, presence, voice settings and native volume behavior are capability-negotiated. Multi-site App settings retain the older single-site reader path; arbitrary binary downgrade is not promised. No independent room/router, new NAT policy, driver installer or separate accompaniment channel is introduced. ## Related work Includes the macOS crop correction reported in #492 and the macOS deployment-test portability contribution from #496. Supersedes the incomplete phase PR #494. #495 remains open. ## Attribution Co-authored-by: Yuqing Huang <670081066@qq.com> Co-authored-by: luol75569-collab <297886760+luol75569-collab@users.noreply.github.com>
283 lines
15 KiB
Markdown
283 lines
15 KiB
Markdown
# Public website
|
|
|
|
The static website source is `site/`. Its content and design follow the
|
|
[public introduction guide](../standards/public-introduction.md).
|
|
|
|
## Public Destinations
|
|
|
|
| Entry | Destination |
|
|
| --- | --- |
|
|
| Website | [piik.tv](https://piik.tv) |
|
|
| P2P-only demo on the separate US server | [demo.piik.tv](https://demo.piik.tv) |
|
|
| App downloads and release notes | [GitHub Releases](https://github.com/TNTcraftHIM/Piik/releases) |
|
|
| Download mirror for domestic access | [Gitee Releases](https://gitee.com/TNTcraftHIM/Piik/releases) |
|
|
| Documentation source | [Reader guides](../guide/README.md), with a separate [developer map](../README.md) |
|
|
|
|
GitHub Pages serves `piik.tv` behind
|
|
Cloudflare; both the GitHub origin and Cloudflare edge use HTTPS. Website and
|
|
Demo HTTP traffic use proxied DNS with origin cache headers respected.
|
|
The separate `stun.piik.tv` hostname stays DNS-only for direct UDP connectivity.
|
|
|
|
GitHub Pages hosts the website's
|
|
[static HTML, CSS and JavaScript](https://docs.github.com/en/pages/getting-started-with-github-pages/what-is-github-pages).
|
|
The Demo runs the Go room service, WebSocket signaling and UDP STUN on the separate US server.
|
|
|
|
### Managed Hosting Assessment
|
|
|
|
Reviewed 2026-10-07. Keep the current deployment for this candidate. A managed
|
|
container can reduce host administration, but must preserve public UDP, stable
|
|
room authority and SQLite storage. [Fly.io supports public UDP](https://docs.fly.io/networking/udp-and-tcp)
|
|
with a dedicated IPv4 address and a specific UDP bind address; external and
|
|
internal UDP ports must match. Its [dedicated IPv4 charge](https://docs.fly.io/about/pricing)
|
|
is $2/month before compute, storage and transfer. The assessment found no cost
|
|
saving over the current server.
|
|
|
|
[Cloudflare Containers disks are ephemeral by default](https://developers.cloudflare.com/containers/faq/#is-disk-persistent-what-happens-to-my-disk-when-my-container-sleeps).
|
|
Keep live SQLite on persistent storage. A provider migration needs owner approval,
|
|
a complete cost comparison, and storage, UDP and restart verification.
|
|
|
|
## Public Demo Configuration
|
|
|
|
The chosen demo allows entry without a site password and provides P2P sharing
|
|
without SFU fallback. Use the [self-hosting runbook](./self-hosting.md) with:
|
|
|
|
```dotenv
|
|
PIIK_ENV=production
|
|
LISTEN_HOST=127.0.0.1
|
|
PORT=8787
|
|
PUBLIC_BASE_URL=https://demo.piik.tv
|
|
ALLOWED_ORIGINS=https://demo.piik.tv
|
|
SITE_ACCESS_PASSWORD=
|
|
ROOM_DATABASE_PATH=/var/lib/piik/rooms.sqlite
|
|
ROOM_EMPTY_TIMEOUT_SECONDS=3600
|
|
MAX_VIEWERS_PER_ROOM=20
|
|
STUN_URLS=stun:stun.piik.tv:3478
|
|
NAT_PREDICTION_ENABLED=true
|
|
SFU_UDP_PORT=
|
|
```
|
|
|
|
Point both hostnames at the US server: proxy `demo.piik.tv` through Cloudflare,
|
|
but leave `stun.piik.tv` DNS-only. Allow UDP 3478/3479/3480 directly to the server;
|
|
Cloudflare's ordinary HTTP proxy does not carry STUN. Caddy terminates origin
|
|
HTTPS/WSS. The demo uses the
|
|
standard [systemd service](./service-management.md#systemd), with its release
|
|
under `/opt/piik/current` and configuration at `/etc/piik/piik.env`. The service
|
|
unit provides the SQLite state directory. Room ownership, invitations and private-room
|
|
admission still apply. The [configuration reference](../standards/configuration.md)
|
|
owns each setting and its bounds.
|
|
|
|
The Demo's Caddy proxy compresses `/assets/*` with zstd/gzip. Successful
|
|
content-hashed JavaScript and CSS responses use
|
|
`Cache-Control: public, max-age=31536000, immutable`; other responses default to
|
|
`no-store`. Match both the hashed filename and a successful response status so
|
|
a missing bundle cannot acquire the long cache lifetime. Keep HTML, room APIs,
|
|
health responses and signaling outside static caching. New bundles have new
|
|
filenames; do not publish different bytes under an existing hashed URL.
|
|
Cloudflare caches those static bundles; HTML and API responses remain uncached,
|
|
and WebSocket signaling passes through to the room service. Media remains P2P.
|
|
|
|
For updates, follow the [application release boundary](../deployment.md#release-boundary)
|
|
and its artifact verification, health checks and recovery rules. Routine application
|
|
rollback restores the previous executable while keeping current room data. This
|
|
Caddy installation needs a scoped updater; the nginx-specific maintainer wrapper
|
|
does not manage it.
|
|
|
|
## Maintenance
|
|
|
|
Website HTML bypasses Cloudflare's edge cache and sends `Cache-Control: no-cache`
|
|
so Browsers revalidate it. Content-hashed scripts, styles and images keep their
|
|
ordinary cache policy. This keeps an older homepage from referring to assets
|
|
removed by a later Pages deployment. These rules match only the website hosts;
|
|
the Demo has its own cache owner above.
|
|
|
|
Copy [the maintenance example](./maintenance.env.example) to
|
|
`.env.maintenance.local` in the checkout and fill in local credentials and targets.
|
|
The file is ignored by Git. Use Node's built-in env-file option:
|
|
|
|
```sh
|
|
node --env-file=.env.maintenance.local scripts/release-maintenance.mjs website-check
|
|
node --env-file=.env.maintenance.local scripts/release-maintenance.mjs website-purge
|
|
node --env-file=.env.maintenance.local scripts/release-maintenance.mjs server-check
|
|
```
|
|
|
|
`website-check` reads the two rule phases, checks fresh HTML and compares
|
|
root/index asset references. `website-purge` clears those entry points from
|
|
Cloudflare; visitors' Browser caches remain separate. `server-check` is a read-only
|
|
SSH check of the Linux `piik` service, running package and public health.
|
|
Keep separate ignored env files or SSH aliases for different Server targets;
|
|
keep private connection details out of scripts. For package upload, cutover
|
|
and recovery, follow [Server deployment](../deployment.md).
|
|
|
|
Rule changes remain explicit infrastructure work: save the current rule phases
|
|
and define their scoped rollback before modifying them. The maintenance commands
|
|
do not rewrite rules or manage DNS. See Cloudflare's
|
|
[cache-rule order](https://developers.cloudflare.com/cache/how-to/cache-rules/order/)
|
|
and [response-header rules](https://developers.cloudflare.com/rules/transform/response-header-modification/):
|
|
edge eligibility and the Browser's cache header have separate owners.
|
|
|
|
## Preview
|
|
|
|
With the repository's development dependencies installed:
|
|
|
|
```sh
|
|
npm ci --prefix site/docs
|
|
npm run build:website
|
|
npm run preview:website
|
|
```
|
|
|
|
Open `http://127.0.0.1:18890`. Rebuild after editing source. The homepage loads
|
|
film A when opened and unloads it when closed. Update its authored artwork when
|
|
product changes affect the scenes. The separate real-component fixture at
|
|
`/film/ui/index.html` supplies README screenshots.
|
|
Publish the static `build/site/` output. Vite preview supports HTTP byte ranges
|
|
for seeking the soundtrack. Keep asset links relative so both a custom
|
|
domain and GitHub's `/Piik/` project path work. For a nested deployment, set
|
|
`PIIK_DOCS_BASE=/Piik/docs/` when building; ordinary custom-domain builds use `/docs/`.
|
|
|
|
The [public-film source](../../site/film/README.md) owns the selected artwork and
|
|
its runtime. The ordinary build includes only A's required runtime, fonts, audio
|
|
and notices. Other candidates and the former 1.0 remain in Git history.
|
|
|
|
The homepage, film and demonstration frames use content-hashed script/style
|
|
bundles; A's relative runtime tree also has one content-hashed directory.
|
|
Their HTML references come from the same build, including imported
|
|
dependencies; fixed filenames must not mix a new page with cached old controls
|
|
or styles. Publish the complete output together.
|
|
|
|
Favicons share the [App artwork and exports](../../cmd/piik-app/DEVELOPMENT.md#desktop-icons).
|
|
The website build copies the public SVG/PNG/ICO assets for the homepage, film
|
|
and documentation, keeping their URLs stable.
|
|
|
|
[Google's favicon guidance](https://developers.google.com/search/docs/appearance/favicon-in-search)
|
|
requires a crawlable homepage and icon, and supports one favicon per hostname.
|
|
Use the PNG/ICO links for search crawlers. Search engines control indexing and
|
|
display; repository pages on `github.com` use GitHub's favicon.
|
|
|
|
## Documentation Build
|
|
|
|
`site/docs/` configures VitePress; its isolated package and lockfile keep document
|
|
tooling out of the App/Server dependency tree. The pinned Vite override follows the
|
|
[VitePress maintainer's guidance](https://github.com/vuejs/vitepress/discussions/5072)
|
|
to use the security-maintained Vite 6 line with stable VitePress 1. Remove the
|
|
override when a stable upstream release supplies a maintained version directly.
|
|
|
|
The explicit list in `site/docs/pages.mjs` maps original Markdown files to public
|
|
routes and sidebar labels. `build.mjs` stages only those files under ignored
|
|
`build/docs-source/`, then emits `build/site/docs/` as part of `build:website`.
|
|
Edit the original Markdown, never a staged copy. Relative links between published
|
|
pages become local web links; references outside the list continue to GitHub.
|
|
Heading IDs reuse the repository checker's GitHub-style slug rule, so section
|
|
links work in both views without a second set of anchors.
|
|
The page edit link targets its original source. Developer context, TODO, research
|
|
and operational release records are not automatically published as reader pages.
|
|
|
|
The docs keep paired English/Chinese guides, shared site language preference,
|
|
system/explicit appearance and the existing mascot. Search uses a local index
|
|
and native word segmentation for Chinese and English, with no hosted search service.
|
|
Technical configuration keeps its existing English owner on GitHub.
|
|
|
|
Both homepage and documentation are uploaded in the same Pages artifact. Do not
|
|
run a second Pages deployment that would overwrite the homepage. Website/docs
|
|
sources and the nested package remain outside product-release paths; shared
|
|
product code and App/Server build inputs still follow the release boundary.
|
|
Check links, language switching, search, keyboard/mobile use and the static
|
|
HTML fallback when changing the public documentation.
|
|
|
|
### Guide screenshots
|
|
|
|
With `agent-browser` installed, start `npm run dev -- --host 127.0.0.1`.
|
|
After changing pictured controls or copy, run in another terminal:
|
|
|
|
```sh
|
|
node scripts/update-guide-images.mjs http://127.0.0.1:8787
|
|
npm run build:website
|
|
```
|
|
|
|
The script regenerates the audio and network diagrams from shared icons and
|
|
palette, then captures `/__tooltip-preview` production components using sample data,
|
|
both languages, light/dark themes and reduced motion. It closes its own session.
|
|
Captures cover the mode selector, source picker, sharing settings, voice panel
|
|
and sample sharing-failure dialog. Place each beside the task it explains. Markdown uses GitHub's
|
|
`#gh-light-mode-only` / `#gh-dark-mode-only` image hints, which the documentation
|
|
theme also follows when its appearance control changes. Do not invert or tint
|
|
screenshots: capture the actual theme. SVG explanations inherit the page's
|
|
colour scheme and remain sharp at smaller sizes. `scripts/update-guide-diagrams.tsx`
|
|
generates the audio-path, network-path and virtual-LAN SVGs and embeds the shared palette in the three-step
|
|
illustration; `build:website` checks these generated parts for source freshness.
|
|
Adjust capture viewport/panel size to show complete choices and avoid unused space;
|
|
do not edit controls or labels inside the saved image.
|
|
`AGENT_BROWSER_PATH` overrides the CLI path. Inspect `docs/assets/guide/` before
|
|
committing with UI/copy changes. Keep example captions; use no live-room data,
|
|
hand-edited text or duplicate mockups.
|
|
|
|
The build stages `docs/assets/` and rewrites Markdown image paths to hashed URLs.
|
|
GitHub and the docs center share the sources; README links to the full tutorial.
|
|
|
|
To refresh the README's four room PNGs in the same run, pass an already-built
|
|
website preview as the second URL:
|
|
|
|
```sh
|
|
node scripts/update-guide-images.mjs http://127.0.0.1:8787 http://127.0.0.1:18890
|
|
```
|
|
|
|
Build that preview from the current UI first. The README captures use the
|
|
[film's real-component fixture](../../site/film/README.md), with sample people
|
|
and generated game artwork. The room illustration and quickstart SVG are
|
|
authored explanations, not screenshots.
|
|
|
|
After changing pictured UI, refresh the affected PNGs with the capture command,
|
|
inspect them, then rebuild. `build:website` bundles components and guides and
|
|
checks generated hero artwork; `check-docs.mjs` validates image targets and
|
|
document links. Screenshot refresh and visual review are manual steps.
|
|
|
|
## Downloads
|
|
|
|
The Windows, macOS and Linux App cards use fixed filenames and each provider's
|
|
native latest-attachment route:
|
|
|
|
- GitHub: `releases/latest/download/asset-name.zip`
|
|
([documentation](https://docs.github.com/en/repositories/releasing-projects-on-github/linking-to-releases)).
|
|
- Gitee: `releases/download/latest/asset-name.zip`
|
|
([Windows download](https://gitee.com/TNTcraftHIM/Piik/releases/download/latest/piik-app-windows-amd64.zip)).
|
|
|
|
Both links follow provider publication without a website rebuild. Supported App
|
|
architecture choices stay visible; one selection updates both providers' links.
|
|
An optional GitHub metadata request supplies the latest version/date and its
|
|
authored editorial title and one-line explanation;
|
|
failure does not disable architecture selection. Without JavaScript, the default
|
|
links remain Windows x64, Apple silicon and Linux x64. Publish a newly listed App
|
|
package before deploying its website option. ARM64 Server packages alone do not
|
|
enable an ARM64 App choice.
|
|
Platform buttons say “Download from GitHub” /
|
|
“GitHub 下载”; the secondary link says “Download from Gitee” /
|
|
“Gitee 国内镜像下载”. Keep versions and archive formats out of these labels.
|
|
[Versioning](../standards/versioning.md#release-sources) owns package verification
|
|
and completion of mirror publication. GitHub remains the primary source; the
|
|
Gitee download can temporarily lag while a mirror publication completes.
|
|
Verify the latest redirects and package checksums after releases.
|
|
|
|
## Publish
|
|
|
|
1. Verify the public copy and destinations above. Publish approved release
|
|
artifacts before adding their download options to the website.
|
|
2. In repository **Settings > Pages**, choose **GitHub Actions** as the source.
|
|
Use the dedicated Pages workflow, not publication of the repository root or
|
|
all of `docs/`, which includes developer research and operational reference.
|
|
3. Set the approved `piik.tv` custom domain in Pages settings and configure its
|
|
DNS using GitHub's [current domain instructions](https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site).
|
|
Actions publishing does not need a `CNAME` file in the source tree.
|
|
4. Accepted main pushes run CI first; success triggers **Website**, which checks
|
|
out that CI run's exact commit. Manual dispatch uses its selected `main` commit.
|
|
Before publishing, both paths skip a build that is no longer current main;
|
|
dispatch again for the latest commit when needed. The separate Gitee mirror
|
|
workflow does not gate Website deployment. Download links resolve through each provider, so
|
|
publishing a package or retrying its mirror needs no link refresh.
|
|
Only `build/site/` is uploaded; website work does not package App/Server.
|
|
Verify HTTPS, both languages, relative assets and per-platform download links.
|
|
|
|
Branch/PR pushes do not deploy. The workflow does not change DNS; the private
|
|
production site and the US P2P-only demo remain separate deployments.
|
|
|
|
For rollback, dispatch the previously accepted site revision from a reviewed
|
|
revert on `main`; runtime App/Server binaries and databases are unaffected.
|