开发者

youtube video not showing in webView

I am new to android. Can anyone please tell how to play youtube video. My requirement is the video should display in the 'WebView' initially and on tapping that, the video should get played.

webView = (WebView)findViewById(R.id.webView1); 
WebSettings websets = webView.getSettings(); 
websets.setJavaScriptEnabled(true); 
registerForContextMenu(webView); 
webView.loadUrl("file:开发者_如何学Go///android_asset/youtubes.html");


Maybe this helps, I came accross this post: link

And indeed, I basically only needed to add to the application manifest xml:

android:hardwareAccelerated="true"

And voila, even the youtube video's started playing

Only available from Android 3.0 (API level 11)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜