wordpress-mobile / wordpress-mobile/WordPress-iOS
Some YouTube embeds don't load in Reader
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 3.9k
- Forks
- 1.2k
- Avg merge
- 23h 51m
- Merged PRs (30d)
- 58
Description
Expected behavior
All embedded YouTube videos that play on the web also play in Reader in the app.
Actual behavior
Only some embedded YouTube videos that play on the web also play in Reader in the app.
| Actual | Expected |
|---|---|
![]() |
![]() |
Steps to reproduce the behavior
- In a WordPress blog on the web, paste these two video URLs into a new post:
- Expect: Loading the post on the web shows the videos embedded and playable
- In Reader in the app, follow the blog from step 1 and load the post
- Observe:
- Video A: Shows a message "Video unavailable".
- Video B: Correctly shows a playable video.
- Expect: Tapping the globe icon at the top of the UI opens a web view that properly plays both videos.
Research
- This LOC may be related.
- Applying the patch below loaded the embeds properly:
diff --git a/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift b/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift
index e395fb95af..91a101570e 100644
--- a/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift
+++ b/WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift
@@ -28,7 +28,7 @@ class ReaderWebView: WKWebView {
let content = formattedContent(addPlaceholder(string), additionalJavaScript: additionalJavaScript)
- super.loadHTMLString(content, baseURL: Bundle.wordPressSharedBundle.bundleURL)
+ super.loadHTMLString(content, baseURL: postURL ?? URL(string: "https://www.wordpress.com")!)
}
/// Given a HTML content, returns it formatted.
Note: Patch was applied to aa1d441040bd970878e2d427806cbd318fbbc76d
Note 2: Patch is only for demo purposes, the nil string fallback URL (www.wordpress.com) is probably not the best choice.
Tested on iPhone 12, iOS 16.2, WPiOS 21.6
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in WordPress/Classes/ViewRelated/Reader/Detail/WebView/ReaderWebView.swift at loadHTMLString and inspect how postURL and the bundle URL are used as the base URL. Reproduce the issue with Video A and Video B in Reader, then verify both play in the embedded view while the globe web view remains functional.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100

