-
Notifications
You must be signed in to change notification settings - Fork 227
RecordAR
Class
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 | Description |
---|---|
Initialization | Initialize RecordAR with ARSCNView or ARSKView
|
Delegate Configurations | Configure RecordARDelegate and RenderARDelegate
|
Audio & Video Devices' Status | Check the media devices' current status |
Video Configurations | Configure video and renderer settings |
Audio Configurations | Configure audio settings |
Media File Configurations | Configure media files compression & caching |
Preparing Methods | Methods to setup RecordAR with the new configurations |
Capturing Methods | Methods to capture and record media content |
Exporting Methods | Methods to export capture or recorded media content |
Initializes ππ³ a new RecordAR
object with an ARSCNView
π.
Initializes ππ³ a new RecordAR
object with an ARSKView
πΎ.
Initializes ππ³ a new RecordAR
object with a SCNView
π².
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.
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 .manual
.
var
fps
:ARVideoFrameRate
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
contentMode
:ARFrameMode
An object that allow customizing the AR content mode. Default is .auto
.
A boolean that enables or disables AR content rendering before recording for image & video processing. Default is true
.
A boolean that enables or disables using environment light rendering. Default is false
.
A boolean that enables or disables audio recording. Default is true
.
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
.
A boolean that enables or disables adjusting captured media for sharing online. Default is true
.
A boolean that enables or disables adjusting captured GIFs for sharing online. Default is true
.
A boolean that enables or disables clearing cached media after exporting to Camera Roll. Default is true
.
A method that prepares the video recorder with ARConfiguration
π.
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
.
A method that renders a photo π and returns it as UIImage
.
func
livePhoto(export:Bool, _ finished: ((_ status:Bool, _ livePhoto:PHLivePhotoPlus?, _ permissionStatus:PHAuthorizationStatus?, _ exported:Bool) -> Swift.Void)? = nil)
A method that renders a PHLivePhoto
π and returns PHLivePhotoPlus
in the completion handler.
func
gif(forDuration duration:TimeInterval, export:Bool, _ finished: ((_ status:Bool, _ gifPath: URL?, _ permissionStatus:PHAuthorizationStatus?, _ exported:Bool) -> Swift.Void)? = nil)
A method that renders a GIF π image and returns its local path (URL
) in the completion handler.
A method that starts or resumes β― recording a video πΉ.
func
record(forDuration duration:TimeInterval, _ finished: ((_ videoPath: URL) -> Swift.Void)? = nil)
A method that starts recording a video πΉ with a specified duration β³ in seconds.
A method that pauses recording a video βΈπΉ. Use record() to resume.
func
stopAndExport(_ finished: ((_ videoPath: URL, _ permissionStatus:PHAuthorizationStatus, _ exported:Bool) -> Swift.Void)? = nil)
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.
func
export(video path:URL, _ finished: ((_ exported:Bool, _ permissionStatus:PHAuthorizationStatus)
A method that exports a video πΉ file path to the Photo Library π²πΎ.
func
export(image path:URL?=nil, UIImage:UIImage?=nil, _ finished: ((_ exported:Bool, _ permissionStatus:PHAuthorizationStatus) -> Swift.Void)? = nil)
A method that exports any image π/π (including gif, jpeg, and png) to the Photo Library π²πΎ.
func
export(live photo:PHLivePhotoPlus, _ finished: ((_ exported:Bool, _ permissionStatus:PHAuthorizationStatus)
A method that exports a PHLivePhotoPlus
π object to the Photo Library π²πΎ.
Having issues implementing ARVideoKit
? Want a new feature added? Contact me
@ahmedbekhit.com
or create an issue
.