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 aRoom
you are connected to.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
LocalParticipant.Listener
Interface that providesLocalParticipant
events.-
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.String
getIdentity()
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.NetworkQualityLevel
getNetworkQualityLevel()
Returns theLocalParticipant
's Network Quality Level.java.lang.String
getSid()
Returns the SID of the local participant.java.lang.String
getSignalingRegion()
Where theLocalParticipant
's signaling traffic enters and exits Twilio's communications cloud.Participant.State
getState()
Returns participant state.java.util.List<VideoTrackPublication>
getVideoTracks()
Returns read-only list of video track publications.boolean
publishTrack(LocalAudioTrack localAudioTrack)
Shares audio track to all participants in aRoom
with defaultLocalTrackPublicationOptions
.boolean
publishTrack(LocalAudioTrack localAudioTrack, LocalTrackPublicationOptions localTrackPublicationOptions)
Shares audio track to all participants in aRoom
with the providedLocalTrackPublicationOptions
.boolean
publishTrack(LocalDataTrack localDataTrack)
Shared data track to all participants in aRoom
with defaultLocalTrackPublicationOptions
.boolean
publishTrack(LocalDataTrack localDataTrack, LocalTrackPublicationOptions localTrackPublicationOptions)
Shared data track to all participants in aRoom
with the providedLocalTrackPublicationOptions
.boolean
publishTrack(LocalVideoTrack localVideoTrack)
Shares video track to all participants in aRoom
with defaultLocalTrackPublicationOptions
.boolean
publishTrack(LocalVideoTrack localVideoTrack, LocalTrackPublicationOptions localTrackPublicationOptions)
Shares video track to all participants in aRoom
with the providedLocalTrackPublicationOptions
.void
setEncodingParameters(EncodingParameters encodingParameters)
Updates theEncodingParameters
used to share media in the Room.void
setListener(LocalParticipant.Listener listener)
Set listener for local participant events.boolean
unpublishTrack(LocalAudioTrack localAudioTrack)
Stops the sharing of an audio track to all the participants in aRoom
.boolean
unpublishTrack(LocalDataTrack localDataTrack)
Stops the sharing of a data track to all the participants in aRoom
.boolean
unpublishTrack(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:
getSid
in interfaceParticipant
-
getIdentity
@NonNull public java.lang.String getIdentity()
Returns the identity of the local participant.- Specified by:
getIdentity
in interfaceParticipant
-
getState
@NonNull public Participant.State getState()
Returns participant state.- Specified by:
getState
in interfaceParticipant
-
getNetworkQualityLevel
@NonNull public NetworkQualityLevel getNetworkQualityLevel()
Returns theLocalParticipant
's Network Quality Level.- Specified by:
getNetworkQualityLevel
in 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:
getAudioTracks
in interfaceParticipant
-
getVideoTracks
@NonNull public java.util.List<VideoTrackPublication> getVideoTracks()
Returns read-only list of video track publications.- Specified by:
getVideoTracks
in interfaceParticipant
-
getDataTracks
@NonNull public java.util.List<DataTrackPublication> getDataTracks()
Returns read-only list of data track publications.- Specified by:
getDataTracks
in 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 aRoom
with 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 aRoom
with 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 aRoom
with 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 aRoom
with 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 aRoom
with 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 aRoom
with 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 theEncodingParameters
used to share media in the Room.- Parameters:
encodingParameters
- TheEncodingParameters
to use ornull
for the default values.
-
-