public class LocalParticipant extends java.lang.Object implements Participant
Room
you are connected to.Modifier and Type | Class and Description |
---|---|
static interface |
LocalParticipant.Listener
Interface that provides
LocalParticipant events. |
Participant.State
Modifier and Type | Method and 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 the
LocalParticipant 's Network Quality Level. |
java.lang.String |
getSid()
Returns the SID of the local participant.
|
java.lang.String |
getSignalingRegion()
Where the
LocalParticipant '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 a
Room with default LocalTrackPublicationOptions . |
boolean |
publishTrack(LocalAudioTrack localAudioTrack,
LocalTrackPublicationOptions localTrackPublicationOptions)
Shares audio track to all participants in a
Room with the provided LocalTrackPublicationOptions . |
boolean |
publishTrack(LocalDataTrack localDataTrack)
Shared data track to all participants in a
Room with default LocalTrackPublicationOptions . |
boolean |
publishTrack(LocalDataTrack localDataTrack,
LocalTrackPublicationOptions localTrackPublicationOptions)
Shared data track to all participants in a
Room with the provided LocalTrackPublicationOptions . |
boolean |
publishTrack(LocalVideoTrack localVideoTrack)
Shares video track to all participants in a
Room with default LocalTrackPublicationOptions . |
boolean |
publishTrack(LocalVideoTrack localVideoTrack,
LocalTrackPublicationOptions localTrackPublicationOptions)
Shares video track to all participants in a
Room with the provided LocalTrackPublicationOptions . |
void |
setEncodingParameters(EncodingParameters encodingParameters)
Updates the
EncodingParameters 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 a
Room . |
boolean |
unpublishTrack(LocalDataTrack localDataTrack)
Stops the sharing of a data track to all the participants in a
Room . |
boolean |
unpublishTrack(LocalVideoTrack localVideoTrack)
Stops the sharing of a video track to all the participants in a
Room . |
@NonNull public java.lang.String getSid()
getSid
in interface Participant
@NonNull public java.lang.String getIdentity()
getIdentity
in interface Participant
@NonNull public Participant.State getState()
getState
in interface Participant
@NonNull public NetworkQualityLevel getNetworkQualityLevel()
LocalParticipant
's Network Quality Level.getNetworkQualityLevel
in interface Participant
Participant.getNetworkQualityLevel()
@NonNull public java.lang.String getSignalingRegion()
LocalParticipant
's signaling traffic enters and exits Twilio's
communications cloud. This property reflects the region passed to ConnectOptions.Builder.region(String)
and when `gll` (the default value) is provided, the
region that was selected using latency based routing.@NonNull public java.util.List<AudioTrackPublication> getAudioTracks()
getAudioTracks
in interface Participant
@NonNull public java.util.List<VideoTrackPublication> getVideoTracks()
getVideoTracks
in interface Participant
@NonNull public java.util.List<DataTrackPublication> getDataTracks()
getDataTracks
in interface Participant
@NonNull public java.util.List<LocalAudioTrackPublication> getLocalAudioTracks()
@NonNull public java.util.List<LocalVideoTrackPublication> getLocalVideoTracks()
@NonNull public java.util.List<LocalDataTrackPublication> getLocalDataTracks()
public boolean publishTrack(@NonNull LocalAudioTrack localAudioTrack)
Room
with default LocalTrackPublicationOptions
.localAudioTrack
- the local audio track to publishpublic boolean publishTrack(@NonNull LocalAudioTrack localAudioTrack, @NonNull LocalTrackPublicationOptions localTrackPublicationOptions)
Room
with the provided LocalTrackPublicationOptions
.localAudioTrack
- the local audio track to publishlocalTrackPublicationOptions
- the local track publication options used to publish the
local audio trackpublic boolean publishTrack(@NonNull LocalVideoTrack localVideoTrack)
Room
with default LocalTrackPublicationOptions
.localVideoTrack
- the local video track to publishpublic boolean publishTrack(@NonNull LocalVideoTrack localVideoTrack, @NonNull LocalTrackPublicationOptions localTrackPublicationOptions)
Room
with the provided LocalTrackPublicationOptions
.localVideoTrack
- the local video track to publishlocalTrackPublicationOptions
- the local track publication options used to publish the
local video trackpublic boolean publishTrack(@NonNull LocalDataTrack localDataTrack)
Room
with default LocalTrackPublicationOptions
.localDataTrack
- the local data track to publishpublic boolean publishTrack(@NonNull LocalDataTrack localDataTrack, @NonNull LocalTrackPublicationOptions localTrackPublicationOptions)
Room
with the provided LocalTrackPublicationOptions
.localDataTrack
- the local data track to publishlocalTrackPublicationOptions
- the local track publication options used to publish the
local data trackpublic boolean unpublishTrack(@NonNull LocalAudioTrack localAudioTrack)
Room
.public boolean unpublishTrack(@NonNull LocalVideoTrack localVideoTrack)
Room
.public boolean unpublishTrack(@NonNull LocalDataTrack localDataTrack)
Room
.public void setListener(@NonNull LocalParticipant.Listener listener)
listener
- of local participant events.public void setEncodingParameters(@Nullable EncodingParameters encodingParameters)
EncodingParameters
used to share media in the Room.encodingParameters
- The EncodingParameters
to use or null
for the
default values.6.0.0