So I have an app that lets a user record a video or pick a video from their photo library, then upload the video to the server. After recording the video, I get the asset's URL.
I try to set the NSData to the assetURL with the following code:
NSString *vidString =[NSString stringWithFormat:@"%@",savedVideoURL];
NSURL *vidURL = [NSURL URLWithString:vidString];
NSData *videoData = [NSData dataWithContentsOfURL:vidURL];
savedVideoURL is the asset URL gained during recording. The asset URL looks something like this: assets-library://asset/asset.MOV?id=6EB7A04D-3DF8-44E5-A6D8-FD98461AE75E&ext=MOV
When I try to set the NSData to that url, NSData is still equal to nil afterwards.
I could not get the following solution to work: Get video NSData from ALAsset url iOS
Does anyone else know a method of setting the NSData to that asset's URL?
Thanks in advance!