Skip to main content

Description

LckService is the main runtime API for the LIV Camera Kit and the default implementation of ILckService. It provides methods for starting/stopping recording and streaming, configuring capture settings (resolution, framerate, bitrate, orientation), managing game and microphone audio, capturing photos, and switching active cameras. It also exposes events for every capture lifecycle moment — recording started, stopped, paused, resumed, streaming events, photo saved, and more.

Usage

Use LckService as the central hub for all capture operations. Inject it via DI, configure your capture settings, then call recording/streaming methods and subscribe to events.
[InjectLck] private ILckService _lckService;

// Configure capture before starting
_lckService.SetTrackResolution(new CameraResolutionDescriptor(1920, 1080));
_lckService.SetTrackFramerate(30);
_lckService.SetTrackBitrate(8000000);

// Subscribe to events
_lckService.OnRecordingStarted += result => Debug.Log("Recording started");
_lckService.OnRecordingStopped += result => Debug.Log("Recording stopped");

// Start recording
_lckService.StartRecording();

References

Events

EventTypeDescription
OnRecordingStartedAction<LckResult>Invoked when a recording session starts.
OnRecordingStoppedAction<LckResult>Invoked when a recording session stops.
OnRecordingPausedAction<LckResult>Invoked when a recording session is paused.
OnRecordingResumedAction<LckResult>Invoked when a recording session resumes.
OnStreamingStartedAction<LckResult>Invoked when a live stream starts.
OnStreamingStoppedAction<LckResult>Invoked when a live stream stops.
OnPhotoSavedAction<LckResult>Invoked when a photo capture is successfully saved.
OnLowStorageSpaceAction<LckResult>Invoked when low storage space is detected.
OnRecordingSavedAction<LckResult<RecordingData>>Invoked when a recording has been successfully saved.
OnActiveCameraSetAction<LckResult<ILckCamera>>Invoked when the active camera is changed.

Methods — Recording

MethodReturnsDescription
StartRecording()LckResultStarts recording to disk.
StopRecording()LckResultStops recording (reason defaults to UserStopped).
PauseRecording()LckResultPauses an active recording.
ResumeRecording()LckResultResumes a paused recording.
GetRecordingDuration()LckResult<TimeSpan>Gets the duration of the current recording.
IsRecording()LckResult<bool>Returns whether recording is currently active.
IsPaused()LckResult<bool>Returns whether the recording is paused.

Methods — Streaming

MethodReturnsDescription
StartStreaming()LckResultStarts live streaming.
StopStreaming([StopReason])LckResultStops live streaming (optional stop reason).
GetStreamDuration()LckResult<TimeSpan>Gets the duration of the current stream.
IsStreaming()LckResult<bool>Returns whether streaming is currently active.

Methods — Capture Settings

MethodReturnsDescription
SetTrackResolution(CameraResolutionDescriptor)LckResultSets the capture resolution (only when not capturing).
SetCameraOrientation(LckCameraOrientation)LckResultSets the camera orientation (only when not capturing).
SetTrackFramerate(uint)LckResultSets the capture framerate (only when not capturing).
SetTrackBitrate(uint)LckResultSets the video bitrate (only when not capturing).
SetTrackAudioBitrate(uint)LckResultSets the audio bitrate (only when not capturing).
SetTrackDescriptor(CameraTrackDescriptor)LckResultSets the active camera track descriptor (only when not capturing).
SetTrackDescriptor(LckCaptureType, CameraTrackDescriptor)LckResultSets a track descriptor for a specific capture type.
GetDescriptor()LckResult<LckDescriptor>Retrieves the current active track descriptor.
SetPreviewActive(bool)LckResultEnables or disables preview rendering.
IsCapturing()LckResult<bool>Returns whether capture is active.
GetActiveCaptureType()LckResult<LckCaptureType>Gets the current capture type (e.g. recording, streaming).
SetActiveCaptureType(LckCaptureType)LckResultSets the current capture type.
CapturePhoto()LckResultCaptures a still photo.

Methods — Camera

MethodReturnsDescription
SetActiveCamera(string cameraId, string monitorId = null)LckResultSets the active camera by ID.
GetActiveCamera()LckResult<ILckCamera>Gets the currently active camera.

Methods — Audio

MethodReturnsDescription
SetGameAudioCaptureActive(bool)LckResultEnables/disables game audio capture.
SetMicrophoneCaptureActive(bool)LckResultEnables/disables microphone capture.
SetMicrophoneGain(float)LckResultSets microphone gain.
SetGameAudioGain(float)LckResultSets 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)LckResultPreloads an audio clip for discreet playback.
PlayDiscreetAudioClip(AudioClip)LckResultPlays a discreet audio clip once.
StopAllDiscreetAudio()LckResultStops all discreet audio clips.

See Also