Skip to content

fix: repair failing YouTube embeds in comments - #25929

Open
dcalhoun wants to merge 3 commits into
trunkfrom
fix/youtube-embeds-in-comments
Open

fix: repair failing YouTube embeds in comments#25929
dcalhoun wants to merge 3 commits into
trunkfrom
fix/youtube-embeds-in-comments

Conversation

@dcalhoun

@dcalhoun dcalhoun commented Aug 22, 2026

Copy link
Copy Markdown
Member

Description

YouTube videos embedded in Reader comments failed to play, showing "Error 153 — Video player configuration error" instead of the video.

YouTube's Required Minimum Functionality terms require embeds to send an HTTP referrer. WebCommentContentRenderer loaded comment HTML with a nil base URL, which gives the document an about:blank origin, so the embed iframe sent no Referer header and the player refused to load.

This is the same root cause as #24984, which fixed post content in ReaderWebView. That fix set a real base URL but was never applied to the comment renderer. This PR loads comment HTML with the same https://wordpress.com/reader base URL, so embeds behave consistently in posts and comments.

Fix #25928. Fix CMM-2349.

Commits

  • style: applies swift-format to the file, no behavior change — split out so the fix diff stays reviewable.
  • fix: the actual change, 8 lines.

Testing instructions

  1. Open the Reader.
  2. Open a post that has a comment containing an embedded YouTube video.
  3. Tap the comments button to open the comment detail view.
  4. Scroll to the comment with the YouTube embed.
  5. Expected: the video renders and plays inline. On trunk it shows "Error 153 — Video player configuration error".
  6. Tap the video and confirm it still opens externally rather than navigating inside the comment.

Verified on device: Jetpack 27.2, iPhone 17, iOS 26.6.1.

dcalhoun and others added 2 commits August 22, 2026 12:21
Formatting-only change, no behavior difference. Committed separately to
keep the following bug fix diff reviewable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmsWazuVWxvq6GuTtyxF43
YouTube requires an HTTP referrer for embedded players. Comment content
was loaded with a nil baseURL, so the iframe sent no referrer and the
player rendered 'Error 153 - Video player configuration error' instead
of the video.

Load comment HTML with the same https://wordpress.com/reader base URL
that ReaderWebView uses for post content.

Fixes #25928

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmsWazuVWxvq6GuTtyxF43
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmsWazuVWxvq6GuTtyxF43
@dcalhoun dcalhoun added this to the 27.3 milestone Aug 22, 2026
@dcalhoun dcalhoun changed the title fix: send HTTP referrer for YouTube embeds in comments fix: repair failing YouTube embeds in comments Aug 22, 2026
@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number33882
VersionPR #25929
Bundle IDorg.wordpress.alpha
Commitbce96b8
Installation URL2jom4icfuokig
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number33882
VersionPR #25929
Bundle IDcom.jetpack.alpha
Commitbce96b8
Installation URL2j0b61opq73r0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@dcalhoun
dcalhoun marked this pull request as ready for review August 22, 2026 16:57
@dcalhoun
dcalhoun requested review from crazytonyli and a lite review from Copilot and removed request for Copilot August 22, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YouTube embeds in Reader comments show "Error 153 — Video player configuration error"

3 participants