Home > @magiclane/maps-sdk > Recorder

Recorder class

Recorder for capturing sensor and multimedia logs.

Use a configured RecorderConfiguration to create a Recorder with Recorder.create(). The recorder manages recording lifecycle (start, stop, pause, resume), audio/video capture and user metadata. See recorder guides for background permissions and storage recommendations.

The recorded logs can be accessed and managed using RecorderBookmarks and their metadata through LogMetadata.

Sensor Data Source

Signature:

export declare class Recorder extends GemAutoreleaseObject 

Extends: GemAutoreleaseObject

Properties

Property

Modifiers

Type

Description

activityRecord

ActivityRecord

Attach activity metadata to the current recording.

Provide an ActivityRecord describing the activity (title, description, sport type, visibility, etc.). Call this before stopping the recording to ensure the metadata is saved with the log.

The activity record does not influence the recording process itself but rather provides descriptive metadata for the saved log.

currentRecordPath

readonly

string

Path to the current log file.

diskSpaceUsedPerSecond

readonly

number

Disk space used per second, in bytes.

metrics

readonly

RecordMetrics

Recording performance metrics.

Returns various runtime statistics for an active recording (average speed, distance, elevation gain, etc.). Available while the recorder is in RecorderStatus.recording.

recorderConfiguration

readonly

RecorderConfiguration

The current RecorderConfiguration in use by the recorder.

Returns the active configuration reflecting the settings applied at creation or through . Useful for inspection or diagnostics.

Changing the configuration while recording does not take effect. Use the method to apply a new configuration.

recorderStatus

readonly

RecorderStatus

Current recorder status.

Methods

Method

Modifiers

Description

addListener(callbacks)

Register callbacks to monitor recorder progress and status changes.

addTextMark(text)

Add a textual annotation (text mark) to the current recording.

Call before stopping the recording to include the annotation in the final log file.

addUserMetadata(key, userMetadata)

Save arbitrary binary user metadata into the current log.

Attach a binary blob under the provided string key. Call before stopping the recording so the data is included in the saved log.

create(config)

static

Creates a configured Recorder instance.

Use this static factory with a RecorderConfiguration to obtain a recorder instance. The factory only constructs the recorder; to begin capturing data call . If recording must work while the app is in the background, ensure the required platform permissions and background location settings are configured (see SDK guides).

isAudioRecording()

Whether audio capture is currently active.

pauseRecording()

Pauses an ongoing recording.

Transitions the recorder to RecorderStatus.pausing and then to RecorderStatus.paused when successful.

removeListener(handler)

Remove a previously registered listener.

resumeRecording()

Resumes a paused recording.

Transitions the recorder to RecorderStatus.resuming and then to RecorderStatus.recording when the operation succeeds.

setRecorderConfiguration(config)

Apply a new recorder configuration.

If the recorder is currently recording it will be stopped, reconfigured and restarted. Callers should handle the returned result to know whether the update succeeded.

startAudioRecording()

Starts audio capture for the current recording.

Resumes audio recording only if a recording is currently active and audio is enabled in the recorder configuration (RecorderConfiguration.enableAudio).

startRecording()

Starts the recording session.

Initiates the recorder and transitions status to RecorderStatus.starting and then to RecorderStatus.recording on success.

Always await the returned promise to ensure the operation has completed.

stopAudioRecording()

Stops audio capture for the current recording.

Suspends audio recording when a recording is active and audio was enabled in the recorder configuration.

stopRecording()

Stops the recording session.

Stops the recorder and transitions the status to RecorderStatus.stopping. On success the status becomes RecorderStatus.stopped; if RecorderConfiguration.continuousRecording is enabled and a chunk boundary was reached the status becomes RecorderStatus.restarting.