我有一个视频播放应用程序,AVPlayerLayer在重复显示和隐藏包含它的模态视图之后不会显示任何内容. 如果我在发生这种情况时忽略模态视图,则下一次加载通常显示正常(?!!).黑屏问题大约发生在20%的时间.
我建立一个AVMutableComposition使AVPlayerItem,但这个错误会发生,即使有只涉及单个样本.
这个问题也可以通过大量的应用程序切换和打开和关闭音乐来重现.我在我的应用程序中包含音乐控件(以及显示当前正在播放的iTunes曲目的简单视图).
这只发生在iOS 4上.它曾经发生在iOS 5上,但是当我开始回收包含AVPlayerLayer它的视图时,它运行正常.我不回收的唯一东西是AVPlayer和相关的AVPlayerItem.
这是我加载资产和构建玩家的方式:
- (void)loadAssetsFromFiles:(id)sender {
NSLog(@"loadAssetsFromFiles called");
assert ([assetURL2clipID count] > 0);
self.isWaitingToLoadAssets = NO;
composition = [AVMutableComposition new];
videoComposition = [AVMutableVideoComposition new];
[self releaseAssets];
//We're going to add this asset to a composition, so we'll need to have random access available
//WARNING: This can cause slow initial loading, so consider loading files later and as needed.
NSDictionary *assetOptions = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] …Run Code Online (Sandbox Code Playgroud) 我有一个视频合成,我想在Airplay上播放(没有镜像).当使用普通的Airplay镜像时,该应用程序可以正常工作,但我希望通过使用Airplay视频获得速度,可靠性和分辨率.
问题是,当我设置
player.usesAirPlayVideoWhileAirPlayScreenIsActive = YES;
Run Code Online (Sandbox Code Playgroud)
......玩家空白.
笔记:
两个问题: