MediaSFU Shared
    Preparing search index...

    Function runMediaControl

    • Invoke a media control safely from a headless surface.

      Gates on getRoomReadiness first — firing clickVideo before the transport exists fails silently and looks like a dead button — then resolves the control off the current bag rather than a snapshot the caller captured earlier.

      Parameters

      Returns Promise<HeadlessActionResult>

      import { runMediaControl } from 'mediasfu-shared';

      await runMediaControl({ parameters, control: 'clickVideo' });
      await runMediaControl({
      parameters,
      control: 'switchVideo',
      extra: { videoPreference: deviceId },
      });