Get recorded videos from the Mobile Camera
Learn how to get the recorded videos from the Result<CameraResult, CameraError>
type in the Camera
’s onDismiss
closure.
Explore a full code sample on GitHub.
Success#
A Recording
has a duration
and contains an array of Video
s. The array contains either one Video
(for single camera recordings or a video that was reacted to) or two Video
s (for dual camera recordings.)
Each Video
has:
- A
url
to the video file that is stored in a temporary location. Make sure to copy the file to a permanent location if you want to access it later. - A
rect
that contains the position of each video as it was shown in the camera preview. For dual camera recordings, you can use theseCGRect
s to arrange the videos as they were laid out in the camera.
Standard and Dual Camera#
If the user has recorded videos, the .recording
case will contain an array of Recording
s, each representing a segment of the recorded video.
Video Reaction#
If the user has recorded a reaction, the .reaction
case will contain the video that was reacted to and an array of Recording
s, each representing a segment of the recorded video.
Failure#
The .failure
case has an associated value of CameraError
, which is either .cancelled
if the user has cancelled the camera without recording anything, or .permissionsMissing
if the user has not allowed accessing their camera and/or microphone.