开发者

How to load youtube page on WebView Android?

I need create WebView which can load a page from Youtube. I don't want play video, I need loading on WebView. I created this code:

WebView youtubeView=(WebView)findViewById(R.id.webViewYoutube);
WebSettings settings=youtubeView.getSettings();
settings.setJavaScriptEnabled(true);
youtubeView.loadUrl("http://www.youtube.com");

But when page is loaded then Android suggest me to choose a other program for loading this page. How can I do my task? I must loading th开发者_Go百科is page without standard browser and other.


If you have a device at least running a 2.2 android version you can read a youtube video directly in your WebView by adding this line:

settings.setPluginsEnabled(true);


Try loading http://m.youtube.com instead of www.youtube.com

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜