I made Video streaming web with Blazor.
Razor page:
<BlazoredVideo EndedEvent="OnEnded" autoplay=true controls=true style="max-width:90%;">
<source src=@streamingUrl />
</BlazoredVideo>
server side:
[HttpGet("{videoId}")]
public FileResult getFileByVideoId(string videoId = null)
{
if (string.IsNullOrWhiteSpace(videoId))
{
return PhysicalFile($"{Config.PhysicalFilePath}/novideo.webm", "application/octet-stream", enableRangeProcessing: true);
}
var crawledVideo = dbContext.Crawled.FirstOrDefault(x => x.VideoId == videoId);
return PhysicalFile($"{Config.PhysicalFilePath}/{crawledVideo.FullPath}", "application/octet-stream", enableRangeProcessing: true);
//return PhysicalFile(path, MimeUtility.GetMimeMapping(fileName), fileName, true);
}
as you can see on the picture, it buffers so little...
So when I go to slow internet area, Can't watch the video smoothly.
How can I make it buffers more and download whole video in pause?