문제

I have an app that loads while a 2 second movie plays. Currently the app is out on the store and has all static content retina display compliant except this video. I have a 960x640 mp4 h.264 encoded video for the retina display and it works well in both iPhone (yes, high res, not 480x320) and iPhone4 simulators. but it just doesn't seem to play on my iPod Touch 3rd Gen running iOS4. I haven't been able to test on the physical retina display yet.

It never occurred to me until now that maybe MPMoviePlayerController might not support higher than 480x320, but the docs do say that.

http://developer.apple.com/library/ios/#documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html

I know this most likely sounds like another @2x solution, but that does not seem to be working either.

Any suggestions for getting this High-res video playing for both screens? I can post code if needed.


For reference, here's the solution:

MPMoviePlayerController *movieController;

if ([[UIScreen mainScreen] scale] == 2.0) {
  movieController = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath: [[NSBundle mainBundle] pathForResource:@"highRes" ofType:@"mp4"]]];
} else {
  movieController = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"lowRes" ofType:@"m4v"]]];
}
도움이 되었습니까?

해결책

I would suggest using code checking here to supply your media player with the correct video file.

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