我正在使用AVPlayer與AVPlayerViewController。我在視頻中添加水印後正在播放視頻。有時它工作正常,但有時它只顯示黑屏,並且音頻在兩種情況下都很好。Avplayer有時顯示黑屏,但聲音很好
vPlayer = [AVPlayer playerWithURL:_videoFilePath];
// create a player view controller
AVPlayerViewController *controller = [[AVPlayerViewController alloc]init];
controller.videoGravity=AVLayerVideoGravityResizeAspect;
controller.player = vPlayer;
[vPlayer seekToTime:kCMTimeZero];
// show the view controller
[self addChildViewController:controller];
[vPlayer play];
controller.view.frame =_imgForVidFrame.frame;
[self.view addSubview:controller.view];
是這個iOS10?你有沒有試過iOS10.1測試版? –
是的,我在iOS10上工作,沒有試過10.1 –
@DeepakChaudhary你找到答案了嗎? –