How read video file from video library on the phone if we know full path to video file, for example:
/private/var/mobile/Media/DCIM/100APPLE/IMG_0011.MOVI tried to use that path in NSData like this:
let videoData = try NSData(contentsOfFile: "/private/var/mobile/Media/DCIM/100APPLE/IMG_0011.MOV", options: NSDataReadingOptions.DataReadingMappedIfSafe)but I receive this error:
Error Domain=NSCocoaErrorDomain Code=257
"The file “IMG_0011.MOV” couldn’t be opened because you don’t have permission to view it."
UserInfo={NSFilePath=/private/var/mobile/Media/DCIM/100APPLE/IMG_0011.MOV, NSUnderlyingError=0x17d88fc0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
Reading (loading) video file from folder (path) in the aplication works fine, but reading from path that is not in the application folder (like path above) does not work.
'So, my question is: how read (get) video file from phone's video library (using full video path) and transform to NSData object, but without saving any data to the disc (using RAM only) during that process?