Possible Duplicate:
Code for download video from Youtube on Java, Android
i want to play a youtube video on a button click.but i dont want that video to be played using youtube site.i want to play it locally.how to do that?
i tried following ways to play the video.
1)startActivity(new Intent(Intent.ActionView,Uri.parse("http://www.youtube.com/watch?v=cxLG2wtE7TM")));
if i use this way,youtube site is opening.after playing that video,it is showing some other videos as suggitions.i dont want to show that related videos as suggitions.i want to play only the video that i mentioned in intent.
Then i tried
2) String Play = "iframe width=\"300\" height=\"400\" src=\"http://www.youtube.com/embed/cxLG2wtE7TM\" frameborder=\"0\" allowfullscreen></iframe>";
myWebView.loadData(Play, "text/html", "utf-8");
if i try this,empty screen is coming. no video is playing.video might not be embedding into my Webview.
3)finally i tried the sample code given in
http://keyeslabs.com/joomla/samplecode/introvideoactivity/IntroVideoActivity.java
if i use this,"Sorry This Video Cannot be played" alert is coming :(
please help me.thanks in advance.