setVideoAtPath(_:completionBlock:)
Replaces the video data in receiver with the video at a given URL.
Declaration
func setVideoAtPath(_ videoPathURL: URL!, completionBlock: (@Sendable (URL?, (any Error)?) -> Void)!)func setVideoAtPath(_ videoPathURL: URL!) async throws -> URL?Parameters
- videoPathURL:
An URL that specifies the location of video data.
- completionBlock:
The block invoked after the save operation completes.
If the application is able to edit the asset, the completion block returns the same asset URL as the receiver, because a new asset is not created.
If the application is not able to edit the asset, the completion blocks return a
nilasset URL and anALAssetsLibraryWriteFailedError.
Discussion
Before invoking this method, you should check the isEditable property of the asset to determine whether it is possible to replace the video data.