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
UseLckService 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.
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 — Recording
| 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. |
| IsRecording() | LckResult<bool> | Returns whether recording is currently active. |
| IsPaused() | LckResult<bool> | Returns whether the recording is paused. |
Methods — Streaming
| Method | Returns | Description |
|---|---|---|
| StartStreaming() | LckResult | Starts live streaming. |
| StopStreaming([StopReason]) | LckResult | Stops 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
| Method | Returns | Description |
|---|---|---|
| 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. |
| GetDescriptor() | LckResult<LckDescriptor> | Retrieves the current active track descriptor. |
| SetPreviewActive(bool) | LckResult | Enables 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) | LckResult | Sets the current capture type. |
| CapturePhoto() | LckResult | Captures a still photo. |
Methods — Camera
Methods — Audio
| Method | Returns | Description |
|---|---|---|
| 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. |
See Also
- ILckService — Interface that LckService implements; use for DI injection
- LckResult — Result type returned by all service methods
- LckDescriptor — Wrapper for active capture settings returned by GetDescriptor
- CameraTrackDescriptor — Resolution/framerate/bitrate configuration struct
- LckStreamingController — Higher-level streaming workflow built on LckService
- LCKCameraController — Higher-level camera controller that uses LckService internally