Refused to load the image 'android-webview-video-poster:default_video_poster' because it violates CSP




I’m trying to embed videos into Android webview. Here is the following html code:

It works fine in jsfiddle, but when I load a HTML that looks like this in Android webview, I see it successfully load the thumbnail of the video. When I click play button, it gives me a popup saying,
“By playing this video you agree to Twitter’s use of cookies…”

I hit “OK”, and it shows “The media could not be played”.

In the log, I see:

Refused to load the image 'android-webview-video-poster:default_video_poster/8443874430566469765' because it violates the following Content Security Policy directive: "img-src 'self' http://localhost:** https://* https://* https://* https://* https://* blob: data:".

I’ve tried but I believe its the CSP in the iframe html, so I have no control over that CSP.

I read Display embedded tweet with video in Android WebView and I cannot use TweetView because I am not able to bring in new dependency to my build.gradle by just specifying an address. I am only able to add in dependency through .jar file or through maven central repository or PyPI or RubyGems or CPAN (please share/guide if either exist).

Here are the culprits:

This iframe url does not allow to load ‘android-webview-video-poster:default_video_poster’ because it specifies a CSP that prevents it:

How to fix?
Please add ‘android-webview-video-poster:default_video_poster’ to img-src of CSP in embed_source html



This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.