Controls the media of a participant in a media session if certain conditions are met.

The options for controlling media.

The ID of the participant to control.

The name of the participant to control.

The type of media to control.

The socket instance for communication.

List of co-host responsibilities.

List of participants in the session.

The current member attempting to control media.

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 media control operation is complete.

Will log an error message if the operation fails.

const options = {
participantId: '12345',
participantName: 'John Doe',
type: 'audio',
socket: socketInstance,
coHostResponsibility: [{ name: 'media', value: true }],
participants: participantList,
member: 'currentMember',
islevel: '2',
showAlert: showAlertFunction,
coHost: 'coHostName',
roomName: 'Room A',
};

controlMediaService.controlMedia(options)
.then(() => {
console.log('Media control action completed');
})
.catch((error) => {
console.error('Error controlling media:', error);
});

Constructors

Methods

Constructors

Methods

  • Controls the media of a participant in a media session if certain conditions are met.

    Parameters

    Returns Promise<void>

    A promise that resolves when the media control operation is complete.