Function controlMedia

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

    Will log an error message if there are issues controlling the media or if participant is not found.

    const options = {
    participantId: '1234',
    participantName: 'John Doe',
    type: 'audio',
    socket: socketInstance,
    coHostResponsibility: [{ name: 'media', value: true }],
    participants: participantList,
    member: 'Admin',
    islevel: '1',
    showAlert: (alert) => console.log(alert.message),
    coHost: 'CoHostName',
    roomName: 'Room 1',
    };

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