useRecording

useRecording(params?): Object

useRecording returns the state and information of a recording in progress, along with helper functions for daily-js recording methods.

Accepts optional callbacks for recording events.

Params (optional)

An object with the following properties:

ParameterRequiredTypeDescription
onRecordingDataFunctionCallback for the recording-data event
onRecordingErrorFunctionCallback for the recording-error event
onRecordingStartedFunctionCallback for the recording-started event
onRecordingStoppedFunctionCallback for the recording-stopped event

Return type

An object with the following properties:

NameTypeDescription
errorbooleantrue in the event of a recording-error
isLocalParticipantRecordedbooleanIndicates whether the local participant is recorded
isRecordingbooleanReturns true if the call is being recorded
layoutObjectDescribes any preset recording layout, and any corresponding layout-specific details. Defaults to undefined
localbooleantrue for local recordings
recordingIdstringA unique id for the recording object
recordingStartedDateDateTimestamp for when the recording started
startedBystringIdentifies the participant who started the recording
startRecordingFunctionSee daily-js startRecording()
stopRecordingFunctionSee daily-js stopRecording()
typestringDetails the Daily recording type used for the recording
updateRecordingFunctionSee daily-js updateRecording()

Sample code