MediaSFU Shared
    Preparing search index...

    Function getRemoteVideoStreams

    • Every remote camera in the room, in render order.

      Two details make this hard to get right by hand, and both are why headless integrations lose the host's video:

      • oldAllStreams matters. During normal conference layout processing the SDK moves a stream out of allVideoStreams into oldAllStreams. Reading only allVideoStreams makes the host disappear mid-call.
      • The self marker must go. allVideoStreams is seeded with a producerId: 'youyou' placeholder for the local user.

      Entries are de-duplicated by producerId, falling back to the stream id, so a stream present in both collections is returned once.

      Parameters

      Returns ResolvedMedia[]

      import { getRemoteVideoStreams } from 'mediasfu-shared';

      const remotes = getRemoteVideoStreams({ parameters });
      const primary = remotes[0]?.stream ?? null;