Research: YouTube and Vimeo embed approaches for Flutter Reader #32

Closed
opened 2026-08-03 15:00:35 +00:00 by TheAnachronism · 1 comment

Part of #30

Question

How should a Flutter Android app embed YouTube and Vimeo (v1 only) inside a flutter_html-based Reader without making WebView the primary article renderer?

Cover:

  • Detecting embeds from common HTML shapes (iframe src, YouTube/Vimeo URLs in links)
  • Recommended packages or patterns (official players vs thumbnail+Custom Tabs vs constrained platform WebView slot)
  • Gesture / lifecycle pitfalls next to a horizontally swipeable Reader (PageView)
  • Licensing / ToS constraints that would force thumbnail+external open instead of inline play

Capture findings under docs/research/ and link them from the resolution.

Part of #30 ## Question How should a Flutter Android app embed **YouTube** and **Vimeo** (v1 only) inside a `flutter_html`-based Reader without making WebView the primary article renderer? Cover: - Detecting embeds from common HTML shapes (iframe `src`, YouTube/Vimeo URLs in links) - Recommended packages or patterns (official players vs thumbnail+Custom Tabs vs constrained platform WebView slot) - Gesture / lifecycle pitfalls next to a horizontally swipeable Reader (`PageView`) - Licensing / ToS constraints that would force thumbnail+external open instead of inline play Capture findings under `docs/research/` and link them from the resolution.
Author
Owner

Resolution

Gist: Keep flutter_html as the Reader; detect allowlisted YouTube/Vimeo iframe/href shapes into an EmbedRef; default UX is poster + play → url_launcher (Custom Tabs/external). Do not enable wholesale flutter_html_iframe. Optional later inline = one constrained webview_flutter slot loading the official embed URL (provider chrome) only after tap, disposed on PageView leave, with external fallback. Prefer youtube_player_iframe URL/thumbnail helpers over youtube_player_flutter custom overlays (ToS + gesture risk). Vimeo: preserve h=; domain allowlists often force external open.

Doc: docs/research/youtube-vimeo-embeds.md on branch research/youtube-vimeo-embeds (commit 913e3d9).

Hands off to #35 Grill: YouTube/Vimeo embed UX in swipeable Reader. No production Reader code in this ticket.

## Resolution **Gist:** Keep `flutter_html` as the Reader; detect allowlisted YouTube/Vimeo iframe/`href` shapes into an `EmbedRef`; default UX is **poster + play → `url_launcher` (Custom Tabs/external)**. Do **not** enable wholesale `flutter_html_iframe`. Optional later inline = one constrained `webview_flutter` slot loading the **official** embed URL (provider chrome) only after tap, disposed on `PageView` leave, with external fallback. Prefer `youtube_player_iframe` URL/thumbnail helpers over `youtube_player_flutter` custom overlays (ToS + gesture risk). Vimeo: preserve `h=`; domain allowlists often force external open. **Doc:** [`docs/research/youtube-vimeo-embeds.md`](https://git.anachronis.dev/TheAnachronism/tt-rss-viewer/src/branch/research/youtube-vimeo-embeds/docs/research/youtube-vimeo-embeds.md) on branch `research/youtube-vimeo-embeds` (commit `913e3d9`). Hands off to [#35 Grill: YouTube/Vimeo embed UX in swipeable Reader](https://git.anachronis.dev/TheAnachronism/tt-rss-viewer/issues/35). No production Reader code in this ticket.
Sign in to join this conversation.
No description provided.