Skip to content

feat(rewrite): add set_youtube_playback_rate rule - #4631

Open
cevdetch wants to merge 1 commit into
miniflux:mainfrom
cevdetch:feat/youtube-playback-rate
Open

cevdetch wants to merge 1 commit into
miniflux:mainfrom
cevdetch:feat/youtube-playback-rate

Conversation

@cevdetch

Copy link
Copy Markdown
Contributor

Closes #2949

Adds a set_youtube_playback_rate("1.5") rewrite rule to set the playback speed of YouTube embeds per feed.

  • The rule finds YouTube iframes in the entry (including ones created by add_youtube_video), adds enablejsapi=1 and tags them with data-youtube-playback-rate.
  • app.js sends the rate to the player with postMessage (no external script, no CSP changes).
  • The rate must be between 0.25 and 2, validated when the rule is saved.
  • The sanitizer allows the new iframe attribute.
  • The existing media_playback_rate setting and Invidious support are unchanged.

Usage: custom rules replace the predefined ones, so a YouTube feed needs add_youtube_video,set_youtube_playback_rate("1.5"). Entries already fetched are not changed.

Tested with unit tests for the rule, validation and sanitizer. I also checked the postMessage handshake in headless Chromium against a real youtube-nocookie.com embed: the player reported playbackRate: 1.5.

@cevdetch
cevdetch force-pushed the feat/youtube-playback-rate branch from 3e41b85 to 8e21271 Compare November 19, 2026 23:32
@cevdetch cevdetch closed this Nov 24, 2026
@cevdetch
cevdetch force-pushed the feat/youtube-playback-rate branch from 8e21271 to 0b385d3 Compare November 24, 2026 14:03
@cevdetch cevdetch reopened this Nov 24, 2026
Add a rewrite rule that sets the playback rate of YouTube embeds per feed.
The rule enables the player JS API on YouTube iframes and tags them with
data-youtube-playback-rate; app.js then sends the rate to the player via
postMessage. Rates outside 0.25-2 are rejected when the rule is saved.

Closes miniflux#2949
@cevdetch
cevdetch force-pushed the feat/youtube-playback-rate branch from d706730 to fd3eb27 Compare November 29, 2026 23:51
@cevdetch

Copy link
Copy Markdown
Contributor Author

@fguillot let's push that to fix #2949 which is open since 2024 and I think it's really a good improvement

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

set youtube playback speed on a per-feed basis

1 participant