Android WebView and YouTube
I am trying to play a YouTube video using WebView. To do this I use the following code but it doesn't work for me. It works in system browser.
<html>
<head>
<style type=\"text/css\">
body{ background-color: transparent; color: white; }
</style&开发者_运维问答gt;
</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>
Try to activate the plug-ins into your WebView:
mWebView.getSettings().setPluginsEnabled(true);
精彩评论