title: Compress video size before attach to an email in swift
body: <p>Previous, I have ask for how to attach video then send via email. Now it working. Advised by some friend from this website.</p>
  
  <p>I found new problem that video size is very large and larger than send with default email app in iOS for same video file.</p>
  
  <p>Please advice me how to compress video file before attach to an email application.</p>
  
  <p>Thank you everyone.</p>
  
  <pre><code>func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
  
      if let myImage = info[UIImagePickerControllerOriginalImage] as? UIImage {
  
          image = info[UIImagePickerControllerOriginalImage] as! UIImage
          self.dismissViewControllerAnimated(false, completion: nil)
          sendmail()
  
      }
      else {
          //picker.videoQuality = UIImagePickerControllerQualityTypeLow
          videoURL = info[UIImagePickerControllerMediaURL] as! NSURL
          self.dismissViewControllerAnimated(true, completion: nil)
          sendmailVDO()
      }
  
  }
  </code></pre>