0

I am trying to work with html5 "video" tag in MVC4 application. I need to play mp4 videos. I am using Chrome Version 57.0.2987.133 (64-bit), all updates are installed, Win 10 Pro. The code is very simple

        <video id="vidSample" width="1024" height="600" controls>
      <source id="vidSource" src="/Video/33.mp4" type="video/mp4">  
    </video>

Sometimes mp4 samples are playing OK, but very often - no (video is not shown, just white background and "play" button is disabled). The same samples. Those, which are short play more often then those which are longer than 30 sec. When long videos are playing I have problems with seeking. If I move the slider, video stops playing.

In Mozilla Firefox and IE11 my application works completely file with all the mp4 samples I have.

I have just discovered an interesting thing. If I open this video in Chrome using a link to it "http://localhost:49887/Video/33.mp4" it is not playing. But if I open it with Chrome right from the file system "file:///D:/Projects/VideoTester/VideoTester/Video/33.mp4" it is playing perfectly well always. Maybe it is somehow depends on Visual Studio web server, app.config etc.?

  • I would check the encoding of the samples to make sure there are no issues (eg MOOV atom at the start not the end) - https://stackoverflow.com/questions/40836206/html5-video-not-streaming-and-taking-90-seconds-to-load/40943383#40943383 - but also are you seeing errors in the network tab in browser tools? – Offbeatmammal Apr 04 '17 at 18:51
  • No I do not see errors in the network tab. However I see there 2 entries for the video file. Both with status 200, but always different sizes. – Nadezhda Sliezina Apr 04 '17 at 19:39
  • do the requests have different/same status? how are you serving the video? can you try re-encoding one of the samples that causes problems using the ffmpeg script in earlier comment – Offbeatmammal Apr 04 '17 at 20:05

1 Answers1

0

I have found out what was wrong. The problem is in Visual Sudio. I am using 2012 and was running my project under it. Then I tried to deploy my project to IIS, opened the page in Chrome and saw that issue was gone.

So the issue is in Visual Studio IIS Express. In a project properties/Web there is a "Servers" section where you can select which web server to use. I have "Use Local IIS Web Server" + "Use IIS Express" selected. It seems that there is some compatibility issue between this web server and Chrome (other browsers are OK), so that video is streaming incorrectly.