Skip to main content
Module: LCKStreaming | Version: 1.0 | Platforms: Win64, Android (Quest)

Overview

This guide walks through enabling and using LCKStreaming from C++ in five steps. By the end, your game will authenticate with the LIV backend and stream to YouTube, Twitch, or a manual RTMP endpoint.
Before you begin, ensure you have a LIV developer account, a valid Tracking ID, and an active streaming subscription. See the Streaming Overview for all prerequisites.

Step 1: Enable Streaming

In Project Settings → Plugins → LCK SDK → Features, enable bEnableStreaming. You can also set it in your DefaultGame.ini:
[/Script/LCKCore.LCKDeveloperSettings]
bEnableStreaming=true

Step 2: Add Module Dependencies

// YourProject.Build.cs
PublicDependencyModuleNames.AddRange(new string[] {
    "LCKStreaming",
    "LCKCore"
});

Step 3: Access the Subsystem

ULCKStreamingSubsystem is a UGameInstanceSubsystem. Access it from any point where you have a valid game instance.
#include "LCKStreamingSubsystem.h"

ULCKStreamingSubsystem* Streaming =
    GetGameInstance()->GetSubsystem<ULCKStreamingSubsystem>();

Step 4: Authenticate and Stream

The minimum flow is: start login, wait for authentication, then start streaming.
void UMyStreamingManager::BeginStreaming()
{
    ULCKStreamingSubsystem* Streaming =
        GetGameInstance()->GetSubsystem<ULCKStreamingSubsystem>();

    if (!Streaming)
    {
        return;
    }

    // Bind delegates before starting login
    Streaming->OnPairingCodeReceived.AddDynamic(
        this, &UMyStreamingManager::HandlePairingCode);
    Streaming->OnAuthenticated.AddDynamic(
        this, &UMyStreamingManager::HandleAuthenticated);
    Streaming->OnStreamStarted.AddDynamic(
        this, &UMyStreamingManager::HandleStreamStarted);
    Streaming->OnStreamStopped.AddDynamic(
        this, &UMyStreamingManager::HandleStreamStopped);
    Streaming->OnStreamError.AddDynamic(
        this, &UMyStreamingManager::HandleStreamError);

    // Begin device pairing
    Streaming->StartLogin();
}

void UMyStreamingManager::HandlePairingCode(const FString& Code)
{
    // Display this code in your UI
    // User enters it at dashboard.liv.tv/pair
    UE_LOG(LogTemp, Log, TEXT("Pairing code: %s"), *Code);
}

void UMyStreamingManager::HandleAuthenticated()
{
    UE_LOG(LogTemp, Log, TEXT("Authenticated — starting stream"));

    ULCKStreamingSubsystem* Streaming =
        GetGameInstance()->GetSubsystem<ULCKStreamingSubsystem>();

    if (Streaming && Streaming->HasStreamingTarget())
    {
        Streaming->StartStreaming();
    }
}

void UMyStreamingManager::HandleStreamStarted()
{
    UE_LOG(LogTemp, Log, TEXT("Stream is live"));
}

void UMyStreamingManager::HandleStreamStopped()
{
    UE_LOG(LogTemp, Log, TEXT("Stream stopped"));
}

void UMyStreamingManager::HandleStreamError(const FString& ErrorMessage)
{
    UE_LOG(LogTemp, Error, TEXT("Stream error: %s"), *ErrorMessage);
}

Step 5: Stop Streaming

void UMyStreamingManager::EndStreaming()
{
    ULCKStreamingSubsystem* Streaming =
        GetGameInstance()->GetSubsystem<ULCKStreamingSubsystem>();

    if (Streaming && Streaming->IsStreaming())
    {
        Streaming->StopStreaming();
    }
}

Complete State Check Example

Use the state query methods to build your UI:
void UMyStreamingWidget::UpdateUI()
{
    ULCKStreamingSubsystem* Streaming =
        GetGameInstance()->GetSubsystem<ULCKStreamingSubsystem>();

    if (!Streaming)
    {
        return;
    }

    // Authentication state
    bool bLoggedIn = Streaming->IsAuthenticated();

    // Subscription check
    bool bCanStream = Streaming->HasActiveSubscription();

    // Target info
    bool bHasTarget = Streaming->HasStreamingTarget();
    FString TargetName = Streaming->GetStreamingTargetName(); // "YouTube", "Twitch", "Manual"

    // Stream state
    bool bIsLive = Streaming->IsStreaming();
    bool bIsStarting = Streaming->IsStartingOrStreaming();
}

All Available Delegates

DelegateSignatureWhen
OnPairingCodeReceivedFOnLCKPairingCodeReceived(const FString&, Code)Pairing code ready for display
OnAuthenticatedFOnLCKAuthenticated()Login succeeded
OnStreamingConfigReceivedFOnLCKStreamingConfigReceived(ELCKStreamingTargetType, const FLCKUserSubscription&)Config loaded from server
OnStreamStartedFOnLCKStreamStarted()RTMP connection active
OnStreamStoppedFOnLCKStreamStopped()Stream ended cleanly
OnStreamErrorFOnLCKStreamError(const FString&, ErrorMessage)An error occurred
OnLoggedOutFOnLCKLoggedOut()User logged out
Always bind delegates before calling StartLogin() or StartStreaming() to avoid missing events that fire quickly.

Troubleshooting

  1. Check IsAuthenticated() — the user must be logged in first
  2. Check HasStreamingTarget() — the streaming config must be loaded
  3. Check HasActiveSubscription() — an active subscription is required
  4. Verify bEnableStreaming is true in project settings
  5. Check LogLCKStreaming for detailed error output
  1. Check OnStreamError for the error message
  2. Verify network connectivity to the RTMP ingest server
  3. Ensure the encoder is available (not locked by another process)
  4. The health check allows 2 consecutive failures before stopping — check logs for encoder health warnings
  1. Verify network connectivity to dashboard.liv.tv
  2. Check that the Tracking ID is valid
  3. Look for errors in LogLCKStreaming

See Also