Class LocalParticipant


  • public class LocalParticipant
    extends Participant
    A LocalParticipant is the local peer connected to the space.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class Participant
      • publish

        public void publish​(LocalTrack localTrack)
                     throws java.lang.IllegalStateException
        Publish a LocalTrack to the space
        Parameters:
        localTrack -
        Throws:
        java.lang.IllegalStateException - when the LocalParticipant is not joined in a Space
      • unpublish

        public void unpublish​(LocalTrack localTrack)
                       throws java.lang.IllegalStateException
        Unpublishes a track from the space
        Parameters:
        localTrack -
        Throws:
        java.lang.IllegalStateException - when the LocalParticipant is not joined in a Space
      • unpublishAll

        public void unpublishAll()
        Unpublishes all media for a LocalParticipant
      • publishCustomEvent

        public void publishCustomEvent​(java.lang.String payload)
        Publishes a string payload to the space. onParticipantCustomEvent on Space.Listener is called upon successfully completing the publish request to the space. There are limits to the size of the message and the rate at which they can be sent.
        Parameters:
        payload -
      • setDisplayName

        public void setDisplayName​(java.lang.String displayName)
        Sets the display name of the local participant onParticipantDisplayNameUpdated on Space.Listener is called upon successfully setting the display name. The displayName is limited to 64 characters in length, and can only be updated every 10 seconds or you will receive an error.
        Parameters:
        displayName -
      • getCameraTrack

        public LocalVideoCameraTrack getCameraTrack()
        Get the camera track for this localParticipant. i.e. the camera of the device. The camera track is a special class which adds methods such as setCamera for if you want to change the camera.
        Returns:
      • getMicrophoneTrack

        public LocalAudioTrack getMicrophoneTrack()
        Get the microphone track for this localParticipant. i.e. the microphone track of the device. We don't expose special controls for this track at this time beyond the usual mute/unmute functionality.
        Returns:
      • getScreenCaptureTrack

        public LocalScreenCaptureTrack getScreenCaptureTrack()
        Get the screen capture track for this localParticipant. This requires a bit more set up work to use than other tracks, and you're best off referring to an example or asking Mux support if you're interested in using this. It's not all that hard, just difficult to document properly.
        Returns: