3

In my app I want to click on a particular button and jump to the youtube app and show a youtube user .Eg http://www.youtube.com/user/punjabiradiousa . How is this possible please suggest some technique?

Philipp Jahoda
  • 47,594
  • 21
  • 164
  • 175
Navdroid
  • 1,475
  • 3
  • 24
  • 48
  • possible duplicate of [Calling YouTube app using ACTION\_VIEW intent Failing most of the time](http://stackoverflow.com/questions/2978963/calling-youtube-app-using-action-view-intent-failing-most-of-the-time) You can only view the User's profile if the YouTube app provides that feature. As for viewing Videos. You can pass video url intents. see the link –  Aug 21 '13 at 08:07
  • 1
    you may refer to http://stackoverflow.com/a/16514288/1131470 – Chor Wai Chun Aug 21 '13 at 08:08
  • I want to open it in youtube app – Navdroid Aug 21 '13 at 08:25
  • The title asks for video playing, question body asks for showing a user. Please edit the other to make the question clear. – laalto Aug 21 '13 at 12:08

3 Answers3

8

Do it like this:

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("http://www.youtube.com/user/punjabiradiousa")));

Taken from here: Android YouTube app Play Video Intent

Community
  • 1
  • 1
Philipp Jahoda
  • 47,594
  • 21
  • 164
  • 175
1

This code i have used to play youtube video

Matcher matcher = Pattern.compile("http://www.youtube.com/embed/").matcher(mVideoId);
matcher.find()
Intent lVideoIntent = new Intent(
                                null,
                                Uri.parse("ytv://" + mVideoId),
                                MainScreen.mContext,
                                com.kids.youtube.OpenYouTubePlayerActivity.class);
                                startActivity(lVideoIntent);
laalto
  • 137,703
  • 64
  • 254
  • 280
FarhaSameer786
  • 370
  • 4
  • 12
0

Its Working

startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("")));
Keshav Gera
  • 8,200
  • 1
  • 56
  • 43