Reputation: 356
I know that I can just start an intent with the URL, but I want a thumbnail that starts the video.
Just like here:
How can I do this?
Upvotes: 1
Views: 270
Reputation: 4863
You need to use YouTube Android Player API. See instructions there: https://developers.google.com/youtube/android/player/
If you want open youtube channel by Intent
you can use folowing snippet:
public static void watchYoutubeVideo(Context context, String channelId) {
Intent intent = new Intent(Intent.ACTION_VIEW,
Uri.parse("http://www.youtube.com/channel/" + channelId));
context.startActivity(intent);
}
Upvotes: 2