Fix: HTML5 Video not playing when deployed to azure


Story by Abhilash on Azure

Share   

The HTML5 video added in the webpage was playbacking successfully in my developer environment. But, why deployed to client's Azure web app it was not playing at all. I suspected for any script errors but browser's console window was empty. Later I figured out that we need to specify mime type in web.config of the website for this to work.

Below is a quick peek of web.config file.

<configuration>
	<system.webServer>
		<staticContent>
			<remove fileExtension=".mp4" />
			<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
			<remove fileExtension=".webm" />
			<mimeMap fileExtension=".webm" mimeType="video/webm" />
			<!-- Add your mime type here -->
		</staticContent>
	</system.webServer>
</configuration>



 

Hope this helps.






comments powered by Disqus

Related Story   →

Create gitignore from File Explorer

Do you know the easiest way to create gitignore file from file explorer? Here is how to do that.