Prototype: YouTube IFrame embed in Linux and Android webviews #94

Closed
opened 2026-10-18 20:43:10 +02:00 by SBDeveloper · 1 comment
Owner

This was generated by AI during triage.

Part of #93

Why this can't be delegated

Needs manual testing on a real Android device and the Linux (WebKitGTK) build, and a judgment call on the result.

Question to answer

Does the official YouTube IFrame player play a video inside the Tauri webview on Linux (WebKitGTK) and on Android, in a throwaway pane?

What to check

  • Plays a known embeddable video ID with sound and controls.
  • No YouTube embed errors (notably error 153, which relates to a missing or invalid origin/Referer under Tauri's custom scheme).
  • If it fails, whether a fix exists (e.g. a localhost origin, a referrerpolicy/origin parameter, or loading the embed from an allowed host), and what that costs.
  • Play/pause/seek/position and ended events are reachable through the IFrame API, so the host can advance the Queue.

Done when

A comment here states, per platform, works / works with fix X / doesn't work, with evidence. If both work, docs/adr/0022-video-mode-embeds-the-youtube-player.md moves to accepted and #93 gets an agent brief. If not, revisit ADR 0022.

Out of scope

Matching, YouTube Data API, Queue integration, settings UI. The prototype is throwaway; do not merge it.

> *This was generated by AI during triage.* Part of #93 ## Why this can't be delegated Needs manual testing on a real Android device and the Linux (WebKitGTK) build, and a judgment call on the result. ## Question to answer Does the official YouTube IFrame player play a video inside the Tauri webview on Linux (WebKitGTK) and on Android, in a throwaway pane? ## What to check - Plays a known embeddable video ID with sound and controls. - No YouTube embed errors (notably error 153, which relates to a missing or invalid origin/Referer under Tauri's custom scheme). - If it fails, whether a fix exists (e.g. a localhost origin, a `referrerpolicy`/`origin` parameter, or loading the embed from an allowed host), and what that costs. - Play/pause/seek/position and ended events are reachable through the IFrame API, so the host can advance the Queue. ## Done when A comment here states, per platform, works / works with fix X / doesn't work, with evidence. If both work, `docs/adr/0022-video-mode-embeds-the-youtube-player.md` moves to accepted and #93 gets an agent brief. If not, revisit ADR 0022. ## Out of scope Matching, YouTube Data API, Queue integration, settings UI. The prototype is throwaway; do not merge it.
Author
Owner

Linux (WebKitGTK, release build, origin tauri://localhost): direct IFrame embed fails with error 153 for all four variants (youtube.com / nocookie, with / without origin param). Works with fix: player page served from http://localhost:<port>, iframed into the host pane and driven via postMessage. Verified play, pause, relative seek, position and ended (state 0).

Android (debug APK, origin http://tauri.localhost): works direct, no fix needed. The localhost-iframe approach also works.

Cost of the Linux fix: a localhost HTTP server in the Rust shell, plus frame-src http://localhost:<port> and script-src for youtube.com / s.ytimg.com in the CSP. Recommend the localhost player page on both platforms for one code path.

Caveat: Android was tested as a debug build; re-check a release build when implementing.

Prototype (throwaway, not for merge): branch prototype/94-youtube-embed. ADR 0022 now accepted.

**Linux (WebKitGTK, release build, origin `tauri://localhost`):** direct IFrame embed fails with error 153 for all four variants (youtube.com / nocookie, with / without `origin` param). **Works with fix:** player page served from `http://localhost:<port>`, iframed into the host pane and driven via `postMessage`. Verified play, pause, relative seek, position and ended (`state 0`). **Android (debug APK, origin `http://tauri.localhost`):** **works direct**, no fix needed. The localhost-iframe approach also works. **Cost of the Linux fix:** a localhost HTTP server in the Rust shell, plus `frame-src http://localhost:<port>` and `script-src` for youtube.com / s.ytimg.com in the CSP. Recommend the localhost player page on both platforms for one code path. Caveat: Android was tested as a debug build; re-check a release build when implementing. Prototype (throwaway, not for merge): branch `prototype/94-youtube-embed`. ADR 0022 now accepted.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
SBDeveloper/medley#94
No description provided.