I've searched and found some ways where I can get the video asset/file of the LivePhoto asset. But what those methods do are as follows:
- They somehow get the resources(PHAssetResource) for the LivePhoto asset
- Select the specific video resource(PHAssetResource) from previously found resources.(Ex:
resource.type==PHAssetResourceTypePairedVideo
) - Save the resource data to a new File(!)
- Get the URL for the newly created File.
But, what I want to know, is there any way I can get the URL for the originally stored file URL, without creating a new File?
[For other types of photos/videos I'm able to get the URLs of the originally stored files. The problem is with the video of the LivePhoto asset.]
I have found a way to directly get the original URL of the file. There is no need to save the file contents in a new file. (Tested on iOS12+)