-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
153 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Core.LogModule; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Security.Cryptography; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Core.RuntimeObject.Download | ||
{ | ||
public class Snapshot | ||
{ | ||
/// <summary> | ||
/// 生成录制中的直播间快照用于切片 | ||
/// </summary> | ||
/// <param name="Uid"></param> | ||
/// <returns></returns> | ||
public static (bool state,string message) CreateRecordingSnapshot(long Uid) | ||
{ | ||
if (Uid == 0) return (false,"UID不能为空"); | ||
|
||
RoomCardClass Card = new(); | ||
if (!_Room.GetCardForUID(Uid, ref Card) || Card == null || !Card.DownInfo.IsDownload) return (false,"当前房间未开播或未录制"); | ||
|
||
string videoFile = Card.DownInfo.DownloadFileList.CurrentOperationVideoFile; | ||
if (!File.Exists(videoFile)) return (false,"当前直播间还未开始录制流"); | ||
|
||
string tempFile = $"{Core.Config.Core_RunConfig._TemporaryFileDirectory}{Path.GetFileName(videoFile)}"; | ||
File.Copy(videoFile, tempFile, true); | ||
|
||
var listener = Card.DownInfo.LiveChatListener; | ||
if (listener != null) | ||
{ | ||
Danmu.SevaDanmu(listener.DanmuMessage.Danmu, tempFile, Card.Name, Card.RoomId); | ||
Danmu.SevaGift(listener.DanmuMessage.Gift, tempFile); | ||
Danmu.SevaGuardBuy(listener.DanmuMessage.GuardBuy, tempFile); | ||
Danmu.SevaSuperChat(listener.DanmuMessage.SuperChat, tempFile); | ||
} | ||
return (true,tempFile); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.