There is a need to stream video. When you send a stream of small video, everything is fine, but when a video is sent for 20 minutes or more, it OutOfMmemoryException.
Controller
public class VideoController : Controller { // GET: Video public FileStreamResult Index() { Stream fileStream = System.IO.File.Open(@"F:\Мусор\Test.mp4", FileMode.Open); return new FileStreamResult(fileStream, "video/mp4");//Исключение } public PartialViewResult GetPlayer() { return PartialView(); } }
Representation:
<script src="~/scripts/jquery-2.2.2.js"></script> <script src="~/scripts/jquery.jplayer.js"></script> <script> $(function () { $("#jpId").jPlayer({ ready: function () { $(this).jPlayer("setMedia", { m4v: '@Url.Action("Index")' }).jPlayer("play"); }, supplied: "m4v", swfPath: "jPlayer/js" }); }); </script> <div id="jpId"></div>
Maybe there is a way to split the stream into several equal parts. Or another solution ZY. JPlayer plugin used