I want to open a youtube video link in MPMoviePlayer
of my application :
I have implemented following code for this :
NSURL *url=[NSURL URLWithString:@"http://www.youtube.com/watch?v=mIMFL9wRaJE"];
NSLog(@"url is %@", url);
MPMoviePlayerController * _moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url];
[[_moviePlayer view]setFrame:CGRectMake(50, 100, 200, 200)];
[_moviePlayer setFullscreen:NO animated:YES];
_moviePlayer.scalingMode = MPMovieScalingModeAspectFit;
_moviePlayer.shouldAutoplay= YES;
[[self view] addSubview: [_moviePlayer view]];
it is not working accordingly. kindly provide a better solution. thank you.