MediaSFU Shared
    Preparing search index...

    Function setParticipantMedia

    • Turn a participant's media off as host or authorised co-host.

      This is one-directional by design: MediaSFU lets a moderator stop someone's camera, microphone or screen share, but cannot start it on their behalf — the participant must re-enable it themselves.

      The SDK's own controlMedia consumer only emits for type: 'audio' and type: 'video'; 'all' and 'screenshare' fall through its guard and do nothing. This helper emits the controlMedia event directly with the same permission and self-protection checks applied uniformly, so every kind works. Hosts (islevel === '2') cannot be muted by anyone, including other hosts.

      Parameters

      Returns Promise<HeadlessActionResult>

      import { setParticipantMedia } from 'mediasfu-shared';

      await setParticipantMedia({ parameters, name: 'Paul', kind: 'video' });
      await setParticipantMedia({ parameters, name: 'Paul', kind: 'all' });