Package com.mux.sdk.webrtc.spaces
Class LocalParticipant
- java.lang.Object
-
- com.mux.sdk.webrtc.spaces.Participant
-
- com.mux.sdk.webrtc.spaces.LocalParticipant
-
public class LocalParticipant extends Participant
A LocalParticipant is the local peer connected to the space.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
LocalParticipant.Errors
-
Field Summary
-
Fields inherited from class com.mux.sdk.webrtc.spaces.Participant
connectionId, displayName, id, space, spaceId
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
LocalVideoCameraTrack
getCameraTrack()
Get the camera track for this localParticipant.LocalAudioTrack
getMicrophoneTrack()
Get the microphone track for this localParticipant.LocalScreenCaptureTrack
getScreenCaptureTrack()
Get the screen capture track for this localParticipant.int
hashCode()
void
publish(LocalTrack localTrack)
Publish aLocalTrack
to the spacevoid
publishCustomEvent(java.lang.String payload)
Publishes a string payload to the space.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.void
unpublish(LocalTrack localTrack)
Unpublishes a track from the spacevoid
unpublishAll()
Unpublishes all media for aLocalParticipant
-
Methods inherited from class com.mux.sdk.webrtc.spaces.Participant
getAudioTracks, getConnectionId, getDisplayName, getId, getRole, getTracks, getVideoTracks, isActiveSpeaker, isTrackSourceMuted, roleSupportsPublishing, toString, updateDisplayName
-
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classParticipant
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classParticipant
-
publish
public void publish(LocalTrack localTrack) throws java.lang.IllegalStateException
Publish aLocalTrack
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 aLocalParticipant
-
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:
-
-