click Audio
Toggles audio for a user, either enabling or disabling the microphone.
Parameters:
options(ClickAudioOptions): Contains all required parameters and callbacks.parameters(ClickAudioParameters): The key configurations for permissions, media settings, callback functions, and state variables.
Workflow:
Audio Toggle:
Disable: Checks if recording is active and if it's safe to disable audio.
Enable: Verifies permissions and sends a request to the host if necessary.
Permissions & Requests:
If the user lacks permissions, sends a request to the host or prompts for permissions.
Uses callbacks to update the UI and emit requests or permission checks.
Media Constraints:
Configures constraints for
getUserMediabased on device and user preference.
Example Usage:
val parameters = object : ClickAudioParameters {
override val checkMediaPermission: Boolean = true
override val hasAudioPermission: Boolean = false
override val audioPaused: Boolean = false
// Other properties and callbacks...
}
clickAudio(ClickAudioOptions(parameters = parameters))Error Handling:
Logs any errors to the console in debug mode.