Description
LckService
is the central entry point for interacting with the LIV Capture Kit at runtime and the default implementation of ILckService
.
It provides APIs for starting and stopping recording or streaming, configuring capture settings (resolution, framerate, bitrate, orientation), managing audio, capturing photos, and controlling active cameras.
This service also exposes events for key lifecycle moments (recording started, stopped, paused, resumed, streaming events, photo saved, etc.), making it easy to integrate LCK into your application workflow.
Usage
-
Retrieve the service via DI:
- Configure capture options (resolution, framerate, bitrate) before starting capture.
-
Start recording or streaming with
StartRecording()
orStartStreaming()
. -
Subscribe to public events such as
OnRecordingStarted
,OnStreamingStopped
, orOnPhotoSaved
to react to capture lifecycle changes.
References
Events
Event | Type | Description |
---|---|---|
OnRecordingStarted | Action<LckResult > | Invoked when a recording session starts. |
OnRecordingStopped | Action<LckResult > | Invoked when a recording session stops. |
OnRecordingPaused | Action<LckResult > | Invoked when a recording session is paused. |
OnRecordingResumed | Action<LckResult > | Invoked when a recording session resumes. |
OnStreamingStarted | Action<LckResult > | Invoked when a live stream starts. |
OnStreamingStopped | Action<LckResult > | Invoked when a live stream stops. |
OnPhotoSaved | Action<LckResult > | Invoked when a photo capture is successfully saved. |
OnLowStorageSpace | Action<LckResult > | Invoked when low storage space is detected. |
OnRecordingSaved | Action<LckResult <RecordingData>> | Invoked when a recording has been successfully saved. |
OnActiveCameraSet | Action<LckResult <ILckCamera>> | Invoked when the active camera is changed. |
Methods
Method | Returns | Description |
---|---|---|
StartRecording() | LckResult | Starts recording to disk. |
StopRecording() | LckResult | Stops recording (reason defaults to UserStopped ). |
PauseRecording() | LckResult | Pauses an active recording. |
ResumeRecording() | LckResult | Resumes a paused recording. |
GetRecordingDuration() | LckResult <TimeSpan> | Gets the duration of the current recording. |
StartStreaming() | LckResult | Starts live streaming. |
StopStreaming([StopReason]) | LckResult | Stops live streaming (optional stop reason). |
GetStreamDuration() | LckResult <TimeSpan> | Gets the duration of the current stream. |
IsRecording() | LckResult <bool> | Returns whether recording is currently active. |
IsStreaming() | LckResult <bool> | Returns whether streaming is currently active. |
IsPaused() | LckResult <bool> | Returns whether the recording is paused. |
IsCapturing() | LckResult <bool> | Returns whether capture is active. |
SetTrackResolution(CameraResolutionDescriptor) | LckResult | Sets the capture resolution (only when not capturing). |
SetCameraOrientation(LckCameraOrientation) | LckResult | Sets the camera orientation (only when not capturing). |
SetTrackFramerate(uint) | LckResult | Sets the capture framerate (only when not capturing). |
SetTrackBitrate(uint) | LckResult | Sets the video bitrate (only when not capturing). |
SetTrackAudioBitrate(uint) | LckResult | Sets the audio bitrate (only when not capturing). |
SetTrackDescriptor(CameraTrackDescriptor) | LckResult | Sets the active camera track descriptor (only when not capturing). |
SetTrackDescriptor(LckCaptureType, CameraTrackDescriptor) | LckResult | Sets a track descriptor for a specific capture type. |
SetPreviewActive(bool) | LckResult | Enables or disables preview rendering. |
GetDescriptor() | LckResult <LckDescriptor> | Retrieves the current active track descriptor. |
CapturePhoto() | LckResult | Captures a still photo. |
GetActiveCaptureType() | LckResult <LckCaptureType> | Gets the current capture type (e.g. recording, streaming). |
SetActiveCaptureType(LckCaptureType) | LckResult | Sets the current capture type. |
SetActiveCamera(string cameraId, string monitorId = null) | LckResult | Sets the active camera by ID. |
GetActiveCamera() | LckResult <ILckCamera> | Gets the currently active camera. |
SetGameAudioCaptureActive(bool) | LckResult | Enables/disables game audio capture. |
SetMicrophoneCaptureActive(bool) | LckResult | Enables/disables microphone capture. |
SetMicrophoneGain(float) | LckResult | Sets microphone gain. |
SetGameAudioGain(float) | LckResult | Sets game audio gain. |
GetMicrophoneOutputLevel() | LckResult <float> | Gets the current microphone output level. |
GetGameOutputLevel() | LckResult <float> | Gets the current game audio output level. |
IsGameAudioMute() | LckResult <bool> | Returns whether game audio is muted. |
PreloadDiscreetAudio(AudioClip, float, bool) | LckResult | Preloads an audio clip for discreet playback. |
PlayDiscreetAudioClip(AudioClip) | LckResult | Plays a discreet audio clip once. |
StopAllDiscreetAudio() | LckResult | Stops all discreet audio clips. |