Instance Method


Sets the player view’s controls panel into trimming mode.


- (void)beginTrimmingWithCompletionHandler:(void (^)(AVPlayerViewTrimResult result))handler;



The block is executed when the user selects either the Trim or the Cancel button in the trimming UI.

The argument passed in is AVPlayerViewTrimOKButton if the user chose the Trim button or AVPlayerViewTrimCancelButton if the user chose the Cancel button.


An example implementation of the handler block is as follows:

- (IBAction)beginTrimming:(id)sender {
    [self.playerView beginTrimmingWithCompletionHandler:^(AVPlayerViewTrimResult result) {
        if (result == AVPlayerViewTrimOKButton) {
            // user selected Trim button (AVPlayerViewTrimOKButton)
        } else {
            // user selected Cancel button (AVPlayerViewTrimCancelButton)

This method blocks until the user selects either the Trim or the Cancel button.

See Also

Trimming Playback Content

Implementing Trimming (macOS)

Implement a QuickTime media-trimming experience in your macOS app.


A Boolean property that specifies if the current player view’s media can be trimmed.


Constants that specify what the user’s action was when trimming the media in a player view. See beginTrimmingWithCompletionHandler: for more information.