canBeginTrimming
A Boolean value that indicates whether the player view can begin trimming.
Declaration
var canBeginTrimming: Bool { get }Mentioned in
Discussion
Before calling beginTrimming(completionHandler:), check the value of this property to determine whether the player view and current media support trimming. This property value is false if the current controls style doesn’t support trimming, the media is content protected, or when playing HTTP Live Streaming media.
If you’re presenting a menu item to initiate trimming, a good place to perform this check is in the validateUserInterfaceItem(_:) method of NSDocument:
override func validateUserInterfaceItem(_ item: NSValidatedUserInterfaceItem) -> Bool {
if item.action == #selector(beginTrimming) {
return playerView.canBeginTrimming
}
return super.validateUserInterfaceItem(item)
}