【发布时间】:2019-01-28 08:59:44
【问题描述】:
我无法访问 m3u8 文件, 但是访问css,txt,jpg,js,...(在wwwroot中)没有问题。 IIs Mime 类型和 web.confing 和 WebHostBuillder.UseWebRoot 设置完成,但问题没有解决。
【问题讨论】:
标签: asp.net-core m3u8
我无法访问 m3u8 文件, 但是访问css,txt,jpg,js,...(在wwwroot中)没有问题。 IIs Mime 类型和 web.confing 和 WebHostBuillder.UseWebRoot 设置完成,但问题没有解决。
【问题讨论】:
标签: asp.net-core m3u8
您应该将 m3u8 文件类型添加到 StaticFileOptions 提供程序:
var provider = new FileExtensionContentTypeProvider();
// Add new mappings
provider.Mappings[".m3u8"] = "application/x-mpegURL";
app.UseStaticFiles(new StaticFileOptions
{
ContentTypeProvider = provider
});
【讨论】: