Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 4 + MPMoviePlayerController

Tags:

iphone

ipad

I have developed universal application which runs on both IPad and IPhone. I am using one component of MPMoviePlayerController in this.

now the iOS4 is released, Today I got a bad news about my application rejection due to this MPMoviePlayerController crash.

iDemoPlayer= [[MPMoviePlayerController alloc] initWithContentURL:aUrl];
[iDemoPlayer play];

This is my src code for playing the video.

In iPhone os 4.0 release I found that

"If you link a Universal application against iPhone SDK 3.2, you must be prepared to embed the movie player view in your interface when running on iOS 4 and later"

ref

http://developer.apple.com/iphone/library/releasenotes/General/RN-iPhoneSDK-4_0/index.html

Can you guys help me,what else updation I need to make so that it will be accepted again!!!!!!

Thanks,

Sagar

like image 835
Sagar... Avatar asked Jun 28 '10 06:06

Sagar...


1 Answers

Ugh, Symbian variable naming conventions.

if ([MPMoviePlayerController instancesRespondToSelector:@selector(view)]) {
  // Running on 3.2+
  iDemoPlayer2 = [[MPMoviePlayerViewController alloc] initWithContentURL:aUrl];
  // Assuming self is a UIViewController
  [self presentMoviePlayerViewControllerAnimated:iDemoPlayer2];
  // This line might be needed
  [self.moviePlayer play];
} else {
  iDemoPlayer= [[MPMoviePlayerController alloc] initWithContentURL:aUrl];
  [iDemoPlayer play];
}
like image 173
tc. Avatar answered Sep 29 '22 09:09

tc.