Skip to content

fix: repair failing YouTube embeds in comments - #25929

Merged
dcalhoun merged 3 commits into
release/27.2from
fix/youtube-embeds-in-comments
Aug 24, 2026
Merged

fix: repair failing YouTube embeds in comments#25929
dcalhoun merged 3 commits into
release/27.2from
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.

@dangermattic

dangermattic commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR contains changes to RELEASE-NOTES.txt.
Note that these changes won't affect the final version of the release notes as this version is in code freeze.
Please, get in touch with a release manager if you want to update the final release notes.

Generated by 🚫 Danger

@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

wpmobilebot commented Aug 22, 2026

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 Number33912
VersionPR #25929
Bundle IDorg.wordpress.alpha
Commite60eee6
Installation URL0bai6n3p07lmo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

wpmobilebot commented Aug 22, 2026

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 Number33912
VersionPR #25929
Bundle IDcom.jetpack.alpha
Commite60eee6
Installation URL47s1dc4vc7jcg
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
@crazytonyli

Copy link
Copy Markdown
Contributor

Do you think we should target the release branch?

@dcalhoun

Copy link
Copy Markdown
Member Author

Do you think we should target the release branch?

Yes, you are correct. I often forget about this project's approach to patching current releases. I'll update the target branch to release/27.2. Thanks.

@dcalhoun
dcalhoun changed the base branch from trunk to release/27.2 August 24, 2026 12:10
dcalhoun and others added 3 commits August 24, 2026 08:11
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
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GmsWazuVWxvq6GuTtyxF43
@dcalhoun
dcalhoun force-pushed the fix/youtube-embeds-in-comments branch from bce96b8 to e60eee6 Compare August 24, 2026 12:11
@dcalhoun
dcalhoun enabled auto-merge (squash) August 24, 2026 12:12
@dcalhoun
dcalhoun merged commit 997fc02 into release/27.2 Aug 24, 2026
28 checks passed
@dcalhoun
dcalhoun deleted the fix/youtube-embeds-in-comments branch August 24, 2026 12:26
github-merge-queue Bot pushed a commit that referenced this pull request Aug 27, 2026
* fix: repair failing YouTube embeds in comments (#25929)

* style: apply swift-format to WebCommentContentRenderer

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

* fix: send HTTP referrer for YouTube embeds in comments

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

* chore: add release note for YouTube comment embed fix

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Merge release_notes/27.2 into release/27.2 (#25936)

* Add editorialized release notes

* Update metadata strings

* Update metadata strings

---------

Co-authored-by: Tony Li <tony.li@automattic.com>

---------

Co-authored-by: David Calhoun <github@davidcalhoun.me>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: WordPress Mobile Bot Account <mobile+wpmobilebot@automattic.com>
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"

4 participants