문제

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");

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top