Open Recording

Learn how to show preview of the recording

Once you get a callback triggered on recording available (You can set it with Register Listeners), calling this method opens up a view/intent to play the recorded video/Gif.

Currently this method is not supported with GIF recording. Coming soon!

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}");
        OpenRecording();
    });
}
void OpenRecording()
{
    recorder.OpenRecording((success, error) =>
    {
        if (success)
        {
            Debug.Log($"Open recording successful");
        }
        else
        {
            Debug.Log($"Open recording failed with error [{error}]");
        }
    });    
}

You can have your own custom video preview by making use of the file path returned from SetOnRecordingAvailable listener and Unity Video Player

Last updated