I can't get the full NSURL of the editedVideoPath, here's my code:
// GLOBAL VARIABLES
var videoPath = String()
var videoURL = NSURL()
// Video Editor delegate
func videoEditorController(editor: UIVideoEditorController, didSaveEditedVideoToPath editedVideoPath: String) {
if saveToPhotoLibrary {
if UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(editedVideoPath) {
UISaveVideoAtPathToSavedPhotosAlbum(editedVideoPath, self, nil, nil)
}
print("SAVED TO PHOTO LIBRARY AT: \(editedVideoPath)")
}
videoPath = editedVideoPath
videoURL = NSURL(string: editedVideoPath)!
print("VIDEO PATH: \(videoPath)")
print("VIDEO URL: \(videoURL)")
dismissViewControllerAnimated(true, completion: nil)
}
The problem is the I can't get the full NSURL out of the videoPath string, here's what the XCode console prints out:
VIDEO PATH: /private/var/mobile/Containers/Data/Application/D7536AD4-353A-48CA-8F31-2D78F9F10730/tmp/trim.BFF7D20F-138A-46A2-A58E-76736AF7343E.MOV
VIDEO URL: /private/var/mobile/Containers/Data/Application/D7536AD4-353A-48CA-8F31-2D78F9F10730/tmp/trim.BFF7D20F-138A-46A2-A58E-76 ... 343E.MOV
As you can see, the VIDEO URL gets dots almost by the end of it, while the VideoPath string is correct. This is a pretty wired issue I've never encountered before with this NSURL statement:
videoURL = NSURL(string: editedVideoPath)!
Since I need to upload that edited video to a web server, I need its full correct url. I thought is was a print() issue, but if I try to grab the videoURL XCode tells me that it's nil, so print() function tells the truth :(
I've searched here and there on stackoverflow, no success.
Hope someone can help, Thanks!