Resumes the recording timer if it is not already running and can be paused/resumed.
The options for resuming the recording timer.
The parameters for the recording timer.
Function to get updated parameters.
Indicates if the timer is currently running.
Indicates if the timer can be paused/resumed.
The elapsed recording time in seconds.
The start time of the recording.
The interval ID for the recording timer.
Function to show an alert message.
Function to update the recording start time.
Function to update the recording timer interval.
Function to update the timer running status.
Function to update the pause/resume status.
Will show an alert if the timer cannot be resumed due to conditions not being met.
const options: RecordResumeTimerOptions = { parameters: { isTimerRunning: false, canPauseResume: true, recordElapsedTime: 10, recordStartTime: Date.now(), recordTimerInterval: null, showAlert: (alert) => { }, updateRecordStartTime: (time) => { }, updateRecordTimerInterval: (interval) => { }, updateIsTimerRunning: (isRunning) => { }, updateCanPauseResume: (canPause) => { }, getUpdatedAllParams: () => ({ }), },};const canResume = await recordResumeTimer(options);if (canResume) { // proceed with the resumed recording} Copy
const options: RecordResumeTimerOptions = { parameters: { isTimerRunning: false, canPauseResume: true, recordElapsedTime: 10, recordStartTime: Date.now(), recordTimerInterval: null, showAlert: (alert) => { }, updateRecordStartTime: (time) => { }, updateRecordTimerInterval: (interval) => { }, updateIsTimerRunning: (isRunning) => { }, updateCanPauseResume: (canPause) => { }, getUpdatedAllParams: () => ({ }), },};const canResume = await recordResumeTimer(options);if (canResume) { // proceed with the resumed recording}
Resumes the recording timer if it is not already running and can be paused/resumed.
Param: options
The options for resuming the recording timer.
Param: options.parameters
The parameters for the recording timer.
Param: options.parameters.getUpdatedAllParams
Function to get updated parameters.
Param: options.parameters.isTimerRunning
Indicates if the timer is currently running.
Param: options.parameters.canPauseResume
Indicates if the timer can be paused/resumed.
Param: options.parameters.recordElapsedTime
The elapsed recording time in seconds.
Param: options.parameters.recordStartTime
The start time of the recording.
Param: options.parameters.recordTimerInterval
The interval ID for the recording timer.
Param: options.parameters.showAlert
Function to show an alert message.
Param: options.parameters.updateRecordStartTime
Function to update the recording start time.
Param: options.parameters.updateRecordTimerInterval
Function to update the recording timer interval.
Param: options.parameters.updateIsTimerRunning
Function to update the timer running status.
Param: options.parameters.updateCanPauseResume
Function to update the pause/resume status.
Returns
Throws
Will show an alert if the timer cannot be resumed due to conditions not being met.
Example