# Save Recorded Video

Once a recording is finished, this call will save the recorded content to disk.&#x20;

> For video recording : On iOS this saves directly to the camera roll. On Android we create an app folder album and copy over there&#x20;

{% hint style="success" %}
For Gif recording : This saves gif to Application.PersistentPath.
{% endhint %}

{% hint style="info" %}
On Android, Make sure you enable **Uses Save Preview** from Screen Recorder Kit Settings. Else it won't get saved to gallery as it needs permissions declared in the manifest. We do it automatically, if you enable it in Screen Recorder Kit settings.
{% endhint %}

```csharp
using VoxelBusters.ScreenRecorderKit;

IScreenRecorder recorder;
//... Create instance for IScreenRecorder via ScreenRecorderBuilder

void RegisterListeners()
{
    recorder.SetOnRecordingAvailable((result) =>
    {
        string path = result.Data as string;
        Debug.Log($"File path: {path}");
        SaveRecording();
    });
}
void SaveRecording()
{
    recorder.SaveRecording(null, (result, error) =>
    {
        if(error == null)
        {
            Debug.Log("Saved recording successfully :" + result.Path);
        }
        else
        {
            Debug.Log($"Failed saving recording [{error}]");
        }
    });
}

```

### Error Codes

| Name                        | Description                                                                                                                                                                                  |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **PREVIEW\_UNAVAILABLE**    | This error string is passed in the callback if save is called when preview is not available                                                                                                  |
| **PERMISSION\_UNAVAILABLE** | This error is passed in the callback if external storage permissions are not set in Screen Recorder Kit Settings inspector (make sure you click on save button after updating the inspector) |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://assetstore.replaykit.voxelbusters.com/api/save-recorded-video.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
