문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top