summaryrefslogtreecommitdiff
path: root/app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt')
-rw-r--r--app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt16
1 files changed, 5 insertions, 11 deletions
diff --git a/app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt b/app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt
index 78020a9..1bc1315 100644
--- a/app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt
+++ b/app/src/main/java/org/terst/feedreader/ui/ReaderWebView.kt
@@ -398,17 +398,11 @@ fun YouTubePlayerDialog(videoId: String, onDismiss: () -> Unit) {
}
}
webChromeClient = WebChromeClient()
- // A host page with the embed in an iframe, not the embed itself as the
- // top-level document. YouTube answers a top-level embed with "Video player
- // configuration error -- Error 153", which is the reported "YouTube play is
- // misconfigured"; framed, the same URL plays. See YouTubeLinks.
- loadDataWithBaseURL(
- YOUTUBE_EMBED_BASE_URL,
- youTubeEmbedPageHtml(videoId),
- "text/html",
- "utf-8",
- null
- )
+ // The embed as this WebView's own ordinary document, with a Referer
+ // header. Without one YouTube answers "Video player configuration error --
+ // Error 153", the reported "YouTube play is misconfigured". See
+ // YouTubeLinks for the alternatives measured and why this one won.
+ loadUrl(youTubeEmbedUrl(videoId), mapOf("Referer" to YOUTUBE_EMBED_REFERRER))
}
},
onRelease = { it.destroy() }