2010-07-23 370 views
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]; 

爲什麼它不工作我可以播放視頻的YouTube格式爲iPhone

回答