Package com.twilio.video
Class LocalDataTrack
java.lang.Object
com.twilio.video.DataTrack
com.twilio.video.LocalDataTrack
- All Implemented Interfaces:
Track
A data track represents a unidirectional data source that can be used to send messages to
participants of a
Room
.-
Method Summary
Modifier and TypeMethodDescriptionstatic LocalDataTrack
create
(android.content.Context context) Creates a local data track with no name andDataTrackOptions.DEFAULT_DATA_TRACK_OPTIONS
.static LocalDataTrack
create
(android.content.Context context, DataTrackOptions dataTrackOptions) Creates a local data track with no name and provided data track options.getName()
Returns the local data track name.boolean
Check if this data track is enabled.void
release()
Releases native memory owned by data track.void
Send string message.void
send
(ByteBuffer messageBuffer) Send binary message.Methods inherited from class com.twilio.video.DataTrack
getMaxPacketLifeTime, getMaxRetransmits, isOrdered, isReliable
-
Method Details
-
create
Creates a local data track with no name andDataTrackOptions.DEFAULT_DATA_TRACK_OPTIONS
.- Parameters:
context
- application context.- Returns:
- local data track
-
create
@Nullable public static LocalDataTrack create(@NonNull android.content.Context context, @Nullable DataTrackOptions dataTrackOptions) Creates a local data track with no name and provided data track options.- Parameters:
context
- application context.dataTrackOptions
- data track options.- Returns:
- local data track.
-
send
Send binary message. The maximum amount of data that can be sent cross-platform in a single invocation of send() is 16KiB. You could possibly send more when both the sender and the receiver are on the same platform.- Parameters:
messageBuffer
- binary message- See Also:
-
send
Send string message. The maximum amount of data that can be sent cross-platform in a single invocation of send() is 16KiB. You could possibly send more when both the sender and the receiver are on the same platform.- Parameters:
message
- string message.- See Also:
-
isEnabled
public boolean isEnabled()Description copied from class:DataTrack
Check if this data track is enabled. -
getName
Returns the local data track name. A pseudo random string is returned if no track name was specified. -
release
public void release()Releases native memory owned by data track.
-