Example #1
0
 public void Check(TriggerType type = TriggerType.HttpApiRecheck)
 {
     if (BililiveAPI.GetRoomInfo(Roomid).isStreaming)
     {
         _StartRecord(type);
     }
 }
 private void HttpCheck()
 {
     try
     {
         if (BililiveAPI.GetRoomInfo(Roomid).isStreaming)
         {
             _StartRecord(TriggerType.HttpApi);
         }
     }
     catch (Exception ex)
     {
         logger.Log(Roomid, LogLevel.Warn, "获取直播间开播状态出错", ex);
     }
 }
Example #3
0
        public void Check(TriggerType type, int millisecondsDelay = 0)
        {
            if (disposedValue)
            {
                throw new ObjectDisposedException(nameof(StreamMonitor));
            }

            if (millisecondsDelay < 0)
            {
                throw new ArgumentOutOfRangeException(nameof(millisecondsDelay), "不能小于0");
            }

            Task.Run(() =>
            {
                Task.Delay(millisecondsDelay).Wait();
                if (BililiveAPI.GetRoomInfo(Roomid).isStreaming)
                {
                    StreamStatusChanged?.Invoke(this, new StreamStatusChangedArgs()
                    {
                        type = type
                    });
                }
            });
        }