Android Question How to allow mixed content on webview

kenkie21

New Member
Licensed User
Hi
Need help @Erel to solve mixed content when using webview library, i'm already use webviewextra and webviewsetting but didnt found solution to enable mixed content. Please some help.

This the log :
Mixed Content: The page at 'https://.../822123&autoplay=true' was loaded over HTTPS, but requested an insecure video 'http://...?refId=1'. This request has been blocked; the content must be served over HTTPS. in https://.../822123&autoplay=true (Line: 0)

Thanks
 
Last edited:

kenkie21

New Member
Licensed User
Hi @Erel , please some advise please.
Cause at native have this
webView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE);
for webview component, how i able to set it ?

Thanks
 

Erel

Administrator
Staff member
Licensed User
Hi @Erel , please some advise please.
It is a mistake to limit your questions to a single member.

B4X:
Sub Activity_Create(FirstTime As Boolean)
   Activity.LoadLayout("Layout1")
   Dim jo As JavaObject
   jo.InitializeContext
   Dim p As Phone
   If p.SdkVersion >= 21 Then
       jo.RunMethod("setWebViewContentMode", Array(WebView1))
   End If
End Sub


#if JAVA
import android.webkit.*;
public static void setWebViewContentMode(WebView wv) {
   wv.getSettings().setMixedContentMode(2);
}
#End If
 
Top