From 02f28b6e09ffb5112411c590124e9dc54f74e2cf Mon Sep 17 00:00:00 2001 From: seasonyuu Date: Wed, 21 Oct 2026 15:14:30 +0800 Subject: [PATCH 1/6] feat: add direct Canvas WebRTC rendering mode Introduce renderer adapters, accessible mode selection and preference migration. Add no-Video rendering, JPEG fallback diagnostics, session isolation and regression coverage with localized documentation. --- README.md | 8 +- README.zh-CN.md | 8 +- common/src/main/assets/web/app.js | 329 +++++++++++++----- common/src/main/assets/web/index.html | 7 +- common/src/main/assets/web/style.css | 2 + .../shilapi/xcertplay/web/BrowserStrings.kt | 13 + docs/ARCHITECTURE.md | 12 + docs/WEBRTC_RECOVERY.md | 10 +- .../src/main/res/values-zh-rCN/ui_strings.xml | 12 + .../src/main/res/values-zh-rTW/ui_strings.xml | 12 + shared/src/main/res/values/ui_strings.xml | 12 + test/localization.test.js | 13 + test/pairing.test.js | 4 +- test/stream-client.test.js | 207 ++++++++++- test/track-canvas.test.js | 91 +++++ test/webrtc.test.js | 82 ++++- 16 files changed, 704 insertions(+), 118 deletions(-) create mode 100644 test/track-canvas.test.js diff --git a/README.md b/README.md index e87ffb8..61ab379 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,13 @@ For 60 fps, select WebRTC video passthrough under Settings → Display & streami The WebRTC interruption tolerance setting offers 4, 10 (default), or 30 seconds and applies on the next browser connection. Recoverable interruptions keep the last video frame visible while waiting for recovery; persistent problems fall back to JPEG after the grace period. Unsupported codecs and terminal connection failures still fall back immediately. This does not enlarge the video buffer or change control and audio connection rules. Refresh the webpage after updating the App. See the [stability and troubleshooting notes](docs/WEBRTC_RECOVERY.md) (Chinese). -If the video element renders incorrectly in your car's browser, enable “Use Canvas to display video (experimental)” on the webpage's connection screen before connecting. This is disabled by default. The selection is saved in the current browser and persists across automatic reconnects and page reloads; if browser storage is disabled, it applies only to the current page. WebRTC video is still decoded by an offscreen `