【发布时间】:2014-09-08 16:56:32
【问题描述】:
如果我像这样使用 KVO 观察我的播放器项目:
AVPlayerItem *playerItem = [AVPlayerItem playerItemWithURL:url];
[playerItem addObserver:self forKeyPath:@"status" options:NSKeyValueObservingOptionNew context:MyClassKVOContext];
[playerItem addObserver:self forKeyPath:@"playbackBufferEmpty" options:NSKeyValueObservingOptionNew context:MyClassKVOContext];
[playerItem addObserver:self forKeyPath:@"playbackLikelyToKeepUp" options:NSKeyValueObservingOptionNew context:MyClassKVOContext];
[playerItem addObserver:self forKeyPath:@"loadedTimeRanges" options:NSKeyValueObservingOptionNew context:MyClassKVOContext];
两个问题:
1) 项目播放完毕后,我是否需要移除我的观察者? (即在AVPlayerItemDidPlayToEndTimeNotification)
2) 如果我调用[_avQueuePlayer removeAllItems],它是否也会删除每个项目的观察者?
【问题讨论】:
标签: iphone avqueueplayer avplayeritem