Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/217.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
webview中的Android youtube_Android_Webview_Youtube_Loaddata - Fatal编程技术网

webview中的Android youtube

webview中的Android youtube,android,webview,youtube,loaddata,Android,Webview,Youtube,Loaddata,我已经使用Webview在我的应用程序中显示了一些html数据。我正在使用以下代码 WebView featureview = (WebView) findViewById(R.id.featureview); WebSettings webSettings = featureview.getSettings(); webSettings.setJavaScriptEnabled(true); featureview.loadData(featureDescription, "text/ht

我已经使用
Webview
在我的应用程序中显示了一些html数据。我正在使用以下代码

WebView featureview = (WebView) findViewById(R.id.featureview);
WebSettings webSettings = featureview.getSettings(); 
webSettings.setJavaScriptEnabled(true); 
featureview.loadData(featureDescription, "text/html", "utf-8");
一些html数据使用类似
的代码嵌入了来自youtube的视频。但它给了黑屏。代码中的问题是什么?这里我想补充一点,我已经安装了flash播放器,正在安卓2.2设备中试用。

启用javascript

 myWebView = (WebView) findViewById(R.id.webview); 
 WebSettings webSettings = myWebView.getSettings(); 
 webSettings.setJavaScriptEnabled(true); 
 myWebView.loadUrl("http://www.youtube.com"); 
请参阅此链接

试试:

webView.getSettings().setPluginsEnabled(true);
或未弃用的等效物:

webview.getSettings().setPluginState(WebSettings.PluginState.ON);

我不想打开任何youtube url,我只想打开一个嵌入html内容的剧本。然而,我添加了setJavaScriptEnabled,但它给出了相同的结果。这对我来说很有效@开发者android应该试试这个,如果它解决了问题,就接受答案。这在大多数情况下不起作用。在这里查看我的答案:
setPluginState
现在也被弃用了。我还想知道你是否解决了这个问题以及如何解决?在这里查看我的答案