Function waitForTrackPublication

  • Parameters

    • __namedParameters: {
          identity?: string;
          kind: TrackKind;
          room: Room;
          signal?: AbortSignal;
          waitForSubscription?: boolean;
      }
      • Optional identity?: string

        Restrict matching to a specific participant identity. When omitted (or undefined), matches whichever remote participant publishes a matching track first. Pass '' to match no one (rare, use undefined instead).

      • kind: TrackKind
      • room: Room
      • Optional signal?: AbortSignal

        Optional AbortSignal that rejects the promise and detaches all room listeners when fired. Without this, callers that lose interest in the publication leak listeners until the room disconnects.

      • Optional waitForSubscription?: boolean

        If true, only resolve once the matching track is subscribed (i.e. publication.subscribed is true and publication.track is set). Mirrors python wait_for_track_publication(wait_for_subscription=True).

    Returns Promise<RemoteTrackPublication>