简体   繁体   中英

html5 video doesn't work after deploying to windows azure

I work on a testing website that allow users to upload audio and video. In local server, everything is fine. The users can upload audio and video and play audio or video as they want. But after deploying the website to windows azure, the video does not work. The users in the azure server can upload audio and video, but they can only play audio. When trying to play video, an error message say (NO video with supported format and MIME type found). 尝试在天蓝色中播放html5视频时出错

In html, I use these to display video

<video id="Video" controls="controls">
    <source src="@Url.Content("~/Video/"+VideName)" type="video/mp4" />
     Your browser does not support HTML5 video.
</video>

I check the server to see if the video files are exist, but the files are exist there.

What is the problem ? Does azure refuse the request for video ?

Probably Azure does not recognize your deployed video files as static content. Try to add the following lines in your web.config file:

<staticContent> <remove fileExtension=".mp4" /> <mimeMap fileExtension=".mp4" mimeType="video/mp4" /> </staticContent>

It should be placed in system.webServer section.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM