AVURLAsset getting video size

前端 未结 7 1873
礼貌的吻别
礼貌的吻别 2020-12-03 16:57

This is pretty frustrating. I\'m trying to get the size of an AVURLasset, but try to avoid naturalSize since Xcode tells me, this is deprecated in iOS5.

<
7条回答
  •  囚心锁ツ
    2020-12-03 17:31

    I just checked the documentation online, and the naturalSize method is deprecated for the AVAsset object. However, there should always be an AVAssetTrack which refers to the AVAsset, and the AVAssetTrack has a naturalSize method that you can call.

    naturalSize

    The natural dimensions of the media data referenced by the track. (read-only)

    @property(nonatomic, readonly) CGSize naturalSize

    Availability

    Available in iOS 4.0 and later. Declared In AVAssetTrack.h

    Via: AVAssetTrack Reference for iOS

提交回复
热议问题