Skip to main content

Latency Configuration

info

As of 2023, Samsung states that Tizen TV's are not optimized for .NET applications. Samsung strongly recommends using JS/Web applications instead of C#/.NET applications for TVs. Please check the Lura Player Web SDK

Some live streams can be delivered through both a standard media source and a lower-latency media source. Lura Player exposes a single latency mode contract so your application can detect when low latency playback is available, request it at startup, switch to it at runtime, and restrict it per viewer.

There are two latency modes:

  • Default ("def") — uses the standard content.media source list. Always available for valid content.
  • Low latency ("low") — uses the optional content.lowLatencyMedia source list. Available only when a low-latency source is provided.

Low latency playback applies to live and DVR-capable live content. It is not used for VOD content.

How low latency media is provided

When playback is resolved through Akta Cloud (app key + asset id), the low-latency source is returned automatically in content.lowLatencyMedia for live content that has one configured. For direct media configuration, provide it alongside content.media:

Latency Configuration
var config = new Configuration
{
Content = new ContentConfiguration
{
Media = new List<ContentMedia>
{
new ContentMedia
{
Url = "https://example.com/default.m3u8",
Type = MediaMimeType.VideoHls
}
},
LowLatencyMedia = new List<ContentMedia>
{
new ContentMedia
{
Url = "https://example.com/low-latency.m3u8",
Type = MediaMimeType.VideoHls
}
}
}
};

await player.SetConfig(config);

content.lowLatencyMedia uses the same item shape and MIME types as content.media. When it is present and contains at least one valid playable item, low latency mode becomes available.

Requesting an initial latency mode

Use initialization.video.latencyMode to request the mode the player should start in. See Initialization Configuration for the full option set.

Latency Configuration
var config = new Configuration
{
Initialization = new InitializationConfiguration
{
Video = new VideoInitializationConfiguration
{
LatencyMode = LatencyModes.LowLatency
}
}
};

await player.SetConfig(config);

If "low" is requested but low latency mode is not available, the player falls back to "def" and starts with content.media. This fallback is not treated as an error.

Restricting which modes are exposed

Use latency.allowedModes to restrict which latency modes the player may expose for the viewer. This is useful for entitlement or premium-user gating.

Latency Configuration
var config = new Configuration
{
Latency = new LatencyConfiguration
{
AllowedModes = new LatencyAllowedModes
{
Low = false
}
}
};

await player.SetConfig(config);

When allowedModes.low is false, the low-latency source is not returned even if one is available. Default latency ("def") is always enabled and is not represented in allowedModes.

Reading availability and switching modes at runtime

You can check which modes are available and switch between them while playback is active. These methods are documented in the Player Methods Reference.

Latency Configuration
// Read the current latency mode
var mode = player.GetLatencyMode();

// Read which modes are available for the current content
var availability = player.GetLatencyModeAvailability();

// Switch to low latency mode
player.SetLatencyMode(LatencyModes.LowLatency);

SetLatencyMode switches to the requested mode only when it is available. If the mode is unavailable, invalid, or already active, the call is a no-op and does not throw.

Reacting to latency mode changes

Listen to the LATENCY_MODE_CHANGED event to update your UI when availability becomes ready or when the effective mode changes.

Latency Configuration
player.AddListener((@event) =>
{
if (@event.Type == UnifiedEventName.LatencyModeChanged)
{
var data = (LatencyModeChanged)@event.Data;
Console.WriteLine(data.LatencyMode); // LatencyModes.Default or LatencyModes.LowLatency
Console.WriteLine(data.Availability); // { Default=true, LowLatency=true }
}
});

The event is emitted when availability for the active content is ready, and again whenever the effective latency mode changes after a successful SetLatencyMode call, a content change, or a DVR live-edge transition.