struggled with this for the last two hours, hope someone has run into it before
I upload a file that is from the server to my documents folder
The file is and is valid (checked using iExplorer on the device and in the local directory of the simulator). We moved each file to the desktop and played without problems.
The strange thing is that the same code works without problems when a file (the same video) is added in the kit.
code:
print("video url string : \(video.urlString)") // prints: /var/mobile/Containers/Data/Application/47AC756B-7A00-4FAE-9348-214972BE61BD/Documents/demo-reel.mp4 // file IS there let asset = AVURLAsset(URL: NSURL(fileURLWithPath: video.urlString)) let keys = ["tracks","playable","duration"] asset.loadValuesAsynchronouslyForKeys(keys, completionHandler: { () -> Void in var error : NSError? = nil let status = asset.statusOfValueForKey("tracks", error: &error) switch status { case .Failed: print("failed \(error?.localizedDescription)") case .Loaded: print("loaded \(error?.localizedDescription)") case .Loading: print("loading \(error?.localizedDescription)") case .Cancelled: print("cancelled \(error?.localizedDescription)") case .Unknown: print("unknown \(error?.localizedDescription)") } prints: failed Optional("The requested URL was not found on this server.")
Am I missing something? help is appreciated
source share