How get the thumbnail from YouTube
For example your youtube video url is as below.
1 |
String youtubeUrl = "https://www.youtube.com/watch?v=Rxo0Upfz48Q"; |
In this url parameter v=Rxo0Upfz48Q stands for video id. So, in above url videoID isRxo0Upfz48Q You can get videoID using below code.
1 2 |
Uri uri = Uri.parse(youtubeUrl); String videoID = uri.getQueryParameter("v"); |
Now using videoID you can make url to get first frame of that youtube video like below.
1 |
String url = "http://img.youtube.com/vi/" + videoID +"/0.jpg"; |
Now […]