0

I want to play youtube video . I am using the following code

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/watch?v=cxLG2wtE7TM")));

It is works.It play the video from youtube site.But I want to play a video in my layout

dran
  • 245
  • 1
  • 6
  • 16
  • Buddy.. Just put more efforts in search... Google doesn't charge it.. Anyway Look at http://stackoverflow.com/questions/6556802/how-to-play-youtube-video-in-android , http://stackoverflow.com/questions/4864178/how-to-display-youtube-video-in-android-videoview and http://stackoverflow.com/questions/1007695/streaming-youtube-videos – user370305 Aug 15 '12 at 07:21
  • have a look at my [answer][1] ,it will solve your problem. [1]: http://stackoverflow.com/a/12158743/1206201 – mrYogi Aug 28 '12 at 12:38

1 Answers1

0

I think you might want to embed the YouTube video in a WebView using the <iframe> tag, then put that WebView inside a parent layout, such as RelativeLayout or LinearLayout. Here's a similar question to yours with an accepted answer, plus some sample code on how to do it: Android video embedding

Community
  • 1
  • 1
Matthew Quiros
  • 13,385
  • 12
  • 87
  • 132