Question

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.setJavaScriptEnabled(true);

// setContentView(webView);

webView.loadUrl("http://www.youtube.com/watch?v=QaIPQMVMRqU&feature=related");

Was it helpful?

Solution

I included a transparent button on the web view and finally I am able to play it.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top