RecordingModal - Comprehensive recording settings with standard and advanced options

RecordingModal is a feature-rich React Native modal for configuring and managing session recordings. It provides both standard (quick start) and advanced (detailed) panels for customizing video layout, background, text overlays, media options, and more.

Key Features:

  • Tabbed interface (Standard / Advanced settings)
  • Video type selection (fullDisplay, mainScreen, custom layouts)
  • Display type options (video, media, all)
  • Background color customization
  • Participant name tags with color options
  • Custom text overlays with positioning
  • Video orientation control
  • Media/audio/video encoding options
  • HLS streaming enablement
  • Real-time preview of settings

UI Customization: This component can be replaced via uiOverrides.recordingModalComponent to provide a completely custom recording modal implementation.

// Basic usage - Display recording modal with default settings
import React, { useState } from 'react';
import { RecordingModal, confirmRecording, startRecording } from 'mediasfu-reactnative-expo';

function RecordingControls() {
const [showModal, setShowModal] = useState(false);
const [recordingParams, setRecordingParams] = useState({
recordPaused: false,
recordingVideoType: 'fullDisplay',
recordingDisplayType: 'video' as const,
recordingBackgroundColor: '#ffffff',
recordingNameTagsColor: '#000000',
recordingOrientationVideo: 'landscape',
recordingNameTags: true,
recordingAddText: false,
recordingCustomText: '',
recordingCustomTextPosition: 'top',
recordingCustomTextColor: '#000000',
recordingMediaOptions: 'default',
recordingAudioOptions: 'default',
recordingVideoOptions: 'default',
recordingAddHLS: false,
eventType: 'conference' as const,
updateRecordingVideoType: (value: string) => setRecordingParams({...recordingParams, recordingVideoType: value}),
updateRecordingDisplayType: (value: 'video' | 'media' | 'all') => setRecordingParams({...recordingParams, recordingDisplayType: value}),
// ... other update functions
getUpdatedAllParams: () => recordingParams,
});

return (
<>
<Button title="Recording Settings" onPress={() => setShowModal(true)} />
<RecordingModal
isRecordingModalVisible={showModal}
onClose={() => setShowModal(false)}
confirmRecording={confirmRecording}
startRecording={startRecording}
parameters={recordingParams}
/>
</>
);
}
// With custom styling and positioning
<RecordingModal
isRecordingModalVisible={showRecordingModal}
onClose={() => setShowRecordingModal(false)}
backgroundColor="#1a1a2e"
position="center"
confirmRecording={async (options) => {
console.log('Confirming recording settings');
await confirmRecording(options);
}}
startRecording={async (options) => {
console.log('Starting recording with settings:', options.parameters);
await startRecording(options);
}}
parameters={{
...recordingParams,
recordingBackgroundColor: '#0f3460',
recordingNameTagsColor: '#e94560',
recordingAddText: true,
recordingCustomText: 'Company Webinar',
recordingAddHLS: true,
}}
/>
// Using uiOverrides for complete modal replacement
import { MyCustomRecordingModal } from './MyCustomRecordingModal';

const sessionConfig = {
credentials: { apiKey: 'your-api-key' },
uiOverrides: {
recordingModalComponent: {
component: MyCustomRecordingModal,
injectedProps: {
theme: 'professional',
presets: ['meeting', 'webinar', 'presentation'],
},
},
},
};

// MyCustomRecordingModal.tsx
export const MyCustomRecordingModal = (props: RecordingModalOptions & { theme: string; presets: string[] }) => {
return (
<Modal visible={props.isRecordingModalVisible} onRequestClose={props.onClose}>
<View style={{ backgroundColor: props.theme === 'professional' ? '#2c3e50' : '#fff' }}>
<Text>Recording Settings</Text>
{props.presets.map(preset => (
<Button key={preset} title={preset} onPress={() => applyPreset(preset)} />
))}
<Button title="Start" onPress={() => props.startRecording({ parameters: props.parameters })} />
</View>
</Modal>
);
};
);
}

export default App;

Properties

propTypes?: WeakValidationMap<RecordingModalOptions>

Used 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.

contextTypes?: ValidationMap<any>

Lets you specify which legacy context is consumed by this component.

defaultProps?: Partial<RecordingModalOptions>

Used to define default values for the props accepted by the component.

type Props = { name?: string }

const MyComponent: FC<Props> = (props) => {
return <div>{props.name}</div>
}

MyComponent.defaultProps = {
name: 'John Doe'
}
displayName?: string

Used in debugging messages. You might want to set it explicitly if you want to display a different name for debugging purposes.


const MyComponent: FC = () => {
return <div>Hello!</div>
}

MyComponent.displayName = 'MyAwesomeComponent'