AVQueuePlayer.timeControlStatus上的KVO始终给出nil值

时间:2018-08-08 01:58:22

标签: ios swift

我正在使用KVO监视AVQueuePlayer.timeControlStatus

timeControlStatusObservation = avPlayer.observe(
    \AVQueuePlayer.timeControlStatus,
    options: [.old, .new],
    changeHandler: {
        [weak self] (player, change) in
        print("timeControlState: \(change.oldValue), \(change.newValue), \(self?.avPlayer.timeControlStatus)")
    })

change.oldValuechange.newValue始终为零,但是avPlayer.timeControlStatus确实具有正确的值。我得到了以下日志:

timeControlState: nil, nil, Optional(playing) 
timeControlState: nil, nil, Optional(paused)

为什么KVO给出零值?这是图书馆的错误吗?

0 个答案:

没有答案