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.
Create Video Recorder
To create a video recorder IScreenRecorder instance, first you need to create an instance of VideoRecorderRuntimeSettings and pass it to ScreenRecorderBuilder.
Configuration
VideoRecorderRuntimeSettings provides a way to configure the video recorder. You can change the microphone status to enable or disable for the current recording.
Once you create a VideoRecorderRuntimeSettings instance, pass it to ScreenRecorderBuilder to create an IScreenRecorder instance.
IScreenRecorderrecorder;//...//...// Create settingsVideoRecorderRuntimeSettingssettings=newVideoRecorderRuntimeSettings(enableMicrophone:true);// Pass settings to ScreenRecorderBuilder and buildScreenRecorderBuilderbuilder=ScreenRecorderBuilder.CreateVideoRecorder(settings);recorder=builder.Build();
Create GIF Recorder
Create a GIF recorder IScreenRecorder instance vis ScreenRecorderBuilder.
Configuration
You can pass Camera instance to builder if you want to record only a specific camera.
IScreenRecorder instance for GIF
You can either record a specific camera or complete screen with GIF recorder.