Load specific thumbnail thumbnail using xml?

R.I.P.

New Member
I've managed to load a thumbnail from youtube, but how can I choose one of the six thumbnails that exist per video?\[code\]<media:thumbnail url='http://i.ytimg.com/vi/dTI0KDuQl_4/default.jpg' height='90' width='120' time='00:02:42' yt:name='default'/><media:thumbnail url='http://i.ytimg.com/vi/dTI0KDuQl_4/mqdefault.jpg' height='180' width='320' yt:name='mqdefault'/><media:thumbnail url='http://i.ytimg.com/vi/dTI0KDuQl_4/hqdefault.jpg' height='360' width='480' yt:name='hqdefault'/><media:thumbnail url='http://i.ytimg.com/vi/dTI0KDuQl_4/1.jpg' height='90' width='120' time='00:01:21' yt:name='start'/><media:thumbnail url='http://i.ytimg.com/vi/dTI0KDuQl_4/2.jpg' height='90' width='120' time='00:02:42' yt:name='middle'/><media:thumbnail url='http://i.ytimg.com/vi/dTI0KDuQl_4/3.jpg' height='90' width='120' time='00:04:03' yt:name='end'/>\[/code\]For example I want the third one (hqdefault).I tried the following using mwfeedparser:\[code\]else if ([currentPath isEqualToString:@"/feed/entry/media:group/media:thumbnail"]) { NSArray *urlArray = [currentElementAttributes objectForKey:@"url"]; item.thumbnail = urlArray; processed = YES; }\[/code\]And in my view controller I entered:\[code\]NSData *data = http://stackoverflow.com/questions/10530548/[NSData dataWithContentsOfURL:[NSURL URLWithString:[[item.thumbnail objectAtIndex:3] URLString]]]; cell.videoThumbnail.image = [UIImage imageWithData:data];\[/code\]But it keeps crashing :/
 
Back
Top