Follow my code:
[HttpGet]
public ActionResult StreamVideo(int type1, int type2)
{
using (var ctx = new Entities())
{
var result = ctx.Table.Where(x => x.Type1 == type1 && x.Type2 == type2).FirstOrDefault();
byte[] video_byte = result.Video;
return new RangeFileContentResult(video_byte, "video/x-msvideo", "NameFile.mp4", DateTime.Now);
}
}
I have a "modal bootstrap" where it has video content.When closing modal and opening again, it gives problem:
System.OutOfMemoryException: 'Exception_WasThrown'
Problem occurs on line:
var result = ctx.Table.Where(x => x.Type1 == type1 && x.Type2 == type2).FirstOrDefault();
Any solution ?