我写了AVPlayer的示例代码用于视频播放。根据Apple docs最初的视频播放器:
- (AVPlayer *)player {
if (!_player) {
AVURLAsset *asset = [AVURLAsset URLAssetWithURL:[NSURL URLWithString:kVideoURL] options:nil];
AVPlayerItem *playerItem = [[AVPlayerItem alloc] initWithAsset:asset];
[playerItem addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:nil];
[playerItem addObserver:self forKeyPath:@"loadedTimeRanges" options:NSKeyValueObservingOptionNew context:nil];
_player = [[AVPlayer alloc] initWithPlayerItem:playerItem];
}
return _player;
}
问题: 当我试图通过交互式手势弹出viewController时,视频帧甚至在某个时候停滞不前。 Here is the snapshot
有人可以帮助我吗?非常感谢!!!