Ios KVO属性列表?

Ios KVO属性列表?,ios,avplayer,key-value-observing,Ios,Avplayer,Key Value Observing,在哪里可以找到AVPlayer的可观察属性列表? 我似乎在Apple文档中的任何地方都找不到它。显示KVO状态键,以及可观察到的AVPlayerItem通知:AVPlayerItemDidPlayToEndTimeNotification,等等 可在“通知”下找到AVPlayerItem可观察通知的完整列表 AVPlayerItemDidPlayToEndTimeNotification AVPlayerItemFailedToPlayToEndTimeNotification AVPlayer

在哪里可以找到AVPlayer的可观察属性列表? 我似乎在Apple文档中的任何地方都找不到它。

显示KVO
状态
键,以及可观察到的
AVPlayerItem
通知:
AVPlayerItemDidPlayToEndTimeNotification
,等等

可在“通知”下找到
AVPlayerItem
可观察通知的完整列表

AVPlayerItemDidPlayToEndTimeNotification
AVPlayerItemFailedToPlayToEndTimeNotification
AVPlayerItemTimeJumpedNotification
AVPlayerItemPlaybackStalledNotification
AVPlayerItemNewAccessLogEntryNotification
AVPlayerItemNewErrorLogEntryNotification
此外,
AVPlayer.h
中有关属性的注释特别说明哪些属性是可观察到的键值:
status
outputObscuedPuetoUnsficientExternalProtection

/*!
 @property status
 @abstract
    The ability of the receiver to be used for playback.

 @discussion
    The value of this property is an AVPlayerStatus that indicates whether the receiver can be used for playback. When
    the value of this property is AVPlayerStatusFailed, the receiver can no longer be used for playback and a new
    instance needs to be created in its place. When this happens, clients can check the value of the error property to
    determine the nature of the failure. This property is key value observable.
 */
@property (nonatomic, readonly) AVPlayerStatus status;

// ...

@interface AVPlayer (AVPlayerProtectedContent)

/*!
    @property outputObscuredDueToInsufficientExternalProtection
    @abstract
        Whether or not decoded output is being obscured due to insufficient external protection.

    @discussion
        The value of this property indicates whether the player is purposefully obscuring the visual output
        of the current item because the requirement for an external protection mechanism is not met by the
        current device configuration. It is highly recommended that clients whose content requires external
        protection observe this property and set the playback rate to zero and display an appropriate user
        interface when the value changes to YES. This property is key value observable.

        Note that the value of this property is dependent on the external protection requirements of the
        current item. These requirements are inherent to the content itself and cannot be externally specified.
        If the current item does not require external protection, the value of this property will be NO.
 */
@property (nonatomic, readonly) BOOL outputObscuredDueToInsufficientExternalProtection NS_AVAILABLE_IOS(6_0);

@end

只有当文档告诉您这是安全/正确的行为时,您才能使用KVO。基本上,要获得您的列表,您只需搜索“可观察”或“观察”或“观察”一词

因此,对于AVPlayer咨询公司,在
状态
属性文档下,我们阅读:

此属性是可观察的键值使用键值观察

类似地,在
输出BSCUREDDUETOINSUPPITIENTEXTERNALPROTECTION
属性文档下,我们阅读:

您可以使用键值观察来观察此属性值的更改

因此,答案是:AVPlayer的
status
属性及其
outputBSCUREDDUETOUnsufficientExternalProtection
属性以及其他属性都是可观察到的关键值


但是,请注意,还有其他方法可以通知AVPlayer发生了什么,例如,通过调用
addPeriodicTimeObserverForInterval:queue:usingBlock:
addBoundaryTimeObserverForTimes:queue:usingBlock:

我们可以找到NSString或NSArray的KVO道具吗?如果有帮助,您应该接受答案。据我所知,
outputBSCUREDDUETOInsufficientExternalProtection
属性也是根据标题在
AVPlayer
上可观察到的键值。好的,添加该键值。