Create
To access the api to record, you need to first create an instance of IScreenRecorder. ScreenRecorderBuilder provides a way to create IScreenRecorder instances for both Gif and Video.
To create a video recorder IScreenRecorder instance, first you need to create an instance of VideoRecorderRuntimeSettings and pass it to ScreenRecorderBuilder.
VideoRecorderRuntimeSettings provides a way to configure the video recorder. You can change the microphone status to enable or disable for the current recording.
Create settings instance
VideoRecorderRuntimeSettings settings = new VideoRecorderRuntimeSettings(enableMicrophone: true);
Once you create a VideoRecorderRuntimeSettings instance, pass it to ScreenRecorderBuilder to create an IScreenRecorder instance.
IScreenRecorder recorder;
//...
//...
// Create settings
VideoRecorderRuntimeSettings settings = new VideoRecorderRuntimeSettings(enableMicrophone: true);
// Pass settings to ScreenRecorderBuilder and build
ScreenRecorderBuilder builder = ScreenRecorderBuilder.CreateVideoRecorder(settings);
recorder = builder.Build();
Create a GIF recorder IScreenRecorder instance vis ScreenRecorderBuilder.
You can pass Camera instance to builder if you want to record only a specific camera.
You can either record a specific camera or complete screen with GIF recorder.
Camera Recording
IScreenRecorder recorder;
Camera cameraInstance;
//....
ScreenRecorderBuilder builder = ScreenRecorderBuilder.CreateGifRecorder(cameraInstance);
recorder = builder.Build();
Full Screen Recording
IScreenRecorder recorder;
//....
ScreenRecorderBuilder builder = ScreenRecorderBuilder.CreateGifRecorder();
recorder = builder.Build();
Last modified 3mo ago