Use on_hls segments

This commit is contained in:
2023-07-31 12:07:51 +01:00
parent d336c8aaa9
commit 55c96a73b9
5 changed files with 88 additions and 23 deletions

View File

@ -75,17 +75,18 @@ public class SrsController : Controller
return new();
}
if (req.Action == "on_hls" && req.Duration.HasValue && !string.IsNullOrEmpty(req.ClientId))
if (req.Action == "on_hls" && req.Duration.HasValue && !string.IsNullOrEmpty(req.ClientId) && !string.IsNullOrEmpty(req.File))
{
await streamManager.ConsumeQuota(req.Duration.Value);
return new();
}
if (req.Action == "on_dvr" && !string.IsNullOrEmpty(req.File))
{
await streamManager.OnDvr(new Uri(_config.SrsHttpHost, $"{req.App}/{Path.GetFileName(req.File)}"));
return new();
}
/*if (req.Action == "on_dvr" && !string.IsNullOrEmpty(req.File))
{
await streamManager.OnDvr(new Uri(_config.SrsHttpHost, $"{req.App}/{Path.GetFileName(req.File)}"));
return new();
}*/
}
else
{