Question

I'm trying to open a video file on a server.

It works fine on < 6.0 using this code:

 NSURL *videoURL = [NSURL URLWithString:[[[[self.campArray objectAtIndex:button.tag]valueForKey:@"images"]objectAtIndex:0]valueForKey:@"imageURL"]];
self.moviePlayer = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];
self.moviePlayer.moviePlayer.shouldAutoplay=YES;
[self presentModalViewController:self.moviePlayer animated:YES];
[self.moviePlayer.moviePlayer play];
[self.moviePlayer release];

but when trying running this code on a device which has iOS 6, the modal view presented and then after 1 sec it closes. It'd not crushing... the player modal view just closes... I read about this and also added @property (strong,nonatomic) MPMoviePlayerViewController *moviePlayer; but it's still not working...

Thanks for any help.

Was it helpful?

Solution

You should use presentViewController method in iOS 6.0 to presenting a view controller. presentModalViewController is deprecated in ios 6.0.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top