Prerequisites
- A working React Native quickstart
- A ready
NosmaiCameraView
Start recording
await NosmaiCameraSdk.startRecording();
Stop and save
const recording = await NosmaiCameraSdk.stopRecording(); console.log(recording.durationSeconds, recording.hasAudio); await NosmaiCameraSdk.saveVideoToGallery( recording.uri, 'nosmai-video' );
The stop result contains a temporary local MP4 URI, duration, size, MIME type, and whether the finalized file includes audio.
Lifecycle rule
Stop recording before camera switch, app pause, navigation, or cleanup. If an optional package-audio track cannot be muxed, inspect E_RECORDING_AUDIO_MUX and verify the finalized result instead of assuming the video was lost.
Verify it worked
Record a short clip with a visible effect, wait for stopRecording, and play the returned URI. Confirm its duration, audio, orientation, and effect output.
Common errors
| Symptom | Cause | Fix |
|---|---|---|
| Recording does not start | NosmaiCameraView is not ready or a session is already active | Wait for camera startup and block duplicate record-button taps |
E_RECORDING_AUDIO_MUX | The optional audio track could not be finalized with the video | Inspect the result and verify native audio permissions and lifecycle |