mirror of
https://github.com/azaion/annotations.git
synced 2026-04-23 02:16:29 +00:00
add quartz for jobs
configure auto-scan folder and create hls files job WIP
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
using Azaion.Repository.DTO.Configs;
|
||||
using Azaion.Video;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
namespace Azaion.WebService.Controllers;
|
||||
|
||||
[Route("/controller")]
|
||||
[Route("/{controller}")]
|
||||
[ApiController]
|
||||
public class VideoController(IVideoManager videoManager) : Controller
|
||||
public class VideoController(IVideoRepository videoRepository, IOptions<FoldersConfig> config) : Controller
|
||||
{
|
||||
[HttpGet("{guid}")]
|
||||
public IActionResult GetVideo(Guid guid)
|
||||
{
|
||||
var media = videoManager.Get(guid);
|
||||
var fileStream = new FileStream(media.M3U8File, FileMode.Open);
|
||||
var media = videoRepository.Get(guid);
|
||||
var fileStream = new FileStream(media.M3U8File(config), FileMode.Open);
|
||||
var fileSize = new FileInfo(media.Path).Length;
|
||||
Response.ContentLength = fileSize;
|
||||
return File(fileStream, "application/x-mpegURL", true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user