# Stop Recording

This call stops the current recording and do the required steps for making the recorded video available for preview.

You need to have an active recording to call this method. Else it throws error.

```csharp
recorder.StopRecording(callback: (success, error) =>
{
    if (success)
    {
        Debug.Log("Stop recording successful.");
    }
    else
    {
        Debug.Log($"Stop recording failed with error [{error}]");
    }
});
```

Example

```csharp
using VoxelBusters.ScreenRecorderKit;

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

public void StopRecording()
{
    recorder.StopRecording((success, error) =>
    {
        if (success)
        {
            Debug.Log("Stop recording successful.");
        }
        else
        {
            Debug.Log($"Stop recording failed with error [{error}]");
        }
    });
}
```


---

# 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/stop-recording.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.
