mediasfu-angular
Version:
mediasfu-angular - Angular 17/18/19 WebRTC SDK for video conferencing, webinars, broadcasts, live streaming, chat, recording, whiteboard, and AI agents. Prebuilt rooms and fully custom UIs.
40 lines (39 loc) • 1.91 kB
TypeScript
import { ShowAlert } from '../../@types/types';
import * as i0 from "@angular/core";
export interface CheckPauseStateOptions {
recordingMediaOptions: string;
recordingVideoPausesLimit: number;
recordingAudioPausesLimit: number;
pauseRecordCount: number;
showAlert?: ShowAlert;
}
export type CheckPauseStateType = (options: CheckPauseStateOptions) => Promise<boolean>;
/**
* Checks if the recording can be paused based on the current pause count and the allowed pause limits.
*
* @param {CheckPauseStateOptions} options - The options for checking the pause state.
* @param {string} options.recordingMediaOptions - The type of media being recorded ("video" or "audio").
* @param {number} options.recordingVideoPausesLimit - The maximum number of pauses allowed for video recordings.
* @param {number} options.recordingAudioPausesLimit - The maximum number of pauses allowed for audio recordings.
* @param {number} options.pauseRecordCount - The current count of pauses that have been made.
* @param {Function} [options.showAlert] - A function to show an alert message if the pause limit is reached.
* @returns {Promise<boolean>} A promise that resolves to `true` if the recording can be paused, otherwise `false`.
*
* @example
* ```typescript
* const checkPauseStateService = new CheckPauseState();
* const canPause = await checkPauseStateService.checkPauseState({
* recordingMediaOptions: 'video',
* recordingVideoPausesLimit: 3,
* recordingAudioPausesLimit: 5,
* pauseRecordCount: 2,
* showAlert: (alert) => console.log(alert.message),
* });
* console.log('Can pause recording:', canPause);
* ```
*/
export declare class CheckPauseState {
checkPauseState: (options: CheckPauseStateOptions) => Promise<boolean>;
static ɵfac: i0.ɵɵFactoryDeclaration<CheckPauseState, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<CheckPauseState>;
}