Ada*_*der 10 iphone cocoa-touch objective-c ipad
使用MPMoviePlayerViewController播放视频时更改iPad设备或模拟器的方向会导致在解除视频播放器时出现不一致的旋转状态.这是iPad SDK 3.2中的一个已知错误,记录在http://www.openradar.me/8012810
我使用Xcode 3.2.2中基于视图的应用程序模板准备了一个最小的示例项目,使用以下代码启动播放器
NSURL *movieUrl = [NSURL URLWithString:@"http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8"];
MPMoviePlayerViewController *player = [[MPMoviePlayerViewController alloc] initWithContentURL:movieUrl];
[self presentMoviePlayerViewControllerAnimated:player];
[player release];
Run Code Online (Sandbox Code Playgroud)
该代码可在GitHub上获得,网址为http://github.com/adamalex/FullScreenMovie,或使用http://github.com/adamalex/FullScreenMovie/zipball/master直接下载
我已联系Apple,他们已经确认这是一个正在调查的错误.我想讨论使用公共API安全提交到App Store的临时解决方法.我将与Apple一起开设开发人员支持案例,并将报告我自己的进展情况.
Ada*_*der 15
Apple开发者技术支持成功回复!
这是一个已知的错误,我们收到了一些重复的错误报告,因此iOS工程师知道这个问题,我们确实有iOS工程建议的临时解决方法.
您需要在呈现电影播放器的视图控制器中实现此功能.
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
[super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
[self performSelector:@selector(fixStatusBar) withObject:nil afterDelay:0];
}
- (void)fixStatusBar {
[[UIApplication sharedApplication] setStatusBarOrientation:[self interfaceOrientation] animated:NO];
}
Run Code Online (Sandbox Code Playgroud)
虽然这有点难看,但现在应该解决这个问题.一旦在系统中修复了错误,建议删除此代码.
这完全解决了我的问题,您可以重新访问http://github.com/adamalex/FullScreenMovie以获取已应用修复的代码.
| 归档时间: |
|
| 查看次数: |
5651 次 |
| 最近记录: |