I have created a app where you can download YouTube videos for android. Now, I want it so that if you play a video in the YouTube native app you can download it too. To do t
You can use the Youtube Android player API to play the video if Youtube app is installed, otherwise just prompt the user to choose from the available web browsers.
if(YouTubeIntents.canResolvePlayVideoIntent(mContext)){
mContext.startActivity(YouTubeIntents.createPlayVideoIntent(mContext, mVideoId));
}else {
Intent webIntent = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.youtube.com/watch?v=" + mVideoId));
mContext.startActivity(webIntent);
}