开发者

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜