@twilio/video-node-sdk - v1.0.0-rc.3
    Preparing search index...

    Interface LocalDataTrack

    A local data track for sending string or binary messages. Create via createLocalDataTrack.

    interface LocalDataTrack {
        kind: "data";
        maxPacketLifeTime: number | null;
        maxRetransmits: number | null;
        name: string;
        ordered: boolean;
        reliable: boolean;
        send(data: string | Buffer<ArrayBufferLike>): Promise<DataTrackSendResult>;
    }
    Index
    kind: "data"

    Always 'data'.

    maxPacketLifeTime: number | null

    The maximum period of time in milliseconds in which retransmissions will be sent, as passed to createLocalDataTrack, or null when unset.

    maxRetransmits: number | null

    The maximum number of times a message is retransmitted before being given up on, as passed to createLocalDataTrack, or null when unset.

    name: string

    Track name, unique across the local participant's published tracks.

    ordered: boolean

    Whether messages are delivered in the order they were sent.

    reliable: boolean

    Whether delivery is reliable (neither retransmit limit set).

    • Send a message to all subscribed remote participants.

      The returned promise always resolves - never rejects - so a fire-and-forget send() cannot produce an unhandled rejection. Await it only when the outcome matters.

      Parameters

      • data: string | Buffer<ArrayBufferLike>

      Returns Promise<DataTrackSendResult>

      Synchronously, if the message exceeds 64 KB (kMaxMessageSize). Oversize messages are never transmitted.

      Synchronously, if data is not a string or Buffer.