I have managed using the YouTube API to fetch thumbnails for my list of videos, however they have black bars top and bottom of the UIImage I get. How can I fetch a thumbnail without these bars and even better a higher quality thumbnail?
Here is the code I use currently:
GDataEntryBase *entry = [[feed entries] objectAtIndex:i];
NSArray *thumbnails = [[(GDataEntryYouTubeVideo *)entry mediaGroup] mediaThumbnails];
NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:[[thumbnails objectAtIndex:0] URLString]]];
UIImage *thumbnail = [UIImage imageWithData:data];
It’s also worth noting that all thumbnails are currently in a 4:3 aspect ratio, for historical purposes. If the underlying video is 16:9 and you plan on using a 16:9 player, then it makes sense to position the thumbnail so that the top and bottom black bars are hidden. That’s independent of whether you use a lower-resolution or higher-resolution thumbnail.