Skip to main content

Description

LckMediator is a static utility that coordinates registration and lookup of cameras (ILckCamera) and monitors (ILckMonitor) within LCK. It maintains collections of active cameras and monitors, raises events when they are registered or unregistered, and forwards monitor-to-camera assignments to downstream systems like mixers. In most cases you won’t call LckMediator directly — LckCamera and LckMonitor register and unregister themselves automatically during their lifecycle. Use it when you need manual control over custom camera/monitor implementations or want to react to registration events.

Usage

Manually registering a custom ILckCamera implementation

var customCamera = new CustomLckCamera(); 
LckMediator.RegisterCamera(customCamera);

var foundCamera = LckMediator.GetCameraById(customCamera.CameraId);
if (foundCamera != null)
    Debug.Log($"Camera {foundCamera.CameraId} is registered.");

// When cleaning up
LckMediator.UnregisterCamera(customCamera);

Reacting to camera/monitor registration events

LckMediator.CameraRegistered += cam =>
    Debug.Log($"Camera registered: {cam.CameraId}");

LckMediator.MonitorRegistered += mon =>
    Debug.Log($"Monitor registered: {mon.MonitorId}");

References

Events

EventTypeDescription
CameraRegisteredAction<ILckCamera>Invoked when a new camera is registered.
CameraUnregisteredAction<ILckCamera>Invoked when a camera is unregistered.
MonitorRegisteredAction<ILckMonitor>Invoked when a new monitor is registered.
MonitorUnregisteredAction<ILckMonitor>Invoked when a monitor is unregistered.
MonitorToCameraAssignmentAction<string, string>Invoked when a monitor is assigned to a camera.

Methods

MethodReturnsDescription
RegisterCamera(ILckCamera)voidRegisters a camera if not already present.
UnregisterCamera(ILckCamera)voidUnregisters a camera by ID.
RegisterMonitor(ILckMonitor)voidRegisters a monitor if not already present.
UnregisterMonitor(ILckMonitor)voidUnregisters a monitor by ID.
GetCameraById(string id)ILckCameraRetrieves a registered camera by its ID.
GetMonitorById(string id)ILckMonitorRetrieves a registered monitor by its ID.
GetCameras()IEnumerable<ILckCamera>Returns all currently registered cameras.
GetMonitors()IEnumerable<ILckMonitor>Returns all currently registered monitors.
NotifyMixerAboutMonitorForCamera(string, string)voidNotifies listeners about an assignment between monitor and camera.

See Also

  • LckCamera — MonoBehaviour that auto-registers with LckMediator on enable
  • LckMonitor — MonoBehaviour that auto-registers with LckMediator on enable
  • ILckCamera — Interface for custom camera implementations
  • ILckMonitor — Interface for custom monitor implementations