Instance Method

startCaptureWithHandler:completionHandler:

Starts screen and audio capture.

Declaration

- (void)startCaptureWithHandler:(void (^)(CMSampleBufferRef sampleBuffer, RPSampleBufferType bufferType, NSError *error))captureHandler completionHandler:(void (^)(NSError *error))completionHandler;

Parameters

captureHandler

A block that is called continuously during screen capture.

sampleBuffer

A CMSampleBuffer object containing either audio or video data.

bufferType

An RPSampleBufferType identifying the media type of the recorded sample.

error

Contains an error code if screen capture failed to start. Otherwise, the value of this parameter is nil.

completionHandler

A block that is called when screen capture has started.

error

If an error occurred, this parameter holds an object that explains the error. Otherwise, the value of this parameter is nil. See Errors for a list of error codes to ReplayKit.

See Also

Controlling App Recording

- startRecordingWithHandler:

Starts recording the app display.

- stopRecordingWithHandler:

Stops the current recording.

RPSampleBufferType

The type of media clip sample being buffered.

- stopCaptureWithHandler:

Stops screen capture

- discardRecordingWithHandler:

Discards the current recording.

- startRecordingWithMicrophoneEnabled:handler:

Starts recording the app’s audio and video.

Deprecated

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software