开发者

You tube video not playing

开发者 https://www.devze.com 2023-03-30 11:50 出处:网络
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

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

0

精彩评论

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

关注公众号