From 37391bd4846f0ffb534c071d3fa120b2f1c36610 Mon Sep 17 00:00:00 2001 From: Joseph Tam Date: Sun, 8 Sep 2024 23:12:53 +0800 Subject: [PATCH] fix: LiveStreamingServerBuilder --- src/LiveStreamingServerNet/LiveStreamingServerBuilder.cs | 3 ++- src/LiveStreamingServerNet/LiveStreamingServerNet.csproj | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/LiveStreamingServerNet/LiveStreamingServerBuilder.cs b/src/LiveStreamingServerNet/LiveStreamingServerBuilder.cs index aefcf0d3..c44c06d8 100644 --- a/src/LiveStreamingServerNet/LiveStreamingServerBuilder.cs +++ b/src/LiveStreamingServerNet/LiveStreamingServerBuilder.cs @@ -49,7 +49,8 @@ public ILiveStreamingServerBuilder ConfigureServer(Action c public ILiveStreamingServer Build() { Services.AddRtmpServer(_configureRtmpServer, _configureServer); - Services.AddHostedService(); + Services.AddSingleton(); + Services.AddHostedService(svc => svc.GetRequiredService()); Services.Configure(options => options.SuppressStatusMessages = true); diff --git a/src/LiveStreamingServerNet/LiveStreamingServerNet.csproj b/src/LiveStreamingServerNet/LiveStreamingServerNet.csproj index 8f737bdd..c3429aec 100644 --- a/src/LiveStreamingServerNet/LiveStreamingServerNet.csproj +++ b/src/LiveStreamingServerNet/LiveStreamingServerNet.csproj @@ -10,7 +10,7 @@ live-streaming;rtmp;flv;http-flv;websocket-flv;hls MIT true - 0.14.6 + 0.14.7