mediasfu-reactnative-expo
Version:
mediasfu-reactnative-expo – Expo-managed React Native WebRTC SDK for video conferencing, webinars, live streaming, broadcast, screen sharing, whiteboard, chat, recording, live subtitles, translation, and AI agent rooms on iOS, Android, and web. Prebuilt r
41 lines • 1.78 kB
JavaScript
import { banParticipant as sharedBanParticipant } from 'mediasfu-shared';
/**
* Bans a participant from the session by removing them from the active and display names arrays,
* updating the participants list, and reordering the streams.
*
* @param {BanParticipantOptions} options - The options for banning a participant.
* @param {string} options.name - The name of the participant to be banned.
* @param {Object} options.parameters - The parameters required for banning the participant.
* @param {string[]} options.parameters.activeNames - The array of active participant names.
* @param {string[]} options.parameters.dispActiveNames - The array of display participant names.
* @param {Object[]} options.parameters.participants - The array of participant objects.
* @param {Function} options.parameters.updateParticipants - The function to update the participants array.
* @param {Function} options.parameters.reorderStreams - The function to reorder the streams.
*
* @returns {Promise<void>} A promise that resolves when the participant has been banned and streams reordered.
*
* @example
* ```typescript
* await banParticipant({
* name: "John Doe",
* parameters: {
* activeNames: ["Alice", "Bob", "John Doe"],
* dispActiveNames: ["Alice", "John Doe"],
* participants: [
* { name: "Alice", isActive: true },
* { name: "Bob", isActive: true },
* { name: "John Doe", isActive: true }
* ],
* updateParticipants: (updated) => setParticipants(updated),
* reorderStreams: reorderStreamFunction,
* },
* });
* ```
*/
export const banParticipant = async ({ name, parameters, }) => {
return sharedBanParticipant({
name,
parameters,
});
};
//# sourceMappingURL=banParticipant.js.map