@twilio/video-node-sdk - v1.0.0-beta.2
    Preparing search index...

    Function createLocalDataTrack

    • Create a LocalDataTrack for sending arbitrary string or binary messages. The track defaults to reliable, ordered delivery; pass maxRetransmits or maxPacketLifeTime to make it unreliable.

      Parameters

      Returns LocalDataTrack

      The created LocalDataTrack.

      If options is not a string or object, if name is not a non-empty string, or if ordered is not a boolean.

      If both maxRetransmits and maxPacketLifeTime are set.

      If either maxRetransmits or maxPacketLifeTime is not an integer in [0, 65535].

      // Reliable, ordered messaging.
      const dataTrack = createLocalDataTrack('chat');
      room.localParticipant.publishTrack(dataTrack);
      dataTrack.send('hello');
      // Unreliable, time-bounded delivery.
      const dataTrack = createLocalDataTrack({ name: 'telemetry', maxPacketLifeTime: 1000 });