Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Swift to record and playback video and sending the video to a server

I am trying to write an app for IOS 8. This app will be written in Swift. I have looked at some Youtube videos for capturing video and playing video. It seems that I have to use AVKit to do this.

After capturing the video I want to be able to send the video to a server so that it can be accessed by other users of this app.

So my question is how do I get my app to record video, send that video to a server, and also be able to play videos from that server.

like image 256
Taylor Simpson Avatar asked Nov 09 '22 17:11

Taylor Simpson


1 Answers

to record a video:

func startCaptureVideoBlogFromViewController(viewcontroller: UIViewController, withDelegate delegate: protocol<UIImagePickerControllerDelegate, UINavigationControllerDelegate>) -> Bool{

    if (UIImagePickerController.isSourceTypeAvailable(.Camera) == false) {

        return false
    }

    let cameraController = UIImagePickerController()
    cameraController.sourceType = .Camera
    cameraController.mediaTypes = [kUTTypeMovie as String]
    cameraController.allowsEditing = false
    cameraController.delegate = delegate

    presentViewController(cameraController, animated: true, completion: nil)

    return true


}
like image 161
Spidvmp Avatar answered Dec 29 '22 12:12

Spidvmp