You tube video not playing
I am trying to call you tube from my web view which is associated with a view stub. The problem is I am able to load the you tube but if I click on the play button of you tube, it is not playing
Here is what I am trying to do
webView = (WebView)findViewById(R.id.webView1);
WebSettings webSet = webView.getSettings();
webSet.setJa开发者_开发技巧vaScriptEnabled(true);
// setContentView(webView);
webView.loadUrl("http://www.youtube.com/watch?v=QaIPQMVMRqU&feature=related");
I included a transparent button on the web view and finally I am able to play it.
Look at this: Android YouTube app Play Video Intent
Apparently on emulator this doesn't work but on device it works. Were you running it only on the emulator?
Your code should work, try it on a real device.
You should better use the url you get in share section of youtube than the one you use: http://youtu.be/QaIPQMVMRqU
if you have made it in android 2.1 that code will not be able to play video on emulator , buti f you intall that same on a android device version 2.2 it will work
if you want to play it in emulator just make it on android version 2.2
精彩评论