Video
@objcMembers
@objc(PESDKVideo)
open class Video : NSObject, NSCopying
An object that wraps audiovisual media.
The Video
class currently supports URL
and AVAsset
as sources for videos. Passing an URL
requires the destination to be in a format that can be decoded by iOS.
-
The underlying
AVAsset
object.Declaration
Swift
public var asset: AVAsset { get }
-
The preferred transformation applied to the natural size of the first video track.
CGSize.zero
is returned if the first video track is not available.Declaration
Swift
public var size: CGSize { get }
-
Creates a new
Video
object from anAVAsset
.Declaration
Swift
public convenience init(asset: AVAsset)
Parameters
asset
The asset that should be passed to the editor.
-
Creates a new
Video
object from anAVAsset
with a specific size.Declaration
Swift
public convenience init(asset: AVAsset, size: CGSize)
Parameters
asset
The asset that should be passed to the editor.
size
The size of the video.
-
Creates a new
Video
object from anURL
.Declaration
Swift
@objc(initWithURL:) public convenience init(url: URL)
Parameters
url
The url to the video on disk. This must be in a format that can be decoded by iOS.
-
Creates a new
Video
object with a composition from multipleAVAsset
s.Declaration
Swift
public convenience init(assets: [AVAsset])
Parameters
assets
The assets that should be passed to the editor. This array must include at least one asset.
-
Creates a new
Video
object with a composition from multipleAVAsset
s and a specific size.Declaration
Swift
public convenience init(assets: [AVAsset], size: CGSize)
Parameters
assets
The assets that should be passed to the editor.
size
The size of the video.
-
Creates a new empty
Video
object with a specific size but without any assets.Declaration
Swift
public convenience init(size: CGSize)
Parameters
size
The size of the video.