我正在尝试使用WebView播放YouTube视频。为此,我使用以下代码,但对我而言不起作用。它可以在系统浏览器中使用。
<html>
<head>
<style type=\"text/css\">
body{ background-color: transparent; color: white; }
</style>
</head>
<body style=\"margin:0\">
<embed id=\"yt\" src=" +'"'+youTubeDetails.getVideoUrl()+'"'+"type=\"application/x-shockwave-flash\" width=\"%0.0f\" height=\"%0.0f\">
</embed>
</body>
</html>
最佳答案
尝试将插件激活到WebView中:
mWebView.getSettings().setPluginsEnabled(true);
关于android - Android WebView和YouTube,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/4905682/