using Azaion.Repository.DTO.Configs; using Azaion.Video; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; namespace Azaion.WebService.Controllers; [Route("/{controller}")] [ApiController] public class VideoController(IVideoRepository videoRepository, IOptions config) : Controller { [HttpGet("{guid}")] public IActionResult GetVideo(Guid guid) { 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); } }