Reputation: 57
NSString *url = @"http://www.youtube.com/watch?v=DqCxv6a5Iu0";
/*
NSString *url = @"http://www.youtube.com/watch?v=DqCxv6a5Iu0";
mp = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]];
[mp play];*/
NSString *videoFilepath = [[NSBundle mainBundle] pathForResource:@"Movie" ofType:@"m4v"];
NSURL *videoURL = [NSURL fileURLWithPath:url];
MPMoviePlayerController *movie;
movie = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
[movie play];
why its not working
Upvotes: 1
Views: 510
Reputation: 3899
you point to an html page, not to a video.
maybe this can be helpful?
How To Play YouTube Videos Within an Application
Upvotes: 1