Skip to content

Commit

Permalink
Delete "Fetch the video identifier asynchronously" demo code in README
Browse files Browse the repository at this point in the history
This code is available in `DemoAsynchronousViewController.m`
  • Loading branch information
0xced committed Oct 12, 2013
1 parent 5e9a54d commit 36773ad
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,6 @@ XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [[XCDYouTubeVid
[self presentMoviePlayerViewControllerAnimated:videoPlayerViewController];
```
#### Fetch the video identifier asynchronously
```objc
XCDYouTubeVideoPlayerViewController *videoPlayerViewController = [XCDYouTubeVideoPlayerViewController new];
[self presentMoviePlayerViewControllerAnimated:videoPlayerViewController];
NSURL *url = [NSURL URLWithString:@"https://gdata.youtube.com/feeds/api/standardfeeds/most_popular?v=2&alt=json&time=today&max-results=1"];
[NSURLConnection sendAsynchronousRequest:[NSURLRequest requestWithURL:url] queue:[NSOperationQueue new] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
id json = [NSJSONSerialization JSONObjectWithData:data ?: [NSData new] options:0 error:NULL];
NSString *videoIdentifier = [[[json valueForKeyPath:@"feed.entry.media$group.yt$videoid.$t"] lastObject] description];
videoPlayerViewController.videoIdentifier = videoIdentifier;
}];
```

#### Present the video in a non full-screen view
```objc
Expand Down

0 comments on commit 36773ad

Please sign in to comment.