iOS Developer Library — Pre-Release

Developer

UIKit Framework Reference UIVideoEditorController Class Reference

Options
Deployment Target:

On This Page
Language:

UIVideoEditorController

A UIVideoEditorController object, or video editor, manages the system-supplied user interface for trimming video frames from the start and end of a previously recorded movie as well as reencoding to lower quality. The object manages user interactions and provides the filesystem path of the edited movie to your delegate object (see UIVideoEditorControllerDelegate Protocol Reference). The features of the UIVideoEditorController class are available only on devices that support video recording.

Use a video editor when your intent is to provide an interface for movie editing. While the UIImagePickerController class also lets a user trim movies, its primary roles are choosing saved pictures and movies, and capturing new pictures and movies.

Import Statement


Swift

import UIKit

Objective-C

@import UIKit;

Availability


Available in iOS 3.1 and later.
  • Returns a Boolean value indicating whether a video file can be edited.

    Declaration

    Swift

    class func canEditVideoAtPath(_ videoPath: String) -> Bool

    Objective-C

    + (BOOL)canEditVideoAtPath:(NSString *)videoPath

    Parameters

    videoPath

    The filesystem path to the video file you want to edit.

    Return Value

    YEStrue if the specified video file can be edited on the current device or NOfalse if it cannot.

    Discussion

    Video editing requires the presence of specific hardware and is available only for specific file formats. Use this method to check whether video editing is available for a given video file, before you create a video editor.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 3.1 and later.

  • delegate delegate Property

    The video editor’s delegate object.

    Declaration

    Swift

    unowned(unsafe) var delegate: protocol<UINavigationControllerDelegate, UIVideoEditorControllerDelegate>?

    Objective-C

    @property(nonatomic, assign) id<UINavigationControllerDelegate, UIVideoEditorControllerDelegate> delegate

    Discussion

    The delegate receives a notification when the system has finished saving an edited movie or when the user cancels the video editor. The delegate also decides when to dismiss the editor interface, so you must provide a delegate to use a video editor. If this property is nil, the editor is dismissed immediately if you try to show it. The delegate protocol is described in UIVideoEditorControllerDelegate Protocol Reference.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 3.1 and later.

  • The maximum duration, in seconds, permitted for trimmed movies saved by the video editor.

    Declaration

    Swift

    var videoMaximumDuration: NSTimeInterval

    Objective-C

    @property(nonatomic) NSTimeInterval videoMaximumDuration

    Discussion

    The system-enforced maximum duration for a video recording is 10 minutes; you can set this value to 10 minutes or less. The default value for this property is also 10 minutes.

    The video editor user interface forces the user to trim a loaded movie to fit within this property’s value prior to saving.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 3.1 and later.

  • videoPath videoPath Property

    The filesystem path to the movie to be loaded by the video editor.

    Declaration

    Swift

    var videoPath: String

    Objective-C

    @property(nonatomic, copy) NSString *videoPath

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 3.1 and later.

  • The video quality to use when saving a trimmed movie.

    Declaration

    Swift

    var videoQuality: UIImagePickerControllerQualityType

    Objective-C

    @property(nonatomic) UIImagePickerControllerQualityType videoQuality

    Discussion

    The available video qualities are described in the UIImagePickerControllerQualityType enumeration. The default value for this property is UIImagePickerControllerQualityTypeLow.

    If a user attempts to reencode a movie to a higher quality, the movie is saved at its existing quality. Reencoding never increases movie dimensions, frame rate, or bit rate.

    Import Statement

    Objective-C

    @import UIKit;

    Swift

    import UIKit

    Availability

    Available in iOS 3.1 and later.