如何使视频资源兼容视网膜显示?
我有一个应用程序,可以在播放 2 秒的电影时加载。目前,该应用程序已在商店上架,并且除此视频外,所有静态内容均符合视网膜显示标准。我有一个用于视网膜显示屏的 960x640 mp4 h.264 编码视频,它在 iPhone(是的,高分辨率,而不是 480x320)和 iPhone4 模拟器中运行良好。但它似乎无法在我运行 iOS4 的 iPod Touch 第三代上播放。我还无法在物理视网膜显示器上进行测试。
直到现在我才意识到 MPMoviePlayerController 可能不支持高于 480x320 的分辨率,但文档确实这么说。
我知道这很可能听起来像另一个 @2x 解决方案,但这似乎也不起作用。
对于让这个高分辨率视频在两个屏幕上播放有什么建议吗?如果需要的话我可以发布代码。
作为参考,这是解决方案:
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 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.
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"]]];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议使用此处的代码检查来为您的媒体播放器提供正确的视频文件。
I would suggest using code checking here to supply your media player with the correct video file.