API Reference
Properties
options
—Contains global options for debuggingRecordingAppOptions
.
Methods
Important: It is recommended to wrap the methods in a try/catch block to handle any possible exceptions from the recording API.
-
isActive()
—Checks if recording or replays status is active.const active = await recorderApi.isActive();
-
queryInformation()
—Queries system information, including supported encoders and available audio/video devices and monitors.const info = await recorderApi.queryInformation();
console.log(info.monitors); -
registerGames(filter)
—Registers game launches, triggering thegame-launched
event for detected processes. Accepts theGamesFilter
object.const gamesFilter = {
gameIds: [1111, 2222], // use [] for all games
};
recorderApi.registerGames(gamesFilter); -
createSettingsBuilder(options)
—Creates theCaptureSettingsBuilder
object.- Parameters:
CaptureSettingsOptions
.
- Parameters:
-
startRecording(options, setting, listener)
—Starts recording based on provided settings.- Parameters:
RecordingOptions
.CaptureSettings
.StopCallback
withRecordStopEventArgs
.
- Parameters:
-
stopRecording(listener)
—Stops the recording.- Parameters: StopCallback with
RecordStopEventArgs
.
- Parameters: StopCallback with
-
splitRecording(listener)
—Manually splits the video at the moment of calling the method, creating a subfolder in the current output directory for the split videos.- Parameters: SplitCallback with
SplitRecordArgs
.
- Parameters: SplitCallback with
Events
-
recording-started
—Fired when video recording starts. Returns StartCallback withRecordEventArgs
.recorderApi.on('recording-started', (RecordEventArgs) => {
console.log(RecordEventArgs.filePath);
}); -
recording-stopped
—Fired when video recording stops. Returns StopCallback withRecordStopEventArgs
.recorderApi.on('recording-stopped', (RecordStopEventArgs) => {
console.log(RecordStopEventArgs.duration);
}); -
recording-split
—Fired when a recording video is split (manual/size/time). Returns SplitCallback withSplitRecordArgs
.recorderApi.on('recording-split', (SplitRecordArgs) => {
console.log(SplitRecordArgs.splitCount);
}); -
replays-started
—Fired when replays recording starts. Returns StartCallback withRecordEventArgs
.recorderApi.on('replays-started', (RecordEventArgs) => {
console.log(RecordEventArgs.filePath);
}); -
replays-stopped
—Fired when replays recording stops. Returns ReplayStopCallback withRecordEventArgs
.recorderApi.on('replays-stopped', (RecordEventArgs) => {
console.log(RecordEventArgs.filePath);
}); -
replay-captured
—Fired when a replay video is captured. Returns ReplayCallback withReplayVideo
.recorderApi.on('replay-captured', (ReplayVideo) => {
console.log(ReplayVideo.duration);
}); -
stats
—Fired at everystatsIntervalMS
(defined inRecordingAppOptions
) interval. Returns RecorderStats.recorderApi.on('stats', (RecorderStats) => {
console.log(RecorderStats.cpuUsage);
});