Unity Live Guest Queue Tutorial
Build an audience and presenter room with com.mediasfu.unity@0.1.0-preview.2 in Unity 2022.3. Create a Unity project, add the package, and add the two scene scripts below. They select the appropriate conference, webinar, or broadcast profile and use the package's declared media dependency.
Prerequisites
- Unity 2022.3 or later.
- The
com.mediasfu.unitypackage at0.1.0-preview.2. Its package manifest declares the requiredcom.mediasfu.mediasoup-client-unitymedia bridge. - A self-hosted MediaSFU endpoint or a development-only, revocable Cloud credential supplied outside the Unity project. The current Unity package has no credential-free Cloud handoff, so a distributed Cloud application needs its authenticated backend boundary.
Project files
First copy the Unity Complete Starter. It contains the manifest and both scripts, and explains exactly which GameObject receives them. For this outcome, choose Live Guest Queue in the Inspector.
The starter pins the room package:
{
"dependencies": {
"com.mediasfu.unity": "0.1.0-preview.2"
}
}
The two scripts are complete in the starter. Add both to one empty GameObject; the room component attaches the package-native WebRTC device before it connects.
var eventType = GetComponent<MediaSFU.Unity.Starter.ProductScenarioRoom>()?.EventType ?? MediaSfuEventType.Conference;
Run
Open your Unity project:
Unity.exe -projectPath .
Select the GameObject, set a display name, either enter a meeting ID or select host creation, and choose the configured self-hosted endpoint when applicable. Enter Play mode. For full scene controls such as moderation, waiting, polls, breakouts, whiteboard, and recording, add the package's MediaSfuBasicRoomFlow sample component to the scene.
Expected result
The component creates or joins the selected room profile, attaches its media backend, and reports a failed connection in the Unity Console instead of silently continuing. With an authorized room and native plugin available, verify local media, a second participant's media, and normal leave.
Recovery
If the native media plugin cannot be created, inspect the Unity Console and install the package's platform plugin before retrying. If room access fails, leave the scene usable and request a new approved entry from the application backend. Do not add a reusable Cloud credential to a scene, player build, log, or source control.
Cleanup
Close the scene or leave the room. The component calls LeaveRoomAsync, disposes the room client and WebRTC device, and your scene should also unsubscribe its own events, stop meters or timers, discard cached authorization, and rebuild room state only after a new approved entry.