0

I am receiving an error when I attempt to upload my video to Parse. The error is client side and is that the variable path is found nil. Perhaps I am declaring this wrong or using pathForResource wrong but I appreciate any help that I would be able to get.

 func Upload() {
    var path = NSBundle.mainBundle().pathForResource("big_buck_bunny_720p_2mb.mp4", ofType: "mp4")
    var videodata: NSData?
    videodata = NSData.dataWithContentsOfMappedFile(path!) as? NSData


    let file = PFFile(name:"capturedVideo", data:videodata!)
    file!.saveInBackground()

}
Leandros
  • 16,805
  • 9
  • 69
  • 108
maz
  • 349
  • 2
  • 3
  • 15
  • try printing out each variable after you declare them to see which one is nil. It's probably a problem with the path variable that's affecting you PFFile. – user3353890 May 21 '16 at 19:14
  • I'm aware its a problem with the path variable, I already stated the in the question, I am curious as to whether or no that is the right format – maz May 22 '16 at 04:14
  • this should give you an idea of something to try since the path is returning nil: http://stackoverflow.com/questions/13401417/unable-to-play-mp4-video-file-from-mainbundle – user3353890 May 22 '16 at 06:46

0 Answers0