我用MPMoviePlayerController我在我的Application Document文件夹中播放一个本地文件,我已经下载了服务器URL:
itemMoviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
[self.view addSubview:itemMoviePlayerController.view];
itemMoviePlayerController.fullscreen = YES;
itemMoviePlayerController.movieSourceType = MPMovieSourceTypeFile;
itemMoviePlayerController.initialPlaybackTime = -1.0;
[itemMoviePlayerController play];
Run Code Online (Sandbox Code Playgroud)
当我.mov下载文件后播放文件时,它显示一个黑色的空白屏幕,应用程序UI无法使用.但是如果下次播放相同的本地文件,它可以正常播放.我甚至验证playState及localState为MPMoviePlayerController他们似乎罚款.什么可能是黑色空屏幕的原因?