2011-02-05 65 views
0

我正在尝试使用WebView播放YouTube视频。要做到这一点,我使用下面的代码,但它不适合我。它在系统浏览器中工作。Android 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> 

回答

1

尝试激活插件到您的WebView:

mWebView.getSettings().setPluginsEnabled(true); 
+0

我已经启用了插件,但没有效果 – Bytecode 2011-03-22 05:30:01