I used hmtl video tag to play video . In my localhost video plays but when I published . It is not played.I have created project based on in ASP.NET. I locally use like this method.
http://localhost:41563/files/Just.mp4
and When I published the url give me an error like this:
http://111.111.22.22:41563/files/Just.mp4
404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
How can I solve this.
Try removing the binding and browse from the server itself(through the IIS console) to see if the application opens. Default document for my ASP . net web app is set in IIS to "Default.
The simplest and easiest way to fix your 404 error code is to redirect the page to another one. You can perform this task using a 301 redirect. What's 301, you may ask? It's a redirect response code that signals a browser that the content has been transferred to another URL.
The 404 File or directory not found error can be caused due to a few factors such as incorrect file name, cookies, and cache being populated, large file size or browser incompatibility.
Check if you have IIS MIME Type for mp4 added for hosted site (or for the directory where you have your video files).
For the Win Server 2012 is is already there but for Win Server 2008 it is not included by default.
So, if you developed/tested on WinSer2012 and then deployed on WinSer2008 then you can have this issue.
The mp4 MIME settings are: File name extension: .mp4 MIME type: video/mp4
The MIME type can be added via Web.config as well, just in case your IIS is on Azure:
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
</system.webServer>
</configuration>
https://blogs.iis.net/bills/how-to-add-mime-types-with-iis7-web-config
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With