tags:

views:

72

answers:

1
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

A: 

you point to an html page, not to a video.

maybe this can be helpful?

How To Play YouTube Videos Within an Application

Noya