원클릭으로
audio-controls
// Control audio during calls — mute/unmute microphone. Use when implementing audio toggle or custom mute buttons. Triggers on "mute audio", "unmute", "microphone", "audio controls", "toggleAudio".
// Control audio during calls — mute/unmute microphone. Use when implementing audio toggle or custom mute buttons. Triggers on "mute audio", "unmute", "microphone", "audio controls", "toggleAudio".
Control audio output mode on mobile — switch between speaker, earpiece, Bluetooth, and headphones. Use when implementing audio routing, speaker toggle, or handling audio device changes. Triggers on "audio mode", "speaker", "earpiece", "bluetooth audio", "headphones", "setAudioMode", "audio routing".
Build custom call UI — hide default header/control panel and render your own React Native views around the call component. Use when hiding default controls and building your own call interface. Triggers on "custom control panel", "custom UI", "hideControlPanel", "custom call interface", "custom buttons".
Register call event listeners using CometChatCalls.addEventListener — session status, participant, media, button click, layout, and mobile-specific events. Use when handling call events, session status, participant changes, media state, button clicks, or layout changes. Triggers on "event listener", "addEventListener", "session listener", "participant listener", "media listener", "button click", "layout listener".
Join a CometChat call session using CometChatCalls.Component with callToken and sessionSettings. Use when joining calls, rendering the call UI, voice vs video calls, or generating tokens. Triggers on "join session", "join call", "start call", "CometChatCalls.Component", "callToken".
Migrate a React Native project from CometChat Calls SDK v4 to v5. Use when upgrading calls SDK version, replacing deprecated v4 APIs, migrating CallSettingsBuilder to sessionSettings, replacing OngoingCallListener with addEventListener. Triggers on "migrate calls sdk", "upgrade v4 to v5", "replace deprecated calls api", "CallSettingsBuilder to sessionSettings", "migration guide".
Enable Picture-in-Picture mode for calls in React Native. Use when implementing PiP, floating call window, or minimized call view. Triggers on "picture in picture", "PiP", "pip mode", "floating window", "enablePictureInPictureLayout".
| name | audio-controls |
| description | Control audio during calls — mute/unmute microphone. Use when implementing audio toggle or custom mute buttons. Triggers on "mute audio", "unmute", "microphone", "audio controls", "toggleAudio". |
| inclusion | manual |
Programmatically control the local microphone (mute/unmute) during an active call.
import { CometChatCalls } from '@cometchat/calls-sdk-react-native';
CometChatCalls.muteAudio(); // mute microphone
CometChatCalls.unmuteAudio(); // unmute microphone
CometChatCalls.toggleAudio(); // toggle mute state
CometChatCalls.addEventListener('onAudioMuted', () => {
// Update mute button to "muted" state
});
CometChatCalls.addEventListener('onAudioUnMuted', () => {
// Update mute button to "unmuted" state
});
<CometChatCalls.Component
callToken={callToken}
sessionSettings={{
startAudioMuted: true, // join muted
}}
/>
import React, { useState, useEffect } from 'react';
import { TouchableOpacity, Text } from 'react-native';
import { CometChatCalls } from '@cometchat/calls-sdk-react-native';
function MuteButton() {
const [muted, setMuted] = useState(false);
useEffect(() => {
const unsub1 = CometChatCalls.addEventListener('onAudioMuted', () => setMuted(true));
const unsub2 = CometChatCalls.addEventListener('onAudioUnMuted', () => setMuted(false));
return () => { unsub1(); unsub2(); };
}, []);
return (
<TouchableOpacity onPress={() => CometChatCalls.toggleAudio()}>
<Text>{muted ? '🔇 Unmute' : '🔊 Mute'}</Text>
</TouchableOpacity>
);
}
muteAudio() / unmuteAudio() only work during an active sessionsetAudioMode() for speaker/earpiece switching instead (see audio-mode skill)startAudioMuted: false as default