Configuration options for media settings
Optional
deprecatedLegacyContext: anyRendered media settings modal
Optional
propUsed to declare the types of the props accepted by the component. These types will be checked during rendering and in development only.
We recommend using TypeScript instead of checking prop types at runtime.
Optional
contextOptional
defaultUsed to define default values for the props accepted by the component.
Optional
displayUsed in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.
MediaSettingsModal - Audio/Video device selection interface
MediaSettingsModal is a React Native component that provides an interface for participants to select their preferred audio and video input devices. It supports camera switching (front/back on mobile), microphone selection, and background effects integration.
Key Features:
UI Customization: This component can be replaced via
uiOverrides.mediaSettingsModal
to provide a completely custom media settings interface.Component
Example
// Basic usage - Device selection import React, { useState } from 'react'; import { MediaSettingsModal } from 'mediasfu-reactnative-expo';
function MediaControls() { const [isModalVisible, setModalVisible] = useState(false); const [selectedCamera, setSelectedCamera] = useState('camera1'); const [selectedMic, setSelectedMic] = useState('mic1');
const videoDevices = [ { deviceId: 'camera1', label: 'Front Camera', kind: 'videoinput' }, { deviceId: 'camera2', label: 'Back Camera', kind: 'videoinput' }, ];
const audioDevices = [ { deviceId: 'mic1', label: 'Built-in Microphone', kind: 'audioinput' }, { deviceId: 'mic2', label: 'Bluetooth Headset', kind: 'audioinput' }, ];
return ( <> <Button title="Media Settings" onPress={() => setModalVisible(true)} /> <MediaSettingsModal isMediaSettingsModalVisible={isModalVisible} onMediaSettingsClose={() => setModalVisible(false)} parameters={{ userDefaultVideoInputDevice: selectedCamera, userDefaultAudioInputDevice: selectedMic, videoInputs: videoDevices, audioInputs: audioDevices, isBackgroundModalVisible: false, updateIsBackgroundModalVisible: (visible) => console.log('Background modal:', visible), getUpdatedAllParams: () => ({ userDefaultVideoInputDevice: selectedCamera, userDefaultAudioInputDevice: selectedMic, videoInputs: videoDevices, audioInputs: audioDevices, }), }} /> ); };
@example