Package com.twilio.video
Class LocalParticipant
- java.lang.Object
-
- com.twilio.video.LocalParticipant
-
- All Implemented Interfaces:
Participant
public class LocalParticipant extends java.lang.Object implements Participant
Represents the local participant of aRoomyou are connected to.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceLocalParticipant.ListenerInterface that providesLocalParticipantevents.-
Nested classes/interfaces inherited from interface com.twilio.video.Participant
Participant.State
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<AudioTrackPublication>getAudioTracks()Returns read-only list of audio track publications.java.util.List<DataTrackPublication>getDataTracks()Returns read-only list of data track publications.java.lang.StringgetIdentity()Returns the identity of the local participant.java.util.List<LocalAudioTrackPublication>getLocalAudioTracks()Returns read-only list of local audio track publications.java.util.List<LocalDataTrackPublication>getLocalDataTracks()Returns read-only list of local data track publications.java.util.List<LocalVideoTrackPublication>getLocalVideoTracks()Returns read-only list of local video track publications.NetworkQualityLevelgetNetworkQualityLevel()Returns theLocalParticipant's Network Quality Level.java.lang.StringgetSid()Returns the SID of the local participant.java.lang.StringgetSignalingRegion()Where theLocalParticipant's signaling traffic enters and exits Twilio's communications cloud.Participant.StategetState()Returns participant state.java.util.List<VideoTrackPublication>getVideoTracks()Returns read-only list of video track publications.booleanpublishTrack(LocalAudioTrack localAudioTrack)Shares audio track to all participants in aRoomwith defaultLocalTrackPublicationOptions.booleanpublishTrack(LocalAudioTrack localAudioTrack, LocalTrackPublicationOptions localTrackPublicationOptions)Shares audio track to all participants in aRoomwith the providedLocalTrackPublicationOptions.booleanpublishTrack(LocalDataTrack localDataTrack)Shared data track to all participants in aRoomwith defaultLocalTrackPublicationOptions.booleanpublishTrack(LocalDataTrack localDataTrack, LocalTrackPublicationOptions localTrackPublicationOptions)Shared data track to all participants in aRoomwith the providedLocalTrackPublicationOptions.booleanpublishTrack(LocalVideoTrack localVideoTrack)Shares video track to all participants in aRoomwith defaultLocalTrackPublicationOptions.booleanpublishTrack(LocalVideoTrack localVideoTrack, LocalTrackPublicationOptions localTrackPublicationOptions)Shares video track to all participants in aRoomwith the providedLocalTrackPublicationOptions.voidsetEncodingParameters(EncodingParameters encodingParameters)Updates theEncodingParametersused to share media in the Room.voidsetListener(LocalParticipant.Listener listener)Set listener for local participant events.booleanunpublishTrack(LocalAudioTrack localAudioTrack)Stops the sharing of an audio track to all the participants in aRoom.booleanunpublishTrack(LocalDataTrack localDataTrack)Stops the sharing of a data track to all the participants in aRoom.booleanunpublishTrack(LocalVideoTrack localVideoTrack)Stops the sharing of a video track to all the participants in aRoom.
-
-
-
Method Detail
-
getSid
@NonNull public java.lang.String getSid()
Returns the SID of the local participant.- Specified by:
getSidin interfaceParticipant
-
getIdentity
@NonNull public java.lang.String getIdentity()
Returns the identity of the local participant.- Specified by:
getIdentityin interfaceParticipant
-
getState
@NonNull public Participant.State getState()
Returns participant state.- Specified by:
getStatein interfaceParticipant
-
getNetworkQualityLevel
@NonNull public NetworkQualityLevel getNetworkQualityLevel()
Returns theLocalParticipant's Network Quality Level.- Specified by:
getNetworkQualityLevelin interfaceParticipant- See Also:
Participant.getNetworkQualityLevel()
-
getSignalingRegion
@NonNull public java.lang.String getSignalingRegion()
Where theLocalParticipant's signaling traffic enters and exits Twilio's communications cloud. This property reflects the region passed toConnectOptions.Builder.region(String)and when `gll` (the default value) is provided, the region that was selected using latency based routing.
-
getAudioTracks
@NonNull public java.util.List<AudioTrackPublication> getAudioTracks()
Returns read-only list of audio track publications.- Specified by:
getAudioTracksin interfaceParticipant
-
getVideoTracks
@NonNull public java.util.List<VideoTrackPublication> getVideoTracks()
Returns read-only list of video track publications.- Specified by:
getVideoTracksin interfaceParticipant
-
getDataTracks
@NonNull public java.util.List<DataTrackPublication> getDataTracks()
Returns read-only list of data track publications.- Specified by:
getDataTracksin interfaceParticipant
-
getLocalAudioTracks
@NonNull public java.util.List<LocalAudioTrackPublication> getLocalAudioTracks()
Returns read-only list of local audio track publications.
-
getLocalVideoTracks
@NonNull public java.util.List<LocalVideoTrackPublication> getLocalVideoTracks()
Returns read-only list of local video track publications.
-
getLocalDataTracks
@NonNull public java.util.List<LocalDataTrackPublication> getLocalDataTracks()
Returns read-only list of local data track publications.
-
publishTrack
public boolean publishTrack(@NonNull LocalAudioTrack localAudioTrack)Shares audio track to all participants in aRoomwith defaultLocalTrackPublicationOptions.- Parameters:
localAudioTrack- the local audio track to publish- Returns:
- true if the audio track published or false if the local participant is not connected or the track was already published.
-
publishTrack
public boolean publishTrack(@NonNull LocalAudioTrack localAudioTrack, @NonNull LocalTrackPublicationOptions localTrackPublicationOptions)Shares audio track to all participants in aRoomwith the providedLocalTrackPublicationOptions.- Parameters:
localAudioTrack- the local audio track to publishlocalTrackPublicationOptions- the local track publication options used to publish the local audio track- Returns:
- true if the audio track was published or false if the local participant is not connected or the track was already published.
-
publishTrack
public boolean publishTrack(@NonNull LocalVideoTrack localVideoTrack)Shares video track to all participants in aRoomwith defaultLocalTrackPublicationOptions.- Parameters:
localVideoTrack- the local video track to publish- Returns:
- true if the video track was published or false if the local participant is not connected or the track was already published.
-
publishTrack
public boolean publishTrack(@NonNull LocalVideoTrack localVideoTrack, @NonNull LocalTrackPublicationOptions localTrackPublicationOptions)Shares video track to all participants in aRoomwith the providedLocalTrackPublicationOptions.- Parameters:
localVideoTrack- the local video track to publishlocalTrackPublicationOptions- the local track publication options used to publish the local video track- Returns:
- true if the video track was published or false if the local participant is not connected or the track was already published.
-
publishTrack
public boolean publishTrack(@NonNull LocalDataTrack localDataTrack)Shared data track to all participants in aRoomwith defaultLocalTrackPublicationOptions.- Parameters:
localDataTrack- the local data track to publish- Returns:
- true if the data track was published or false if the local participant is not connected or the track was already published.
-
publishTrack
public boolean publishTrack(@NonNull LocalDataTrack localDataTrack, @NonNull LocalTrackPublicationOptions localTrackPublicationOptions)Shared data track to all participants in aRoomwith the providedLocalTrackPublicationOptions.- Parameters:
localDataTrack- the local data track to publishlocalTrackPublicationOptions- the local track publication options used to publish the local data track- Returns:
- true if the data track was published or false if the local participant is not connected or the track was already published.
-
unpublishTrack
public boolean unpublishTrack(@NonNull LocalAudioTrack localAudioTrack)Stops the sharing of an audio track to all the participants in aRoom.- Returns:
- true if the audio track was unpublished or false if the local participant is not connected or could not unpublish audio track.
-
unpublishTrack
public boolean unpublishTrack(@NonNull LocalVideoTrack localVideoTrack)Stops the sharing of a video track to all the participants in aRoom.- Returns:
- true if video track was unpublished or false if the local participant is not connected or could not unpublish video track.
-
unpublishTrack
public boolean unpublishTrack(@NonNull LocalDataTrack localDataTrack)Stops the sharing of a data track to all the participants in aRoom.- Returns:
- true if the data track was unpublished or false if the local participant is not connected or could not unpublish the data track.
-
setListener
public void setListener(@NonNull LocalParticipant.Listener listener)Set listener for local participant events.- Parameters:
listener- of local participant events.
-
setEncodingParameters
public void setEncodingParameters(@Nullable EncodingParameters encodingParameters)Updates theEncodingParametersused to share media in the Room.- Parameters:
encodingParameters- TheEncodingParametersto use ornullfor the default values.
-
-