Package 

Class LocalDataTrack

  • 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 LocalDataTrack create(@NonNull() Context context) Creates a local data track with no name and .
      static LocalDataTrack create(@NonNull() Context context, @Nullable() DataTrackOptions dataTrackOptions) Creates a local data track with no name and provided data track options.
      synchronized void send(@NonNull() ByteBuffer messageBuffer) Send binary message.
      synchronized void send(@NonNull() String message) Send string message.
      synchronized boolean isEnabled() Check if this data track is enabled.
      String getName() Returns the local data track name.
      synchronized void release() Releases native memory owned by data track.
      • Methods inherited from class com.twilio.video.DataTrack

        getMaxPacketLifeTime, getMaxRetransmits, isOrdered, isReliable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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.