-
- All Implemented Interfaces:
-
com.twilio.video.Track
public class LocalDataTrack extends DataTrack
A data track represents a unidirectional data source that can be used to send messages to participants of a Room.
-
-
Method Summary
Modifier and Type Method Description static LocalDataTrackcreate(@NonNull() Context context)Creates a local data track with no name and . static LocalDataTrackcreate(@NonNull() Context context, @Nullable() DataTrackOptions dataTrackOptions)Creates a local data track with no name and provided data track options. synchronized voidsend(@NonNull() ByteBuffer messageBuffer)Send binary message. synchronized voidsend(@NonNull() String message)Send string message. synchronized booleanisEnabled()Check if this data track is enabled. StringgetName()Returns the local data track name. synchronized voidrelease()Releases native memory owned by data track. -
-
Method Detail
-
create
@Nullable() static LocalDataTrack create(@NonNull() Context context)
- Parameters:
context- application context.
-
create
@Nullable() static LocalDataTrack create(@NonNull() 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.
-
send
synchronized void send(@NonNull() ByteBuffer messageBuffer)
Send binary message. The maximum amount of data that can be sent cross-platform in a singleinvocation of send() is 16KiB. You could possibly send more when both the sender and thereceiver are on the same platform.
- Parameters:
messageBuffer- binary message
-
send
synchronized void send(@NonNull() String message)
Send string message. The maximum amount of data that can be sent cross-platform in a singleinvocation of send() is 16KiB. You could possibly send more when both the sender and thereceiver are on the same platform.
- Parameters:
message- string message.
-
isEnabled
synchronized boolean isEnabled()
Check if this data track is enabled.
-
getName
@NonNull() String getName()
Returns the local data track name. A pseudo random string is returned if no track name wasspecified.
-
release
synchronized void release()
Releases native memory owned by data track.
-
-
-
-