I am having a video file on server. When I copy the URL and run in safari it start playing video in browser using quick time player, but it is not playing in simulator, it is showing loading but nothing happening. Please help me. How can I solve this?
Thanks.
-
(void)playMovieWithUrl:(NSString*)url{
moviePlayerViewController = [[MPMoviePlayerViewController alloc] init];
moviePlayerViewController.moviePlayer.controlStyle = MPMovieControlStyleDefault;
moviePlayerViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight |
UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin |
UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
[self.view addSubview:moviePlayerViewController.moviePlayer.view];
[moviePlayerViewController.moviePlayer setFullscreen:YES];
[moviePlayerViewController.moviePlayer stop];
NSLog(@"playerUrl %@",url);
[moviePlayerViewController.moviePlayer setMovieSourceType:MPMovieSourceTypeStreaming];
[moviePlayerViewController.moviePlayer setContentURL:[NSURL URLWithString:url]];
[moviePlayerViewController.moviePlayer prepareToPlay];
//moviePlayerViewController.moviePlayer.initialPlaybackTime = interval;
[moviePlayerViewController.moviePlayer play];
}