Skip to main content

API Reference

Properties

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 the game-launched event for detected processes. Accepts the GamesFilter object.

    const gamesFilter = {
    gameIds: [1111, 2222], // use [] for all games
    };
    recorderApi.registerGames(gamesFilter);
  • createSettingsBuilder(options)—Creates the CaptureSettingsBuilder object.

  • startRecording(options, setting, listener)—Starts recording based on provided settings.

  • stopRecording(listener)—Stops the recording.

  • 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.

Events

  • recording-started—Fired when video recording starts. Returns StartCallback with RecordEventArgs.

    recorderApi.on('recording-started', (RecordEventArgs) => {
    console.log(RecordEventArgs.filePath);
    });
  • recording-stopped—Fired when video recording stops. Returns StopCallback with RecordStopEventArgs.

    recorderApi.on('recording-stopped', (RecordStopEventArgs) => {
    console.log(RecordStopEventArgs.duration);
    });
  • recording-split—Fired when a recording video is split (manual/size/time). Returns SplitCallback with SplitRecordArgs.

    recorderApi.on('recording-split', (SplitRecordArgs) => {
    console.log(SplitRecordArgs.splitCount);
    });
  • replays-started—Fired when replays recording starts. Returns StartCallback with RecordEventArgs.

    recorderApi.on('replays-started', (RecordEventArgs) => {
    console.log(RecordEventArgs.filePath);
    });
  • replays-stopped—Fired when replays recording stops. Returns ReplayStopCallback with RecordEventArgs.

    recorderApi.on('replays-stopped', (RecordEventArgs) => {
    console.log(RecordEventArgs.filePath);
    });
  • replay-captured—Fired when a replay video is captured. Returns ReplayCallback with ReplayVideo.

    recorderApi.on('replay-captured', (ReplayVideo) => {
    console.log(ReplayVideo.duration);
    });
  • stats—Fired at every statsIntervalMS (defined in RecordingAppOptions) interval. Returns RecorderStats.

    recorderApi.on('stats', (RecorderStats) => {
    console.log(RecorderStats.cpuUsage);
    });