fix: cap automatic playout refreshes
This commit is contained in:
@@ -75,4 +75,13 @@ public sealed class PlayoutOptions
|
||||
public int MaximumReconnectAttempts { get; set; } = 3;
|
||||
|
||||
public bool ReconnectEnabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Optional trusted local safety ceiling for timer-driven same-scene refreshes
|
||||
/// started by one TAKE IN. Null preserves the legacy continuous-refresh behavior;
|
||||
/// zero disables automatic refresh; a positive value stops after that many
|
||||
/// successful refresh dispatches and drains the final play callback before
|
||||
/// reporting that the limit was reached. Web content cannot change this value.
|
||||
/// </summary>
|
||||
public int? MaximumAutomaticRefreshesPerTakeIn { get; set; }
|
||||
}
|
||||
|
||||
@@ -98,6 +98,14 @@ internal sealed record ValidatedPlayoutOptions(
|
||||
0,
|
||||
1_000,
|
||||
nameof(options.MaximumReconnectAttempts));
|
||||
if (options.MaximumAutomaticRefreshesPerTakeIn is { } maximumAutomaticRefreshes)
|
||||
{
|
||||
RequireRange(
|
||||
maximumAutomaticRefreshes,
|
||||
0,
|
||||
1_000_000,
|
||||
nameof(options.MaximumAutomaticRefreshesPerTakeIn));
|
||||
}
|
||||
|
||||
Regex? titleRegex = null;
|
||||
var allowlist = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
Reference in New Issue
Block a user