0

I've spent the last few days going through as many Stack Overflow questions that seem to cover this issue and I cannot find a solution that works for me, so hopefully this isn't a duplicate question.

I have an MP4 file that is encoded as such:

codec info from vlc

I also converted to webm too, using Miro Video Converter.

I have input this in to my webpage using a straight forward video tag like so:

<video controls autoplay muted loop>
<source src="video.mp4" type="video/mp4">
<source src="video.webm" type="video/webm">
</video>

And this can be seen online: https://www.kristyellispersonaltraining.co.uk/videotest.htm

It works perfectly fine in Chrome, Firefox and on phones. But as soon as I try and view it in a Microsoft browser I just can't get it to work. Both IE11 and Edge display errors.

IE11 and Edge Error Message

I've re-encoded the file several times, and as far as I can tell I have it in the exact codec it should be.

Dev tools display this error:

HTTP502: BAD GATEWAY - The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfil the request.

Can anyone shed any light on what might be going on here?

Claire_Monkey
  • 109
  • 1
  • 2
  • 13
  • here are some articles about how to trouble 502 bad gateway error, you could refer to them: [502 Bad Gateway Error](https://www.lifewire.com/502-bad-gateway-error-explained-2622939), [502 HTTP Status Code](https://stackoverflow.com/questions/5011632/502-http-status-code), [A Simple Explanation of a 502 Bad Gateway Error & How to Resolve It](https://blog.hubspot.com/marketing/502-bad-gateway) and [HTTP Error 502 Bad gateway](http://net-informations.com/q/mis/502.html). – Zhi Lv Oct 01 '19 at 10:58

1 Answers1

0

If that error is showing for the video request, it has absolutely nothing to do with how you've encoded the video, or anything client-side. You need to figure out what the issue is server-side, by checking your server-side logs.

Brad
  • 159,648
  • 54
  • 349
  • 530
  • Even though it's only happening in IE and Edge, and displays fine in all other browsers? – Claire_Monkey Sep 30 '19 at 07:47
  • @VampiricMonkey Emphatically, yes! How could the browser have anything at all to do with it if it doesn't even have the video to try to decode? You probably have something broken server-side that's trying to detect browser. Either that or IE is fetching a different video source and your server isn't handling it. – Brad Sep 30 '19 at 14:07
  • any ideas of what exactly that could be? IIS gives us absolutely nothing useful in logs. My mime types are set correctly in my web.config. I haven't put anything in that is browser detecting on either side. I just don't have a clue what I should be looking for? – Claire_Monkey Oct 01 '19 at 08:10
  • @VampiricMonkey According to your server, Nginx is your server. I assume then that you have Nginx in front of IIS? It looks to me that IIS isn't properly dealing with range requests. If you drop the `Range` header from the request for `https://www.kristyellispersonaltraining.co.uk/video.mp4`, it works. – Brad Oct 01 '19 at 13:59
  • Yeah it is Nginx in front of IIS. But looks like we have to install IIS plugins before we get options for the Range header, so we will just have to work around it until we next do a reboot. Thanks for the help anyway. – Claire_Monkey Oct 02 '19 at 13:31