         super.didReceiveMemoryWarning()
         // Dispose of any resources that can be recreated.
     }
-
+    
+    func imagePickerControllerDidCancel(picker: UIImagePickerController) {
+        self.dismissViewControllerAnimated(true, completion: nil)
+        self.navigationController?.popToRootViewControllerAnimated(true)
+    }
 
     func imagePickerController(picker: UIImagePickerController!, didFinishPickingMediaWithInfo info:NSDictionary!) {
 

    var previewLayer : AVCaptureVideoPreviewLayer?
    var captureDevice : AVCaptureDevice?
    var currentUser = PFUser.currentUser()


    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.

        captureSession.sessionPreset = AVCaptureSessionPreset640x480

        if UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceType.Camera) {
            println("captureVideoPressed and camera available.")

        }
        println("view stack= \(self.view)")
        
        if newPerspective == true {
            let vc = self.storyboard?.instantiateViewControllerWithIdentifier("StoryfieldsVC") as StoryfieldsVC
            vc.url = "https://s3.amazonaws.com/theperspectiveapp/\(uploadRequest.key)"
            self.dismissViewControllerAnimated(true, completion: nil)
            self.navigationController?.pushViewController(vc, animated: true)
        } else {
            let vc = self.storyboard?.instantiateViewControllerWithIdentifier("WhosNextVC") as WhosNextVC
            vc.url = "https://s3.amazonaws.com/theperspectiveapp/\(uploadRequest.key)"
            self.dismissViewControllerAnimated(true, completion: nil)
            self.navigationController?.pushViewController(vc, animated: true)
        }
    }

//  DELETE VIDEO TABLE(?)
    
    func createVideoParseObj(key: String) {
        var video = PFObject(className:"Video")
        video["url"] = "https://s3.amazonaws.com/theperspectiveapp/\(key)"
