1

'naturalSize' is unavailable: APIs deprecated as of iOS 7 and earlier are unavailable in Swift

    let videoAsst = AVAsset()
    videoAsst.assetWithURL(videoUrl)
    let videoSize = videoAsst.naturalSize

Please help me to which API is used to get natural size in Swift

Ankit Jain
  • 1,858
  • 22
  • 35

1 Answers1

5

I have found out the solution hope it will be helpful for all.

var clipVideoTrack = videoAsst.tracksWithMediaType(AVMediaTypeVideo)[0] as! AVAssetTrack

// Video size
let videoSize = clipVideoTrack.naturalSize
Ankit Jain
  • 1,858
  • 22
  • 35