Class MuteParticipants

Mutes a participant in a media session if certain conditions are met.

This method checks the current user's level and their co-host responsibilities to determine if they are allowed to mute a specified participant. If allowed, the method emits a socket event to mute the participant. If not allowed, an alert is displayed.

The options for muting participants.

The socket instance for communication.

List of co-host responsibilities.

The participant to be muted.

The current member attempting to mute.

The level of the current member.

Optional function to show alerts.

The co-host information.

The name of the room.

A promise that resolves when the participant is muted.

Will log an error if there is an issue accessing co-host responsibilities.

const muteService = new MuteParticipants();
muteService.muteParticipants({
socket: socketInstance,
coHostResponsibility: [{ name: 'media', value: true }],
participant: { id: '123', name: 'John', islevel: '1', muted: false },
member: 'Alice',
islevel: '1',
showAlert: ({ message, type }) => {
console.log(`Alert: ${message} - Type: ${type}`);
},
coHost: 'Bob',
roomName: 'room1',
});

Constructors

Methods

Constructors

Methods