Skip to content
Ahmed Fathi Bekhit edited this page Nov 4, 2017 · 12 revisions

Class

RecordAR

RecordAR is an ARView sub-class that renders an ARSCNView or ARSKView content with the device's camera stream to generate a video πŸ“Ή, photo πŸŒ„, live photo πŸŽ‡ or GIF πŸŽ†.


Table of Contents
Initialization
Delegate Configurations
Audio & Video Devices' Status
Video Configurations
Audio Configurations
Media File Configurations
Preparing Methods
Capturing Methods
Exporting Methods

Topics

Initialization

init (ARSceneKit:ARSCNView)

Initializes 🌞🍳 a new RecordAR object with an ARSCNView πŸš€.

init (ARSpriteKit:ARSKView)

Initializes 🌞🍳 a new RecordAR object with an ARSKView πŸ‘Ύ.

Delegate Configurations

var delegate:RecordARDelegate

An object that passes the AR video recorder errors and status through the protocol methods.

var renderAR:RenderARDelegate

An object that passes the AR rendered content through the protocol method.

Audio & Video Devices' Status

var status:RecordARStatus

An object that returns the AR recorder current status.

var micStatus:RecordARMicrophoneStatus

An object that returns the current Microphone status.

var requestMicPermission:RecordARMicrophonePermission

An object that allow configuring when to ask for Microphone permission, if needed. Default is .auto.

Video Configurations

An object that allow customizing the video frame per second rate. Default is .auto.

var videoOrientation:ARVideoOrientation

An object that allow customizing the video orientation. Default is .auto.

var onlyRenderWhileRecording:Bool

A boolean that enables or disables AR content rendering before recording for image & video processing. Default is true.

Audio Configurations

var enableAudio:Bool

A boolean that enables or disables audio recording. Default is true.

var enableMixWithOthers:Bool

A boolean that enables or disables audio mixWithOthers if audio recording is enabled. This allows playing music and recording audio at the same time. Default is true.

Media File Configurations

var adjustVideoForSharing:Bool

A boolean that enables or disables adjusting captured media for sharing online. Default is true.

var adjustGIFForSharing:Bool

A boolean that enables or disables adjusting captured GIFs for sharing online. Default is true.

var deleteCacheWhenExported:Bool

A boolean that enables or disables clearing cached media after exporting to Camera Roll. Default is true.

Preparing Methods

func prepare(_ configuration:ARConfiguration)

A method that prepares the video recorder with ARConfiguration πŸ“.

func rest()

A method that switches off the orientation lock used in a UIViewController that contains AR scenes πŸ“πŸ˜΄.

A method that requsts microphone πŸŽ™ permission manually, if requestMicPermission is set to manual.

Capturing Methods

func photo() -> UIImage

A method that renders a photo πŸŒ„ and returns it as UIImage.

A method that renders a PHLivePhoto πŸŽ‡ and returns PHLivePhotoPlus in the completion handler.

A method that renders a GIF πŸŽ† image and returns its local path (URL) in the completion handler.

func record()

A method that starts or resumes ⏯ recording a video πŸ“Ή.

A method that starts recording a video πŸ“Ή with a specified duration ⏳ in seconds.

func pause()

A method that pauses recording a video βΈπŸ“Ή.

A method that stops ⏹ recording a video πŸ“Ή and exports it to the Photo Library πŸ“²πŸ’Ύ.

A method that stops ⏹ recording a video πŸ“Ή and returns the video path in the completion handler.

Exporting Methods

A method that exports a video πŸ“Ή file path to the Photo Library πŸ“²πŸ’Ύ.

A method that exports any image πŸŒ„/πŸŽ† (including gif, jpeg, and png) to the Photo Library πŸ“²πŸ’Ύ.

A method that exports a PHLivePhotoPlus πŸŽ‡ object to the Photo Library πŸ“²πŸ’Ύ.

Clone this wiki locally