Created the MVC5 project, in it lie the HOME / Index action in the view of which the <video> tag lies:

 <video muted autoplay="autoplay" loop="loop"> <source src="@Url.Action("Index","Video")" /> </video> 

At the start, a black square appeared and that's it (Before that, a straight path was specified in the src attribute - but that didn't help either). There is also a Video / Index action that returns a stream file:

 public class VideoController : Controller { // GET: Video public FileStreamResult Index() { Stream fileStream = System.IO.File.Open(Server.MapPath("~/BG.mp4"), FileMode.Open); return new FileStreamResult(fileStream, "video/mp4"); } } 

If you go to the action Video / Index player is generated but the video does not start. So the browser knows that there is a video but can not take it. What is the problem?

    1 answer 1

    Try to add the following to webconfig:

     <staticContent> <remove fileExtension=".mp4" /> <mimeMap fileExtension=".mp4" mimeType="video/mp4" /> </staticContent> 

    Add to the section <system.webServer>

    • Passed by. What is the default MIME? Is he there, just have to clean it? - Athari
    • Did as you said, but so far there is no reaction. - Alexey