1

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.

Muddu Patil
  • 713
  • 1
  • 11
  • 24
  • 1
    MPMoviePlayerController not playing youtube video directly, it play only video file path Url in ios, Check this https://github.com/hellozimi/HCYoutubeParser – NANNAV Apr 01 '14 at 07:24

0 Answers0