0

I have referred the answers of

android-youtube-app-play-video-intent

how-to-play-youtube-video-in-my-android-application

and many more.All those are playing videos by using Intent which creates a new Window and to be more precise by creating a new Activity.

But,I am having a scenario in which I want to play a Video on click of a Button by staying in the same Activity


refer this video tutorial: http://mfarhan133.wordpress.com/2010/10/13/using-audio-video-files-tutorial-for-android/

Community
  • 1
  • 1
Jack Dsilva
  • 1,504
  • 3
  • 24
  • 44

2 Answers2

1

Use a VideoView http://developer.android.com/reference/android/widget/VideoView.html

Rajdeep Dua
  • 11,190
  • 2
  • 32
  • 22
0

If you want to play a video file from phone storage or streaming, you can use VideoView.

If you want to open youtube video, you can use a WebView in your activity and open the youtube link.
See this WebView Tutorial.

Karthik
  • 3,509
  • 1
  • 20
  • 26