简体   繁体   English

ASP.NET视频webm未加载

[英]ASP.NET Video webm not loading


I have created a basic website in asp.net. 我在asp.net中创建了一个基本网站。 I'm playing with the azure platform, but I'm having some difficulties. 我正在玩蔚蓝的平台,但我遇到了一些困难。
The website contains a video (.webm) 该网站包含一个视频(.webm)

<video autoplay loop muted class="background_login" src="Content/background.webm"></video>

The video does load when running locally, but when I have pushed it to the azurewebsites.net it stays black. 该视频在本地运行时会加载,但当我将其推送到azurewebsites.net时,它会保持黑色。
I have read about the mime types, and that they should be declared. 我已经阅读过有关mime类型的内容,并且应该声明它们。 So I put this in my web.config: 所以我把它放在我的web.config中:

<system.webServer>
<staticContent>
  <mimeMap fileExtension=".webm" mimeType="video/webm" />
</staticContent>

It still doesn't work, though. 但它仍然不起作用。 The website can be found at: 'link deleted' 该网站位于:'link deleted'
The video is stored in the Content folder (checked if it's actually there with FileZilla, and it's there): 'link deleted' 视频存储在Content文件夹中(如果它实际上存在FileZilla,则检查它是否存在):'link deleted'
Calling it directly gives a internal server error. 直接调用它会产生内部服务器错误。

Any ideas of what might go wrong here? 什么可能出错的想法?

Sometimes if you have ASP.NET Forms authentication enabled you get HTTP 500 errors requesting static content files (.mp3, .mp4 ...) 有时,如果您启用了ASP.NET Forms身份验证,则会收到请求静态内容文件的HTTP 500错误(.mp3,.mp4 ...)

Removing the mimeMap element should fix the problem. 删除mimeMap元素应该可以解决问题。

Change your staticContent section to : 将staticContent部分更改为:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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