MediaSFU Shared
    Preparing search index...

    Function getParticipantMediaState

    • Whether a participant is publishing, and what to label them.

      "Is this person on camera?" is not participant.muted and not the presence of a stream in your grid — it is whether videoID holds a real producer reference. MediaSFU writes the string 'none' rather than an empty value when there is no producer, which is why a naive truthiness check reports everyone as publishing.

      Parameters

      Returns ParticipantMediaState

      import { getParticipantMediaState } from 'mediasfu-shared';

      const paul = getParticipantMediaState({ parameters, name: 'Paul' });
      if (paul.hasVideo) renderCamera(paul.videoProducerId);