Search code examples
c#asp.netmodel-view-controller

video file loaded sucussefully when run my website locally but not after publishing


I have a overlay video playing in the background and it works fine when I run the website locally after deploying to azure I got this error message in browser console

HTTP load failed with status 404. Load of media resource


Solution

  • Finally I found the answer for my question I had to edit web.config file to allow server send video files

    <staticContent> 
        <mimeMap fileExtension="mp4" mimeType="video/mp4"/> 
        <mimeMap fileExtension="m4v" mimeType="video/m4v"/> 
        <mimeMap fileExtension="ogg" mimeType="video/ogg"/> 
        <mimeMap fileExtension="ogv" mimeType="video/ogg"/> 
        <mimeMap fileExtension="webm" mimeType="video/webm"/> 
    </staticContent>