I have made an RSS reader app in Xcode, which gets it's information from a YouTube channel. How can I get the thumbails from the videos?
I am able to use this link: http://gdata.youtube.com/feeds/mobile/users/HaatFilms/uploads?alt=rss
To get the uploads text, but what would I use to get the thumbnail for each specific video?
To save this thumbnail to your device, right-click it and select “Save Image As.” Select a folder to save the thumbnail in, and you're all set.
Yes, you could use exactly the same thumbnail each time but when someone looks through your catalog to watch older videos, having exactly the same thumbnail may discourage them from binging on your past videos.
Step 1: Open the youtube video (that you want to see the thumbnail for) in your browser. Step 2: View the HTML source of the video by clicking 'CTRL + U' or 'CMD + U' if you are on a mac. You can also view the source by right clicking on a black area of the screen and then selecting 'View Source'.
Just play the youtube video that has the background image you wanted and click on the Youtube Image Downloader chrome extension icon, and that's it! The image will immediately start downloading.
Using the listed RSS feed:
You'll see links that include:
LKk6SvGmJj4
Previous episode: http://youtu.be/LKk6SvGmJj4 http://gdata.youtube.com/feeds/mobile/videos/LKk6SvGmJj4
That's the youtube ID.
Take that ID and use it with a straight image tag.
http://img.youtube.com/vi/LKk6SvGmJj4/0.jpg
http://img.youtube.com/vi/LKk6SvGmJj4/1.jpg
Use those images to populate your tables. Personally, I use Afnetworking's UIImageView category.
https://github.com/AFNetworking/AFNetworking
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 100.0f, 100.0f)];
[imageView setImageWithURL:[NSURL URLWithString:@"http://img.youtube.com/vi/LKk6SvGmJj4/1.jpg"] placeholderImage:[UIImage imageNamed:@"placeholder-avatar"]];
I have used UIImageView+AFNetworking
category to load image to an UIImageView
. UIImageView+AFNetworking
NSString * youtubeID = @"TJkmc8-eyvE";
NSURL *youtubeURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://img.youtube.com/vi/%@/0.jpg",youtubeId];
[imageView setImageWithURL:youtubeURL] placeholderImage:[UIImage imageNamed:@"placeHolderImage"]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With