2011-02-05 79 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