How to quickly record video?

I use the application for playing with songs, I need to record the screen when the user guesses and captures the audio output of the device. I want my application to support ios8, so "ReplayKit" is disconnected from the table, and which SDK should I use? I am new if some sample code would be much more useful, thanks.

+4
source share
2 answers

Using Apple ReplayKit, you can let your user record gameplay, or in your case, no matter what the user does.

Link to WWDC 2015 presentation included here

:

func startRecording() {
        let recorder = RPScreenRecorder.sharedRecorder()

        recorder.startRecordingWithMicrophoneEnabled(true) { [unowned self] (error) in
            if let unwrappedError = error {
                print(unwrappedError.localizedDescription)
            } else {
                self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Stop", style: .Plain, target: self, action: "stopRecording")
            }
        }
    }

    func stopRecording() {
        let recorder = RPScreenRecorder.sharedRecorder()

        recorder.stopRecordingWithHandler { [unowned self] (preview, error) in
            self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Start", style: .Plain, target: self, action: "startRecording")

            if let unwrappedPreview = preview {
                unwrappedPreview.previewControllerDelegate = self
                self.presentViewController(unwrappedPreview, animated: true, completion: nil)
            }
        }
    }
+2

RPScreenRecorder - , . , , - , , . , 30 + fps, , , .

0

All Articles