![](/img/trans.png)
[英]Xcode Not Deploying Phonegap App To 64bit Simulator Or Iphone 5s
[英]AVPlayer not working on iPhone 5s 64bit iOS 7.0.3
我试图找出一个仅在iPhone5上出现的与AVPlayer播放视频有关的问题。 问题是,影片将在到目前为止我测试过的所有设备上播放,除了5s 64位型号。
我的理论是,它与64位绑定,但我无法将其绑定到任何东西。 我发现了另一个stackoverflow帖子,该帖子将类似的问题与使用自动布局的解决方法相关联。 但是,我没有使用自动布局。
直到5s为止,这段代码一直有效:
-(void)viewWillAppear:(BOOL)animated
{
self.player = [[AVPlayer alloc] initWithURL:[NSURL URLWithString:@"http://www.somemovieurlhere.mp4"]];
AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];
playerLayer.frame = self.view.bounds;
playerLayer.backgroundColor = [UIColor orangeColor].CGColor;
[self.view.layer addSublayer:playerLayer];
[self.player play];
}
我知道该图层已添加,因为如果您设置背景色,它将在视图中显示,但从未播放过电影。 在我的项目中,可以通过注销“ currentTime”属性来告知电影正在播放,如下所示:
float time = CMTimeGetSeconds([player currentTime]);
这是来自iphone4s的电影图像以及我在iphone5s中看到的图像。 我也用原始的iphone5进行了测试,效果很好。
关于什么可能导致此的任何想法? 在此先感谢您的帮助。
看来苹果最新的更新7.0.4解决了这个问题。 他们的更新今天才发布。
谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.