Webview enable plug-ins

dboggs411

New Member
Licensed User
Longtime User
I can play flash movies on the regular browser after installing the adobe flash app. However, this doesn't work for the Webview. A response on another discussion group said this could be enabled with the following code in Java:

WebView mWebView = (WebView) findViewById(R.id.WebView01); mWebView.getSettings().setPluginsEnabled(true);

How would I do this in B4A?

Along the same lines, how can I enable the YouTube player in B4A?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can do it with agraham's Reflection library:
B4X:
Sub Globals
    Dim wv As WebView
End Sub

Sub Activity_Create(FirstTime As Boolean)
    wv.Initialize("wv")
    Dim r As Reflector
    r.Target = wv
    r.Target = r.RunMethod("getSettings")
    r.RunMethod2("setPluginsEnabled", True, "java.lang.boolean")
End Sub

What do you mean with enabling the YouTube player?
 
Upvote 0

alfcen

Well-Known Member
Licensed User
Longtime User
Found this thread after encountering the same problem. Will future versions of the webview handle this without Reflector? To agraham: no disrespect intended. :sign0089:
 
Upvote 0

alfcen

Well-Known Member
Licensed User
Longtime User
I am running Ver 1.50. Without Reflector the webview shows nothing but an "Get Adobe Flash Player" icon. With reflector (and Flash Player 10.3) this page comes up just fine:
Live NASA TV

In Webview auto-complete I can see JavaScriptEnabled (by default), though.
 
Upvote 0

alfcen

Well-Known Member
Licensed User
Longtime User
Great. Looking forward to the next update. No rush on that, thanks to agraham's Reflector the problem can be worked around very easily.
 
Upvote 0
Top