Package com.twilio.video
Class LocalParticipant
java.lang.Object
com.twilio.video.LocalParticipant
- All Implemented Interfaces:
Participant
Represents the local participant of a
Room
you are connected to.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface that providesLocalParticipant
events.Nested classes/interfaces inherited from interface com.twilio.video.Participant
Participant.State
-
Method Summary
Modifier and TypeMethodDescriptionReturns read-only list of audio track publications.Returns read-only list of data track publications.Returns the identity of the local participant.Returns read-only list of local audio track publications.Returns read-only list of local data track publications.Returns read-only list of local video track publications.Returns theLocalParticipant
's Network Quality Level.getSid()
Returns the SID of the local participant.Where theLocalParticipant
's signaling traffic enters and exits Twilio's communications cloud.getState()
Returns participant state.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 Details
-
getSid
Returns the SID of the local participant.- Specified by:
getSid
in interfaceParticipant
-
getIdentity
Returns the identity of the local participant.- Specified by:
getIdentity
in interfaceParticipant
-
getState
Returns participant state.- Specified by:
getState
in interfaceParticipant
-
getNetworkQualityLevel
Returns theLocalParticipant
's Network Quality Level.- Specified by:
getNetworkQualityLevel
in interfaceParticipant
- See Also:
-
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
Returns read-only list of audio track publications.- Specified by:
getAudioTracks
in interfaceParticipant
-
getVideoTracks
Returns read-only list of video track publications.- Specified by:
getVideoTracks
in interfaceParticipant
-
getDataTracks
Returns read-only list of data track publications.- Specified by:
getDataTracks
in interfaceParticipant
-
getLocalAudioTracks
Returns read-only list of local audio track publications. -
getLocalVideoTracks
Returns read-only list of local video track publications. -
getLocalDataTracks
Returns read-only list of local data track publications. -
publishTrack
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
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
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
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
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
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
Set listener for local participant events.- Parameters:
listener
- of local participant events.
-
setEncodingParameters
Updates theEncodingParameters
used to share media in the Room.- Parameters:
encodingParameters
- TheEncodingParameters
to use ornull
for the default values.
-