Skip to main content

React Native device selection and effects

Use mediasfu-reactnative 2.5.2 room controls for camera and microphone switching and the supported background and translation experiences.

Camera and microphone switching​

Use MediaSettingsModal for supplied controls. The package exports switchVideoAlt to flip the front/back camera and switchUserVideo / switchUserVideoAlt for its selected-camera flows:

import {switchVideoAlt} from 'mediasfu-reactnative';

type CameraFlipOptions = Parameters<typeof switchVideoAlt>[0];

export function flipCamera(options: CameraFlipOptions) {
return switchVideoAlt(options);
}

Pass the current room options. To change the microphone, use switchUserAudio with the same room options. Bluetooth, wired-headset, and speaker routing are owned by the native audio system.

Backgrounds and translation​

The supplied BackgroundModal and TranslationSettingsModal are room UI surfaces. Native virtual-background processing is not supported by this package; do not show an enabled native effect control. Translation controls apply only to rooms configured for translation.

Test permissions, camera changes, interruptions, and audio routing on physical Android and iOS devices. Keep device failure recoverable and avoid promising translated playback until you have tested it in the configured room on the target device.

Continue with React Native room operations and React Native recovery.