MediaSFU Angular
    Preparing search index...

    Class ControlMedia

    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);
    });
    Index

    Constructors

    Methods

    Constructors

    Methods

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

      Parameters

      • options: ControlMediaOptions

        The options for controlling media.

        • participantId: string
        • participantName: string
        • type: "video" | "all" | "audio" | "screenshare"
        • socket: Socket
        • coHostResponsibility: CoHostResponsibility[]
        • participants: Participant[]
        • member: string
        • islevel: string
        • OptionalshowAlert?: ShowAlert
        • coHost: string
        • roomName: string

      Returns Promise<void>

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