Kareem Arab
Kareem Arab

Reputation: 105

Captured Video URL not Found

I keep getting this error when I run this piece of code specifically: what might be the problem here? I'm assuming that the URL of the video isn't being found, but if that's the case then why is this happening?

Error copying image: Error Domain=NSURLErrorDomain Code=-1100 "The requested URL was not found on this server." UserInfo={NSLocalizedDescription=The requested URL was not found on this server., NSUnderlyingError=0x161215860 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}} Error copying image and no previous frames to duplicate

Here's the snippet of code causing the problem:

isRecording = true
        self.godDamnWebView.hidden = true
        UIView.animateWithDuration(0.5, delay: 0.0, options: [.Repeat, .Autoreverse, .AllowUserInteraction], animations: { () -> () in
            self.cameraButton.transform = CGAffineTransformMakeScale(0.5, 0.5)
            }, completion: nil)

        let outputPath = NSTemporaryDirectory() + "output.mov"
        let outputFileURL = NSURL(fileURLWithPath: outputPath)

        videoFileOutput?.startRecordingToOutputFileURL(outputFileURL, recordingDelegate: self)

Upvotes: 1

Views: 911

Answers (1)

Alessandro Ornano
Alessandro Ornano

Reputation: 35392

The best way to do is:

let outputFileURL = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("output.mov")

Upvotes: 1

Related Questions