Beispiel #1
0
 public async Task <IActionResult> ServerStartedAsync([FromBody] Dictionary <string, string> dicts)
 {
     if (!ZLMediaKitWebHookEvents.OnServerStarted_IsNull)
     {
         _ = Task.Run(() =>
         {
             var config = new ServerConfig
             {
                 Api       = GetModel <ServerConfig.ApiConfig>(dicts, ServerConfig.ApiConfig.PrefixName),
                 Ffmpeg    = GetModel <ServerConfig.FfmpegConfig>(dicts, ServerConfig.FfmpegConfig.PrefixName),
                 General   = GetModel <ServerConfig.GeneralConfig>(dicts, ServerConfig.GeneralConfig.PrefixName),
                 Hls       = GetModel <ServerConfig.HlsConfig>(dicts, ServerConfig.HlsConfig.PrefixName),
                 Hook      = GetModel <ServerConfig.HookConfig>(dicts, ServerConfig.HookConfig.PrefixName),
                 Http      = GetModel <ServerConfig.HttpConfig>(dicts, ServerConfig.HttpConfig.PrefixName),
                 Multicast = GetModel <ServerConfig.MulticastConfig>(dicts, ServerConfig.MulticastConfig.PrefixName),
                 Record    = GetModel <ServerConfig.RecordConfig>(dicts, ServerConfig.RecordConfig.PrefixName),
                 Rtmp      = GetModel <ServerConfig.RtmpConfig>(dicts, ServerConfig.RtmpConfig.PrefixName),
                 Rtp       = GetModel <ServerConfig.RtpConfig>(dicts, ServerConfig.RtpConfig.PrefixName),
                 RtpProxy  = GetModel <ServerConfig.RtpProxyConfig>(dicts, ServerConfig.RtpProxyConfig.PrefixName),
                 Rtsp      = GetModel <ServerConfig.RtspConfig>(dicts, ServerConfig.RtspConfig.PrefixName),
                 Shell     = GetModel <ServerConfig.ShellConfig>(dicts, ServerConfig.ShellConfig.PrefixName)
             };
             SetServerInfo(config);
             ZLMediaKitWebHookEvents.OnServerStarted_Call(config);
         });
     }
     return(Json(new ResultBase()));
 }