I'll keep it simple, heres the code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
VideoEntry *entry = [videoEntries objectAtIndex:indexPath.row];
[HCYoutubeParser h264videosWithYoutubeURL:[NSURL URLWithString:entry.url] completeBlock:^(NSDictionary *videoDictionary, NSError *error) {
NSArray *urls = [videoDictionary allValues];
NSURL *url = [NSURL URLWithString:[urls objectAtIndex:0]];
[mp.moviePlayer setAllowsAirPlay:YES];
[mp.moviePlayer setContentURL:url];
[mp.moviePlayer prepareToPlay];
[mp.moviePlayer play];
[self presentMoviePlayerViewControllerAnimated:mp];
}];
}
mp is a MPMoviePlayerViewController. The view controller is presented but then the movie doesn't start, it just says "Loading..." and before you ask I'm 100% sure the links work.
Thanks!