|
@@ -1436,7 +1436,7 @@ namespace WingDeviceService.Service
|
|
|
Logger.WriteLineInfo($"DeviceService ReportLiveStateAsync, [{tokenInfo.AccountType.ToString()}]{tokenInfo.AccountName}, state:{request.LiveState.ToString()}, message:{request.Message}");
|
|
|
break;
|
|
|
}
|
|
|
- if (request.LiveState == DeviceLiveStateEnum.Pushing || request.LiveState == DeviceLiveStateEnum.Closed)
|
|
|
+ if (request.LiveState == DeviceLiveStateEnum.Closed)
|
|
|
{
|
|
|
var liveRoom = await _rtcService.GetInitiatingRoomByDeviceCodeAsync(new GetInitiatingRoomByDeviceCodeRequest
|
|
|
{
|
|
@@ -1447,7 +1447,7 @@ namespace WingDeviceService.Service
|
|
|
var expireTime = DateTime.UtcNow.AddSeconds(_reportStateTimeout * -1);
|
|
|
var validViewers = liveRoom.ViewerInfos.Where(x => x.LastReportTime >= expireTime)?.ToList() ?? new List<LiveViewerDTO>();
|
|
|
|
|
|
- if (request.LiveState == DeviceLiveStateEnum.Closed && validViewers.Any())
|
|
|
+ if (validViewers.Any())
|
|
|
{
|
|
|
//关闭直播 to users
|
|
|
var message = new DeviceLiveFinishedNotification
|
|
@@ -1456,13 +1456,10 @@ namespace WingDeviceService.Service
|
|
|
};
|
|
|
await BroadcastNotificationAsync(liveRoom.LiveRoomCode, validViewers.Select(x => x.UserCode).ToList(), message);
|
|
|
}
|
|
|
- if (request.LiveState == DeviceLiveStateEnum.Pushing && !validViewers.Any())
|
|
|
+ await _rtcService.CloseAsync(new CloseRequest
|
|
|
{
|
|
|
- await _rtcService.CloseAsync(new CloseRequest
|
|
|
- {
|
|
|
- LiveRoomCode = liveRoom.LiveRoomCode
|
|
|
- });
|
|
|
- }
|
|
|
+ LiveRoomCode = liveRoom.LiveRoomCode
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
|