Taylor Simpson
Taylor Simpson

Reputation: 970

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.

Upvotes: 5

Views: 1401

Answers (1)

Spidvmp
Spidvmp

Reputation: 283

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


}

Upvotes: 1

Related Questions