HomeGuidesChangelogDiscussions
Hire a ReactVision Expert 🛠️Launch Studio 🖥️Sponsor on GitHub ❤️Log In
Guides

AR Session Recording

AR Session Recording

Capture an AR session to local storage — camera passthrough + raw IMU + ground-truth pose — for offline analysis (e.g. tinyvio / reactviro_validate_recording). This is not screen recording.

Not the same as startVideoRecording / stopVideoRecording, or ViroCameraTexture's startRecording. Those capture rendered / camera-texture video. Session recording keeps three separate streams a visual-inertial engine needs to replay the session offline.

Available since ViroReact 2.58.0. Documented here as part of the 3.0 docs catch-up.

Quick start

const { success, error } = await sceneNavigator.startRecording(outputDir);
// ...walk the space...
await sceneNavigator.stopRecording();
const status: ViroRecordingStatus = await sceneNavigator.getRecordingStatus(); // "None" | "Recording" | "IOError" | "Unsupported"

outputDir should be a plain filesystem path (not a file:// URI). After stop it contains video.mp4 and session.jsonl.

API

MethodDescription
startRecording(outputDir)Starts capture. Returns { success, error? }. On Android, rejects if RECORD_AUDIO has not been granted (3.0.3+; it used to hang).
stopRecording()Finalizes files. No-op if nothing is recording.
getRecordingStatus()ViroRecordingStatus: "None" | "Recording" | "IOError" | "Unsupported", the same on iOS and Android from 3.0.3.

Platform support

PlatformStatus
iOS✅
Android✅
Web / visionOS / Quest❌ — getRecordingStatus() returns "Unsupported"

Changes in 3.0.3

  • Same status strings on both platforms. getRecordingStatus() answers "None", "Recording", "IOError" or "Unsupported" on Android too, typed by the exported ViroRecordingStatus. Android used to return the Java enum names (NONE, RECORDING, IO_ERROR, UNSUPPORTED), so update any code that matched them.
  • Microphone permission on Android. startRecording without RECORD_AUDIO now rejects instead of hanging. Request the microphone permission before you start.
  • iOS. Camera recordings carry an audio track, and every recording promise settles (virocore 3.0.3).

Getting files off the device

On iOS, enable Files-app access (UIFileSharingEnabled + LSSupportsOpeningDocumentsInPlace) and/or share immediately with expo-sharing. Android app-external paths are reachable via adb pull or a file manager.

Related