Since this remained unanswered, I thought I could offer an offer. The end result that I think is the same as what you are looking for, but the path to it is a little different.
So, from my understanding, you want the UITableView controller to display a list of YouTube videos that play when you click on them. This is how I processed this script in one of my applications.
- You need to get the RSS feed of the video you want on your list. This is pretty easy ... if the user has the format http://www.youtube.com/rss/user/{USERNAMEβΊ/videos.rss
- So, from there you need to parse the RSS feed into a list of objects that have a title, description, thumbnail and link to the video. All of this is provided in RSS, and I used NSXMLParser to do the job.
- Once you have a good list of value objects to work with, all you have to do is turn off the MPMoviePlayerViewController column and pass it the URL to play the movie.
implemented didSelectRowAtIndexPath implementation
- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { Video *video = [self.items objectAtIndex:[indexPath row]]; MPMoviePlayerViewController *mp = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL URLWithString:video.video]]; [self presentMoviePlayerViewControllerAnimated:mp]; [mp release]; }
This is what the interface looks like for my Video class
@interface Video : NSManagedObject { @property (nonatomic, retain) NSString * title; @property (nonatomic, retain) NSString * link; @property (nonatomic, retain) NSString * comments; @property (nonatomic, retain) NSString * thumbnail; @property (nonatomic, retain) NSString * pubDate; @property (nonatomic, retain) NSString * video; @property (nonatomic, retain) NSString * guid; @property (nonatomic, retain) NSString * desc; @end
This is pretty much a nice easy way to display YouTube videos in the UITableViewController. I will not understand XML parsing, there is a ton of documentation on how to do this. I just made a quick google and this blog really gets into the nuts and bolts that I'm talking about:
http://useyourloaf.com/blog/2010/10/16/parsing-an-rss-feed-using-nsxmlparser.html
Hope this helps you. I know that this does not apply to placing markup in WebView, but I think that you will find this method a little more intuitive and because there were no answers ... I hope it raises you up and starts.
source share