Unable to host MP4 files on Azure web site

夙愿已清 提交于 2019-11-27 19:19:30
ewitkows

The linked SO answer worked for me conceptually, but it didn't indicate the appropriate fileExtension. My config had to instead indicate the following. (Note, for any who have this question, by default my azure website didn't have a web.config initially, so I had to add the following to a text file, save as web.config, and FTP to my webroot.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
               <remove fileExtension=".mp4" />
               <mimeMap fileExtension=".mp4" mimeType="video/mp4" />
               <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
     </staticContent>
    </system.webServer>
</configuration>
RyanCEI

Have you confirmed your MIME type for .MP4 is correctly configured, as asked:

Windows Azure - Serve unknown (mp4) MIME types in Windows Azure IIS storage

There is only a single way to do this currently, and I confirmed this with the Azure team.

Add a web.config file to the root of the application wwwroot\web.config with the following contents

<?xml version="1.0" encoding="UTF-8"?>
  <configuration>
    <system.webServer>
      <staticContent>
        <mimeMap fileExtension=".mp4" mimeType="application/mp4" />
      </staticContent>
    </system.webServer>
  </configuration>

Azure Web Apps does not support some types of media files. You could use an Azure Media Service to upload it and later refer the media file from your code.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!