I have using Webview
to display some html data in my app. I am using the following code.
WebView featureview = (WebView) findViewById(R.id.featureview);
WebSettings webSettings = featureview.getSettings();
webSettings.setJavaScriptEnabled(true);
featureview.loadData(featureDescription, "text/html", "utf-8");
Some of the html data has embedded video from youtube using code like <iframe height='390' frameborder='0' width='640' allowfullscreen='' src='http://www.youtube.com/embed/8xgkw67o0Gc' title='YouTube video player'></iframe>
. But it is giving black screen. what is the problem in code? Here I like to add I have installed the flash player and I am trying in in Android 2.2 device.
Try:
webView.getSettings().setPluginsEnabled(true);
Or the non-deprecated equivalent:
webview.getSettings().setPluginState(WebSettings.PluginState.ON);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With