Package com.twilio.video
Class LocalDataTrack
- java.lang.Object
-
- com.twilio.video.DataTrack
-
- com.twilio.video.LocalDataTrack
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static 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.java.lang.String
getName()
Returns the local data track name.boolean
isEnabled()
Check if this data track is enabled.void
release()
Releases native memory owned by data track.void
send(java.lang.String message)
Send string message.void
send(java.nio.ByteBuffer messageBuffer)
Send binary message.-
Methods inherited from class com.twilio.video.DataTrack
getMaxPacketLifeTime, getMaxRetransmits, isOrdered, isReliable
-
-
-
-
Method Detail
-
create
@Nullable public static LocalDataTrack create(@NonNull android.content.Context context)
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
public void send(@NonNull java.nio.ByteBuffer messageBuffer)
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:
- Understanding Message Size Limits
-
send
public void send(@NonNull java.lang.String message)
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:
- Understanding Message Size Limits
-
isEnabled
public boolean isEnabled()
Description copied from class:DataTrack
Check if this data track is enabled.
-
getName
@NonNull public java.lang.String 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.
-
-