iPhone X UIStatusBar_Modern
UMLOG: error: session_id=2EF37813300A985080FEE9530FECF464, context=[<UIStatusBar_Modern 0x7fb0c272d430> valueForUndefinedKey:]: this class is not key value coding-compliant for the key foregroundView. 我把播放器页面关掉,程序就可以了
这是想表达什么意思呢?播放不了了?播放崩溃了?还就是单纯说有这种错误日志但是没影响播放呢?
[self.player prepareToPlay] [self.player stop] 任何一行代码,就报上面的错误,马上是崩溃!!!只有在IPhone X 有这样的问题
你完整的调用方式是什么样的呢,我们这边没出现过你说的这种情况
o.controlStyle = MPMovieControlStyleNone;
[self addSubview:o.view];
o.view.frame = self.bounds;
[self bringSubviewToFront:o.view];
o.view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
o.shouldAutoplay = TRUE;
o.shouldEnableVideoPostProcessing = TRUE;
o.scalingMode = MPMovieScalingModeAspectFit;
o.videoDecoderMode = MPMovieVideoDecoderMode_AUTO;
o.shouldLoop = NO;
o.bufferTimeMax = 10;
[o setTimeout:(self.isLiving || self.isImbaLiving) ? 2 :10 readTimeout:30];
//************配置
self.urlStr = urlStr; self.holdLastPic = holdLastPic;
if (self.isFirstPlay == NO) {
self.isFirstPlay = YES;
[self addObserver]; //执行一次监听
}else {
[self.player reset:holdLastPic];
[self.player setUrl:[NSURL URLWithString:urlStr]];
}
[self.player prepareToPlay];
//***************url 执行的方法
[self.player prepareToPlay]; 如果把这行代码和 【self.payer stop】去掉不能播放,但是运行是可以的,如果添加上面,直接闪退,只有iPhone X才会出现的
没看明白上面的代码是什么逻辑,你可以试试把代码抽出来弄个尽量简单的工程,或者用我们的demo在iPhone X上运行试试是什么结果
最简单播放甚至几行代码就可以的,例如下面这样,从最简单的调用开始,找一下是哪里出的问题
NSURL* url = [NSURL URLWithString:@"rtmp://live.hkstv.hk.lxdns.com/live/hks"];
player = [[KSYMoviePlayerController alloc]initWithContentURL:url];
player.view.frame = self.view.bounds;
[self.view addSubview:player.view];
[player prepareToPlay];
问题解决了,,什么都不用改,以前是你给我的 framework 现在我集成了 pod 完美解决